@realsee/five 6.0.0-alpha.112 → 6.0.0-alpha.113

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.
Files changed (48) hide show
  1. package/docs/assets/navigation.js +1 -1
  2. package/docs/assets/search.js +1 -1
  3. package/docs/classes/plugins.BackgroundPluginController.html +37 -0
  4. package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
  5. package/docs/classes/plugins.OrientationPluginController.html +9 -9
  6. package/docs/enums/plugins.BackgroundPluginType.WarningCodeType.html +2 -0
  7. package/docs/functions/plugins.BackgroundPlugin.html +1 -0
  8. package/docs/hierarchy.html +1 -1
  9. package/docs/interfaces/plugins.BackgroundPluginType.Config.html +1 -0
  10. package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +20 -0
  11. package/docs/interfaces/plugins.BackgroundPluginType.Params.html +3 -0
  12. package/docs/interfaces/plugins.BackgroundPluginType.PluginDataItem.html +1 -0
  13. package/docs/interfaces/plugins.OrientationPluginType.Config.html +3 -2
  14. package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
  15. package/docs/interfaces/plugins.OrientationPluginType.Params.html +2 -2
  16. package/docs/interfaces/plugins.OrientationPluginType.State.html +4 -4
  17. package/docs/modules/plugins.BackgroundPluginType.html +10 -0
  18. package/docs/modules/plugins.html +6 -3
  19. package/docs/types/plugins.BackgroundPluginType.Mirror.html +1 -0
  20. package/docs/types/plugins.BackgroundPluginType.Mode.html +1 -0
  21. package/docs/types/plugins.BackgroundPluginType.PluginData.html +1 -0
  22. package/docs/types/plugins.BackgroundPluginType.State.html +1 -0
  23. package/five/index.js +3 -3
  24. package/five/index.mjs +4 -4
  25. package/gltf-loader/index.js +3 -3
  26. package/gltf-loader/index.mjs +3 -3
  27. package/line/index.js +3 -3
  28. package/line/index.mjs +3 -3
  29. package/package.json +1 -1
  30. package/plugins/index.d.ts +90 -0
  31. package/plugins/index.js +180 -159
  32. package/plugins/index.mjs +1678 -1606
  33. package/react/index.js +2 -2
  34. package/react/index.mjs +2 -2
  35. package/sticker/index.js +3 -3
  36. package/sticker/index.mjs +3 -3
  37. package/umd/five-gltf-loader.js +3 -3
  38. package/umd/five-line.js +3 -3
  39. package/umd/five-plugins.js +179 -158
  40. package/umd/five-react.js +2 -2
  41. package/umd/five-sticker.js +3 -3
  42. package/umd/five-vfx.js +2 -2
  43. package/umd/five-vue.js +2 -2
  44. package/umd/five.js +3 -3
  45. package/vfx/index.js +2 -2
  46. package/vfx/index.mjs +2 -2
  47. package/vue/index.js +2 -2
  48. package/vue/index.mjs +2 -2
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 7/31/2024
5
- * Version: 6.0.0-alpha.112
4
+ * Generated: 2024/8/5
5
+ * Version: 6.0.0-alpha.113
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,13 +252,13 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */(function(Ft,yr){typeof exports=="object"&&typeof module!="undefined"?yr(exports,require("@realsee/five"),require("three")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three"],yr):(Ft=typeof globalThis!="undefined"?globalThis:Ft||self,yr(Ft.FiveSDK_Plugins={},Ft.FiveSDK,Ft.THREE))})(this,function(Ft,yr,_f){"use strict";function bf(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const _e=bf(_f);function wf(e){return/^https?:\/\/|^\/\//.test(e)||/^data:/.test(e)}function Mf(e,t){return wf(t)?t:"".concat(e).concat(t)}Ft.BasePlugin=void 0,function(e){var t=function(){function n(r,i){this.hooks=new yr.Subscribe,this.staticPrefix="//vr-image-4.realsee-cdn.cn",this.five=r,i!=null&&i.staticPrefix&&(this.staticPrefix=i.staticPrefix)}return n.prototype.getCurrentState=function(){return this.state},n.prototype.absoluteUrl=function(r){return Mf(this.staticPrefix,r)},n}();e.Controller=t}(Ft.BasePlugin||(Ft.BasePlugin={}));var Cs=function(e,t){return Cs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Cs(e,t)};function Rs(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Cs(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Bt=function(){return Bt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Bt.apply(this,arguments)};function Os(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(h){o(h)}}function c(u){try{l(r.throw(u))}catch(h){o(h)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(e,t||[])).next())})}function Ds(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Ic(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function Ef(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){r.onload=r.onerror=function(){},t(r)},r.onerror=function(i){r.onload=r.onerror=function(){},n(i)},r.crossOrigin="",r.src=e})}var Tf=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),Is=typeof performance!="undefined"?function(){return Tf+performance.now()}:function(){return Date.now()};function qa(e,t,n){return e+(t-e)*n}function Sf(e,t,n,r){var i=(t*n+2*e)/Math.pow(n,3),a=-(2*t*n+3*e)/Math.pow(n,2),o=t,s=e;return i*Math.pow(r,3)+a*Math.pow(r,2)+o*r+s}function Af(e,t,n,r){var i=(t*n+2*e)/Math.pow(n,3),a=-(2*t*n+3*e)/Math.pow(n,2),o=t;return 3*i*Math.pow(r,2)+2*a*r+o}function Lf(e,t,n,r){var i=r[1]-r[0];return e=Ya(e,r),t=Ya(t,r),t-e>i/2?qa(e+i,t,n):e-t>i/2?qa(e-i,t,n):qa(e,t,n)}function Ya(e,t){var n=t[1]-t[0];return e<t[0]?Ya(e+n,t):e>=t[1]?Ya(e-n,t):e}function Pf(e,t,n,r){return r?Lf(e,t,n,r):qa(e,t,n)}var Nc=function(){function e(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=Is(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var n in t){var r=t[n];typeof r=="number"?(this.value[n]=r,this.config[n]={circle:!1}):(this.value[n]=r.value,this.config[n]={circle:r.circle})}this.keyframes=[{progress:0,value:Bt({},this.value)},{progress:1,value:Bt({},this.value)}]}return e.prototype.getProgress=function(t){var n=t-this.startTime;return n<0?0:n>=this.duration?1:1-Sf(1,this.startVelocity,this.duration,n)},e.prototype.getValue=function(t){for(var n=1;n<this.keyframes.length;n++)if(this.keyframes[n].progress>t){var r=this.keyframes[n-1],i=this.keyframes[n],a={};for(var o in this.config){var s=(t-r.progress)/(i.progress-r.progress);a[o]=Pf(r.value[o],i.value[o],s,this.config[o].circle)}return a}return Bt({},this.keyframes[this.keyframes.length-1].value)},e.prototype.getProgressVelocity=function(t){var n=t-this.startTime;return n>=this.duration?0:Af(1,this.startVelocity,this.duration,n)},e.prototype.update=function(t){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(t))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},e.prototype.getKeyFrameSegment=function(t){for(var n=this.getProgress(t),r=1;r<this.keyframes.length;r++)if(this.keyframes[r].progress>n)return[this.keyframes[r-1],this.keyframes[r]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},e.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},e.prototype.set=function(t,n,r,i){var a;r===void 0&&(r=0),isNaN(n)&&(n=0),isNaN(r)&&(r=0),i=i!=null?i:Is();var o=this.getProgress(i),s=this.getValue(o),c={};for(var l in this.config)c[l]=(a=t[l])!==null&&a!==void 0?a:s[l];var u=[{progress:0,value:s},{progress:1,value:c}];return this.setKeyframes(u,n,r,i)},e.prototype.setKeyframes=function(t,n,r,i){var a=this;if(r===void 0&&(r=0),t.length<2)throw new Error("keyframes invalid.");return isNaN(n)&&(n=0),isNaN(r)&&(r=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(o,s){i=i!=null?i:Is(),a.progress=0,a.ended=!1,a.startTime=i,a.startVelocity=r,a.keyframes=t,a.duration=n,n===0?(a.progress=1,a.value=Bt({},t[t.length-1].value)):a.value=Bt({},t[0].value),a.callbacks=[o,s]})},e.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},e}(),Cf=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.5,opacity:1,shadow:1}},{progress:.8,value:{scale:2,opacity:0,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],Rf=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.4,opacity:1,shadow:2}},{progress:.8,value:{scale:1.6,opacity:.4,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],Of=`
255
+ */(function(Ct,yr){typeof exports=="object"&&typeof module!="undefined"?yr(exports,require("@realsee/five"),require("three"),require("@realsee/five/plugins")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three","@realsee/five/plugins"],yr):(Ct=typeof globalThis!="undefined"?globalThis:Ct||self,yr(Ct.FiveSDK_Plugins={},Ct.FiveSDK,Ct.THREE,Ct.FiveSDK_Plugins))})(this,function(Ct,yr,_f,bf){"use strict";function wf(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const _e=wf(_f);function Mf(e){return/^https?:\/\/|^\/\//.test(e)||/^data:/.test(e)}function Ef(e,t){return Mf(t)?t:"".concat(e).concat(t)}Ct.BasePlugin=void 0,function(e){var t=function(){function n(r,i){this.hooks=new yr.Subscribe,this.staticPrefix="//vr-image-4.realsee-cdn.cn",this.five=r,i!=null&&i.staticPrefix&&(this.staticPrefix=i.staticPrefix)}return n.prototype.getCurrentState=function(){return this.state},n.prototype.absoluteUrl=function(r){return Ef(this.staticPrefix,r)},n}();e.Controller=t}(Ct.BasePlugin||(Ct.BasePlugin={}));var Is=function(e,t){return Is=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Is(e,t)};function Ya(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Is(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Bt=function(){return Bt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Bt.apply(this,arguments)};function Za(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(h){o(h)}}function c(u){try{l(r.throw(u))}catch(h){o(h)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(e,t||[])).next())})}function Ja(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Nc(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function Tf(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){r.onload=r.onerror=function(){},t(r)},r.onerror=function(i){r.onload=r.onerror=function(){},n(i)},r.crossOrigin="",r.src=e})}var Sf=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),Ns=typeof performance!="undefined"?function(){return Sf+performance.now()}:function(){return Date.now()};function Qa(e,t,n){return e+(t-e)*n}function Af(e,t,n,r){var i=(t*n+2*e)/Math.pow(n,3),a=-(2*t*n+3*e)/Math.pow(n,2),o=t,s=e;return i*Math.pow(r,3)+a*Math.pow(r,2)+o*r+s}function Lf(e,t,n,r){var i=(t*n+2*e)/Math.pow(n,3),a=-(2*t*n+3*e)/Math.pow(n,2),o=t;return 3*i*Math.pow(r,2)+2*a*r+o}function Pf(e,t,n,r){var i=r[1]-r[0];return e=Ka(e,r),t=Ka(t,r),t-e>i/2?Qa(e+i,t,n):e-t>i/2?Qa(e-i,t,n):Qa(e,t,n)}function Ka(e,t){var n=t[1]-t[0];return e<t[0]?Ka(e+n,t):e>=t[1]?Ka(e-n,t):e}function Cf(e,t,n,r){return r?Pf(e,t,n,r):Qa(e,t,n)}var Fc=function(){function e(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=Ns(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var n in t){var r=t[n];typeof r=="number"?(this.value[n]=r,this.config[n]={circle:!1}):(this.value[n]=r.value,this.config[n]={circle:r.circle})}this.keyframes=[{progress:0,value:Bt({},this.value)},{progress:1,value:Bt({},this.value)}]}return e.prototype.getProgress=function(t){var n=t-this.startTime;return n<0?0:n>=this.duration?1:1-Af(1,this.startVelocity,this.duration,n)},e.prototype.getValue=function(t){for(var n=1;n<this.keyframes.length;n++)if(this.keyframes[n].progress>t){var r=this.keyframes[n-1],i=this.keyframes[n],a={};for(var o in this.config){var s=(t-r.progress)/(i.progress-r.progress);a[o]=Cf(r.value[o],i.value[o],s,this.config[o].circle)}return a}return Bt({},this.keyframes[this.keyframes.length-1].value)},e.prototype.getProgressVelocity=function(t){var n=t-this.startTime;return n>=this.duration?0:Lf(1,this.startVelocity,this.duration,n)},e.prototype.update=function(t){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(t))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},e.prototype.getKeyFrameSegment=function(t){for(var n=this.getProgress(t),r=1;r<this.keyframes.length;r++)if(this.keyframes[r].progress>n)return[this.keyframes[r-1],this.keyframes[r]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},e.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},e.prototype.set=function(t,n,r,i){var a;r===void 0&&(r=0),isNaN(n)&&(n=0),isNaN(r)&&(r=0),i=i!=null?i:Ns();var o=this.getProgress(i),s=this.getValue(o),c={};for(var l in this.config)c[l]=(a=t[l])!==null&&a!==void 0?a:s[l];var u=[{progress:0,value:s},{progress:1,value:c}];return this.setKeyframes(u,n,r,i)},e.prototype.setKeyframes=function(t,n,r,i){var a=this;if(r===void 0&&(r=0),t.length<2)throw new Error("keyframes invalid.");return isNaN(n)&&(n=0),isNaN(r)&&(r=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(o,s){i=i!=null?i:Ns(),a.progress=0,a.ended=!1,a.startTime=i,a.startVelocity=r,a.keyframes=t,a.duration=n,n===0?(a.progress=1,a.value=Bt({},t[t.length-1].value)):a.value=Bt({},t[0].value),a.callbacks=[o,s]})},e.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},e}(),Rf=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.5,opacity:1,shadow:1}},{progress:.8,value:{scale:2,opacity:0,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],Of=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.4,opacity:1,shadow:2}},{progress:.8,value:{scale:1.6,opacity:.4,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],Df=`
256
256
  varying vec2 vUv;
257
257
  void main() {
258
258
  vUv = uv;
259
259
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
260
260
  }
261
- `,Df=`
261
+ `,If=`
262
262
  varying vec2 vUv;
263
263
  uniform sampler2D map;
264
264
  uniform vec4 color;
@@ -304,7 +304,7 @@ void main() {
304
304
  }
305
305
  }
306
306
  }
307
- `,If=function(e){Rs(t,e);function t(n,r){var i=e.call(this,n)||this;i.canvas=document.createElement("canvas"),i.group=new _e.Group,i.wrapper=document.createElement("div"),i.style=document.createElement("style"),i.itemMaskMesh=function(){var s=new _e.Mesh(new _e.SphereBufferGeometry(1,60,40),new _e.ShaderMaterial({vertexShader:Of,fragmentShader:Df,uniforms:{map:{value:new _e.Texture},color:{value:new _e.Vector4}},depthWrite:!1,depthTest:!1,transparent:!0}));return s.renderOrder=-3,s.geometry.rotateY(-Math.PI/2),s.geometry.scale(-1,1,1),s}(),i.onFivePanoArrived=function(s){i.state.mode==="mask"&&i.loadPanoMask(s)},i.onFiveWantsMoveToPano=function(s){i.state.mode==="box"&&i.select()},i.loadPanoMask=function(s){return Os(i,void 0,void 0,function(){var c,l,u,h,f,d,m,g,y,p;return Ds(this,function(v){switch(v.label){case 0:return c=this,l=c.five,u=c.canvas,h=c.itemMaskMesh,f=c.data,d=u.getContext("2d"),m=l.observers[s],g=(p=f==null?void 0:f.object_mask_list.find(function(_){return _.derived_id===String(m.derivedId)}))===null||p===void 0?void 0:p.object_mask_url,g?[4,Ef(g)]:[2];case 1:return y=v.sent(),u.width=y.width,u.height=y.height,d==null||d.drawImage(y,0,0,y.width,y.height),h.material.uniforms.map.value.image=y,h.material.uniforms.map.value.minFilter=_e.LinearFilter,h.material.uniforms.map.value.needsUpdate=!0,h.position.copy(m.position),h.quaternion.copy(m.quaternion),l.scene.add(h),l.needsRender=!0,[2]}})})},i.onFiveMouseMove=function(s){var c;if(i.state.mode==="mask"&&i.five.state.mode==="Panorama"){var l=i,u=l.five,h=l.itemMaskMesh,f=u.observers[u.state.panoIndex],d=(c=s.pointers[0])===null||c===void 0?void 0:c.raycaster;if(d){var m=d.intersectObjects(i.group.children.filter(function(g){return g.userData.visible_viewpoint.includes(String(f.derivedId))}),!0)[0];m?h.material.uniforms.color.value=m.object.userData.color:h.material.uniforms.color.value=new _e.Vector4(0,0,0,1)}}},i.onFiveTapGesture=function(s){var c=i.five,l=c.observers[c.state.panoIndex];if(s){var u=s.intersectObjects(i.group.children.filter(function(d){return d.userData.visible_viewpoint.includes(String(l.derivedId))}),!0)[0];if(u){i.select(u.object.name),i.stopAnimation&&i.stopAnimation(),i.tapPosition=u.point,i.changeTapScreenPosition();var h=new Nc({opacity:0,scale:0,shadow:2}),f=new Nc({opacity:0,scale:0,shadow:2});return h.setKeyframes(Cf,1e3),f.setKeyframes(Rf,1e3),i.stopAnimation=yr.AnimationFrameLoop.shared.add(function(d,m){var g,y=h.update(d),p=f.update(d);i.wrapper.firstChild.style.opacity="".concat(h.value.opacity),i.wrapper.firstChild.style.transform="scale(".concat(h.value.scale,")"),i.wrapper.firstChild.style.boxShadow="0 0 0 ".concat(h.value.shadow,"px #fff"),i.wrapper.lastChild.style.opacity="".concat(f.value.opacity),i.wrapper.lastChild.style.transform="scale(".concat(f.value.scale,")"),i.wrapper.lastChild.style.boxShadow="0 0 0 ".concat(f.value.shadow,"px #fff"),y&&p&&((g=i.stopAnimation)===null||g===void 0||g.call(i),i.stopAnimation=void 0,c.getElement().parentElement.removeChild(i.wrapper))},!1,0,10),c.getElement().parentElement.appendChild(i.wrapper),!1}}},i.changeTapScreenPosition=function(){if(i.tapPosition){var s=i.tapPosition.clone().project(i.five.camera),c=(s.x+1)/2,l=-(s.y-1)/2;i.wrapper.style.opacity=s.z>0&&s.z<1?"1":"0",i.wrapper.style.transform="translate(".concat(c*100,"%, ").concat(l*100,"%)")}},i.onFiveCameraUpdate=function(s){i.changeTapScreenPosition()},i.dispose=function(){i.disable()},i.five=n;var a={enabled:!0,visible:!0,mode:"box",selectedId:null,selectAll:!1};i.state=Object.assign(a,r==null?void 0:r.initialState);var o=Bt({},r==null?void 0:r.config);return i._config=o,i.group.rotateX(Math.PI),i.wrapper.className="ItemMaskPlugin",i.wrapper.innerHTML='<span class="ItemMaskPluginCircle"></span><span class="ItemMaskPluginCircle"></span>',i.style.innerHTML=`
307
+ `,Nf=function(e){Ya(t,e);function t(n,r){var i=e.call(this,n)||this;i.canvas=document.createElement("canvas"),i.group=new _e.Group,i.wrapper=document.createElement("div"),i.style=document.createElement("style"),i.itemMaskMesh=function(){var s=new _e.Mesh(new _e.SphereBufferGeometry(1,60,40),new _e.ShaderMaterial({vertexShader:Df,fragmentShader:If,uniforms:{map:{value:new _e.Texture},color:{value:new _e.Vector4}},depthWrite:!1,depthTest:!1,transparent:!0}));return s.renderOrder=-3,s.geometry.rotateY(-Math.PI/2),s.geometry.scale(-1,1,1),s}(),i.onFivePanoArrived=function(s){i.state.mode==="mask"&&i.loadPanoMask(s)},i.onFiveWantsMoveToPano=function(s){i.state.mode==="box"&&i.select()},i.loadPanoMask=function(s){return Za(i,void 0,void 0,function(){var c,l,u,h,f,d,m,g,y,p;return Ja(this,function(v){switch(v.label){case 0:return c=this,l=c.five,u=c.canvas,h=c.itemMaskMesh,f=c.data,d=u.getContext("2d"),m=l.observers[s],g=(p=f==null?void 0:f.object_mask_list.find(function(_){return _.derived_id===String(m.derivedId)}))===null||p===void 0?void 0:p.object_mask_url,g?[4,Tf(g)]:[2];case 1:return y=v.sent(),u.width=y.width,u.height=y.height,d==null||d.drawImage(y,0,0,y.width,y.height),h.material.uniforms.map.value.image=y,h.material.uniforms.map.value.minFilter=_e.LinearFilter,h.material.uniforms.map.value.needsUpdate=!0,h.position.copy(m.position),h.quaternion.copy(m.quaternion),l.scene.add(h),l.needsRender=!0,[2]}})})},i.onFiveMouseMove=function(s){var c;if(i.state.mode==="mask"&&i.five.state.mode==="Panorama"){var l=i,u=l.five,h=l.itemMaskMesh,f=u.observers[u.state.panoIndex],d=(c=s.pointers[0])===null||c===void 0?void 0:c.raycaster;if(d){var m=d.intersectObjects(i.group.children.filter(function(g){return g.userData.visible_viewpoint.includes(String(f.derivedId))}),!0)[0];m?h.material.uniforms.color.value=m.object.userData.color:h.material.uniforms.color.value=new _e.Vector4(0,0,0,1)}}},i.onFiveTapGesture=function(s){var c=i.five,l=c.observers[c.state.panoIndex];if(s){var u=s.intersectObjects(i.group.children.filter(function(d){return d.userData.visible_viewpoint.includes(String(l.derivedId))}),!0)[0];if(u){i.select(u.object.name),i.stopAnimation&&i.stopAnimation(),i.tapPosition=u.point,i.changeTapScreenPosition();var h=new Fc({opacity:0,scale:0,shadow:2}),f=new Fc({opacity:0,scale:0,shadow:2});return h.setKeyframes(Rf,1e3),f.setKeyframes(Of,1e3),i.stopAnimation=yr.AnimationFrameLoop.shared.add(function(d,m){var g,y=h.update(d),p=f.update(d);i.wrapper.firstChild.style.opacity="".concat(h.value.opacity),i.wrapper.firstChild.style.transform="scale(".concat(h.value.scale,")"),i.wrapper.firstChild.style.boxShadow="0 0 0 ".concat(h.value.shadow,"px #fff"),i.wrapper.lastChild.style.opacity="".concat(f.value.opacity),i.wrapper.lastChild.style.transform="scale(".concat(f.value.scale,")"),i.wrapper.lastChild.style.boxShadow="0 0 0 ".concat(f.value.shadow,"px #fff"),y&&p&&((g=i.stopAnimation)===null||g===void 0||g.call(i),i.stopAnimation=void 0,c.getElement().parentElement.removeChild(i.wrapper))},!1,0,10),c.getElement().parentElement.appendChild(i.wrapper),!1}}},i.changeTapScreenPosition=function(){if(i.tapPosition){var s=i.tapPosition.clone().project(i.five.camera),c=(s.x+1)/2,l=-(s.y-1)/2;i.wrapper.style.opacity=s.z>0&&s.z<1?"1":"0",i.wrapper.style.transform="translate(".concat(c*100,"%, ").concat(l*100,"%)")}},i.onFiveCameraUpdate=function(s){i.changeTapScreenPosition()},i.dispose=function(){i.disable()},i.five=n;var a={enabled:!0,visible:!0,mode:"box",selectedId:null,selectAll:!1};i.state=Object.assign(a,r==null?void 0:r.initialState);var o=Bt({},r==null?void 0:r.config);return i._config=o,i.group.rotateX(Math.PI),i.wrapper.className="ItemMaskPlugin",i.wrapper.innerHTML='<span class="ItemMaskPluginCircle"></span><span class="ItemMaskPluginCircle"></span>',i.style.innerHTML=`
308
308
  .ItemMaskPlugin {
309
309
  position: absolute;
310
310
  top: 0;
@@ -322,7 +322,7 @@ void main() {
322
322
  border-radius: 50%;
323
323
  box-shadow: 0px 0px 0px 2px #fff;
324
324
  }
325
- `,i.state.enabled&&i._enable({userAction:!1}),i}return Object.defineProperty(t.prototype,"config",{get:function(){return Bt({},this._config)},enumerable:!1,configurable:!0}),t.prototype.updateState=function(n,r){var i=this.state;this.state=Bt(Bt({},this.state),n),this.hooks.emit("stateChange",{state:this.state,prevState:i,userAction:r})},t.prototype.load=function(n){return Os(this,void 0,void 0,function(){var r,i,a=this;return Ds(this,function(o){return this.data=n,r=n.data_list.map(function(s){var c,l=s.position.end.map(function(b){return Number(b)}),u=s.position.start.map(function(b){return Number(b)}),h=Math.abs(l[0]-u[0]),f=Math.abs(l[1]-u[1]),d=Math.abs(l[2]-u[2]),m=l[0]/2+u[0]/2,g=l[1]/2+u[1]/2,y=l[2]/2+u[2]/2,p=new _e.Vector3(m,g,y),v=new _e.BoxBufferGeometry(h,f,d),_=new _e.ShaderMaterial({vertexShader:`
325
+ `,i.state.enabled&&i._enable({userAction:!1}),i}return Object.defineProperty(t.prototype,"config",{get:function(){return Bt({},this._config)},enumerable:!1,configurable:!0}),t.prototype.updateState=function(n,r){var i=this.state;this.state=Bt(Bt({},this.state),n),this.hooks.emit("stateChange",{state:this.state,prevState:i,userAction:r})},t.prototype.load=function(n){return Za(this,void 0,void 0,function(){var r,i,a=this;return Ja(this,function(o){return this.data=n,r=n.data_list.map(function(s){var c,l=s.position.end.map(function(b){return Number(b)}),u=s.position.start.map(function(b){return Number(b)}),h=Math.abs(l[0]-u[0]),f=Math.abs(l[1]-u[1]),d=Math.abs(l[2]-u[2]),m=l[0]/2+u[0]/2,g=l[1]/2+u[1]/2,y=l[2]/2+u[2]/2,p=new _e.Vector3(m,g,y),v=new _e.BoxBufferGeometry(h,f,d),_=new _e.ShaderMaterial({vertexShader:`
326
326
  varying vec2 vUv;
327
327
  void main() {
328
328
  vUv = uv;
@@ -347,38 +347,38 @@ void main() {
347
347
  gl_FragColor = vec4(1.0, 1.0, 1.0, alpha / 4.0 * opacity);
348
348
  }
349
349
  }
350
- `,side:_e.DoubleSide,visible:a.state.selectedId==="".concat(s.category_name).concat(s.index),uniforms:{opacity:{value:a.state.mode==="box"?1:0}},depthWrite:!1,depthTest:!1,transparent:!0}),x=new _e.Mesh(v,_);return x.position.copy(p),x.name="".concat(s.category_name).concat(s.index),x.userData.color=new((c=_e.Vector4).bind.apply(c,Ic(Ic([void 0],s.mask_color.map(function(b){return b/255}).reverse(),!1),[1],!1))),x.userData.visible_viewpoint=Object.keys(s.visible_viewpoint),x}),(i=this.group).add.apply(i,r),[2]})})},t.prototype.setState=function(n,r){r===void 0&&(r={});var i=this.state,a=r.userAction!==void 0?r.userAction:!0;if(this.updateState(n,a),n.enabled!==void 0&&i.enabled!==n.enabled){var o={userAction:a};n.enabled?this._enable(o):this._disable(o)}},t.prototype.setMode=function(n){this.updateState({mode:n},!1),n==="mask"?(this.group.children.forEach(function(r){r.material.uniforms.opacity.value=0}),this.loadPanoMask(this.five.state.panoIndex)):n==="box"&&(this.itemMaskMesh.material.uniforms.color.value=new _e.Vector4(0,0,0,1),this.group.children.forEach(function(r){r.material.uniforms.opacity.value=1}),this.five.needsRender=!0)},t.prototype.select=function(n,r){var i=this,a;this.updateState({selectedId:n!=null?n:null},(a=r==null?void 0:r.userAction)!==null&&a!==void 0?a:!1),this.group.children.forEach(function(o){o.material.visible=i.state.selectAll||o.name===n}),this.five.needsRender=!0},t.prototype.selectAll=function(n){n===void 0&&(n=!0),this.updateState({selectAll:!!n},!1),this.select()},t.prototype._enable=function(n){this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.on("gesture.mousemove",this.onFiveMouseMove),this.five.on("wantsTapGesture",this.onFiveTapGesture),this.five.on("cameraUpdate",this.onFiveCameraUpdate),this.five.scene.add(this.group),document.head.appendChild(this.style)},t.prototype._disable=function(n){this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.off("gesture.mousemove",this.onFiveMouseMove),this.five.off("wantsTapGesture",this.onFiveTapGesture),this.five.off("cameraUpdate",this.onFiveCameraUpdate),this.five.scene.remove(this.group),document.head.removeChild(this.style)},t.prototype.enable=function(n){var r;if(!this.state.enabled){var i=(r=n==null?void 0:n.userAction)!==null&&r!==void 0?r:!0;this.updateState({enabled:!0},i),this._enable({userAction:i})}},t.prototype.disable=function(n){var r;if(this.state.enabled!==!1){var i=(r=n==null?void 0:n.userAction)!==null&&r!==void 0?r:!0;this.updateState({enabled:!1},i),this._disable({userAction:i})}},t}(Ft.BasePlugin.Controller),Nf=function(e,t){return new If(e,t)};/*! Hammer.JS - v2.0.7 - 2016-04-22
350
+ `,side:_e.DoubleSide,visible:a.state.selectedId==="".concat(s.category_name).concat(s.index),uniforms:{opacity:{value:a.state.mode==="box"?1:0}},depthWrite:!1,depthTest:!1,transparent:!0}),x=new _e.Mesh(v,_);return x.position.copy(p),x.name="".concat(s.category_name).concat(s.index),x.userData.color=new((c=_e.Vector4).bind.apply(c,Nc(Nc([void 0],s.mask_color.map(function(b){return b/255}).reverse(),!1),[1],!1))),x.userData.visible_viewpoint=Object.keys(s.visible_viewpoint),x}),(i=this.group).add.apply(i,r),[2]})})},t.prototype.setState=function(n,r){r===void 0&&(r={});var i=this.state,a=r.userAction!==void 0?r.userAction:!0;if(this.updateState(n,a),n.enabled!==void 0&&i.enabled!==n.enabled){var o={userAction:a};n.enabled?this._enable(o):this._disable(o)}},t.prototype.setMode=function(n){this.updateState({mode:n},!1),n==="mask"?(this.group.children.forEach(function(r){r.material.uniforms.opacity.value=0}),this.loadPanoMask(this.five.state.panoIndex)):n==="box"&&(this.itemMaskMesh.material.uniforms.color.value=new _e.Vector4(0,0,0,1),this.group.children.forEach(function(r){r.material.uniforms.opacity.value=1}),this.five.needsRender=!0)},t.prototype.select=function(n,r){var i=this,a;this.updateState({selectedId:n!=null?n:null},(a=r==null?void 0:r.userAction)!==null&&a!==void 0?a:!1),this.group.children.forEach(function(o){o.material.visible=i.state.selectAll||o.name===n}),this.five.needsRender=!0},t.prototype.selectAll=function(n){n===void 0&&(n=!0),this.updateState({selectAll:!!n},!1),this.select()},t.prototype._enable=function(n){this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.on("gesture.mousemove",this.onFiveMouseMove),this.five.on("wantsTapGesture",this.onFiveTapGesture),this.five.on("cameraUpdate",this.onFiveCameraUpdate),this.five.scene.add(this.group),document.head.appendChild(this.style)},t.prototype._disable=function(n){this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.off("gesture.mousemove",this.onFiveMouseMove),this.five.off("wantsTapGesture",this.onFiveTapGesture),this.five.off("cameraUpdate",this.onFiveCameraUpdate),this.five.scene.remove(this.group),document.head.removeChild(this.style)},t.prototype.enable=function(n){var r;if(!this.state.enabled){var i=(r=n==null?void 0:n.userAction)!==null&&r!==void 0?r:!0;this.updateState({enabled:!0},i),this._enable({userAction:i})}},t.prototype.disable=function(n){var r;if(this.state.enabled!==!1){var i=(r=n==null?void 0:n.userAction)!==null&&r!==void 0?r:!0;this.updateState({enabled:!1},i),this._disable({userAction:i})}},t}(Ct.BasePlugin.Controller),Ff=function(e,t){return new Nf(e,t)};/*! Hammer.JS - v2.0.7 - 2016-04-22
351
351
  * http://hammerjs.github.io/
352
352
  *
353
353
  * Copyright (c) 2016 Jorik Tangelder;
354
- * Licensed under the MIT license */var Ns=function(e,t,n,r){var i=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):r,o="function",s=Math.round,c=Math.abs,l=Date.now;function u(w,M,P){return setTimeout(v(w,P),M)}function h(w,M,P){return Array.isArray(w)?(f(w,P[M],P),!0):!1}function f(w,M,P){var U;if(w)if(w.forEach)w.forEach(M,P);else if(w.length!==r)for(U=0;U<w.length;)M.call(P,w[U],U,w),U++;else for(U in w)w.hasOwnProperty(U)&&M.call(P,w[U],U,w)}function d(w,M,P){var U="DEPRECATED METHOD: "+M+`
354
+ * Licensed under the MIT license */var Fs=function(e,t,n,r){var i=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):r,o="function",s=Math.round,c=Math.abs,l=Date.now;function u(w,M,P){return setTimeout(v(w,P),M)}function h(w,M,P){return Array.isArray(w)?(f(w,P[M],P),!0):!1}function f(w,M,P){var U;if(w)if(w.forEach)w.forEach(M,P);else if(w.length!==r)for(U=0;U<w.length;)M.call(P,w[U],U,w),U++;else for(U in w)w.hasOwnProperty(U)&&M.call(P,w[U],U,w)}function d(w,M,P){var U="DEPRECATED METHOD: "+M+`
355
355
  `+P+` AT
356
- `;return function(){var Q=new Error("get-stack-trace"),ge=Q&&Q.stack?Q.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Xe=e.console&&(e.console.warn||e.console.log);return Xe&&Xe.call(e.console,U,ge),w.apply(this,arguments)}}var m;typeof Object.assign!="function"?m=function(M){if(M===r||M===null)throw new TypeError("Cannot convert undefined or null to object");for(var P=Object(M),U=1;U<arguments.length;U++){var Q=arguments[U];if(Q!==r&&Q!==null)for(var ge in Q)Q.hasOwnProperty(ge)&&(P[ge]=Q[ge])}return P}:m=Object.assign;var g=d(function(M,P,U){for(var Q=Object.keys(P),ge=0;ge<Q.length;)(!U||U&&M[Q[ge]]===r)&&(M[Q[ge]]=P[Q[ge]]),ge++;return M},"extend","Use `assign`."),y=d(function(M,P){return g(M,P,!0)},"merge","Use `assign`.");function p(w,M,P){var U=M.prototype,Q;Q=w.prototype=Object.create(U),Q.constructor=w,Q._super=U,P&&m(Q,P)}function v(w,M){return function(){return w.apply(M,arguments)}}function _(w,M){return typeof w==o?w.apply(M&&M[0]||r,M):w}function x(w,M){return w===r?M:w}function b(w,M,P){f(O(M),function(U){w.addEventListener(U,P,!1)})}function T(w,M,P){f(O(M),function(U){w.removeEventListener(U,P,!1)})}function C(w,M){for(;w;){if(w==M)return!0;w=w.parentNode}return!1}function N(w,M){return w.indexOf(M)>-1}function O(w){return w.trim().split(/\s+/g)}function J(w,M,P){if(w.indexOf&&!P)return w.indexOf(M);for(var U=0;U<w.length;){if(P&&w[U][P]==M||!P&&w[U]===M)return U;U++}return-1}function F(w){return Array.prototype.slice.call(w,0)}function B(w,M,P){for(var U=[],Q=[],ge=0;ge<w.length;){var Xe=w[ge][M];J(Q,Xe)<0&&U.push(w[ge]),Q[ge]=Xe,ge++}return U=U.sort(function(Xt,vt){return Xt[M]>vt[M]}),U}function V(w,M){for(var P,U,Q=M[0].toUpperCase()+M.slice(1),ge=0;ge<i.length;){if(P=i[ge],U=P?P+Q:M,U in w)return U;ge++}return r}var Y=1;function D(){return Y++}function z(w){var M=w.ownerDocument||w;return M.defaultView||M.parentWindow||e}var k=/mobile|tablet|ip(ad|hone|od)|android/i,q="ontouchstart"in e,Z=V(e,"PointerEvent")!==r,ee=q&&k.test(navigator.userAgent),te="touch",oe="pen",Pe="mouse",be="kinect",re=25,G=1,Be=2,xe=4,Te=8,ue=1,$=2,Ce=4,Ye=8,Qe=16,nt=$|Ce,$e=Ye|Qe,A=nt|$e,L=["x","y"],ne=["clientX","clientY"];function K(w,M){var P=this;this.manager=w,this.callback=M,this.element=w.element,this.target=w.options.inputTarget,this.domHandler=function(U){_(w.options.enable,[w])&&P.handler(U)},this.init()}K.prototype={handler:function(){},init:function(){this.evEl&&b(this.element,this.evEl,this.domHandler),this.evTarget&&b(this.target,this.evTarget,this.domHandler),this.evWin&&b(z(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(z(this.element),this.evWin,this.domHandler)}};function Fe(w){var M,P=w.options.inputClass;return P?M=P:Z?M=Ot:ee?M=j:q?M=Ae:M=it,new M(w,ye)}function ye(w,M,P){var U=P.pointers.length,Q=P.changedPointers.length,ge=M&G&&U-Q===0,Xe=M&(xe|Te)&&U-Q===0;P.isFirst=!!ge,P.isFinal=!!Xe,ge&&(w.session={}),P.eventType=M,R(w,P),w.emit("hammer.input",P),w.recognize(P),w.session.prevInput=P}function R(w,M){var P=w.session,U=M.pointers,Q=U.length;P.firstInput||(P.firstInput=me(M)),Q>1&&!P.firstMultiple?P.firstMultiple=me(M):Q===1&&(P.firstMultiple=!1);var ge=P.firstInput,Xe=P.firstMultiple,St=Xe?Xe.center:ge.center,Xt=M.center=ie(U);M.timeStamp=l(),M.deltaTime=M.timeStamp-ge.timeStamp,M.angle=I(St,Xt),M.distance=Re(St,Xt),he(P,M),M.offsetDirection=pe(M.deltaX,M.deltaY);var vt=Se(M.deltaTime,M.deltaX,M.deltaY);M.overallVelocityX=vt.x,M.overallVelocityY=vt.y,M.overallVelocity=c(vt.x)>c(vt.y)?vt.x:vt.y,M.scale=Xe?Me(Xe.pointers,U):1,M.rotation=Xe?we(Xe.pointers,U):0,M.maxPointers=P.prevInput?M.pointers.length>P.prevInput.maxPointers?M.pointers.length:P.prevInput.maxPointers:M.pointers.length,fe(P,M);var Cn=w.element;C(M.srcEvent.target,Cn)&&(Cn=M.srcEvent.target),M.target=Cn}function he(w,M){var P=M.center,U=w.offsetDelta||{},Q=w.prevDelta||{},ge=w.prevInput||{};(M.eventType===G||ge.eventType===xe)&&(Q=w.prevDelta={x:ge.deltaX||0,y:ge.deltaY||0},U=w.offsetDelta={x:P.x,y:P.y}),M.deltaX=Q.x+(P.x-U.x),M.deltaY=Q.y+(P.y-U.y)}function fe(w,M){var P=w.lastInterval||M,U=M.timeStamp-P.timeStamp,Q,ge,Xe,St;if(M.eventType!=Te&&(U>re||P.velocity===r)){var Xt=M.deltaX-P.deltaX,vt=M.deltaY-P.deltaY,Cn=Se(U,Xt,vt);ge=Cn.x,Xe=Cn.y,Q=c(Cn.x)>c(Cn.y)?Cn.x:Cn.y,St=pe(Xt,vt),w.lastInterval=M}else Q=P.velocity,ge=P.velocityX,Xe=P.velocityY,St=P.direction;M.velocity=Q,M.velocityX=ge,M.velocityY=Xe,M.direction=St}function me(w){for(var M=[],P=0;P<w.pointers.length;)M[P]={clientX:s(w.pointers[P].clientX),clientY:s(w.pointers[P].clientY)},P++;return{timeStamp:l(),pointers:M,center:ie(M),deltaX:w.deltaX,deltaY:w.deltaY}}function ie(w){var M=w.length;if(M===1)return{x:s(w[0].clientX),y:s(w[0].clientY)};for(var P=0,U=0,Q=0;Q<M;)P+=w[Q].clientX,U+=w[Q].clientY,Q++;return{x:s(P/M),y:s(U/M)}}function Se(w,M,P){return{x:M/w||0,y:P/w||0}}function pe(w,M){return w===M?ue:c(w)>=c(M)?w<0?$:Ce:M<0?Ye:Qe}function Re(w,M,P){P||(P=L);var U=M[P[0]]-w[P[0]],Q=M[P[1]]-w[P[1]];return Math.sqrt(U*U+Q*Q)}function I(w,M,P){P||(P=L);var U=M[P[0]]-w[P[0]],Q=M[P[1]]-w[P[1]];return Math.atan2(Q,U)*180/Math.PI}function we(w,M){return I(M[1],M[0],ne)+I(w[1],w[0],ne)}function Me(w,M){return Re(M[0],M[1],ne)/Re(w[0],w[1],ne)}var Ve={mousedown:G,mousemove:Be,mouseup:xe},Ee="mousedown",Ze="mousemove mouseup";function it(){this.evEl=Ee,this.evWin=Ze,this.pressed=!1,K.apply(this,arguments)}p(it,K,{handler:function(M){var P=Ve[M.type];P&G&&(M.button===0||M.button===2)&&(this.pressed=!0),P&Be&&M.which!==1&&(P=xe),this.pressed&&(P&xe&&(this.pressed=!1),this.callback(this.manager,P,{pointers:[M],changedPointers:[M],pointerType:Pe,srcEvent:M}))}});var pt={pointerdown:G,pointermove:Be,pointerup:xe,pointercancel:Te,pointerout:Te},Ht={2:te,3:oe,4:Pe,5:be},at="pointerdown",Pt="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(at="MSPointerDown",Pt="MSPointerMove MSPointerUp MSPointerCancel");function Ot(){this.evEl=at,this.evWin=Pt,K.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}p(Ot,K,{handler:function(M){var P=this.store,U=!1,Q=!1,ge=M.type.toLowerCase().replace("ms",""),Xe=pt[ge],St=Ht[M.pointerType]||M.pointerType,Xt=St==te,vt=J(P,M.pointerId,"pointerId");Xe&G&&(M.button===0||M.button===2||Xt)?vt<0&&(P.push(M),vt=P.length-1):Xe&(xe|Te)?U=!0:!Xt&&M.buttons===0&&(U=!0,Q=!0,Xe=pt.pointerup),!(vt<0)&&(Q||(P[vt]=M),this.callback(this.manager,Xe,{pointers:P,changedPointers:[M],pointerType:St,srcEvent:P[vt]}),U&&P.splice(vt,1))}});var Kt={touchstart:G,touchmove:Be,touchend:xe,touchcancel:Te},Ii="touchstart",Ni="touchstart touchmove touchend touchcancel";function Br(){this.evTarget=Ii,this.evWin=Ni,this.started=!1,K.apply(this,arguments)}p(Br,K,{handler:function(M){var P=Kt[M.type];if(P===G&&(this.started=!0),!!this.started){var U=S.call(this,M,P);P&(xe|Te)&&U[0].length-U[1].length===0&&(this.started=!1),this.callback(this.manager,P,{pointers:U[0],changedPointers:U[1],pointerType:te,srcEvent:M})}}});function S(w,M){var P=F(w.touches),U=F(w.changedTouches);return M&(xe|Te)&&(P=B(P.concat(U),"identifier")),[P,U]}var W={touchstart:G,touchmove:Be,touchend:xe,touchcancel:Te},H="touchstart touchmove touchend touchcancel";function j(){this.evTarget=H,this.targetIds={},K.apply(this,arguments)}p(j,K,{handler:function(M){var P=W[M.type],U=se.call(this,M,P);U&&this.callback(this.manager,P,{pointers:U[0],changedPointers:U[1],pointerType:te,srcEvent:M})}});function se(w,M){var P=F(w.touches),U=this.targetIds;if(M&(G|Be)&&P.length===1)return U[P[0].identifier]=!0,[P,P];var Q,ge,Xe=F(w.changedTouches),St=[],Xt=this.target;if(ge=P.filter(function(vt){return C(vt.target,Xt)}),M===G)for(Q=0;Q<ge.length;)U[ge[Q].identifier]=!0,Q++;for(Q=0;Q<Xe.length;)U[Xe[Q].identifier]&&St.push(Xe[Q]),M&(xe|Te)&&delete U[Xe[Q].identifier],Q++;if(St.length)return[B(ge.concat(St),"identifier"),St]}var Ge=2500,Ie=25;function Ae(){K.apply(this,arguments);var w=v(this.handler,this);this.touch=new j(this.manager,w),this.mouse=new it(this.manager,w),this.primaryTouch=null,this.lastTouches=[]}p(Ae,K,{handler:function(M,P,U){var Q=U.pointerType==te,ge=U.pointerType==Pe;if(!(ge&&U.sourceCapabilities&&U.sourceCapabilities.firesTouchEvents)){if(Q)Ue.call(this,P,U);else if(ge&&ct.call(this,U))return;this.callback(M,P,U)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Ue(w,M){w&G?(this.primaryTouch=M.changedPointers[0].identifier,He.call(this,M)):w&(xe|Te)&&He.call(this,M)}function He(w){var M=w.changedPointers[0];if(M.identifier===this.primaryTouch){var P={x:M.clientX,y:M.clientY};this.lastTouches.push(P);var U=this.lastTouches,Q=function(){var ge=U.indexOf(P);ge>-1&&U.splice(ge,1)};setTimeout(Q,Ge)}}function ct(w){for(var M=w.srcEvent.clientX,P=w.srcEvent.clientY,U=0;U<this.lastTouches.length;U++){var Q=this.lastTouches[U],ge=Math.abs(M-Q.x),Xe=Math.abs(P-Q.y);if(ge<=Ie&&Xe<=Ie)return!0}return!1}var Ke=a?V(a.style,"touchAction"):r,Je=Ke!==r,ze="compute",qe="auto",yt="manipulation",Tt="none",xt="pan-x",vn="pan-y",st=Xa();function Xn(w,M){this.manager=w,this.set(M)}Xn.prototype={set:function(w){w==ze&&(w=this.compute()),Je&&this.manager.element.style&&st[w]&&(this.manager.element.style[Ke]=w),this.actions=w.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var w=[];return f(this.manager.recognizers,function(M){_(M.options.enable,[M])&&(w=w.concat(M.getTouchAction()))}),mr(w.join(" "))},preventDefaults:function(w){var M=w.srcEvent,P=w.offsetDirection;if(this.manager.session.prevented){M.preventDefault();return}var U=this.actions,Q=N(U,Tt)&&!st[Tt],ge=N(U,vn)&&!st[vn],Xe=N(U,xt)&&!st[xt];if(Q){var St=w.pointers.length===1,Xt=w.distance<2,vt=w.deltaTime<250;if(St&&Xt&&vt)return}if(!(Xe&&ge)&&(Q||ge&&P&nt||Xe&&P&$e))return this.preventSrc(M)},preventSrc:function(w){this.manager.session.prevented=!0,w.preventDefault()}};function mr(w){if(N(w,Tt))return Tt;var M=N(w,xt),P=N(w,vn);return M&&P?Tt:M||P?M?xt:vn:N(w,yt)?yt:qe}function Xa(){if(!Je)return!1;var w={},M=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(P){w[P]=M?e.CSS.supports("touch-action",P):!0}),w}var Fi=1,an=2,Bi=4,gr=8,jn=gr,ja=16,Pn=32;function qn(w){this.options=m({},this.defaults,w||{}),this.id=D(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=Fi,this.simultaneous={},this.requireFail=[]}qn.prototype={defaults:{},set:function(w){return m(this.options,w),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(w){if(h(w,"recognizeWith",this))return this;var M=this.simultaneous;return w=As(w,this),M[w.id]||(M[w.id]=w,w.recognizeWith(this)),this},dropRecognizeWith:function(w){return h(w,"dropRecognizeWith",this)?this:(w=As(w,this),delete this.simultaneous[w.id],this)},requireFailure:function(w){if(h(w,"requireFailure",this))return this;var M=this.requireFail;return w=As(w,this),J(M,w)===-1&&(M.push(w),w.requireFailure(this)),this},dropRequireFailure:function(w){if(h(w,"dropRequireFailure",this))return this;w=As(w,this);var M=J(this.requireFail,w);return M>-1&&this.requireFail.splice(M,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(w){return!!this.simultaneous[w.id]},emit:function(w){var M=this,P=this.state;function U(Q){M.manager.emit(Q,w)}P<gr&&U(M.options.event+mf(P)),U(M.options.event),w.additionalEvent&&U(w.additionalEvent),P>=gr&&U(M.options.event+mf(P))},tryEmit:function(w){if(this.canEmit())return this.emit(w);this.state=Pn},canEmit:function(){for(var w=0;w<this.requireFail.length;){if(!(this.requireFail[w].state&(Pn|Fi)))return!1;w++}return!0},recognize:function(w){var M=m({},w);if(!_(this.options.enable,[this,M])){this.reset(),this.state=Pn;return}this.state&(jn|ja|Pn)&&(this.state=Fi),this.state=this.process(M),this.state&(an|Bi|gr|ja)&&this.tryEmit(M)},process:function(w){},getTouchAction:function(){},reset:function(){}};function mf(w){return w&ja?"cancel":w&gr?"end":w&Bi?"move":w&an?"start":""}function gf(w){return w==Qe?"down":w==Ye?"up":w==$?"left":w==Ce?"right":""}function As(w,M){var P=M.manager;return P?P.get(w):w}function mn(){qn.apply(this,arguments)}p(mn,qn,{defaults:{pointers:1},attrTest:function(w){var M=this.options.pointers;return M===0||w.pointers.length===M},process:function(w){var M=this.state,P=w.eventType,U=M&(an|Bi),Q=this.attrTest(w);return U&&(P&Te||!Q)?M|ja:U||Q?P&xe?M|gr:M&an?M|Bi:an:Pn}});function Ls(){mn.apply(this,arguments),this.pX=null,this.pY=null}p(Ls,mn,{defaults:{event:"pan",threshold:10,pointers:1,direction:A},getTouchAction:function(){var w=this.options.direction,M=[];return w&nt&&M.push(vn),w&$e&&M.push(xt),M},directionTest:function(w){var M=this.options,P=!0,U=w.distance,Q=w.direction,ge=w.deltaX,Xe=w.deltaY;return Q&M.direction||(M.direction&nt?(Q=ge===0?ue:ge<0?$:Ce,P=ge!=this.pX,U=Math.abs(w.deltaX)):(Q=Xe===0?ue:Xe<0?Ye:Qe,P=Xe!=this.pY,U=Math.abs(w.deltaY))),w.direction=Q,P&&U>M.threshold&&Q&M.direction},attrTest:function(w){return mn.prototype.attrTest.call(this,w)&&(this.state&an||!(this.state&an)&&this.directionTest(w))},emit:function(w){this.pX=w.deltaX,this.pY=w.deltaY;var M=gf(w.direction);M&&(w.additionalEvent=this.options.event+M),this._super.emit.call(this,w)}});function Pc(){mn.apply(this,arguments)}p(Pc,mn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Tt]},attrTest:function(w){return this._super.attrTest.call(this,w)&&(Math.abs(w.scale-1)>this.options.threshold||this.state&an)},emit:function(w){if(w.scale!==1){var M=w.scale<1?"in":"out";w.additionalEvent=this.options.event+M}this._super.emit.call(this,w)}});function Cc(){qn.apply(this,arguments),this._timer=null,this._input=null}p(Cc,qn,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[qe]},process:function(w){var M=this.options,P=w.pointers.length===M.pointers,U=w.distance<M.threshold,Q=w.deltaTime>M.time;if(this._input=w,!U||!P||w.eventType&(xe|Te)&&!Q)this.reset();else if(w.eventType&G)this.reset(),this._timer=u(function(){this.state=jn,this.tryEmit()},M.time,this);else if(w.eventType&xe)return jn;return Pn},reset:function(){clearTimeout(this._timer)},emit:function(w){this.state===jn&&(w&&w.eventType&xe?this.manager.emit(this.options.event+"up",w):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Rc(){mn.apply(this,arguments)}p(Rc,mn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Tt]},attrTest:function(w){return this._super.attrTest.call(this,w)&&(Math.abs(w.rotation)>this.options.threshold||this.state&an)}});function Oc(){mn.apply(this,arguments)}p(Oc,mn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:nt|$e,pointers:1},getTouchAction:function(){return Ls.prototype.getTouchAction.call(this)},attrTest:function(w){var M=this.options.direction,P;return M&(nt|$e)?P=w.overallVelocity:M&nt?P=w.overallVelocityX:M&$e&&(P=w.overallVelocityY),this._super.attrTest.call(this,w)&&M&w.offsetDirection&&w.distance>this.options.threshold&&w.maxPointers==this.options.pointers&&c(P)>this.options.velocity&&w.eventType&xe},emit:function(w){var M=gf(w.offsetDirection);M&&this.manager.emit(this.options.event+M,w),this.manager.emit(this.options.event,w)}});function Ps(){qn.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}p(Ps,qn,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[yt]},process:function(w){var M=this.options,P=w.pointers.length===M.pointers,U=w.distance<M.threshold,Q=w.deltaTime<M.time;if(this.reset(),w.eventType&G&&this.count===0)return this.failTimeout();if(U&&Q&&P){if(w.eventType!=xe)return this.failTimeout();var ge=this.pTime?w.timeStamp-this.pTime<M.interval:!0,Xe=!this.pCenter||Re(this.pCenter,w.center)<M.posThreshold;this.pTime=w.timeStamp,this.pCenter=w.center,!Xe||!ge?this.count=1:this.count+=1,this._input=w;var St=this.count%M.taps;if(St===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=jn,this.tryEmit()},M.interval,this),an):jn}return Pn},failTimeout:function(){return this._timer=u(function(){this.state=Pn},this.options.interval,this),Pn},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==jn&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ui(w,M){return M=M||{},M.recognizers=x(M.recognizers,Ui.defaults.preset),new Dc(w,M)}Ui.VERSION="2.0.7",Ui.defaults={domEvents:!1,touchAction:ze,enable:!0,inputTarget:null,inputClass:null,preset:[[Rc,{enable:!1}],[Pc,{enable:!1},["rotate"]],[Oc,{direction:nt}],[Ls,{direction:nt},["swipe"]],[Ps],[Ps,{event:"doubletap",taps:2},["tap"]],[Cc]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var w0=1,yf=2;function Dc(w,M){this.options=m({},Ui.defaults,M||{}),this.options.inputTarget=this.options.inputTarget||w,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=w,this.input=Fe(this),this.touchAction=new Xn(this,this.options.touchAction),xf(this,!0),f(this.options.recognizers,function(P){var U=this.add(new P[0](P[1]));P[2]&&U.recognizeWith(P[2]),P[3]&&U.requireFailure(P[3])},this)}Dc.prototype={set:function(w){return m(this.options,w),w.touchAction&&this.touchAction.update(),w.inputTarget&&(this.input.destroy(),this.input.target=w.inputTarget,this.input.init()),this},stop:function(w){this.session.stopped=w?yf:w0},recognize:function(w){var M=this.session;if(!M.stopped){this.touchAction.preventDefaults(w);var P,U=this.recognizers,Q=M.curRecognizer;(!Q||Q&&Q.state&jn)&&(Q=M.curRecognizer=null);for(var ge=0;ge<U.length;)P=U[ge],M.stopped!==yf&&(!Q||P==Q||P.canRecognizeWith(Q))?P.recognize(w):P.reset(),!Q&&P.state&(an|Bi|gr)&&(Q=M.curRecognizer=P),ge++}},get:function(w){if(w instanceof qn)return w;for(var M=this.recognizers,P=0;P<M.length;P++)if(M[P].options.event==w)return M[P];return null},add:function(w){if(h(w,"add",this))return this;var M=this.get(w.options.event);return M&&this.remove(M),this.recognizers.push(w),w.manager=this,this.touchAction.update(),w},remove:function(w){if(h(w,"remove",this))return this;if(w=this.get(w),w){var M=this.recognizers,P=J(M,w);P!==-1&&(M.splice(P,1),this.touchAction.update())}return this},on:function(w,M){if(w!==r&&M!==r){var P=this.handlers;return f(O(w),function(U){P[U]=P[U]||[],P[U].push(M)}),this}},off:function(w,M){if(w!==r){var P=this.handlers;return f(O(w),function(U){M?P[U]&&P[U].splice(J(P[U],M),1):delete P[U]}),this}},emit:function(w,M){this.options.domEvents&&M0(w,M);var P=this.handlers[w]&&this.handlers[w].slice();if(!(!P||!P.length)){M.type=w,M.preventDefault=function(){M.srcEvent.preventDefault()};for(var U=0;U<P.length;)P[U](M),U++}},destroy:function(){this.element&&xf(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function xf(w,M){var P=w.element;if(P.style){var U;f(w.options.cssProps,function(Q,ge){U=V(P.style,ge),M?(w.oldCssProps[U]=P.style[U],P.style[U]=Q):P.style[U]=w.oldCssProps[U]||""}),M||(w.oldCssProps={})}}function M0(w,M){var P=t.createEvent("Event");P.initEvent(w,!0,!0),P.gesture=M,M.target.dispatchEvent(P)}return m(Ui,{INPUT_START:G,INPUT_MOVE:Be,INPUT_END:xe,INPUT_CANCEL:Te,STATE_POSSIBLE:Fi,STATE_BEGAN:an,STATE_CHANGED:Bi,STATE_ENDED:gr,STATE_RECOGNIZED:jn,STATE_CANCELLED:ja,STATE_FAILED:Pn,DIRECTION_NONE:ue,DIRECTION_LEFT:$,DIRECTION_RIGHT:Ce,DIRECTION_UP:Ye,DIRECTION_DOWN:Qe,DIRECTION_HORIZONTAL:nt,DIRECTION_VERTICAL:$e,DIRECTION_ALL:A,Manager:Dc,Input:K,TouchAction:Xn,TouchInput:j,MouseInput:it,PointerEventInput:Ot,TouchMouseInput:Ae,SingleTouchInput:Br,Recognizer:qn,AttrRecognizer:mn,Tap:Ps,Pan:Ls,Swipe:Oc,Pinch:Pc,Rotate:Rc,Press:Cc,on:b,off:T,each:f,merge:y,extend:g,assign:m,inherit:p,bindFn:v,prefixed:V}),Ui}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});Number.EPSILON===void 0&&(Number.EPSILON=Math.pow(2,-52)),Number.isInteger===void 0&&(Number.isInteger=function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}),Math.sign===void 0&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype||Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),Object.assign===void 0&&(Object.assign=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const t=Object(e);for(let n=1;n<arguments.length;n++){const r=arguments[n];if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t});const Ff="117",Yn={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Zn={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Bf=0,Fc=1,Uf=2,Bc=1,zf=2,zi=3,Gi=0,At=1,Za=2,Uc=1,Jn=0,Hi=1,zc=2,Gc=3,Hc=4,Gf=5,Ur=100,Hf=101,Vf=102,Vc=103,kc=104,kf=200,Wf=201,Xf=202,jf=203,Wc=204,Xc=205,qf=206,Yf=207,Zf=208,Jf=209,Qf=210,Kf=0,$f=1,ed=2,Fs=3,td=4,nd=5,rd=6,id=7,Ja=0,ad=1,od=2,Vi=0,jc=1,sd=2,ld=3,cd=4,ud=5,Bs=300,Us=301,zs=302,qc=303,Gs=304,Yc=305,ki=306,Hs=307,Qa=1e3,Vt=1001,Ka=1002,_t=1003,Vs=1004,ks=1005,Dt=1006,Zc=1007,$a=1008,Wi=1009,hd=1010,fd=1011,eo=1012,dd=1013,to=1014,Qn=1015,no=1016,pd=1017,vd=1018,md=1019,Xi=1020,gd=1021,xr=1022,on=1023,yd=1024,xd=1025,_d=on,zr=1026,ji=1027,bd=1028,wd=1029,Md=1030,Ed=1031,Td=1032,Sd=1033,Jc=33776,Qc=33777,Kc=33778,$c=33779,eu=35840,tu=35841,nu=35842,ru=35843,Ad=36196,iu=37492,au=37496,Ld=37808,Pd=37809,Cd=37810,Rd=37811,Od=37812,Dd=37813,Id=37814,Nd=37815,Fd=37816,Bd=37817,Ud=37818,zd=37819,Gd=37820,Hd=37821,Vd=36492,kd=37840,Wd=37841,Xd=37842,jd=37843,qd=37844,Yd=37845,Zd=37846,Jd=37847,Qd=37848,Kd=37849,$d=37850,ep=37851,tp=37852,np=37853,rp=2200,ip=2201,ap=2202,ro=2300,io=2301,Ws=2302,Gr=2400,Hr=2401,ao=2402,Xs=2500,ou=2501,op=0,kt=3e3,oo=3001,js=3007,qs=3002,sp=3003,su=3004,lu=3005,cu=3006,lp=3200,cp=3201,Vr=0,up=1,Ys=7680,hp=519,so=35044,qi=35048;function sn(){}Object.assign(sn.prototype,{addEventListener:function(e,t){this._listeners===void 0&&(this._listeners={});var n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)},hasEventListener:function(e,t){if(this._listeners===void 0)return!1;var n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1},removeEventListener:function(e,t){if(this._listeners!==void 0){var n=this._listeners,r=n[e];if(r!==void 0){var i=r.indexOf(t);i!==-1&&r.splice(i,1)}}},dispatchEvent:function(e){if(this._listeners!==void 0){var t=this._listeners,n=t[e.type];if(n!==void 0){e.target=this;for(var r=n.slice(0),i=0,a=r.length;i<a;i++)r[i].call(this,e)}}}});for(var Ct=[],Yi=0;Yi<256;Yi++)Ct[Yi]=(Yi<16?"0":"")+Yi.toString(16);var ke={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0,i=Ct[e&255]+Ct[e>>8&255]+Ct[e>>16&255]+Ct[e>>24&255]+"-"+Ct[t&255]+Ct[t>>8&255]+"-"+Ct[t>>16&15|64]+Ct[t>>24&255]+"-"+Ct[n&63|128]+Ct[n>>8&255]+"-"+Ct[n>>16&255]+Ct[n>>24&255]+Ct[r&255]+Ct[r>>8&255]+Ct[r>>16&255]+Ct[r>>24&255];return i.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,r,i){return r+(e-t)*(i-r)/(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*e*(3-2*e))},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-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*ke.DEG2RAD},radToDeg:function(e){return e*ke.RAD2DEG},isPowerOfTwo:function(e){return(e&e-1)===0&&e!==0},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))},setQuaternionFromProperEuler:function(e,t,n,r,i){var a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),h=a((t-r)/2),f=o((t-r)/2),d=a((r-t)/2),m=o((r-t)/2);switch(i){case"XYX":e.set(s*u,c*h,c*f,s*l);break;case"YZY":e.set(c*f,s*u,c*h,s*l);break;case"ZXZ":e.set(c*h,c*f,s*u,s*l);break;case"XZX":e.set(s*u,c*m,c*d,s*l);break;case"YXY":e.set(c*d,s*u,c*m,s*l);break;case"ZYZ":e.set(c*m,c*d,s*u,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};function X(e,t){this.x=e||0,this.y=t||0}Object.defineProperties(X.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(X.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 t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar: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 t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar: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,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min: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)+Math.PI;return 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.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return t===void 0&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}});function Ut(){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(Ut.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,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},extractBasis:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),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},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],f=n[5],d=n[8],m=r[0],g=r[3],y=r[6],p=r[1],v=r[4],_=r[7],x=r[2],b=r[5],T=r[8];return i[0]=a*m+o*p+s*x,i[3]=a*g+o*v+s*b,i[6]=a*y+o*_+s*T,i[1]=c*m+l*p+u*x,i[4]=c*g+l*v+u*b,i[7]=c*y+l*_+u*T,i[2]=h*m+f*p+d*x,i[5]=h*g+f*v+d*b,i[8]=h*y+f*_+d*T,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],r=e[2],i=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*i*l+n*o*s+r*i*c-r*a*s},getInverse:function(e,t){t!==void 0&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=e.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7],f=n[8],d=f*c-l*h,m=l*u-f*s,g=h*s-c*u,y=i*d+a*m+o*g;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);var p=1/y;return r[0]=d*p,r[1]=(o*h-f*a)*p,r[2]=(l*a-o*c)*p,r[3]=m*p,r[4]=(f*i-o*u)*p,r[5]=(o*s-l*i)*p,r[6]=g*p,r[7]=(a*u-h*i)*p,r[8]=(c*i-a*s)*p,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,r,i,a,o){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-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),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],c=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*c,r[6]=t*o+n*l,r[1]=-n*i+t*s,r[4]=-n*a+t*c,r[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,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){t===void 0&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){e===void 0&&(e=[]),t===void 0&&(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 kr,_r={getDataURL:function(e){var t;if(typeof HTMLCanvasElement=="undefined")return e.src;if(e instanceof HTMLCanvasElement)t=e;else{kr===void 0&&(kr=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),kr.width=e.width,kr.height=e.height;var n=kr.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=kr}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},fp=0;function ot(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(this,"id",{value:fp++}),this.uuid=ke.generateUUID(),this.name="",this.image=e!==void 0?e:ot.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=t!==void 0?t:ot.DEFAULT_MAPPING,this.wrapS=n!==void 0?n:Vt,this.wrapT=r!==void 0?r:Vt,this.magFilter=i!==void 0?i:Dt,this.minFilter=a!==void 0?a:$a,this.anisotropy=c!==void 0?c:1,this.format=o!==void 0?o:on,this.internalFormat=null,this.type=s!==void 0?s:Wi,this.offset=new X(0,0),this.repeat=new X(1,1),this.center=new X(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ut,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l!==void 0?l:kt,this.version=0,this.onUpdate=null}ot.DEFAULT_IMAGE=void 0,ot.DEFAULT_MAPPING=Bs,ot.prototype=Object.assign(Object.create(sn.prototype),{constructor:ot,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.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)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(this.image!==void 0){var r=this.image;if(r.uuid===void 0&&(r.uuid=ke.generateUUID()),!t&&e.images[r.uuid]===void 0){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)i.push(_r.getDataURL(r[a]))}else i=_r.getDataURL(r);e.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==Bs)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Qa:e.x=e.x-Math.floor(e.x);break;case Vt:e.x=e.x<0?0:1;break;case Ka:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Qa:e.y=e.y-Math.floor(e.y);break;case Vt:e.y=e.y<0?0:1;break;case Ka:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(ot.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}});function et(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=r!==void 0?r:1}Object.defineProperties(et.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(et.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,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=e.w!==void 0?e.w:1,this},add:function(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar: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 t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar: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,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this},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,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],h=s[1],f=s[5],d=s[9],m=s[2],g=s[6],y=s[10];if(Math.abs(l-h)<a&&Math.abs(u-m)<a&&Math.abs(d-g)<a){if(Math.abs(l+h)<o&&Math.abs(u+m)<o&&Math.abs(d+g)<o&&Math.abs(c+f+y-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var p=(c+1)/2,v=(f+1)/2,_=(y+1)/2,x=(l+h)/4,b=(u+m)/4,T=(d+g)/4;return p>v&&p>_?p<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(p),r=x/n,i=b/n):v>_?v<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(v),n=x/r,i=T/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=b/i,r=T/i),this.set(n,r,i,t),this}var C=Math.sqrt((g-d)*(g-d)+(u-m)*(u-m)+(h-l)*(h-l));return Math.abs(C)<.001&&(C=1),this.x=(g-d)/C,this.y=(u-m)/C,this.z=(h-l)/C,this.w=Math.acos((c+f+y-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.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return t===void 0&&(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 e===void 0&&(e=[]),t===void 0&&(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 n!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}});function $t(e,t,n){this.width=e,this.height=t,this.scissor=new et(0,0,e,t),this.scissorTest=!1,this.viewport=new et(0,0,e,t),n=n||{},this.texture=new ot(void 0,n.mapping,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=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Dt,this.depthBuffer=n.depthBuffer!==void 0?n.depthBuffer:!0,this.stencilBuffer=n.stencilBuffer!==void 0?n.stencilBuffer:!0,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null}$t.prototype=Object.assign(Object.create(sn.prototype),{constructor:$t,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"})}});function uu(e,t,n){$t.call(this,e,t,n),this.samples=4}uu.prototype=Object.assign(Object.create($t.prototype),{constructor:uu,isWebGLMultisampleRenderTarget:!0,copy:function(e){return $t.prototype.copy.call(this,e),this.samples=e.samples,this}});function bt(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=r!==void 0?r:1}Object.assign(bt,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,a,o){var s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],h=i[a+0],f=i[a+1],d=i[a+2],m=i[a+3];if(u!==m||s!==h||c!==f||l!==d){var g=1-o,y=s*h+c*f+l*d+u*m,p=y>=0?1:-1,v=1-y*y;if(v>Number.EPSILON){var _=Math.sqrt(v),x=Math.atan2(_,y*p);g=Math.sin(g*x)/_,o=Math.sin(o*x)/_}var b=o*p;if(s=s*g+h*b,c=c*g+f*b,l=l*g+d*b,u=u*g+m*b,g===1-o){var T=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=T,c*=T,l*=T,u*=T}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u},multiplyQuaternionsFlat:function(e,t,n,r,i,a){var o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],h=i[a+1],f=i[a+2],d=i[a+3];return e[t]=o*d+l*u+s*f-c*h,e[t+1]=s*d+l*h+c*u-o*f,e[t+2]=c*d+l*f+o*h-s*u,e[t+3]=l*d-o*u-s*h-c*f,e}}),Object.defineProperties(bt.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(bt.prototype,{isQuaternion:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,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,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),h=s(n/2),f=s(r/2),d=s(i/2);switch(a){case"XYZ":this._x=h*l*u+c*f*d,this._y=c*f*u-h*l*d,this._z=c*l*d+h*f*u,this._w=c*l*u-h*f*d;break;case"YXZ":this._x=h*l*u+c*f*d,this._y=c*f*u-h*l*d,this._z=c*l*d-h*f*u,this._w=c*l*u+h*f*d;break;case"ZXY":this._x=h*l*u-c*f*d,this._y=c*f*u+h*l*d,this._z=c*l*d+h*f*u,this._w=c*l*u-h*f*d;break;case"ZYX":this._x=h*l*u-c*f*d,this._y=c*f*u+h*l*d,this._z=c*l*d-h*f*u,this._w=c*l*u+h*f*d;break;case"YZX":this._x=h*l*u+c*f*d,this._y=c*f*u+h*l*d,this._z=c*l*d-h*f*u,this._w=c*l*u-h*f*d;break;case"XZY":this._x=h*l*u-c*f*d,this._y=c*f*u-h*l*d,this._z=c*l*d+h*f*u,this._w=c*l*u+h*f*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t!==!1&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],h=n+o+u,f;return h>0?(f=.5/Math.sqrt(h+1),this._w=.25/f,this._x=(l-s)*f,this._y=(i-c)*f,this._z=(a-r)*f):n>o&&n>u?(f=2*Math.sqrt(1+n-o-u),this._w=(l-s)/f,this._x=.25*f,this._y=(r+a)/f,this._z=(i+c)/f):o>u?(f=2*Math.sqrt(1+o-n-u),this._w=(i-c)/f,this._x=(r+a)/f,this._y=.25*f,this._z=(s+l)/f):(f=2*Math.sqrt(1+u-n-o),this._w=(a-r)/f,this._x=(i+c)/f,this._y=(s+l)/f,this._z=.25*f),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=1e-6,r=e.dot(t)+1;return r<n?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(ke.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(n===0)return this;var r=Math.min(1,t/n);return this.slerp(e,r),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 e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this},slerp:function(e,t){if(t===0)return this;if(t===1)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,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*r+t*this._y,this._z=c*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),u=Math.atan2(l,o),h=Math.sin((1-t)*u)/l,f=Math.sin(t*u)/l;return this._w=a*h+this._w*f,this._x=n*h+this._x*f,this._y=r*h+this._y*f,this._z=i*h+this._z*f,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 t===void 0&&(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 e===void 0&&(e=[]),t===void 0&&(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){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var Zs=new E,hu=new bt;function E(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}Object.assign(E.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 t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar: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 t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar: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 t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar: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(hu.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(hu.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*r-o*n,l=s*n+o*t-i*r,u=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=c*s+h*-i+l*-o-u*-a,this.y=l*s+h*-a+u*-i-c*-o,this.z=u*s+h*-o+c*-a-l*-i,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,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},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.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this},cross:function(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.lengthSq();if(t===0)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},projectOnPlane:function(e){return Zs.copy(this).projectOnVector(e),this.sub(Zs)},reflect:function(e){return this.sub(Zs.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(ke.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,r=this.z-e.z;return t*t+n*n+r*r},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 r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},setFromCylindrical: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(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,t*4)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,t*3)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return t===void 0&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});var Wr=new E,ln=new We,dp=new E(0,0,0),pp=new E(1,1,1),Kn=new E,lo=new E,jt=new E;function We(){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(We.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,c,l,u,h,f,d,m,g){var y=this.elements;return y[0]=e,y[4]=t,y[8]=n,y[12]=r,y[1]=i,y[5]=a,y[9]=o,y[13]=s,y[2]=c,y[6]=l,y[10]=u,y[14]=h,y[3]=f,y[7]=d,y[11]=m,y[15]=g,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 We().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,r=1/Wr.setFromMatrixColumn(e,0).length(),i=1/Wr.setFromMatrixColumn(e,1).length(),a=1/Wr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},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,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order==="XYZ"){var h=a*l,f=a*u,d=o*l,m=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=f+d*c,t[5]=h-m*c,t[9]=-o*s,t[2]=m-h*c,t[6]=d+f*c,t[10]=a*s}else if(e.order==="YXZ"){var g=s*l,y=s*u,p=c*l,v=c*u;t[0]=g+v*o,t[4]=p*o-y,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=y*o-p,t[6]=v+g*o,t[10]=a*s}else if(e.order==="ZXY"){var g=s*l,y=s*u,p=c*l,v=c*u;t[0]=g-v*o,t[4]=-a*u,t[8]=p+y*o,t[1]=y+p*o,t[5]=a*l,t[9]=v-g*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order==="ZYX"){var h=a*l,f=a*u,d=o*l,m=o*u;t[0]=s*l,t[4]=d*c-f,t[8]=h*c+m,t[1]=s*u,t[5]=m*c+h,t[9]=f*c-d,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order==="YZX"){var _=a*s,x=a*c,b=o*s,T=o*c;t[0]=s*l,t[4]=T-_*u,t[8]=b*u+x,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=x*u+b,t[10]=_-T*u}else if(e.order==="XZY"){var _=a*s,x=a*c,b=o*s,T=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=_*u+T,t[5]=a*l,t[9]=x*u-b,t[2]=b*u-x,t[6]=o*l,t[10]=T*u+_}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(dp,e,pp)},lookAt:function(e,t,n){var r=this.elements;return jt.subVectors(e,t),jt.lengthSq()===0&&(jt.z=1),jt.normalize(),Kn.crossVectors(n,jt),Kn.lengthSq()===0&&(Math.abs(n.z)===1?jt.x+=1e-4:jt.z+=1e-4,jt.normalize(),Kn.crossVectors(n,jt)),Kn.normalize(),lo.crossVectors(jt,Kn),r[0]=Kn.x,r[4]=lo.x,r[8]=jt.x,r[1]=Kn.y,r[5]=lo.y,r[9]=jt.y,r[2]=Kn.z,r[6]=lo.z,r[10]=jt.z,this},multiply:function(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],f=n[13],d=n[2],m=n[6],g=n[10],y=n[14],p=n[3],v=n[7],_=n[11],x=n[15],b=r[0],T=r[4],C=r[8],N=r[12],O=r[1],J=r[5],F=r[9],B=r[13],V=r[2],Y=r[6],D=r[10],z=r[14],k=r[3],q=r[7],Z=r[11],ee=r[15];return i[0]=a*b+o*O+s*V+c*k,i[4]=a*T+o*J+s*Y+c*q,i[8]=a*C+o*F+s*D+c*Z,i[12]=a*N+o*B+s*z+c*ee,i[1]=l*b+u*O+h*V+f*k,i[5]=l*T+u*J+h*Y+f*q,i[9]=l*C+u*F+h*D+f*Z,i[13]=l*N+u*B+h*z+f*ee,i[2]=d*b+m*O+g*V+y*k,i[6]=d*T+m*J+g*Y+y*q,i[10]=d*C+m*F+g*D+y*Z,i[14]=d*N+m*B+g*z+y*ee,i[3]=p*b+v*O+_*V+x*k,i[7]=p*T+v*J+_*Y+x*q,i[11]=p*C+v*F+_*D+x*Z,i[15]=p*N+v*B+_*z+x*ee,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},determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],h=e[10],f=e[14],d=e[3],m=e[7],g=e[11],y=e[15];return d*(+i*s*u-r*c*u-i*o*h+n*c*h+r*o*f-n*s*f)+m*(+t*s*f-t*c*h+i*a*h-r*a*f+r*c*l-i*s*l)+g*(+t*c*u-t*o*f-i*a*u+n*a*f+i*o*l-n*c*l)+y*(-r*o*l-t*s*u+t*o*h+r*a*u-n*a*h+n*s*l)},transpose:function(){var e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},getInverse:function(e,t){t!==void 0&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=r[6],h=r[7],f=r[8],d=r[9],m=r[10],g=r[11],y=r[12],p=r[13],v=r[14],_=r[15],x=d*v*h-p*m*h+p*u*g-l*v*g-d*u*_+l*m*_,b=y*m*h-f*v*h-y*u*g+c*v*g+f*u*_-c*m*_,T=f*p*h-y*d*h+y*l*g-c*p*g-f*l*_+c*d*_,C=y*d*u-f*p*u-y*l*m+c*p*m+f*l*v-c*d*v,N=i*x+a*b+o*T+s*C;if(N===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var O=1/N;return n[0]=x*O,n[1]=(p*m*s-d*v*s-p*o*g+a*v*g+d*o*_-a*m*_)*O,n[2]=(l*v*s-p*u*s+p*o*h-a*v*h-l*o*_+a*u*_)*O,n[3]=(d*u*s-l*m*s-d*o*h+a*m*h+l*o*g-a*u*g)*O,n[4]=b*O,n[5]=(f*v*s-y*m*s+y*o*g-i*v*g-f*o*_+i*m*_)*O,n[6]=(y*u*s-c*v*s-y*o*h+i*v*h+c*o*_-i*u*_)*O,n[7]=(c*m*s-f*u*s+f*o*h-i*m*h-c*o*g+i*u*g)*O,n[8]=T*O,n[9]=(y*d*s-f*p*s-y*a*g+i*p*g+f*a*_-i*d*_)*O,n[10]=(c*p*s-y*l*s+y*a*h-i*p*h-c*a*_+i*l*_)*O,n[11]=(f*l*s-c*d*s-f*a*h+i*d*h+c*a*g-i*l*g)*O,n[12]=C*O,n[13]=(f*p*o-y*d*o+y*a*m-i*p*m-f*a*v+i*d*v)*O,n[14]=(y*l*o-c*p*o-y*a*u+i*p*u+c*a*v-i*l*v)*O,n[15]=(c*d*o-f*l*o+f*a*u-i*d*u-c*a*m+i*l*m)*O,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},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],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},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),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*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 r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,h=i*c,f=i*l,d=i*u,m=a*l,g=a*u,y=o*u,p=s*c,v=s*l,_=s*u,x=n.x,b=n.y,T=n.z;return r[0]=(1-(m+y))*x,r[1]=(f+_)*x,r[2]=(d-v)*x,r[3]=0,r[4]=(f-_)*b,r[5]=(1-(h+y))*b,r[6]=(g+p)*b,r[7]=0,r[8]=(d+v)*T,r[9]=(g-p)*T,r[10]=(1-(h+m))*T,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},decompose:function(e,t,n){var r=this.elements,i=Wr.set(r[0],r[1],r[2]).length(),a=Wr.set(r[4],r[5],r[6]).length(),o=Wr.set(r[8],r[9],r[10]).length(),s=this.determinant();s<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],ln.copy(this);var c=1/i,l=1/a,u=1/o;return ln.elements[0]*=c,ln.elements[1]*=c,ln.elements[2]*=c,ln.elements[4]*=l,ln.elements[5]*=l,ln.elements[6]*=l,ln.elements[8]*=u,ln.elements[9]*=u,ln.elements[10]*=u,t.setFromRotationMatrix(ln),n.x=i,n.y=a,n.z=o,this},makePerspective:function(e,t,n,r,i,a){a===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),c=2*i/(n-r),l=(t+e)/(t-e),u=(n+r)/(n-r),h=-(a+i)/(a-i),f=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=f,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),c=1/(n-r),l=1/(a-i),u=(t+e)*s,h=(n+r)*c,f=(a+i)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-f,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){t===void 0&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){e===void 0&&(e=[]),t===void 0&&(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 fu=new We,du=new bt;function Xr(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||Xr.DefaultOrder}Xr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Xr.DefaultOrder="XYZ",Object.defineProperties(Xr.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(Xr.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||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 r=ke.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],c=i[1],l=i[5],u=i[9],h=i[2],f=i[6],d=i[10];switch(t=t||this._order,t){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(f,l),this._z=0);break;case"YXZ":this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,a),this._z=0);break;case"ZXY":this._x=Math.asin(r(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n!==!1&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return fu.makeRotationFromQuaternion(e),this.setFromRotationMatrix(fu,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return du.setFromEuler(this),this.setFromQuaternion(du,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],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(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 E(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});function Js(){this.mask=1}Object.assign(Js.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return(this.mask&e.mask)!==0}});let vp=0;const pu=new E,jr=new bt,Rn=new We,co=new E,Zi=new E,mp=new E,gp=new bt,vu=new E(1,0,0),mu=new E(0,1,0),gu=new E(0,0,1),yp={type:"added"},xp={type:"removed"};function ae(){Object.defineProperty(this,"id",{value:vp++}),this.uuid=ke.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ae.DefaultUp.clone();var e=new E,t=new Xr,n=new bt,r=new E(1,1,1);function i(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(i),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new We},normalMatrix:{value:new Ut}}),this.matrix=new We,this.matrixWorld=new We,this.matrixAutoUpdate=ae.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Js,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}ae.DefaultUp=new E(0,1,0),ae.DefaultMatrixAutoUpdate=!0,ae.prototype=Object.assign(Object.create(sn.prototype),{constructor:ae,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4: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 jr.setFromAxisAngle(e,t),this.quaternion.multiply(jr),this},rotateOnWorldAxis:function(e,t){return jr.setFromAxisAngle(e,t),this.quaternion.premultiply(jr),this},rotateX:function(e){return this.rotateOnAxis(vu,e)},rotateY:function(e){return this.rotateOnAxis(mu,e)},rotateZ:function(e){return this.rotateOnAxis(gu,e)},translateOnAxis:function(e,t){return pu.copy(e).applyQuaternion(this.quaternion),this.position.add(pu.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(vu,e)},translateY:function(e){return this.translateOnAxis(mu,e)},translateZ:function(e){return this.translateOnAxis(gu,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(Rn.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?co.copy(e):co.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),Zi.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rn.lookAt(Zi,co,this.up):Rn.lookAt(co,Zi,this.up),this.quaternion.setFromRotationMatrix(Rn),r&&(Rn.extractRotation(r.matrixWorld),jr.setFromRotationMatrix(Rn),this.quaternion.premultiply(jr.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?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(yp)):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 n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(xp)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),Rn.getInverse(this.matrixWorld),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Rn.multiply(e.parent.matrixWorld)),e.applyMatrix4(Rn),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,r=this.children.length;n<r;n++){var i=this.children[n],a=i.getObjectByProperty(e,t);if(a!==void 0)return a}},getWorldPosition:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new E),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new bt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Zi,e,mp),e},getWorldScale:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new E),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Zi,gp,e),e},getWorldDirection:function(e){e===void 0&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new E),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,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(this.visible!==!1){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;t!==null&&(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)&&(this.parent===null?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,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON());function i(y,p){return y[p.uuid]===void 0&&(y[p.uuid]=p.toJSON(e)),p.uuid}if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);var a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){var o=a.shapes;if(Array.isArray(o))for(var s=0,c=o.length;s<c;s++){var l=o[s];i(e.shapes,l)}else i(e.shapes,o)}}if(this.material!==void 0)if(Array.isArray(this.material)){for(var u=[],s=0,c=this.material.length;s<c;s++)u.push(i(e.materials,this.material[s]));r.material=u}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(var s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(e).object)}if(t){var h=g(e.geometries),f=g(e.materials),d=g(e.textures),m=g(e.images),o=g(e.shapes);h.length>0&&(n.geometries=h),f.length>0&&(n.materials=f),d.length>0&&(n.textures=d),m.length>0&&(n.images=m),o.length>0&&(n.shapes=o)}return n.object=r,n;function g(y){var p=[];for(var v in y){var _=y[v];delete _.metadata,p.push(_)}return p}},clone:function(e){return new this.constructor().copy(this,e)},copy:function(e,t){if(t===void 0&&(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)),t===!0)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}});function Ji(){ae.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Ji.prototype=Object.assign(Object.create(ae.prototype),{constructor:Ji,isScene:!0,copy:function(e,t){return ae.prototype.copy.call(this,e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=ae.prototype.toJSON.call(this,e);return this.background!==null&&(t.object.background=this.background.toJSON(e)),this.environment!==null&&(t.object.environment=this.environment.toJSON(e)),this.fog!==null&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var On=[new E,new E,new E,new E,new E,new E,new E,new E],Qi=new E,Qs=new gn,qr=new E,Yr=new E,Zr=new E,$n=new E,er=new E,br=new E,Ki=new E,uo=new E,ho=new E,wr=new E;function gn(e,t){this.min=e!==void 0?e:new E(1/0,1/0,1/0),this.max=t!==void 0?t:new E(-1/0,-1/0,-1/0)}Object.assign(gn.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,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],u=e[s+1],h=e[s+2];l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),u=e.getY(s),h=e.getZ(s);l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,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=Qi.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 e===void 0&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new E),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return e===void 0&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new E),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;t!==void 0&&(t.boundingBox===null&&t.computeBoundingBox(),Qs.copy(t.boundingBox),Qs.applyMatrix4(e.matrixWorld),this.union(Qs));for(var n=e.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);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 t===void 0&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new E),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,Qi),Qi.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(Ki),uo.subVectors(this.max,Ki),qr.subVectors(e.a,Ki),Yr.subVectors(e.b,Ki),Zr.subVectors(e.c,Ki),$n.subVectors(Yr,qr),er.subVectors(Zr,Yr),br.subVectors(qr,Zr);var t=[0,-$n.z,$n.y,0,-er.z,er.y,0,-br.z,br.y,$n.z,0,-$n.x,er.z,0,-er.x,br.z,0,-br.x,-$n.y,$n.x,0,-er.y,er.x,0,-br.y,br.x,0];return!Ks(t,qr,Yr,Zr,uo)||(t=[1,0,0,0,1,0,0,0,1],!Ks(t,qr,Yr,Zr,uo))?!1:(ho.crossVectors($n,er),t=[ho.x,ho.y,ho.z],Ks(t,qr,Yr,Zr,uo))},clampPoint:function(e,t){return t===void 0&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new E),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){var t=Qi.copy(e).clamp(this.min,this.max);return t.sub(e).length()},getBoundingSphere:function(e){return e===void 0&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=this.getSize(Qi).length()*.5,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()?this:(On[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),On[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),On[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),On[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),On[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),On[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),On[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),On[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(On),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)}});function Ks(e,t,n,r,i){var a,o;for(a=0,o=e.length-3;a<=o;a+=3){wr.fromArray(e,a);var s=i.x*Math.abs(wr.x)+i.y*Math.abs(wr.y)+i.z*Math.abs(wr.z),c=t.dot(wr),l=n.dot(wr),u=r.dot(wr);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>s)return!1}return!0}var _p=new gn;function Dn(e,t){this.center=e!==void 0?e:new E,this.radius=t!==void 0?t:-1}Object.assign(Dn.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;t!==void 0?n.copy(t):_p.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},isEmpty:function(){return this.radius<0},makeEmpty:function(){return this.center.set(0,0,0),this.radius=-1,this},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 t===void 0&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new E),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 e===void 0&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new gn),this.isEmpty()?(e.makeEmpty(),e):(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 In=new E,$s=new E,fo=new E,tr=new E,el=new E,po=new E,tl=new E;function Jr(e,t){this.origin=e!==void 0?e:new E,this.direction=t!==void 0?t:new E(0,0,-1)}Object.assign(Jr.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 t===void 0&&(console.warn("THREE.Ray: .at() target is now required"),t=new E),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,In)),this},closestPointToPoint:function(e,t){t===void 0&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new E),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=In.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(In.copy(this.direction).multiplyScalar(t).add(this.origin),In.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,r){$s.copy(e).add(t).multiplyScalar(.5),fo.copy(t).sub(e).normalize(),tr.copy(this.origin).sub($s);var i=e.distanceTo(t)*.5,a=-this.direction.dot(fo),o=tr.dot(this.direction),s=-tr.dot(fo),c=tr.lengthSq(),l=Math.abs(1-a*a),u,h,f,d;if(l>0)if(u=a*s-o,h=a*o-s,d=i*l,u>=0)if(h>=-d)if(h<=d){var m=1/l;u*=m,h*=m,f=u*(u+a*h+2*o)+h*(a*u+h+2*s)+c}else h=i,u=Math.max(0,-(a*h+o)),f=-u*u+h*(h+2*s)+c;else h=-i,u=Math.max(0,-(a*h+o)),f=-u*u+h*(h+2*s)+c;else h<=-d?(u=Math.max(0,-(-a*i+o)),h=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+h*(h+2*s)+c):h<=d?(u=0,h=Math.min(Math.max(-i,-s),i),f=h*(h+2*s)+c):(u=Math.max(0,-(a*i+o)),h=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+h*(h+2*s)+c);else h=a>0?-i:i,u=Math.max(0,-(a*h+o)),f=-u*u+h*(h+2*s)+c;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(fo).multiplyScalar(h).add($s),f},intersectSphere:function(e,t){In.subVectors(e.center,this.origin);var n=In.dot(this.direction),r=In.dot(In)-n*n,i=e.radius*e.radius;if(r>i)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?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 n===null?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);if(t===0)return!0;var n=e.normal.dot(this.direction);return n*t<0},intersectBox:function(e,t){var n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(n=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),l>=0?(i=(e.min.y-h.y)*l,a=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,a=(e.min.y-h.y)*l),n>a||i>r||((i>n||n!==n)&&(n=i),(a<r||r!==r)&&(r=a),u>=0?(o=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)},intersectsBox:function(e){return this.intersectBox(e,In)!==null},intersectTriangle:function(e,t,n,r,i){el.subVectors(t,e),po.subVectors(n,e),tl.crossVectors(el,po);var a=this.direction.dot(tl),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;tr.subVectors(this.origin,e);var s=o*this.direction.dot(po.crossVectors(tr,po));if(s<0)return null;var c=o*this.direction.dot(el.cross(tr));if(c<0||s+c>a)return null;var l=-o*tr.dot(tl);return l<0?null:this.at(l/a,i)},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 nl=new E,bp=new E,wp=new Ut;function yn(e,t){this.normal=e!==void 0?e:new E(1,0,0),this.constant=t!==void 0?t:0}Object.assign(yn.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var r=nl.subVectors(n,t).cross(bp.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,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 t===void 0&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new E),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){t===void 0&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new E);var n=e.delta(nl),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):void 0;var i=-(e.start.dot(this.normal)+this.constant)/r;if(!(i<0||i>1))return t.copy(n).multiplyScalar(i).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 e===void 0&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new E),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||wp.getNormalMatrix(e),r=this.coplanarPoint(nl).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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 cn=new E,Nn=new E,rl=new E,Fn=new E,Qr=new E,Kr=new E,yu=new E,il=new E,al=new E,ol=new E;function Rt(e,t,n){this.a=e!==void 0?e:new E,this.b=t!==void 0?t:new E,this.c=n!==void 0?n:new E}Object.assign(Rt,{getNormal:function(e,t,n,r){r===void 0&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new E),r.subVectors(n,t),cn.subVectors(e,t),r.cross(cn);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},getBarycoord:function(e,t,n,r,i){cn.subVectors(r,t),Nn.subVectors(n,t),rl.subVectors(e,t);var a=cn.dot(cn),o=cn.dot(Nn),s=cn.dot(rl),c=Nn.dot(Nn),l=Nn.dot(rl),u=a*c-o*o;if(i===void 0&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new E),u===0)return i.set(-2,-1,-1);var h=1/u,f=(c*s-o*l)*h,d=(a*l-o*s)*h;return i.set(1-f-d,d,f)},containsPoint:function(e,t,n,r){return Rt.getBarycoord(e,t,n,r,Fn),Fn.x>=0&&Fn.y>=0&&Fn.x+Fn.y<=1},getUV:function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Fn),s.set(0,0),s.addScaledVector(i,Fn.x),s.addScaledVector(a,Fn.y),s.addScaledVector(o,Fn.z),s},isFrontFacing:function(e,t,n,r){return cn.subVectors(n,t),Nn.subVectors(e,t),cn.cross(Nn).dot(r)<0}}),Object.assign(Rt.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,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),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 cn.subVectors(this.c,this.b),Nn.subVectors(this.a,this.b),cn.cross(Nn).length()*.5},getMidpoint:function(e){return e===void 0&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new E),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return Rt.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return e===void 0&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new yn),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return Rt.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,r,i){return Rt.getUV(e,this.a,this.b,this.c,t,n,r,i)},containsPoint:function(e){return Rt.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return Rt.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){t===void 0&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new E);var n=this.a,r=this.b,i=this.c,a,o;Qr.subVectors(r,n),Kr.subVectors(i,n),il.subVectors(e,n);var s=Qr.dot(il),c=Kr.dot(il);if(s<=0&&c<=0)return t.copy(n);al.subVectors(e,r);var l=Qr.dot(al),u=Kr.dot(al);if(l>=0&&u<=l)return t.copy(r);var h=s*u-l*c;if(h<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Qr,a);ol.subVectors(e,i);var f=Qr.dot(ol),d=Kr.dot(ol);if(d>=0&&f<=d)return t.copy(i);var m=f*c-s*d;if(m<=0&&c>=0&&d<=0)return o=c/(c-d),t.copy(n).addScaledVector(Kr,o);var g=l*d-f*u;if(g<=0&&u-l>=0&&f-d>=0)return yu.subVectors(i,r),o=(u-l)/(u-l+(f-d)),t.copy(r).addScaledVector(yu,o);var y=1/(g+m+h);return a=m*y,o=h*y,t.copy(n).addScaledVector(Qr,a).addScaledVector(Kr,o)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var xu={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},un={h:0,s:0,l:0},vo={h:0,s:0,l:0};function de(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}function sl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}function ll(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function cl(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}Object.assign(de.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&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=(e&255)/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=ke.euclideanModulo(e,1),t=ke.clamp(t,0,1),n=ke.clamp(n,0,1),t===0)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=sl(i,r,e+1/3),this.g=sl(i,r,e),this.b=sl(i,r,e-1/3)}return this},setStyle:function(e){function t(h){h!==void 0&&parseFloat(h)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,c)}break}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=n[1],u=l.length;if(u===3)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(u===6)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=xu[e];return t!==void 0?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 t===void 0&&(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){t===void 0&&(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=ll(e.r),this.g=ll(e.g),this.b=ll(e.b),this},copyLinearToSRGB:function(e){return this.r=cl(e.r),this.g=cl(e.g),this.b=cl(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){e===void 0&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t=this.r,n=this.g,r=this.b,i=Math.max(t,n,r),a=Math.min(t,n,r),o,s,c=(a+i)/2;if(a===i)o=0,s=0;else{var l=i-a;switch(s=c<=.5?l/(i+a):l/(2-i-a),i){case t:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-t)/l+2;break;case r:o=(t-n)/l+4;break}o/=6}return e.h=o,e.s=s,e.l=c,e},getStyle:function(){return"rgb("+(this.r*255|0)+","+(this.g*255|0)+","+(this.b*255|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(un),un.h+=e,un.s+=t,un.l+=n,this.setHSL(un.h,un.s,un.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(un),e.getHSL(vo);var n=ke.lerp(un.h,vo.h,t),r=ke.lerp(un.s,vo.s,t),i=ke.lerp(un.l,vo.l,t);return this.setHSL(n,r,i),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return t===void 0&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),de.NAMES=xu;function mo(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new E,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new de,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=a!==void 0?a:0}Object.assign(mo.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(var t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Mp=0;function Oe(){Object.defineProperty(this,"id",{value:Mp++}),this.uuid=ke.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=Hi,this.side=Gi,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Wc,this.blendDst=Xc,this.blendEquation=Ur,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Fs,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=hp,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ys,this.stencilZFail=Ys,this.stencilZPass=Ys,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}Oe.prototype=Object.assign(Object.create(sn.prototype),{constructor:Oe,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(e!==void 0)for(var t in e){var n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Uc;continue}var r=this[t];if(r===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}},toJSON:function(e){var t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),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,this.combine!==void 0&&(n.combine=this.combine),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.size!==void 0&&(n.size=this.size),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Hi&&(n.blending=this.blending),this.flatShading===!0&&(n.flatShading=this.flatShading),this.side!==Gi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(n.morphTargets=!0),this.morphNormals===!0&&(n.morphNormals=!0),this.skinning===!0&&(n.skinning=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function r(o){var s=[];for(var c in o){var l=o[c];delete l.metadata,s.push(l)}return s}if(t){var i=r(e.textures),a=r(e.images);i.length>0&&(n.textures=i),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.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(t!==null){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.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(Oe.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}});function hn(e){Oe.call(this),this.type="MeshBasicMaterial",this.color=new de(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=Ja,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)}hn.prototype=Object.create(Oe.prototype),hn.prototype.constructor=hn,hn.prototype.isMeshBasicMaterial=!0,hn.prototype.copy=function(e){return Oe.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};var rt=new E;function De(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n===!0,this.usage=so,this.updateRange={offset:0,count:-1},this.version=0}Object.defineProperty(De.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),Object.assign(De.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 r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];a===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new de),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];a===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new X),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];a===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new E),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];a===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new et),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},applyMatrix3:function(e){for(var t=0,n=this.count;t<n;t++)rt.x=this.getX(t),rt.y=this.getY(t),rt.z=this.getZ(t),rt.applyMatrix3(e),this.setXYZ(t,rt.x,rt.y,rt.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)rt.x=this.getX(t),rt.y=this.getY(t),rt.z=this.getZ(t),rt.applyMatrix4(e),this.setXYZ(t,rt.x,rt.y,rt.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)rt.x=this.getX(t),rt.y=this.getY(t),rt.z=this.getZ(t),rt.applyNormalMatrix(e),this.setXYZ(t,rt.x,rt.y,rt.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)rt.x=this.getX(t),rt.y=this.getY(t),rt.z=this.getZ(t),rt.transformDirection(e),this.setXYZ(t,rt.x,rt.y,rt.z);return this},set:function(e,t){return t===void 0&&(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,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},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}}});function ul(e,t,n){De.call(this,new Int8Array(e),t,n)}ul.prototype=Object.create(De.prototype),ul.prototype.constructor=ul;function hl(e,t,n){De.call(this,new Uint8Array(e),t,n)}hl.prototype=Object.create(De.prototype),hl.prototype.constructor=hl;function fl(e,t,n){De.call(this,new Uint8ClampedArray(e),t,n)}fl.prototype=Object.create(De.prototype),fl.prototype.constructor=fl;function dl(e,t,n){De.call(this,new Int16Array(e),t,n)}dl.prototype=Object.create(De.prototype),dl.prototype.constructor=dl;function $i(e,t,n){De.call(this,new Uint16Array(e),t,n)}$i.prototype=Object.create(De.prototype),$i.prototype.constructor=$i;function pl(e,t,n){De.call(this,new Int32Array(e),t,n)}pl.prototype=Object.create(De.prototype),pl.prototype.constructor=pl;function ea(e,t,n){De.call(this,new Uint32Array(e),t,n)}ea.prototype=Object.create(De.prototype),ea.prototype.constructor=ea;function ce(e,t,n){De.call(this,new Float32Array(e),t,n)}ce.prototype=Object.create(De.prototype),ce.prototype.constructor=ce;function vl(e,t,n){De.call(this,new Float64Array(e),t,n)}vl.prototype=Object.create(De.prototype),vl.prototype.constructor=vl;function _u(){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(_u.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,t!==void 0&&(t.count=a*3-t.start,n.push(t)),t={start:a*3,materialIndex:r})}t!==void 0&&(t.count=a*3-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t=e.faces,n=e.vertices,r=e.faceVertexUvs,i=r[0]&&r[0].length>0,a=r[1]&&r[1].length>0,o=e.morphTargets,s=o.length,c;if(s>0){c=[];for(var l=0;l<s;l++)c[l]={name:o[l].name,data:[]};this.morphTargets.position=c}var u=e.morphNormals,h=u.length,f;if(h>0){f=[];for(var l=0;l<h;l++)f[l]={name:u[l].name,data:[]};this.morphTargets.normal=f}var d=e.skinIndices,m=e.skinWeights,g=d.length===n.length,y=m.length===n.length;n.length>0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var l=0;l<t.length;l++){var p=t[l];this.vertices.push(n[p.a],n[p.b],n[p.c]);var v=p.vertexNormals;if(v.length===3)this.normals.push(v[0],v[1],v[2]);else{var _=p.normal;this.normals.push(_,_,_)}var x=p.vertexColors;if(x.length===3)this.colors.push(x[0],x[1],x[2]);else{var b=p.color;this.colors.push(b,b,b)}if(i===!0){var T=r[0][l];T!==void 0?this.uvs.push(T[0],T[1],T[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new X,new X,new X))}if(a===!0){var T=r[1][l];T!==void 0?this.uvs2.push(T[0],T[1],T[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new X,new X,new X))}for(var C=0;C<s;C++){var N=o[C].vertices;c[C].data.push(N[p.a],N[p.b],N[p.c])}for(var C=0;C<h;C++){var O=u[C].vertexNormals[l];f[C].data.push(O.a,O.b,O.c)}g&&this.skinIndices.push(d[p.a],d[p.b],d[p.c]),y&&this.skinWeights.push(m[p.a],m[p.b],m[p.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,e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this}});function bu(e){if(e.length===0)return-1/0;let t=e[0];for(let n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}var Ep=1,xn=new We,ml=new ae,$r=new E,qt=new gn,ta=new gn,wt=new E;function ve(){Object.defineProperty(this,"id",{value:Ep+=2}),this.uuid=ke.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={}}ve.prototype=Object.assign(Object.create(sn.prototype),{constructor:ve,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(bu(e)>65535?ea:$i)(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:n!==void 0?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(n!==void 0){var r=new Ut().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},rotateX:function(e){return xn.makeRotationX(e),this.applyMatrix4(xn),this},rotateY:function(e){return xn.makeRotationY(e),this.applyMatrix4(xn),this},rotateZ:function(e){return xn.makeRotationZ(e),this.applyMatrix4(xn),this},translate:function(e,t,n){return xn.makeTranslation(e,t,n),this.applyMatrix4(xn),this},scale:function(e,t,n){return xn.makeScale(e,t,n),this.applyMatrix4(xn),this},lookAt:function(e){return ml.lookAt(e),ml.updateMatrix(),this.applyMatrix4(ml.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter($r).negate(),this.translate($r.x,$r.y,$r.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new ce(t.vertices.length*3,3),r=new ce(t.colors.length*3,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new ce(t.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(t.lineDistances))}t.boundingSphere!==null&&(this.boundingSphere=t.boundingSphere.clone()),t.boundingBox!==null&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new ce(t,3)),this},updateFromObject:function(e){var t=e.geometry;if(e.isMesh){var n=t.__directGeometry;if(t.elementsNeedUpdate===!0&&(n=void 0,t.elementsNeedUpdate=!1),n===void 0)return this.fromGeometry(t);n.verticesNeedUpdate=t.verticesNeedUpdate,n.normalsNeedUpdate=t.normalsNeedUpdate,n.colorsNeedUpdate=t.colorsNeedUpdate,n.uvsNeedUpdate=t.uvsNeedUpdate,n.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=n}var r;return t.verticesNeedUpdate===!0&&(r=this.attributes.position,r!==void 0&&(r.copyVector3sArray(t.vertices),r.needsUpdate=!0),t.verticesNeedUpdate=!1),t.normalsNeedUpdate===!0&&(r=this.attributes.normal,r!==void 0&&(r.copyVector3sArray(t.normals),r.needsUpdate=!0),t.normalsNeedUpdate=!1),t.colorsNeedUpdate===!0&&(r=this.attributes.color,r!==void 0&&(r.copyColorsArray(t.colors),r.needsUpdate=!0),t.colorsNeedUpdate=!1),t.uvsNeedUpdate&&(r=this.attributes.uv,r!==void 0&&(r.copyVector2sArray(t.uvs),r.needsUpdate=!0),t.uvsNeedUpdate=!1),t.lineDistancesNeedUpdate&&(r=this.attributes.lineDistance,r!==void 0&&(r.copyArray(t.lineDistances),r.needsUpdate=!0),t.lineDistancesNeedUpdate=!1),t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=new _u().fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(e.vertices.length*3);if(this.setAttribute("position",new De(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(e.normals.length*3);this.setAttribute("normal",new De(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(e.colors.length*3);this.setAttribute("color",new De(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(e.uvs.length*2);this.setAttribute("uv",new De(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(e.uvs2.length*2);this.setAttribute("uv2",new De(a,2).copyVector2sArray(e.uvs2))}this.groups=e.groups;for(var o in e.morphTargets){for(var s=[],c=e.morphTargets[o],l=0,u=c.length;l<u;l++){var h=c[l],f=new ce(h.data.length*3,3);f.name=h.name,s.push(f.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var d=new ce(e.skinIndices.length*4,4);this.setAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new ce(e.skinWeights.length*4,4);this.setAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new gn);var e=this.attributes.position,t=this.morphAttributes.position;if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var i=t[n];qt.setFromBufferAttribute(i),this.morphTargetsRelative?(wt.addVectors(this.boundingBox.min,qt.min),this.boundingBox.expandByPoint(wt),wt.addVectors(this.boundingBox.max,qt.max),this.boundingBox.expandByPoint(wt)):(this.boundingBox.expandByPoint(qt.min),this.boundingBox.expandByPoint(qt.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(){this.boundingSphere===null&&(this.boundingSphere=new Dn);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(qt.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];ta.setFromBufferAttribute(a),this.morphTargetsRelative?(wt.addVectors(qt.min,ta.min),qt.expandByPoint(wt),wt.addVectors(qt.max,ta.max),qt.expandByPoint(wt)):(qt.expandByPoint(ta.min),qt.expandByPoint(ta.max))}qt.getCenter(n);for(var o=0,r=0,i=e.count;r<i;r++)wt.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(wt));if(t)for(var r=0,i=t.length;r<i;r++)for(var a=t[r],s=this.morphTargetsRelative,c=0,l=a.count;c<l;c++)wt.fromBufferAttribute(a,c),s&&($r.fromBufferAttribute(e,c),wt.add($r)),o=Math.max(o,n.distanceToSquared(wt));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(t.normal===void 0)this.setAttribute("normal",new De(new Float32Array(n.length),3));else for(var r=t.normal.array,i=0,a=r.length;i<a;i++)r[i]=0;var o=t.normal.array,s,c,l,u=new E,h=new E,f=new E,d=new E,m=new E;if(e)for(var g=e.array,i=0,a=e.count;i<a;i+=3)s=g[i+0]*3,c=g[i+1]*3,l=g[i+2]*3,u.fromArray(n,s),h.fromArray(n,c),f.fromArray(n,l),d.subVectors(f,h),m.subVectors(u,h),d.cross(m),o[s]+=d.x,o[s+1]+=d.y,o[s+2]+=d.z,o[c]+=d.x,o[c+1]+=d.y,o[c+2]+=d.z,o[l]+=d.x,o[l+1]+=d.y,o[l+2]+=d.z;else for(var i=0,a=n.length;i<a;i+=9)u.fromArray(n,i),h.fromArray(n,i+3),f.fromArray(n,i+6),d.subVectors(f,h),m.subVectors(u,h),d.cross(m),o[i]=d.x,o[i+1]=d.y,o[i+2]=d.z,o[i+3]=d.x,o[i+4]=d.y,o[i+5]=d.z,o[i+6]=d.x,o[i+7]=d.y,o[i+8]=d.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(!(e&&e.isBufferGeometry)){console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);return}t===void 0&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(e.attributes[r]!==void 0)for(var i=n[r],a=i.array,o=e.attributes[r],s=o.array,c=o.itemSize*t,l=Math.min(s.length,a.length-c),u=0,h=c;u<l;u++,h++)a[h]=s[u];return this},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)wt.x=e.getX(t),wt.y=e.getY(t),wt.z=e.getZ(t),wt.normalize(),e.setXYZ(t,wt.x,wt.y,wt.z)},toNonIndexed:function(){function e(g,y){for(var p=g.array,v=g.itemSize,_=g.normalized,x=new p.constructor(y.length*v),b=0,T=0,C=0,N=y.length;C<N;C++){b=y[C]*v;for(var O=0;O<v;O++)x[T++]=p[b++]}return new De(x,v,_)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new ve,n=this.index.array,r=this.attributes;for(var i in r){var a=r[i],o=e(a,n);t.setAttribute(i,o)}var s=this.morphAttributes;for(i in s){for(var c=[],l=s[i],u=0,h=l.length;u<h;u++){var a=l[u],o=e(a,n);c.push(o)}t.morphAttributes[i]=c}t.morphTargetsRelative=this.morphTargetsRelative;for(var f=this.groups,u=0,d=f.length;u<d;u++){var m=f[u];t.addGroup(m.start,m.count,m.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),this.parameters!==void 0){var t=this.parameters;for(var n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;r!==null&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var n in i){var a=i[n],o=a.toJSON();a.name!==""&&(o.name=a.name),e.data.attributes[n]=o}var s={},c=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],u=[],h=0,f=l.length;h<f;h++){var a=l[h],o=a.toJSON();a.name!==""&&(o.name=a.name),u.push(o)}u.length>0&&(s[n]=u,c=!0)}c&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(e.data.groups=JSON.parse(JSON.stringify(d)));var m=this.boundingSphere;return m!==null&&(e.data.boundingSphere={center:m.center.toArray(),radius:m.radius}),e},clone:function(){return new ve().copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;i!==null&&this.setIndex(i.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,r=l.length;n<r;n++)c.push(l[n].clone());this.morphAttributes[t]=c}this.morphTargetsRelative=e.morphTargetsRelative;var u=e.groups;for(n=0,r=u.length;n<r;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var f=e.boundingBox;f!==null&&(this.boundingBox=f.clone());var d=e.boundingSphere;return d!==null&&(this.boundingSphere=d.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 wu=new We,Mr=new Jr,gl=new Dn,nr=new E,rr=new E,ir=new E,yl=new E,xl=new E,_l=new E,go=new E,yo=new E,xo=new E,ei=new X,ti=new X,ni=new X,na=new E,_o=new E;function ut(e,t){ae.call(this),this.type="Mesh",this.geometry=e!==void 0?e:new ve,this.material=t!==void 0?t:new hn,this.updateMorphTargets()}ut.prototype=Object.assign(Object.create(ae.prototype),{constructor:ut,isMesh:!0,copy:function(e){return ae.prototype.copy.call(this,e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e=this.geometry,t,n,r;if(e.isBufferGeometry){var i=e.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(o!==void 0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=o.length;t<n;t++)r=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}}else{var s=e.morphTargets;s!==void 0&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n=this.geometry,r=this.material,i=this.matrixWorld;if(r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),gl.copy(n.boundingSphere),gl.applyMatrix4(i),e.ray.intersectsSphere(gl)!==!1&&(wu.getInverse(i),Mr.copy(e.ray).applyMatrix4(wu),!(n.boundingBox!==null&&Mr.intersectsBox(n.boundingBox)===!1)))){var a;if(n.isBufferGeometry){var o,s,c,l=n.index,u=n.attributes.position,h=n.morphAttributes.position,f=n.morphTargetsRelative,d=n.attributes.uv,m=n.attributes.uv2,g=n.groups,y=n.drawRange,p,v,_,x,b,T,C,N;if(l!==null)if(Array.isArray(r))for(p=0,_=g.length;p<_;p++)for(b=g[p],T=r[b.materialIndex],C=Math.max(b.start,y.start),N=Math.min(b.start+b.count,y.start+y.count),v=C,x=N;v<x;v+=3)o=l.getX(v),s=l.getX(v+1),c=l.getX(v+2),a=bo(this,T,e,Mr,u,h,f,d,m,o,s,c),a&&(a.faceIndex=Math.floor(v/3),a.face.materialIndex=b.materialIndex,t.push(a));else for(C=Math.max(0,y.start),N=Math.min(l.count,y.start+y.count),p=C,_=N;p<_;p+=3)o=l.getX(p),s=l.getX(p+1),c=l.getX(p+2),a=bo(this,r,e,Mr,u,h,f,d,m,o,s,c),a&&(a.faceIndex=Math.floor(p/3),t.push(a));else if(u!==void 0)if(Array.isArray(r))for(p=0,_=g.length;p<_;p++)for(b=g[p],T=r[b.materialIndex],C=Math.max(b.start,y.start),N=Math.min(b.start+b.count,y.start+y.count),v=C,x=N;v<x;v+=3)o=v,s=v+1,c=v+2,a=bo(this,T,e,Mr,u,h,f,d,m,o,s,c),a&&(a.faceIndex=Math.floor(v/3),a.face.materialIndex=b.materialIndex,t.push(a));else for(C=Math.max(0,y.start),N=Math.min(u.count,y.start+y.count),p=C,_=N;p<_;p+=3)o=p,s=p+1,c=p+2,a=bo(this,r,e,Mr,u,h,f,d,m,o,s,c),a&&(a.faceIndex=Math.floor(p/3),t.push(a))}else if(n.isGeometry){var O,J,F,B=Array.isArray(r),V=n.vertices,Y=n.faces,D,z=n.faceVertexUvs[0];z.length>0&&(D=z);for(var k=0,q=Y.length;k<q;k++){var Z=Y[k],ee=B?r[Z.materialIndex]:r;if(ee!==void 0&&(O=V[Z.a],J=V[Z.b],F=V[Z.c],a=Mu(this,ee,e,Mr,O,J,F,na),a)){if(D&&D[k]){var te=D[k];ei.copy(te[0]),ti.copy(te[1]),ni.copy(te[2]),a.uv=Rt.getUV(na,O,J,F,ei,ti,ni,new X)}a.face=Z,a.faceIndex=k,t.push(a)}}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});function Mu(e,t,n,r,i,a,o,s){var c;if(t.side===At?c=r.intersectTriangle(o,a,i,!0,s):c=r.intersectTriangle(i,a,o,t.side!==Za,s),c===null)return null;_o.copy(s),_o.applyMatrix4(e.matrixWorld);var l=n.ray.origin.distanceTo(_o);return l<n.near||l>n.far?null:{distance:l,point:_o.clone(),object:e}}function bo(e,t,n,r,i,a,o,s,c,l,u,h){nr.fromBufferAttribute(i,l),rr.fromBufferAttribute(i,u),ir.fromBufferAttribute(i,h);var f=e.morphTargetInfluences;if(t.morphTargets&&a&&f){go.set(0,0,0),yo.set(0,0,0),xo.set(0,0,0);for(var d=0,m=a.length;d<m;d++){var g=f[d],y=a[d];g!==0&&(yl.fromBufferAttribute(y,l),xl.fromBufferAttribute(y,u),_l.fromBufferAttribute(y,h),o?(go.addScaledVector(yl,g),yo.addScaledVector(xl,g),xo.addScaledVector(_l,g)):(go.addScaledVector(yl.sub(nr),g),yo.addScaledVector(xl.sub(rr),g),xo.addScaledVector(_l.sub(ir),g)))}nr.add(go),rr.add(yo),ir.add(xo)}e.isSkinnedMesh&&(e.boneTransform(l,nr),e.boneTransform(u,rr),e.boneTransform(h,ir));var p=Mu(e,t,n,r,nr,rr,ir,na);if(p){s&&(ei.fromBufferAttribute(s,l),ti.fromBufferAttribute(s,u),ni.fromBufferAttribute(s,h),p.uv=Rt.getUV(na,nr,rr,ir,ei,ti,ni,new X)),c&&(ei.fromBufferAttribute(c,l),ti.fromBufferAttribute(c,u),ni.fromBufferAttribute(c,h),p.uv2=Rt.getUV(na,nr,rr,ir,ei,ti,ni,new X));var v=new mo(l,u,h);Rt.getNormal(nr,rr,ir,v.normal),p.face=v}return p}var Tp=0,_n=new We,bl=new ae,wo=new E;function Ne(){Object.defineProperty(this,"id",{value:Tp+=2}),this.uuid=ke.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}Ne.prototype=Object.assign(Object.create(sn.prototype),{constructor:Ne,isGeometry:!0,applyMatrix4:function(e){for(var t=new Ut().getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){var i=this.vertices[n];i.applyMatrix4(e)}for(var n=0,r=this.faces.length;n<r;n++){var a=this.faces[n];a.normal.applyMatrix3(t).normalize();for(var o=0,s=a.vertexNormals.length;o<s;o++)a.vertexNormals[o].applyMatrix3(t).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return _n.makeRotationX(e),this.applyMatrix4(_n),this},rotateY:function(e){return _n.makeRotationY(e),this.applyMatrix4(_n),this},rotateZ:function(e){return _n.makeRotationZ(e),this.applyMatrix4(_n),this},translate:function(e,t,n){return _n.makeTranslation(e,t,n),this.applyMatrix4(_n),this},scale:function(e,t,n){return _n.makeScale(e,t,n),this.applyMatrix4(_n),this},lookAt:function(e){return bl.lookAt(e),bl.updateMatrix(),this.applyMatrix4(bl.matrix),this},fromBufferGeometry:function(e){var t=this,n=e.index!==null?e.index.array:void 0,r=e.attributes;if(r.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=r.position.array,a=r.normal!==void 0?r.normal.array:void 0,o=r.color!==void 0?r.color.array:void 0,s=r.uv!==void 0?r.uv.array:void 0,c=r.uv2!==void 0?r.uv2.array:void 0;c!==void 0&&(this.faceVertexUvs[1]=[]);for(var l=0;l<i.length;l+=3)t.vertices.push(new E().fromArray(i,l)),o!==void 0&&t.colors.push(new de().fromArray(o,l));function u(p,v,_,x){var b=o===void 0?[]:[t.colors[p].clone(),t.colors[v].clone(),t.colors[_].clone()],T=a===void 0?[]:[new E().fromArray(a,p*3),new E().fromArray(a,v*3),new E().fromArray(a,_*3)],C=new mo(p,v,_,T,b,x);t.faces.push(C),s!==void 0&&t.faceVertexUvs[0].push([new X().fromArray(s,p*2),new X().fromArray(s,v*2),new X().fromArray(s,_*2)]),c!==void 0&&t.faceVertexUvs[1].push([new X().fromArray(c,p*2),new X().fromArray(c,v*2),new X().fromArray(c,_*2)])}var h=e.groups;if(h.length>0)for(var l=0;l<h.length;l++)for(var f=h[l],d=f.start,m=f.count,g=d,y=d+m;g<y;g+=3)n!==void 0?u(n[g],n[g+1],n[g+2],f.materialIndex):u(g,g+1,g+2,f.materialIndex);else if(n!==void 0)for(var l=0;l<n.length;l+=3)u(n[l],n[l+1],n[l+2]);else for(var l=0;l<i.length/3;l+=3)u(l,l+1,l+2);return this.computeFaceNormals(),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(wo).negate(),this.translate(wo.x,wo.y,wo.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=t===0?1:1/t,r=new We;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){for(var e=new E,t=new E,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){e===void 0&&(e=!0);var t,n,r,i,a,o;for(o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new E;if(e){var s,c,l,u=new E,h=new E;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],s=this.vertices[a.a],c=this.vertices[a.b],l=this.vertices[a.c],u.subVectors(l,c),h.subVectors(s,c),u.cross(h),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)a=this.faces[r],o[a.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(r=0,i=this.faces.length;r<i;r++){a=this.faces[r];var f=a.vertexNormals;f.length===3?(f[0].copy(o[a.a]),f[1].copy(o[a.b]),f[2].copy(o[a.c])):(f[0]=o[a.a].clone(),f[1]=o[a.b].clone(),f[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++){n=this.faces[e];var r=n.vertexNormals;r.length===3?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for(i=this.faces[n],i.__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var a=new Ne;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,l,u;for(n=0,r=this.faces.length;n<r;n++)l=new E,u={a:new E,b:new E,c:new E},o.push(l),s.push(u)}var c=this.morphNormals[e];a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals();var l,u;for(n=0,r=this.faces.length;n<r;n++)i=this.faces[n],l=c.faceNormals[n],u=c.vertexNormals[n],l.copy(i.normal),u.a.copy(i.vertexNormals[0]),u.b.copy(i.vertexNormals[1]),u.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)i=this.faces[n],i.normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new gn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new Dn),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(!(e&&e.isGeometry)){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);return}var r,i=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,c=e.faces,l=this.colors,u=e.colors;n===void 0&&(n=0),t!==void 0&&(r=new Ut().getNormalMatrix(t));for(var h=0,f=o.length;h<f;h++){var d=o[h],m=d.clone();t!==void 0&&m.applyMatrix4(t),a.push(m)}for(var h=0,f=u.length;h<f;h++)l.push(u[h].clone());for(h=0,f=c.length;h<f;h++){var g=c[h],y,p,v,_=g.vertexNormals,x=g.vertexColors;y=new mo(g.a+i,g.b+i,g.c+i),y.normal.copy(g.normal),r!==void 0&&y.normal.applyMatrix3(r).normalize();for(var b=0,T=_.length;b<T;b++)p=_[b].clone(),r!==void 0&&p.applyMatrix3(r).normalize(),y.vertexNormals.push(p);y.color.copy(g.color);for(var b=0,T=x.length;b<T;b++)v=x[b],y.vertexColors.push(v.clone());y.materialIndex=g.materialIndex+n,s.push(y)}for(var h=0,f=e.faceVertexUvs.length;h<f;h++){var C=e.faceVertexUvs[h];this.faceVertexUvs[h]===void 0&&(this.faceVertexUvs[h]=[]);for(var b=0,T=C.length;b<T;b++){for(var N=C[b],O=[],J=0,F=N.length;J<F;J++)O.push(N[J].clone());this.faceVertexUvs[h].push(O)}}},mergeMesh:function(e){if(!(e&&e.isMesh)){console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e);return}e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)},mergeVertices:function(){var e={},t=[],n=[],r,i,a=4,o=Math.pow(10,a),s,c,l,u,h,f;for(s=0,c=this.vertices.length;s<c;s++)r=this.vertices[s],i=Math.round(r.x*o)+"_"+Math.round(r.y*o)+"_"+Math.round(r.z*o),e[i]===void 0?(e[i]=s,t.push(this.vertices[s]),n[s]=t.length-1):n[s]=n[e[i]];var d=[];for(s=0,c=this.faces.length;s<c;s++){l=this.faces[s],l.a=n[l.a],l.b=n[l.b],l.c=n[l.c],u=[l.a,l.b,l.c];for(var m=0;m<3;m++)if(u[m]===u[(m+1)%3]){d.push(s);break}}for(s=d.length-1;s>=0;s--){var g=d[s];for(this.faces.splice(g,1),h=0,f=this.faceVertexUvs.length;h<f;h++)this.faceVertexUvs[h].splice(g,1)}var y=this.vertices.length-t.length;return this.vertices=t,y},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new E(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;function r(l,u){return l.materialIndex-u.materialIndex}e.sort(r);var i=this.faceVertexUvs[0],a=this.faceVertexUvs[1],o,s;i&&i.length===t&&(o=[]),a&&a.length===t&&(s=[]);for(var n=0;n<t;n++){var c=e[n]._id;o&&o.push(i[c]),s&&s.push(a[c])}o&&(this.faceVertexUvs[0]=o),s&&(this.faceVertexUvs[1]=s)},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),this.parameters!==void 0){var t=this.parameters;for(var n in t)t[n]!==void 0&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}for(var o=[],s=[],c={},l=[],u={},h=[],f={},i=0;i<this.faces.length;i++){var d=this.faces[i],m=!0,g=!1,y=this.faceVertexUvs[0][i]!==void 0,p=d.normal.length()>0,v=d.vertexNormals.length>0,_=d.color.r!==1||d.color.g!==1||d.color.b!==1,x=d.vertexColors.length>0,b=0;if(b=O(b,0,0),b=O(b,1,m),b=O(b,2,g),b=O(b,3,y),b=O(b,4,p),b=O(b,5,v),b=O(b,6,_),b=O(b,7,x),o.push(b),o.push(d.a,d.b,d.c),o.push(d.materialIndex),y){var T=this.faceVertexUvs[0][i];o.push(B(T[0]),B(T[1]),B(T[2]))}if(p&&o.push(J(d.normal)),v){var C=d.vertexNormals;o.push(J(C[0]),J(C[1]),J(C[2]))}if(_&&o.push(F(d.color)),x){var N=d.vertexColors;o.push(F(N[0]),F(N[1]),F(N[2]))}}function O(V,Y,D){return D?V|1<<Y:V&~(1<<Y)}function J(V){var Y=V.x.toString()+V.y.toString()+V.z.toString();return c[Y]!==void 0||(c[Y]=s.length/3,s.push(V.x,V.y,V.z)),c[Y]}function F(V){var Y=V.r.toString()+V.g.toString()+V.b.toString();return u[Y]!==void 0||(u[Y]=l.length,l.push(V.getHex())),u[Y]}function B(V){var Y=V.x.toString()+V.y.toString();return f[Y]!==void 0||(f[Y]=h.length/2,h.push(V.x,V.y)),f[Y]}return e.data={},e.data.vertices=r,e.data.normals=s,l.length>0&&(e.data.colors=l),h.length>0&&(e.data.uvs=[h]),e.data.faces=o,e},clone:function(){return new Ne().copy(this)},copy:function(e){var t,n,r,i,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 u=e.faceVertexUvs[t];for(this.faceVertexUvs[t]===void 0&&(this.faceVertexUvs[t]=[]),r=0,i=u.length;r<i;r++){var h=u[r],f=[];for(a=0,o=h.length;a<o;a++){var d=h[a];f.push(d.clone())}this.faceVertexUvs[t].push(f)}}var m=e.morphTargets;for(t=0,n=m.length;t<n;t++){var g={};if(g.name=m[t].name,m[t].vertices!==void 0)for(g.vertices=[],r=0,i=m[t].vertices.length;r<i;r++)g.vertices.push(m[t].vertices[r].clone());if(m[t].normals!==void 0)for(g.normals=[],r=0,i=m[t].normals.length;r<i;r++)g.normals.push(m[t].normals[r].clone());this.morphTargets.push(g)}var y=e.morphNormals;for(t=0,n=y.length;t<n;t++){var p={};if(y[t].vertexNormals!==void 0)for(p.vertexNormals=[],r=0,i=y[t].vertexNormals.length;r<i;r++){var v=y[t].vertexNormals[r],_={};_.a=v.a.clone(),_.b=v.b.clone(),_.c=v.c.clone(),p.vertexNormals.push(_)}if(y[t].faceNormals!==void 0)for(p.faceNormals=[],r=0,i=y[t].faceNormals.length;r<i;r++)p.faceNormals.push(y[t].faceNormals[r].clone());this.morphNormals.push(p)}var x=e.skinWeights;for(t=0,n=x.length;t<n;t++)this.skinWeights.push(x[t].clone());var b=e.skinIndices;for(t=0,n=b.length;t<n;t++)this.skinIndices.push(b[t].clone());var T=e.lineDistances;for(t=0,n=T.length;t<n;t++)this.lineDistances.push(T[t]);var C=e.boundingBox;C!==null&&(this.boundingBox=C.clone());var N=e.boundingSphere;return N!==null&&(this.boundingSphere=N.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"})}});class Sp extends Ne{constructor(t,n,r,i,a,o){super(),this.type="BoxGeometry",this.parameters={width:t,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:o},this.fromBufferGeometry(new Mo(t,n,r,i,a,o)),this.mergeVertices()}}class Mo extends ve{constructor(t,n,r,i,a,o){super(),this.type="BoxBufferGeometry",this.parameters={width:t,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:o};const s=this;t=t||1,n=n||1,r=r||1,i=Math.floor(i)||1,a=Math.floor(a)||1,o=Math.floor(o)||1;const c=[],l=[],u=[],h=[];let f=0,d=0;m("z","y","x",-1,-1,r,n,t,o,a,0),m("z","y","x",1,-1,r,n,-t,o,a,1),m("x","z","y",1,1,t,r,n,i,o,2),m("x","z","y",1,-1,t,r,-n,i,o,3),m("x","y","z",1,-1,t,n,r,i,a,4),m("x","y","z",-1,-1,t,n,-r,i,a,5),this.setIndex(c),this.setAttribute("position",new ce(l,3)),this.setAttribute("normal",new ce(u,3)),this.setAttribute("uv",new ce(h,2));function m(g,y,p,v,_,x,b,T,C,N,O){const J=x/C,F=b/N,B=x/2,V=b/2,Y=T/2,D=C+1,z=N+1;let k=0,q=0;const Z=new E;for(let ee=0;ee<z;ee++){const te=ee*F-V;for(let oe=0;oe<D;oe++){const Pe=oe*J-B;Z[g]=Pe*v,Z[y]=te*_,Z[p]=Y,l.push(Z.x,Z.y,Z.z),Z[g]=0,Z[y]=0,Z[p]=T>0?1:-1,u.push(Z.x,Z.y,Z.z),h.push(oe/C),h.push(1-ee/N),k+=1}}for(let ee=0;ee<N;ee++)for(let te=0;te<C;te++){const oe=f+te+D*ee,Pe=f+te+D*(ee+1),be=f+(te+1)+D*(ee+1),re=f+(te+1)+D*ee;c.push(oe,Pe,re),c.push(Pe,be,re),q+=6}s.addGroup(d,q,O),d+=q,f+=k}}}function ri(e){var t={};for(var n in e){t[n]={};for(var r in e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function It(e){for(var t={},n=0;n<e.length;n++){var r=ri(e[n]);for(var i in r)t[i]=r[i]}return t}var Ap={clone:ri,merge:It},Lp=`void main() {
356
+ `;return function(){var Q=new Error("get-stack-trace"),ge=Q&&Q.stack?Q.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Xe=e.console&&(e.console.warn||e.console.log);return Xe&&Xe.call(e.console,U,ge),w.apply(this,arguments)}}var m;typeof Object.assign!="function"?m=function(M){if(M===r||M===null)throw new TypeError("Cannot convert undefined or null to object");for(var P=Object(M),U=1;U<arguments.length;U++){var Q=arguments[U];if(Q!==r&&Q!==null)for(var ge in Q)Q.hasOwnProperty(ge)&&(P[ge]=Q[ge])}return P}:m=Object.assign;var g=d(function(M,P,U){for(var Q=Object.keys(P),ge=0;ge<Q.length;)(!U||U&&M[Q[ge]]===r)&&(M[Q[ge]]=P[Q[ge]]),ge++;return M},"extend","Use `assign`."),y=d(function(M,P){return g(M,P,!0)},"merge","Use `assign`.");function p(w,M,P){var U=M.prototype,Q;Q=w.prototype=Object.create(U),Q.constructor=w,Q._super=U,P&&m(Q,P)}function v(w,M){return function(){return w.apply(M,arguments)}}function _(w,M){return typeof w==o?w.apply(M&&M[0]||r,M):w}function x(w,M){return w===r?M:w}function b(w,M,P){f(O(M),function(U){w.addEventListener(U,P,!1)})}function T(w,M,P){f(O(M),function(U){w.removeEventListener(U,P,!1)})}function C(w,M){for(;w;){if(w==M)return!0;w=w.parentNode}return!1}function N(w,M){return w.indexOf(M)>-1}function O(w){return w.trim().split(/\s+/g)}function J(w,M,P){if(w.indexOf&&!P)return w.indexOf(M);for(var U=0;U<w.length;){if(P&&w[U][P]==M||!P&&w[U]===M)return U;U++}return-1}function F(w){return Array.prototype.slice.call(w,0)}function B(w,M,P){for(var U=[],Q=[],ge=0;ge<w.length;){var Xe=w[ge][M];J(Q,Xe)<0&&U.push(w[ge]),Q[ge]=Xe,ge++}return U=U.sort(function(Xt,vt){return Xt[M]>vt[M]}),U}function V(w,M){for(var P,U,Q=M[0].toUpperCase()+M.slice(1),ge=0;ge<i.length;){if(P=i[ge],U=P?P+Q:M,U in w)return U;ge++}return r}var Y=1;function D(){return Y++}function z(w){var M=w.ownerDocument||w;return M.defaultView||M.parentWindow||e}var k=/mobile|tablet|ip(ad|hone|od)|android/i,q="ontouchstart"in e,Z=V(e,"PointerEvent")!==r,ee=q&&k.test(navigator.userAgent),te="touch",oe="pen",Pe="mouse",be="kinect",re=25,G=1,Be=2,xe=4,Te=8,ue=1,$=2,Ce=4,Ye=8,Qe=16,nt=$|Ce,$e=Ye|Qe,A=nt|$e,L=["x","y"],ne=["clientX","clientY"];function K(w,M){var P=this;this.manager=w,this.callback=M,this.element=w.element,this.target=w.options.inputTarget,this.domHandler=function(U){_(w.options.enable,[w])&&P.handler(U)},this.init()}K.prototype={handler:function(){},init:function(){this.evEl&&b(this.element,this.evEl,this.domHandler),this.evTarget&&b(this.target,this.evTarget,this.domHandler),this.evWin&&b(z(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(z(this.element),this.evWin,this.domHandler)}};function Fe(w){var M,P=w.options.inputClass;return P?M=P:Z?M=Dt:ee?M=j:q?M=Ae:M=it,new M(w,ye)}function ye(w,M,P){var U=P.pointers.length,Q=P.changedPointers.length,ge=M&G&&U-Q===0,Xe=M&(xe|Te)&&U-Q===0;P.isFirst=!!ge,P.isFinal=!!Xe,ge&&(w.session={}),P.eventType=M,R(w,P),w.emit("hammer.input",P),w.recognize(P),w.session.prevInput=P}function R(w,M){var P=w.session,U=M.pointers,Q=U.length;P.firstInput||(P.firstInput=me(M)),Q>1&&!P.firstMultiple?P.firstMultiple=me(M):Q===1&&(P.firstMultiple=!1);var ge=P.firstInput,Xe=P.firstMultiple,St=Xe?Xe.center:ge.center,Xt=M.center=ie(U);M.timeStamp=l(),M.deltaTime=M.timeStamp-ge.timeStamp,M.angle=I(St,Xt),M.distance=Re(St,Xt),he(P,M),M.offsetDirection=pe(M.deltaX,M.deltaY);var vt=Se(M.deltaTime,M.deltaX,M.deltaY);M.overallVelocityX=vt.x,M.overallVelocityY=vt.y,M.overallVelocity=c(vt.x)>c(vt.y)?vt.x:vt.y,M.scale=Xe?Me(Xe.pointers,U):1,M.rotation=Xe?we(Xe.pointers,U):0,M.maxPointers=P.prevInput?M.pointers.length>P.prevInput.maxPointers?M.pointers.length:P.prevInput.maxPointers:M.pointers.length,fe(P,M);var Cn=w.element;C(M.srcEvent.target,Cn)&&(Cn=M.srcEvent.target),M.target=Cn}function he(w,M){var P=M.center,U=w.offsetDelta||{},Q=w.prevDelta||{},ge=w.prevInput||{};(M.eventType===G||ge.eventType===xe)&&(Q=w.prevDelta={x:ge.deltaX||0,y:ge.deltaY||0},U=w.offsetDelta={x:P.x,y:P.y}),M.deltaX=Q.x+(P.x-U.x),M.deltaY=Q.y+(P.y-U.y)}function fe(w,M){var P=w.lastInterval||M,U=M.timeStamp-P.timeStamp,Q,ge,Xe,St;if(M.eventType!=Te&&(U>re||P.velocity===r)){var Xt=M.deltaX-P.deltaX,vt=M.deltaY-P.deltaY,Cn=Se(U,Xt,vt);ge=Cn.x,Xe=Cn.y,Q=c(Cn.x)>c(Cn.y)?Cn.x:Cn.y,St=pe(Xt,vt),w.lastInterval=M}else Q=P.velocity,ge=P.velocityX,Xe=P.velocityY,St=P.direction;M.velocity=Q,M.velocityX=ge,M.velocityY=Xe,M.direction=St}function me(w){for(var M=[],P=0;P<w.pointers.length;)M[P]={clientX:s(w.pointers[P].clientX),clientY:s(w.pointers[P].clientY)},P++;return{timeStamp:l(),pointers:M,center:ie(M),deltaX:w.deltaX,deltaY:w.deltaY}}function ie(w){var M=w.length;if(M===1)return{x:s(w[0].clientX),y:s(w[0].clientY)};for(var P=0,U=0,Q=0;Q<M;)P+=w[Q].clientX,U+=w[Q].clientY,Q++;return{x:s(P/M),y:s(U/M)}}function Se(w,M,P){return{x:M/w||0,y:P/w||0}}function pe(w,M){return w===M?ue:c(w)>=c(M)?w<0?$:Ce:M<0?Ye:Qe}function Re(w,M,P){P||(P=L);var U=M[P[0]]-w[P[0]],Q=M[P[1]]-w[P[1]];return Math.sqrt(U*U+Q*Q)}function I(w,M,P){P||(P=L);var U=M[P[0]]-w[P[0]],Q=M[P[1]]-w[P[1]];return Math.atan2(Q,U)*180/Math.PI}function we(w,M){return I(M[1],M[0],ne)+I(w[1],w[0],ne)}function Me(w,M){return Re(M[0],M[1],ne)/Re(w[0],w[1],ne)}var Ve={mousedown:G,mousemove:Be,mouseup:xe},Ee="mousedown",Ze="mousemove mouseup";function it(){this.evEl=Ee,this.evWin=Ze,this.pressed=!1,K.apply(this,arguments)}p(it,K,{handler:function(M){var P=Ve[M.type];P&G&&(M.button===0||M.button===2)&&(this.pressed=!0),P&Be&&M.which!==1&&(P=xe),this.pressed&&(P&xe&&(this.pressed=!1),this.callback(this.manager,P,{pointers:[M],changedPointers:[M],pointerType:Pe,srcEvent:M}))}});var pt={pointerdown:G,pointermove:Be,pointerup:xe,pointercancel:Te,pointerout:Te},Ht={2:te,3:oe,4:Pe,5:be},at="pointerdown",Pt="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(at="MSPointerDown",Pt="MSPointerMove MSPointerUp MSPointerCancel");function Dt(){this.evEl=at,this.evWin=Pt,K.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}p(Dt,K,{handler:function(M){var P=this.store,U=!1,Q=!1,ge=M.type.toLowerCase().replace("ms",""),Xe=pt[ge],St=Ht[M.pointerType]||M.pointerType,Xt=St==te,vt=J(P,M.pointerId,"pointerId");Xe&G&&(M.button===0||M.button===2||Xt)?vt<0&&(P.push(M),vt=P.length-1):Xe&(xe|Te)?U=!0:!Xt&&M.buttons===0&&(U=!0,Q=!0,Xe=pt.pointerup),!(vt<0)&&(Q||(P[vt]=M),this.callback(this.manager,Xe,{pointers:P,changedPointers:[M],pointerType:St,srcEvent:P[vt]}),U&&P.splice(vt,1))}});var Kt={touchstart:G,touchmove:Be,touchend:xe,touchcancel:Te},Ii="touchstart",Ni="touchstart touchmove touchend touchcancel";function Br(){this.evTarget=Ii,this.evWin=Ni,this.started=!1,K.apply(this,arguments)}p(Br,K,{handler:function(M){var P=Kt[M.type];if(P===G&&(this.started=!0),!!this.started){var U=S.call(this,M,P);P&(xe|Te)&&U[0].length-U[1].length===0&&(this.started=!1),this.callback(this.manager,P,{pointers:U[0],changedPointers:U[1],pointerType:te,srcEvent:M})}}});function S(w,M){var P=F(w.touches),U=F(w.changedTouches);return M&(xe|Te)&&(P=B(P.concat(U),"identifier")),[P,U]}var W={touchstart:G,touchmove:Be,touchend:xe,touchcancel:Te},H="touchstart touchmove touchend touchcancel";function j(){this.evTarget=H,this.targetIds={},K.apply(this,arguments)}p(j,K,{handler:function(M){var P=W[M.type],U=se.call(this,M,P);U&&this.callback(this.manager,P,{pointers:U[0],changedPointers:U[1],pointerType:te,srcEvent:M})}});function se(w,M){var P=F(w.touches),U=this.targetIds;if(M&(G|Be)&&P.length===1)return U[P[0].identifier]=!0,[P,P];var Q,ge,Xe=F(w.changedTouches),St=[],Xt=this.target;if(ge=P.filter(function(vt){return C(vt.target,Xt)}),M===G)for(Q=0;Q<ge.length;)U[ge[Q].identifier]=!0,Q++;for(Q=0;Q<Xe.length;)U[Xe[Q].identifier]&&St.push(Xe[Q]),M&(xe|Te)&&delete U[Xe[Q].identifier],Q++;if(St.length)return[B(ge.concat(St),"identifier"),St]}var Ge=2500,Ie=25;function Ae(){K.apply(this,arguments);var w=v(this.handler,this);this.touch=new j(this.manager,w),this.mouse=new it(this.manager,w),this.primaryTouch=null,this.lastTouches=[]}p(Ae,K,{handler:function(M,P,U){var Q=U.pointerType==te,ge=U.pointerType==Pe;if(!(ge&&U.sourceCapabilities&&U.sourceCapabilities.firesTouchEvents)){if(Q)Ue.call(this,P,U);else if(ge&&ct.call(this,U))return;this.callback(M,P,U)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Ue(w,M){w&G?(this.primaryTouch=M.changedPointers[0].identifier,He.call(this,M)):w&(xe|Te)&&He.call(this,M)}function He(w){var M=w.changedPointers[0];if(M.identifier===this.primaryTouch){var P={x:M.clientX,y:M.clientY};this.lastTouches.push(P);var U=this.lastTouches,Q=function(){var ge=U.indexOf(P);ge>-1&&U.splice(ge,1)};setTimeout(Q,Ge)}}function ct(w){for(var M=w.srcEvent.clientX,P=w.srcEvent.clientY,U=0;U<this.lastTouches.length;U++){var Q=this.lastTouches[U],ge=Math.abs(M-Q.x),Xe=Math.abs(P-Q.y);if(ge<=Ie&&Xe<=Ie)return!0}return!1}var Ke=a?V(a.style,"touchAction"):r,Je=Ke!==r,ze="compute",qe="auto",yt="manipulation",Tt="none",xt="pan-x",vn="pan-y",st=ja();function Xn(w,M){this.manager=w,this.set(M)}Xn.prototype={set:function(w){w==ze&&(w=this.compute()),Je&&this.manager.element.style&&st[w]&&(this.manager.element.style[Ke]=w),this.actions=w.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var w=[];return f(this.manager.recognizers,function(M){_(M.options.enable,[M])&&(w=w.concat(M.getTouchAction()))}),mr(w.join(" "))},preventDefaults:function(w){var M=w.srcEvent,P=w.offsetDirection;if(this.manager.session.prevented){M.preventDefault();return}var U=this.actions,Q=N(U,Tt)&&!st[Tt],ge=N(U,vn)&&!st[vn],Xe=N(U,xt)&&!st[xt];if(Q){var St=w.pointers.length===1,Xt=w.distance<2,vt=w.deltaTime<250;if(St&&Xt&&vt)return}if(!(Xe&&ge)&&(Q||ge&&P&nt||Xe&&P&$e))return this.preventSrc(M)},preventSrc:function(w){this.manager.session.prevented=!0,w.preventDefault()}};function mr(w){if(N(w,Tt))return Tt;var M=N(w,xt),P=N(w,vn);return M&&P?Tt:M||P?M?xt:vn:N(w,yt)?yt:qe}function ja(){if(!Je)return!1;var w={},M=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(P){w[P]=M?e.CSS.supports("touch-action",P):!0}),w}var Fi=1,an=2,Bi=4,gr=8,jn=gr,qa=16,Pn=32;function qn(w){this.options=m({},this.defaults,w||{}),this.id=D(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=Fi,this.simultaneous={},this.requireFail=[]}qn.prototype={defaults:{},set:function(w){return m(this.options,w),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(w){if(h(w,"recognizeWith",this))return this;var M=this.simultaneous;return w=Rs(w,this),M[w.id]||(M[w.id]=w,w.recognizeWith(this)),this},dropRecognizeWith:function(w){return h(w,"dropRecognizeWith",this)?this:(w=Rs(w,this),delete this.simultaneous[w.id],this)},requireFailure:function(w){if(h(w,"requireFailure",this))return this;var M=this.requireFail;return w=Rs(w,this),J(M,w)===-1&&(M.push(w),w.requireFailure(this)),this},dropRequireFailure:function(w){if(h(w,"dropRequireFailure",this))return this;w=Rs(w,this);var M=J(this.requireFail,w);return M>-1&&this.requireFail.splice(M,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(w){return!!this.simultaneous[w.id]},emit:function(w){var M=this,P=this.state;function U(Q){M.manager.emit(Q,w)}P<gr&&U(M.options.event+mf(P)),U(M.options.event),w.additionalEvent&&U(w.additionalEvent),P>=gr&&U(M.options.event+mf(P))},tryEmit:function(w){if(this.canEmit())return this.emit(w);this.state=Pn},canEmit:function(){for(var w=0;w<this.requireFail.length;){if(!(this.requireFail[w].state&(Pn|Fi)))return!1;w++}return!0},recognize:function(w){var M=m({},w);if(!_(this.options.enable,[this,M])){this.reset(),this.state=Pn;return}this.state&(jn|qa|Pn)&&(this.state=Fi),this.state=this.process(M),this.state&(an|Bi|gr|qa)&&this.tryEmit(M)},process:function(w){},getTouchAction:function(){},reset:function(){}};function mf(w){return w&qa?"cancel":w&gr?"end":w&Bi?"move":w&an?"start":""}function gf(w){return w==Qe?"down":w==Ye?"up":w==$?"left":w==Ce?"right":""}function Rs(w,M){var P=M.manager;return P?P.get(w):w}function mn(){qn.apply(this,arguments)}p(mn,qn,{defaults:{pointers:1},attrTest:function(w){var M=this.options.pointers;return M===0||w.pointers.length===M},process:function(w){var M=this.state,P=w.eventType,U=M&(an|Bi),Q=this.attrTest(w);return U&&(P&Te||!Q)?M|qa:U||Q?P&xe?M|gr:M&an?M|Bi:an:Pn}});function Os(){mn.apply(this,arguments),this.pX=null,this.pY=null}p(Os,mn,{defaults:{event:"pan",threshold:10,pointers:1,direction:A},getTouchAction:function(){var w=this.options.direction,M=[];return w&nt&&M.push(vn),w&$e&&M.push(xt),M},directionTest:function(w){var M=this.options,P=!0,U=w.distance,Q=w.direction,ge=w.deltaX,Xe=w.deltaY;return Q&M.direction||(M.direction&nt?(Q=ge===0?ue:ge<0?$:Ce,P=ge!=this.pX,U=Math.abs(w.deltaX)):(Q=Xe===0?ue:Xe<0?Ye:Qe,P=Xe!=this.pY,U=Math.abs(w.deltaY))),w.direction=Q,P&&U>M.threshold&&Q&M.direction},attrTest:function(w){return mn.prototype.attrTest.call(this,w)&&(this.state&an||!(this.state&an)&&this.directionTest(w))},emit:function(w){this.pX=w.deltaX,this.pY=w.deltaY;var M=gf(w.direction);M&&(w.additionalEvent=this.options.event+M),this._super.emit.call(this,w)}});function Cc(){mn.apply(this,arguments)}p(Cc,mn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Tt]},attrTest:function(w){return this._super.attrTest.call(this,w)&&(Math.abs(w.scale-1)>this.options.threshold||this.state&an)},emit:function(w){if(w.scale!==1){var M=w.scale<1?"in":"out";w.additionalEvent=this.options.event+M}this._super.emit.call(this,w)}});function Rc(){qn.apply(this,arguments),this._timer=null,this._input=null}p(Rc,qn,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[qe]},process:function(w){var M=this.options,P=w.pointers.length===M.pointers,U=w.distance<M.threshold,Q=w.deltaTime>M.time;if(this._input=w,!U||!P||w.eventType&(xe|Te)&&!Q)this.reset();else if(w.eventType&G)this.reset(),this._timer=u(function(){this.state=jn,this.tryEmit()},M.time,this);else if(w.eventType&xe)return jn;return Pn},reset:function(){clearTimeout(this._timer)},emit:function(w){this.state===jn&&(w&&w.eventType&xe?this.manager.emit(this.options.event+"up",w):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Oc(){mn.apply(this,arguments)}p(Oc,mn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Tt]},attrTest:function(w){return this._super.attrTest.call(this,w)&&(Math.abs(w.rotation)>this.options.threshold||this.state&an)}});function Dc(){mn.apply(this,arguments)}p(Dc,mn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:nt|$e,pointers:1},getTouchAction:function(){return Os.prototype.getTouchAction.call(this)},attrTest:function(w){var M=this.options.direction,P;return M&(nt|$e)?P=w.overallVelocity:M&nt?P=w.overallVelocityX:M&$e&&(P=w.overallVelocityY),this._super.attrTest.call(this,w)&&M&w.offsetDirection&&w.distance>this.options.threshold&&w.maxPointers==this.options.pointers&&c(P)>this.options.velocity&&w.eventType&xe},emit:function(w){var M=gf(w.offsetDirection);M&&this.manager.emit(this.options.event+M,w),this.manager.emit(this.options.event,w)}});function Ds(){qn.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}p(Ds,qn,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[yt]},process:function(w){var M=this.options,P=w.pointers.length===M.pointers,U=w.distance<M.threshold,Q=w.deltaTime<M.time;if(this.reset(),w.eventType&G&&this.count===0)return this.failTimeout();if(U&&Q&&P){if(w.eventType!=xe)return this.failTimeout();var ge=this.pTime?w.timeStamp-this.pTime<M.interval:!0,Xe=!this.pCenter||Re(this.pCenter,w.center)<M.posThreshold;this.pTime=w.timeStamp,this.pCenter=w.center,!Xe||!ge?this.count=1:this.count+=1,this._input=w;var St=this.count%M.taps;if(St===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=jn,this.tryEmit()},M.interval,this),an):jn}return Pn},failTimeout:function(){return this._timer=u(function(){this.state=Pn},this.options.interval,this),Pn},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==jn&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ui(w,M){return M=M||{},M.recognizers=x(M.recognizers,Ui.defaults.preset),new Ic(w,M)}Ui.VERSION="2.0.7",Ui.defaults={domEvents:!1,touchAction:ze,enable:!0,inputTarget:null,inputClass:null,preset:[[Oc,{enable:!1}],[Cc,{enable:!1},["rotate"]],[Dc,{direction:nt}],[Os,{direction:nt},["swipe"]],[Ds],[Ds,{event:"doubletap",taps:2},["tap"]],[Rc]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var T0=1,yf=2;function Ic(w,M){this.options=m({},Ui.defaults,M||{}),this.options.inputTarget=this.options.inputTarget||w,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=w,this.input=Fe(this),this.touchAction=new Xn(this,this.options.touchAction),xf(this,!0),f(this.options.recognizers,function(P){var U=this.add(new P[0](P[1]));P[2]&&U.recognizeWith(P[2]),P[3]&&U.requireFailure(P[3])},this)}Ic.prototype={set:function(w){return m(this.options,w),w.touchAction&&this.touchAction.update(),w.inputTarget&&(this.input.destroy(),this.input.target=w.inputTarget,this.input.init()),this},stop:function(w){this.session.stopped=w?yf:T0},recognize:function(w){var M=this.session;if(!M.stopped){this.touchAction.preventDefaults(w);var P,U=this.recognizers,Q=M.curRecognizer;(!Q||Q&&Q.state&jn)&&(Q=M.curRecognizer=null);for(var ge=0;ge<U.length;)P=U[ge],M.stopped!==yf&&(!Q||P==Q||P.canRecognizeWith(Q))?P.recognize(w):P.reset(),!Q&&P.state&(an|Bi|gr)&&(Q=M.curRecognizer=P),ge++}},get:function(w){if(w instanceof qn)return w;for(var M=this.recognizers,P=0;P<M.length;P++)if(M[P].options.event==w)return M[P];return null},add:function(w){if(h(w,"add",this))return this;var M=this.get(w.options.event);return M&&this.remove(M),this.recognizers.push(w),w.manager=this,this.touchAction.update(),w},remove:function(w){if(h(w,"remove",this))return this;if(w=this.get(w),w){var M=this.recognizers,P=J(M,w);P!==-1&&(M.splice(P,1),this.touchAction.update())}return this},on:function(w,M){if(w!==r&&M!==r){var P=this.handlers;return f(O(w),function(U){P[U]=P[U]||[],P[U].push(M)}),this}},off:function(w,M){if(w!==r){var P=this.handlers;return f(O(w),function(U){M?P[U]&&P[U].splice(J(P[U],M),1):delete P[U]}),this}},emit:function(w,M){this.options.domEvents&&S0(w,M);var P=this.handlers[w]&&this.handlers[w].slice();if(!(!P||!P.length)){M.type=w,M.preventDefault=function(){M.srcEvent.preventDefault()};for(var U=0;U<P.length;)P[U](M),U++}},destroy:function(){this.element&&xf(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function xf(w,M){var P=w.element;if(P.style){var U;f(w.options.cssProps,function(Q,ge){U=V(P.style,ge),M?(w.oldCssProps[U]=P.style[U],P.style[U]=Q):P.style[U]=w.oldCssProps[U]||""}),M||(w.oldCssProps={})}}function S0(w,M){var P=t.createEvent("Event");P.initEvent(w,!0,!0),P.gesture=M,M.target.dispatchEvent(P)}return m(Ui,{INPUT_START:G,INPUT_MOVE:Be,INPUT_END:xe,INPUT_CANCEL:Te,STATE_POSSIBLE:Fi,STATE_BEGAN:an,STATE_CHANGED:Bi,STATE_ENDED:gr,STATE_RECOGNIZED:jn,STATE_CANCELLED:qa,STATE_FAILED:Pn,DIRECTION_NONE:ue,DIRECTION_LEFT:$,DIRECTION_RIGHT:Ce,DIRECTION_UP:Ye,DIRECTION_DOWN:Qe,DIRECTION_HORIZONTAL:nt,DIRECTION_VERTICAL:$e,DIRECTION_ALL:A,Manager:Ic,Input:K,TouchAction:Xn,TouchInput:j,MouseInput:it,PointerEventInput:Dt,TouchMouseInput:Ae,SingleTouchInput:Br,Recognizer:qn,AttrRecognizer:mn,Tap:Ds,Pan:Os,Swipe:Dc,Pinch:Cc,Rotate:Oc,Press:Rc,on:b,off:T,each:f,merge:y,extend:g,assign:m,inherit:p,bindFn:v,prefixed:V}),Ui}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});Number.EPSILON===void 0&&(Number.EPSILON=Math.pow(2,-52)),Number.isInteger===void 0&&(Number.isInteger=function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}),Math.sign===void 0&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype||Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),Object.assign===void 0&&(Object.assign=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const t=Object(e);for(let n=1;n<arguments.length;n++){const r=arguments[n];if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t});const Bf="117",Yn={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Zn={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Uf=0,Bc=1,zf=2,Uc=1,Gf=2,zi=3,Gi=0,At=1,$a=2,zc=1,Jn=0,Hi=1,Gc=2,Hc=3,Vc=4,Hf=5,Ur=100,Vf=101,kf=102,kc=103,Wc=104,Wf=200,Xf=201,jf=202,qf=203,Xc=204,jc=205,Yf=206,Zf=207,Jf=208,Qf=209,Kf=210,$f=0,ed=1,td=2,Bs=3,nd=4,rd=5,id=6,ad=7,eo=0,od=1,sd=2,Vi=0,qc=1,ld=2,cd=3,ud=4,hd=5,Us=300,zs=301,Gs=302,Yc=303,Hs=304,Zc=305,ki=306,Vs=307,to=1e3,Vt=1001,no=1002,_t=1003,ks=1004,Ws=1005,It=1006,Jc=1007,ro=1008,Wi=1009,fd=1010,dd=1011,io=1012,pd=1013,ao=1014,Qn=1015,oo=1016,vd=1017,md=1018,gd=1019,Xi=1020,yd=1021,xr=1022,on=1023,xd=1024,_d=1025,bd=on,zr=1026,ji=1027,wd=1028,Md=1029,Ed=1030,Td=1031,Sd=1032,Ad=1033,Qc=33776,Kc=33777,$c=33778,eu=33779,tu=35840,nu=35841,ru=35842,iu=35843,Ld=36196,au=37492,ou=37496,Pd=37808,Cd=37809,Rd=37810,Od=37811,Dd=37812,Id=37813,Nd=37814,Fd=37815,Bd=37816,Ud=37817,zd=37818,Gd=37819,Hd=37820,Vd=37821,kd=36492,Wd=37840,Xd=37841,jd=37842,qd=37843,Yd=37844,Zd=37845,Jd=37846,Qd=37847,Kd=37848,$d=37849,ep=37850,tp=37851,np=37852,rp=37853,ip=2200,ap=2201,op=2202,so=2300,lo=2301,Xs=2302,Gr=2400,Hr=2401,co=2402,js=2500,su=2501,sp=0,kt=3e3,uo=3001,qs=3007,Ys=3002,lp=3003,lu=3004,cu=3005,uu=3006,cp=3200,up=3201,Vr=0,hp=1,Zs=7680,fp=519,ho=35044,qi=35048;function sn(){}Object.assign(sn.prototype,{addEventListener:function(e,t){this._listeners===void 0&&(this._listeners={});var n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)},hasEventListener:function(e,t){if(this._listeners===void 0)return!1;var n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1},removeEventListener:function(e,t){if(this._listeners!==void 0){var n=this._listeners,r=n[e];if(r!==void 0){var i=r.indexOf(t);i!==-1&&r.splice(i,1)}}},dispatchEvent:function(e){if(this._listeners!==void 0){var t=this._listeners,n=t[e.type];if(n!==void 0){e.target=this;for(var r=n.slice(0),i=0,a=r.length;i<a;i++)r[i].call(this,e)}}}});for(var Rt=[],Yi=0;Yi<256;Yi++)Rt[Yi]=(Yi<16?"0":"")+Yi.toString(16);var ke={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0,i=Rt[e&255]+Rt[e>>8&255]+Rt[e>>16&255]+Rt[e>>24&255]+"-"+Rt[t&255]+Rt[t>>8&255]+"-"+Rt[t>>16&15|64]+Rt[t>>24&255]+"-"+Rt[n&63|128]+Rt[n>>8&255]+"-"+Rt[n>>16&255]+Rt[n>>24&255]+Rt[r&255]+Rt[r>>8&255]+Rt[r>>16&255]+Rt[r>>24&255];return i.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,r,i){return r+(e-t)*(i-r)/(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*e*(3-2*e))},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-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*ke.DEG2RAD},radToDeg:function(e){return e*ke.RAD2DEG},isPowerOfTwo:function(e){return(e&e-1)===0&&e!==0},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))},setQuaternionFromProperEuler:function(e,t,n,r,i){var a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),h=a((t-r)/2),f=o((t-r)/2),d=a((r-t)/2),m=o((r-t)/2);switch(i){case"XYX":e.set(s*u,c*h,c*f,s*l);break;case"YZY":e.set(c*f,s*u,c*h,s*l);break;case"ZXZ":e.set(c*h,c*f,s*u,s*l);break;case"XZX":e.set(s*u,c*m,c*d,s*l);break;case"YXY":e.set(c*d,s*u,c*m,s*l);break;case"ZYZ":e.set(c*m,c*d,s*u,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};function X(e,t){this.x=e||0,this.y=t||0}Object.defineProperties(X.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(X.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 t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar: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 t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar: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,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min: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)+Math.PI;return 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.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return t===void 0&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}});function Ut(){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(Ut.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,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},extractBasis:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),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},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],f=n[5],d=n[8],m=r[0],g=r[3],y=r[6],p=r[1],v=r[4],_=r[7],x=r[2],b=r[5],T=r[8];return i[0]=a*m+o*p+s*x,i[3]=a*g+o*v+s*b,i[6]=a*y+o*_+s*T,i[1]=c*m+l*p+u*x,i[4]=c*g+l*v+u*b,i[7]=c*y+l*_+u*T,i[2]=h*m+f*p+d*x,i[5]=h*g+f*v+d*b,i[8]=h*y+f*_+d*T,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],r=e[2],i=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*i*l+n*o*s+r*i*c-r*a*s},getInverse:function(e,t){t!==void 0&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=e.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7],f=n[8],d=f*c-l*h,m=l*u-f*s,g=h*s-c*u,y=i*d+a*m+o*g;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);var p=1/y;return r[0]=d*p,r[1]=(o*h-f*a)*p,r[2]=(l*a-o*c)*p,r[3]=m*p,r[4]=(f*i-o*u)*p,r[5]=(o*s-l*i)*p,r[6]=g*p,r[7]=(a*u-h*i)*p,r[8]=(c*i-a*s)*p,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,r,i,a,o){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-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),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],c=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*c,r[6]=t*o+n*l,r[1]=-n*i+t*s,r[4]=-n*a+t*c,r[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,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){t===void 0&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){e===void 0&&(e=[]),t===void 0&&(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 kr,_r={getDataURL:function(e){var t;if(typeof HTMLCanvasElement=="undefined")return e.src;if(e instanceof HTMLCanvasElement)t=e;else{kr===void 0&&(kr=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),kr.width=e.width,kr.height=e.height;var n=kr.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=kr}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},dp=0;function ot(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(this,"id",{value:dp++}),this.uuid=ke.generateUUID(),this.name="",this.image=e!==void 0?e:ot.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=t!==void 0?t:ot.DEFAULT_MAPPING,this.wrapS=n!==void 0?n:Vt,this.wrapT=r!==void 0?r:Vt,this.magFilter=i!==void 0?i:It,this.minFilter=a!==void 0?a:ro,this.anisotropy=c!==void 0?c:1,this.format=o!==void 0?o:on,this.internalFormat=null,this.type=s!==void 0?s:Wi,this.offset=new X(0,0),this.repeat=new X(1,1),this.center=new X(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ut,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l!==void 0?l:kt,this.version=0,this.onUpdate=null}ot.DEFAULT_IMAGE=void 0,ot.DEFAULT_MAPPING=Us,ot.prototype=Object.assign(Object.create(sn.prototype),{constructor:ot,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.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)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(this.image!==void 0){var r=this.image;if(r.uuid===void 0&&(r.uuid=ke.generateUUID()),!t&&e.images[r.uuid]===void 0){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)i.push(_r.getDataURL(r[a]))}else i=_r.getDataURL(r);e.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==Us)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case to:e.x=e.x-Math.floor(e.x);break;case Vt:e.x=e.x<0?0:1;break;case no:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case to:e.y=e.y-Math.floor(e.y);break;case Vt:e.y=e.y<0?0:1;break;case no:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(ot.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}});function et(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=r!==void 0?r:1}Object.defineProperties(et.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(et.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,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=e.w!==void 0?e.w:1,this},add:function(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar: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 t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar: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,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this},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,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],h=s[1],f=s[5],d=s[9],m=s[2],g=s[6],y=s[10];if(Math.abs(l-h)<a&&Math.abs(u-m)<a&&Math.abs(d-g)<a){if(Math.abs(l+h)<o&&Math.abs(u+m)<o&&Math.abs(d+g)<o&&Math.abs(c+f+y-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var p=(c+1)/2,v=(f+1)/2,_=(y+1)/2,x=(l+h)/4,b=(u+m)/4,T=(d+g)/4;return p>v&&p>_?p<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(p),r=x/n,i=b/n):v>_?v<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(v),n=x/r,i=T/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=b/i,r=T/i),this.set(n,r,i,t),this}var C=Math.sqrt((g-d)*(g-d)+(u-m)*(u-m)+(h-l)*(h-l));return Math.abs(C)<.001&&(C=1),this.x=(g-d)/C,this.y=(u-m)/C,this.z=(h-l)/C,this.w=Math.acos((c+f+y-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.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return t===void 0&&(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 e===void 0&&(e=[]),t===void 0&&(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 n!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}});function $t(e,t,n){this.width=e,this.height=t,this.scissor=new et(0,0,e,t),this.scissorTest=!1,this.viewport=new et(0,0,e,t),n=n||{},this.texture=new ot(void 0,n.mapping,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=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:It,this.depthBuffer=n.depthBuffer!==void 0?n.depthBuffer:!0,this.stencilBuffer=n.stencilBuffer!==void 0?n.stencilBuffer:!0,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null}$t.prototype=Object.assign(Object.create(sn.prototype),{constructor:$t,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"})}});function hu(e,t,n){$t.call(this,e,t,n),this.samples=4}hu.prototype=Object.assign(Object.create($t.prototype),{constructor:hu,isWebGLMultisampleRenderTarget:!0,copy:function(e){return $t.prototype.copy.call(this,e),this.samples=e.samples,this}});function bt(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=r!==void 0?r:1}Object.assign(bt,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,a,o){var s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],h=i[a+0],f=i[a+1],d=i[a+2],m=i[a+3];if(u!==m||s!==h||c!==f||l!==d){var g=1-o,y=s*h+c*f+l*d+u*m,p=y>=0?1:-1,v=1-y*y;if(v>Number.EPSILON){var _=Math.sqrt(v),x=Math.atan2(_,y*p);g=Math.sin(g*x)/_,o=Math.sin(o*x)/_}var b=o*p;if(s=s*g+h*b,c=c*g+f*b,l=l*g+d*b,u=u*g+m*b,g===1-o){var T=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=T,c*=T,l*=T,u*=T}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u},multiplyQuaternionsFlat:function(e,t,n,r,i,a){var o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],h=i[a+1],f=i[a+2],d=i[a+3];return e[t]=o*d+l*u+s*f-c*h,e[t+1]=s*d+l*h+c*u-o*f,e[t+2]=c*d+l*f+o*h-s*u,e[t+3]=l*d-o*u-s*h-c*f,e}}),Object.defineProperties(bt.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(bt.prototype,{isQuaternion:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,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,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),h=s(n/2),f=s(r/2),d=s(i/2);switch(a){case"XYZ":this._x=h*l*u+c*f*d,this._y=c*f*u-h*l*d,this._z=c*l*d+h*f*u,this._w=c*l*u-h*f*d;break;case"YXZ":this._x=h*l*u+c*f*d,this._y=c*f*u-h*l*d,this._z=c*l*d-h*f*u,this._w=c*l*u+h*f*d;break;case"ZXY":this._x=h*l*u-c*f*d,this._y=c*f*u+h*l*d,this._z=c*l*d+h*f*u,this._w=c*l*u-h*f*d;break;case"ZYX":this._x=h*l*u-c*f*d,this._y=c*f*u+h*l*d,this._z=c*l*d-h*f*u,this._w=c*l*u+h*f*d;break;case"YZX":this._x=h*l*u+c*f*d,this._y=c*f*u+h*l*d,this._z=c*l*d-h*f*u,this._w=c*l*u-h*f*d;break;case"XZY":this._x=h*l*u-c*f*d,this._y=c*f*u-h*l*d,this._z=c*l*d+h*f*u,this._w=c*l*u+h*f*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t!==!1&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],h=n+o+u,f;return h>0?(f=.5/Math.sqrt(h+1),this._w=.25/f,this._x=(l-s)*f,this._y=(i-c)*f,this._z=(a-r)*f):n>o&&n>u?(f=2*Math.sqrt(1+n-o-u),this._w=(l-s)/f,this._x=.25*f,this._y=(r+a)/f,this._z=(i+c)/f):o>u?(f=2*Math.sqrt(1+o-n-u),this._w=(i-c)/f,this._x=(r+a)/f,this._y=.25*f,this._z=(s+l)/f):(f=2*Math.sqrt(1+u-n-o),this._w=(a-r)/f,this._x=(i+c)/f,this._y=(s+l)/f,this._z=.25*f),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=1e-6,r=e.dot(t)+1;return r<n?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(ke.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(n===0)return this;var r=Math.min(1,t/n);return this.slerp(e,r),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 e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this},slerp:function(e,t){if(t===0)return this;if(t===1)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,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*r+t*this._y,this._z=c*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),u=Math.atan2(l,o),h=Math.sin((1-t)*u)/l,f=Math.sin(t*u)/l;return this._w=a*h+this._w*f,this._x=n*h+this._x*f,this._y=r*h+this._y*f,this._z=i*h+this._z*f,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 t===void 0&&(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 e===void 0&&(e=[]),t===void 0&&(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){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var Js=new E,fu=new bt;function E(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}Object.assign(E.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 t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar: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 t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar: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 t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar: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(fu.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(fu.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*r-o*n,l=s*n+o*t-i*r,u=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=c*s+h*-i+l*-o-u*-a,this.y=l*s+h*-a+u*-i-c*-o,this.z=u*s+h*-o+c*-a-l*-i,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,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},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.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this},cross:function(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.lengthSq();if(t===0)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},projectOnPlane:function(e){return Js.copy(this).projectOnVector(e),this.sub(Js)},reflect:function(e){return this.sub(Js.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(ke.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,r=this.z-e.z;return t*t+n*n+r*r},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 r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},setFromCylindrical: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(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,t*4)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,t*3)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return t===void 0&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});var Wr=new E,ln=new We,pp=new E(0,0,0),vp=new E(1,1,1),Kn=new E,fo=new E,jt=new E;function We(){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(We.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,c,l,u,h,f,d,m,g){var y=this.elements;return y[0]=e,y[4]=t,y[8]=n,y[12]=r,y[1]=i,y[5]=a,y[9]=o,y[13]=s,y[2]=c,y[6]=l,y[10]=u,y[14]=h,y[3]=f,y[7]=d,y[11]=m,y[15]=g,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 We().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,r=1/Wr.setFromMatrixColumn(e,0).length(),i=1/Wr.setFromMatrixColumn(e,1).length(),a=1/Wr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},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,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order==="XYZ"){var h=a*l,f=a*u,d=o*l,m=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=f+d*c,t[5]=h-m*c,t[9]=-o*s,t[2]=m-h*c,t[6]=d+f*c,t[10]=a*s}else if(e.order==="YXZ"){var g=s*l,y=s*u,p=c*l,v=c*u;t[0]=g+v*o,t[4]=p*o-y,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=y*o-p,t[6]=v+g*o,t[10]=a*s}else if(e.order==="ZXY"){var g=s*l,y=s*u,p=c*l,v=c*u;t[0]=g-v*o,t[4]=-a*u,t[8]=p+y*o,t[1]=y+p*o,t[5]=a*l,t[9]=v-g*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order==="ZYX"){var h=a*l,f=a*u,d=o*l,m=o*u;t[0]=s*l,t[4]=d*c-f,t[8]=h*c+m,t[1]=s*u,t[5]=m*c+h,t[9]=f*c-d,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order==="YZX"){var _=a*s,x=a*c,b=o*s,T=o*c;t[0]=s*l,t[4]=T-_*u,t[8]=b*u+x,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=x*u+b,t[10]=_-T*u}else if(e.order==="XZY"){var _=a*s,x=a*c,b=o*s,T=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=_*u+T,t[5]=a*l,t[9]=x*u-b,t[2]=b*u-x,t[6]=o*l,t[10]=T*u+_}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(pp,e,vp)},lookAt:function(e,t,n){var r=this.elements;return jt.subVectors(e,t),jt.lengthSq()===0&&(jt.z=1),jt.normalize(),Kn.crossVectors(n,jt),Kn.lengthSq()===0&&(Math.abs(n.z)===1?jt.x+=1e-4:jt.z+=1e-4,jt.normalize(),Kn.crossVectors(n,jt)),Kn.normalize(),fo.crossVectors(jt,Kn),r[0]=Kn.x,r[4]=fo.x,r[8]=jt.x,r[1]=Kn.y,r[5]=fo.y,r[9]=jt.y,r[2]=Kn.z,r[6]=fo.z,r[10]=jt.z,this},multiply:function(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],f=n[13],d=n[2],m=n[6],g=n[10],y=n[14],p=n[3],v=n[7],_=n[11],x=n[15],b=r[0],T=r[4],C=r[8],N=r[12],O=r[1],J=r[5],F=r[9],B=r[13],V=r[2],Y=r[6],D=r[10],z=r[14],k=r[3],q=r[7],Z=r[11],ee=r[15];return i[0]=a*b+o*O+s*V+c*k,i[4]=a*T+o*J+s*Y+c*q,i[8]=a*C+o*F+s*D+c*Z,i[12]=a*N+o*B+s*z+c*ee,i[1]=l*b+u*O+h*V+f*k,i[5]=l*T+u*J+h*Y+f*q,i[9]=l*C+u*F+h*D+f*Z,i[13]=l*N+u*B+h*z+f*ee,i[2]=d*b+m*O+g*V+y*k,i[6]=d*T+m*J+g*Y+y*q,i[10]=d*C+m*F+g*D+y*Z,i[14]=d*N+m*B+g*z+y*ee,i[3]=p*b+v*O+_*V+x*k,i[7]=p*T+v*J+_*Y+x*q,i[11]=p*C+v*F+_*D+x*Z,i[15]=p*N+v*B+_*z+x*ee,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},determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],h=e[10],f=e[14],d=e[3],m=e[7],g=e[11],y=e[15];return d*(+i*s*u-r*c*u-i*o*h+n*c*h+r*o*f-n*s*f)+m*(+t*s*f-t*c*h+i*a*h-r*a*f+r*c*l-i*s*l)+g*(+t*c*u-t*o*f-i*a*u+n*a*f+i*o*l-n*c*l)+y*(-r*o*l-t*s*u+t*o*h+r*a*u-n*a*h+n*s*l)},transpose:function(){var e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},getInverse:function(e,t){t!==void 0&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=r[6],h=r[7],f=r[8],d=r[9],m=r[10],g=r[11],y=r[12],p=r[13],v=r[14],_=r[15],x=d*v*h-p*m*h+p*u*g-l*v*g-d*u*_+l*m*_,b=y*m*h-f*v*h-y*u*g+c*v*g+f*u*_-c*m*_,T=f*p*h-y*d*h+y*l*g-c*p*g-f*l*_+c*d*_,C=y*d*u-f*p*u-y*l*m+c*p*m+f*l*v-c*d*v,N=i*x+a*b+o*T+s*C;if(N===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var O=1/N;return n[0]=x*O,n[1]=(p*m*s-d*v*s-p*o*g+a*v*g+d*o*_-a*m*_)*O,n[2]=(l*v*s-p*u*s+p*o*h-a*v*h-l*o*_+a*u*_)*O,n[3]=(d*u*s-l*m*s-d*o*h+a*m*h+l*o*g-a*u*g)*O,n[4]=b*O,n[5]=(f*v*s-y*m*s+y*o*g-i*v*g-f*o*_+i*m*_)*O,n[6]=(y*u*s-c*v*s-y*o*h+i*v*h+c*o*_-i*u*_)*O,n[7]=(c*m*s-f*u*s+f*o*h-i*m*h-c*o*g+i*u*g)*O,n[8]=T*O,n[9]=(y*d*s-f*p*s-y*a*g+i*p*g+f*a*_-i*d*_)*O,n[10]=(c*p*s-y*l*s+y*a*h-i*p*h-c*a*_+i*l*_)*O,n[11]=(f*l*s-c*d*s-f*a*h+i*d*h+c*a*g-i*l*g)*O,n[12]=C*O,n[13]=(f*p*o-y*d*o+y*a*m-i*p*m-f*a*v+i*d*v)*O,n[14]=(y*l*o-c*p*o-y*a*u+i*p*u+c*a*v-i*l*v)*O,n[15]=(c*d*o-f*l*o+f*a*u-i*d*u-c*a*m+i*l*m)*O,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},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],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},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),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*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 r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,h=i*c,f=i*l,d=i*u,m=a*l,g=a*u,y=o*u,p=s*c,v=s*l,_=s*u,x=n.x,b=n.y,T=n.z;return r[0]=(1-(m+y))*x,r[1]=(f+_)*x,r[2]=(d-v)*x,r[3]=0,r[4]=(f-_)*b,r[5]=(1-(h+y))*b,r[6]=(g+p)*b,r[7]=0,r[8]=(d+v)*T,r[9]=(g-p)*T,r[10]=(1-(h+m))*T,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},decompose:function(e,t,n){var r=this.elements,i=Wr.set(r[0],r[1],r[2]).length(),a=Wr.set(r[4],r[5],r[6]).length(),o=Wr.set(r[8],r[9],r[10]).length(),s=this.determinant();s<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],ln.copy(this);var c=1/i,l=1/a,u=1/o;return ln.elements[0]*=c,ln.elements[1]*=c,ln.elements[2]*=c,ln.elements[4]*=l,ln.elements[5]*=l,ln.elements[6]*=l,ln.elements[8]*=u,ln.elements[9]*=u,ln.elements[10]*=u,t.setFromRotationMatrix(ln),n.x=i,n.y=a,n.z=o,this},makePerspective:function(e,t,n,r,i,a){a===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),c=2*i/(n-r),l=(t+e)/(t-e),u=(n+r)/(n-r),h=-(a+i)/(a-i),f=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=f,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),c=1/(n-r),l=1/(a-i),u=(t+e)*s,h=(n+r)*c,f=(a+i)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-f,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){t===void 0&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){e===void 0&&(e=[]),t===void 0&&(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 du=new We,pu=new bt;function Xr(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||Xr.DefaultOrder}Xr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Xr.DefaultOrder="XYZ",Object.defineProperties(Xr.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(Xr.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||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 r=ke.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],c=i[1],l=i[5],u=i[9],h=i[2],f=i[6],d=i[10];switch(t=t||this._order,t){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(f,l),this._z=0);break;case"YXZ":this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,a),this._z=0);break;case"ZXY":this._x=Math.asin(r(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n!==!1&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return du.makeRotationFromQuaternion(e),this.setFromRotationMatrix(du,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return pu.setFromEuler(this),this.setFromQuaternion(pu,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],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(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 E(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});function Qs(){this.mask=1}Object.assign(Qs.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return(this.mask&e.mask)!==0}});let mp=0;const vu=new E,jr=new bt,Rn=new We,po=new E,Zi=new E,gp=new E,yp=new bt,mu=new E(1,0,0),gu=new E(0,1,0),yu=new E(0,0,1),xp={type:"added"},_p={type:"removed"};function ae(){Object.defineProperty(this,"id",{value:mp++}),this.uuid=ke.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ae.DefaultUp.clone();var e=new E,t=new Xr,n=new bt,r=new E(1,1,1);function i(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(i),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new We},normalMatrix:{value:new Ut}}),this.matrix=new We,this.matrixWorld=new We,this.matrixAutoUpdate=ae.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Qs,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}ae.DefaultUp=new E(0,1,0),ae.DefaultMatrixAutoUpdate=!0,ae.prototype=Object.assign(Object.create(sn.prototype),{constructor:ae,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4: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 jr.setFromAxisAngle(e,t),this.quaternion.multiply(jr),this},rotateOnWorldAxis:function(e,t){return jr.setFromAxisAngle(e,t),this.quaternion.premultiply(jr),this},rotateX:function(e){return this.rotateOnAxis(mu,e)},rotateY:function(e){return this.rotateOnAxis(gu,e)},rotateZ:function(e){return this.rotateOnAxis(yu,e)},translateOnAxis:function(e,t){return vu.copy(e).applyQuaternion(this.quaternion),this.position.add(vu.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(mu,e)},translateY:function(e){return this.translateOnAxis(gu,e)},translateZ:function(e){return this.translateOnAxis(yu,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(Rn.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?po.copy(e):po.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),Zi.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rn.lookAt(Zi,po,this.up):Rn.lookAt(po,Zi,this.up),this.quaternion.setFromRotationMatrix(Rn),r&&(Rn.extractRotation(r.matrixWorld),jr.setFromRotationMatrix(Rn),this.quaternion.premultiply(jr.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?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(xp)):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 n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(_p)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),Rn.getInverse(this.matrixWorld),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Rn.multiply(e.parent.matrixWorld)),e.applyMatrix4(Rn),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,r=this.children.length;n<r;n++){var i=this.children[n],a=i.getObjectByProperty(e,t);if(a!==void 0)return a}},getWorldPosition:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new E),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new bt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Zi,e,gp),e},getWorldScale:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new E),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Zi,yp,e),e},getWorldDirection:function(e){e===void 0&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new E),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,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(this.visible!==!1){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;t!==null&&(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)&&(this.parent===null?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,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON());function i(y,p){return y[p.uuid]===void 0&&(y[p.uuid]=p.toJSON(e)),p.uuid}if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);var a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){var o=a.shapes;if(Array.isArray(o))for(var s=0,c=o.length;s<c;s++){var l=o[s];i(e.shapes,l)}else i(e.shapes,o)}}if(this.material!==void 0)if(Array.isArray(this.material)){for(var u=[],s=0,c=this.material.length;s<c;s++)u.push(i(e.materials,this.material[s]));r.material=u}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(var s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(e).object)}if(t){var h=g(e.geometries),f=g(e.materials),d=g(e.textures),m=g(e.images),o=g(e.shapes);h.length>0&&(n.geometries=h),f.length>0&&(n.materials=f),d.length>0&&(n.textures=d),m.length>0&&(n.images=m),o.length>0&&(n.shapes=o)}return n.object=r,n;function g(y){var p=[];for(var v in y){var _=y[v];delete _.metadata,p.push(_)}return p}},clone:function(e){return new this.constructor().copy(this,e)},copy:function(e,t){if(t===void 0&&(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)),t===!0)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}});function Ji(){ae.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Ji.prototype=Object.assign(Object.create(ae.prototype),{constructor:Ji,isScene:!0,copy:function(e,t){return ae.prototype.copy.call(this,e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=ae.prototype.toJSON.call(this,e);return this.background!==null&&(t.object.background=this.background.toJSON(e)),this.environment!==null&&(t.object.environment=this.environment.toJSON(e)),this.fog!==null&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var On=[new E,new E,new E,new E,new E,new E,new E,new E],Qi=new E,Ks=new gn,qr=new E,Yr=new E,Zr=new E,$n=new E,er=new E,br=new E,Ki=new E,vo=new E,mo=new E,wr=new E;function gn(e,t){this.min=e!==void 0?e:new E(1/0,1/0,1/0),this.max=t!==void 0?t:new E(-1/0,-1/0,-1/0)}Object.assign(gn.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,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],u=e[s+1],h=e[s+2];l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),u=e.getY(s),h=e.getZ(s);l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,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=Qi.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 e===void 0&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new E),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return e===void 0&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new E),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;t!==void 0&&(t.boundingBox===null&&t.computeBoundingBox(),Ks.copy(t.boundingBox),Ks.applyMatrix4(e.matrixWorld),this.union(Ks));for(var n=e.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);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 t===void 0&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new E),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,Qi),Qi.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(Ki),vo.subVectors(this.max,Ki),qr.subVectors(e.a,Ki),Yr.subVectors(e.b,Ki),Zr.subVectors(e.c,Ki),$n.subVectors(Yr,qr),er.subVectors(Zr,Yr),br.subVectors(qr,Zr);var t=[0,-$n.z,$n.y,0,-er.z,er.y,0,-br.z,br.y,$n.z,0,-$n.x,er.z,0,-er.x,br.z,0,-br.x,-$n.y,$n.x,0,-er.y,er.x,0,-br.y,br.x,0];return!$s(t,qr,Yr,Zr,vo)||(t=[1,0,0,0,1,0,0,0,1],!$s(t,qr,Yr,Zr,vo))?!1:(mo.crossVectors($n,er),t=[mo.x,mo.y,mo.z],$s(t,qr,Yr,Zr,vo))},clampPoint:function(e,t){return t===void 0&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new E),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){var t=Qi.copy(e).clamp(this.min,this.max);return t.sub(e).length()},getBoundingSphere:function(e){return e===void 0&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=this.getSize(Qi).length()*.5,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()?this:(On[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),On[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),On[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),On[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),On[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),On[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),On[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),On[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(On),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)}});function $s(e,t,n,r,i){var a,o;for(a=0,o=e.length-3;a<=o;a+=3){wr.fromArray(e,a);var s=i.x*Math.abs(wr.x)+i.y*Math.abs(wr.y)+i.z*Math.abs(wr.z),c=t.dot(wr),l=n.dot(wr),u=r.dot(wr);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>s)return!1}return!0}var bp=new gn;function Dn(e,t){this.center=e!==void 0?e:new E,this.radius=t!==void 0?t:-1}Object.assign(Dn.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;t!==void 0?n.copy(t):bp.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},isEmpty:function(){return this.radius<0},makeEmpty:function(){return this.center.set(0,0,0),this.radius=-1,this},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 t===void 0&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new E),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 e===void 0&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new gn),this.isEmpty()?(e.makeEmpty(),e):(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 In=new E,el=new E,go=new E,tr=new E,tl=new E,yo=new E,nl=new E;function Jr(e,t){this.origin=e!==void 0?e:new E,this.direction=t!==void 0?t:new E(0,0,-1)}Object.assign(Jr.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 t===void 0&&(console.warn("THREE.Ray: .at() target is now required"),t=new E),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,In)),this},closestPointToPoint:function(e,t){t===void 0&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new E),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=In.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(In.copy(this.direction).multiplyScalar(t).add(this.origin),In.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,r){el.copy(e).add(t).multiplyScalar(.5),go.copy(t).sub(e).normalize(),tr.copy(this.origin).sub(el);var i=e.distanceTo(t)*.5,a=-this.direction.dot(go),o=tr.dot(this.direction),s=-tr.dot(go),c=tr.lengthSq(),l=Math.abs(1-a*a),u,h,f,d;if(l>0)if(u=a*s-o,h=a*o-s,d=i*l,u>=0)if(h>=-d)if(h<=d){var m=1/l;u*=m,h*=m,f=u*(u+a*h+2*o)+h*(a*u+h+2*s)+c}else h=i,u=Math.max(0,-(a*h+o)),f=-u*u+h*(h+2*s)+c;else h=-i,u=Math.max(0,-(a*h+o)),f=-u*u+h*(h+2*s)+c;else h<=-d?(u=Math.max(0,-(-a*i+o)),h=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+h*(h+2*s)+c):h<=d?(u=0,h=Math.min(Math.max(-i,-s),i),f=h*(h+2*s)+c):(u=Math.max(0,-(a*i+o)),h=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+h*(h+2*s)+c);else h=a>0?-i:i,u=Math.max(0,-(a*h+o)),f=-u*u+h*(h+2*s)+c;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(go).multiplyScalar(h).add(el),f},intersectSphere:function(e,t){In.subVectors(e.center,this.origin);var n=In.dot(this.direction),r=In.dot(In)-n*n,i=e.radius*e.radius;if(r>i)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?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 n===null?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);if(t===0)return!0;var n=e.normal.dot(this.direction);return n*t<0},intersectBox:function(e,t){var n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(n=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),l>=0?(i=(e.min.y-h.y)*l,a=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,a=(e.min.y-h.y)*l),n>a||i>r||((i>n||n!==n)&&(n=i),(a<r||r!==r)&&(r=a),u>=0?(o=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)},intersectsBox:function(e){return this.intersectBox(e,In)!==null},intersectTriangle:function(e,t,n,r,i){tl.subVectors(t,e),yo.subVectors(n,e),nl.crossVectors(tl,yo);var a=this.direction.dot(nl),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;tr.subVectors(this.origin,e);var s=o*this.direction.dot(yo.crossVectors(tr,yo));if(s<0)return null;var c=o*this.direction.dot(tl.cross(tr));if(c<0||s+c>a)return null;var l=-o*tr.dot(nl);return l<0?null:this.at(l/a,i)},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 rl=new E,wp=new E,Mp=new Ut;function yn(e,t){this.normal=e!==void 0?e:new E(1,0,0),this.constant=t!==void 0?t:0}Object.assign(yn.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var r=rl.subVectors(n,t).cross(wp.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,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 t===void 0&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new E),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){t===void 0&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new E);var n=e.delta(rl),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):void 0;var i=-(e.start.dot(this.normal)+this.constant)/r;if(!(i<0||i>1))return t.copy(n).multiplyScalar(i).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 e===void 0&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new E),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||Mp.getNormalMatrix(e),r=this.coplanarPoint(rl).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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 cn=new E,Nn=new E,il=new E,Fn=new E,Qr=new E,Kr=new E,xu=new E,al=new E,ol=new E,sl=new E;function Ot(e,t,n){this.a=e!==void 0?e:new E,this.b=t!==void 0?t:new E,this.c=n!==void 0?n:new E}Object.assign(Ot,{getNormal:function(e,t,n,r){r===void 0&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new E),r.subVectors(n,t),cn.subVectors(e,t),r.cross(cn);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},getBarycoord:function(e,t,n,r,i){cn.subVectors(r,t),Nn.subVectors(n,t),il.subVectors(e,t);var a=cn.dot(cn),o=cn.dot(Nn),s=cn.dot(il),c=Nn.dot(Nn),l=Nn.dot(il),u=a*c-o*o;if(i===void 0&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new E),u===0)return i.set(-2,-1,-1);var h=1/u,f=(c*s-o*l)*h,d=(a*l-o*s)*h;return i.set(1-f-d,d,f)},containsPoint:function(e,t,n,r){return Ot.getBarycoord(e,t,n,r,Fn),Fn.x>=0&&Fn.y>=0&&Fn.x+Fn.y<=1},getUV:function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Fn),s.set(0,0),s.addScaledVector(i,Fn.x),s.addScaledVector(a,Fn.y),s.addScaledVector(o,Fn.z),s},isFrontFacing:function(e,t,n,r){return cn.subVectors(n,t),Nn.subVectors(e,t),cn.cross(Nn).dot(r)<0}}),Object.assign(Ot.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,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),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 cn.subVectors(this.c,this.b),Nn.subVectors(this.a,this.b),cn.cross(Nn).length()*.5},getMidpoint:function(e){return e===void 0&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new E),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return Ot.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return e===void 0&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new yn),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return Ot.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,r,i){return Ot.getUV(e,this.a,this.b,this.c,t,n,r,i)},containsPoint:function(e){return Ot.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return Ot.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){t===void 0&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new E);var n=this.a,r=this.b,i=this.c,a,o;Qr.subVectors(r,n),Kr.subVectors(i,n),al.subVectors(e,n);var s=Qr.dot(al),c=Kr.dot(al);if(s<=0&&c<=0)return t.copy(n);ol.subVectors(e,r);var l=Qr.dot(ol),u=Kr.dot(ol);if(l>=0&&u<=l)return t.copy(r);var h=s*u-l*c;if(h<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Qr,a);sl.subVectors(e,i);var f=Qr.dot(sl),d=Kr.dot(sl);if(d>=0&&f<=d)return t.copy(i);var m=f*c-s*d;if(m<=0&&c>=0&&d<=0)return o=c/(c-d),t.copy(n).addScaledVector(Kr,o);var g=l*d-f*u;if(g<=0&&u-l>=0&&f-d>=0)return xu.subVectors(i,r),o=(u-l)/(u-l+(f-d)),t.copy(r).addScaledVector(xu,o);var y=1/(g+m+h);return a=m*y,o=h*y,t.copy(n).addScaledVector(Qr,a).addScaledVector(Kr,o)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var _u={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},un={h:0,s:0,l:0},xo={h:0,s:0,l:0};function de(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}function ll(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}function cl(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function ul(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}Object.assign(de.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&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=(e&255)/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=ke.euclideanModulo(e,1),t=ke.clamp(t,0,1),n=ke.clamp(n,0,1),t===0)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=ll(i,r,e+1/3),this.g=ll(i,r,e),this.b=ll(i,r,e-1/3)}return this},setStyle:function(e){function t(h){h!==void 0&&parseFloat(h)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,c)}break}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=n[1],u=l.length;if(u===3)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(u===6)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=_u[e];return t!==void 0?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 t===void 0&&(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){t===void 0&&(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=cl(e.r),this.g=cl(e.g),this.b=cl(e.b),this},copyLinearToSRGB:function(e){return this.r=ul(e.r),this.g=ul(e.g),this.b=ul(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){e===void 0&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t=this.r,n=this.g,r=this.b,i=Math.max(t,n,r),a=Math.min(t,n,r),o,s,c=(a+i)/2;if(a===i)o=0,s=0;else{var l=i-a;switch(s=c<=.5?l/(i+a):l/(2-i-a),i){case t:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-t)/l+2;break;case r:o=(t-n)/l+4;break}o/=6}return e.h=o,e.s=s,e.l=c,e},getStyle:function(){return"rgb("+(this.r*255|0)+","+(this.g*255|0)+","+(this.b*255|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(un),un.h+=e,un.s+=t,un.l+=n,this.setHSL(un.h,un.s,un.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(un),e.getHSL(xo);var n=ke.lerp(un.h,xo.h,t),r=ke.lerp(un.s,xo.s,t),i=ke.lerp(un.l,xo.l,t);return this.setHSL(n,r,i),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return t===void 0&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),de.NAMES=_u;function _o(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new E,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new de,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=a!==void 0?a:0}Object.assign(_o.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(var t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Ep=0;function Oe(){Object.defineProperty(this,"id",{value:Ep++}),this.uuid=ke.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=Hi,this.side=Gi,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Xc,this.blendDst=jc,this.blendEquation=Ur,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Bs,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=fp,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Zs,this.stencilZFail=Zs,this.stencilZPass=Zs,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}Oe.prototype=Object.assign(Object.create(sn.prototype),{constructor:Oe,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(e!==void 0)for(var t in e){var n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===zc;continue}var r=this[t];if(r===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}},toJSON:function(e){var t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),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,this.combine!==void 0&&(n.combine=this.combine),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.size!==void 0&&(n.size=this.size),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Hi&&(n.blending=this.blending),this.flatShading===!0&&(n.flatShading=this.flatShading),this.side!==Gi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(n.morphTargets=!0),this.morphNormals===!0&&(n.morphNormals=!0),this.skinning===!0&&(n.skinning=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function r(o){var s=[];for(var c in o){var l=o[c];delete l.metadata,s.push(l)}return s}if(t){var i=r(e.textures),a=r(e.images);i.length>0&&(n.textures=i),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.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(t!==null){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.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(Oe.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}});function hn(e){Oe.call(this),this.type="MeshBasicMaterial",this.color=new de(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=eo,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)}hn.prototype=Object.create(Oe.prototype),hn.prototype.constructor=hn,hn.prototype.isMeshBasicMaterial=!0,hn.prototype.copy=function(e){return Oe.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};var rt=new E;function De(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n===!0,this.usage=ho,this.updateRange={offset:0,count:-1},this.version=0}Object.defineProperty(De.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),Object.assign(De.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 r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];a===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new de),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];a===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new X),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];a===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new E),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];a===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new et),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},applyMatrix3:function(e){for(var t=0,n=this.count;t<n;t++)rt.x=this.getX(t),rt.y=this.getY(t),rt.z=this.getZ(t),rt.applyMatrix3(e),this.setXYZ(t,rt.x,rt.y,rt.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)rt.x=this.getX(t),rt.y=this.getY(t),rt.z=this.getZ(t),rt.applyMatrix4(e),this.setXYZ(t,rt.x,rt.y,rt.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)rt.x=this.getX(t),rt.y=this.getY(t),rt.z=this.getZ(t),rt.applyNormalMatrix(e),this.setXYZ(t,rt.x,rt.y,rt.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)rt.x=this.getX(t),rt.y=this.getY(t),rt.z=this.getZ(t),rt.transformDirection(e),this.setXYZ(t,rt.x,rt.y,rt.z);return this},set:function(e,t){return t===void 0&&(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,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},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}}});function hl(e,t,n){De.call(this,new Int8Array(e),t,n)}hl.prototype=Object.create(De.prototype),hl.prototype.constructor=hl;function fl(e,t,n){De.call(this,new Uint8Array(e),t,n)}fl.prototype=Object.create(De.prototype),fl.prototype.constructor=fl;function dl(e,t,n){De.call(this,new Uint8ClampedArray(e),t,n)}dl.prototype=Object.create(De.prototype),dl.prototype.constructor=dl;function pl(e,t,n){De.call(this,new Int16Array(e),t,n)}pl.prototype=Object.create(De.prototype),pl.prototype.constructor=pl;function $i(e,t,n){De.call(this,new Uint16Array(e),t,n)}$i.prototype=Object.create(De.prototype),$i.prototype.constructor=$i;function vl(e,t,n){De.call(this,new Int32Array(e),t,n)}vl.prototype=Object.create(De.prototype),vl.prototype.constructor=vl;function ea(e,t,n){De.call(this,new Uint32Array(e),t,n)}ea.prototype=Object.create(De.prototype),ea.prototype.constructor=ea;function ce(e,t,n){De.call(this,new Float32Array(e),t,n)}ce.prototype=Object.create(De.prototype),ce.prototype.constructor=ce;function ml(e,t,n){De.call(this,new Float64Array(e),t,n)}ml.prototype=Object.create(De.prototype),ml.prototype.constructor=ml;function bu(){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(bu.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,t!==void 0&&(t.count=a*3-t.start,n.push(t)),t={start:a*3,materialIndex:r})}t!==void 0&&(t.count=a*3-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t=e.faces,n=e.vertices,r=e.faceVertexUvs,i=r[0]&&r[0].length>0,a=r[1]&&r[1].length>0,o=e.morphTargets,s=o.length,c;if(s>0){c=[];for(var l=0;l<s;l++)c[l]={name:o[l].name,data:[]};this.morphTargets.position=c}var u=e.morphNormals,h=u.length,f;if(h>0){f=[];for(var l=0;l<h;l++)f[l]={name:u[l].name,data:[]};this.morphTargets.normal=f}var d=e.skinIndices,m=e.skinWeights,g=d.length===n.length,y=m.length===n.length;n.length>0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var l=0;l<t.length;l++){var p=t[l];this.vertices.push(n[p.a],n[p.b],n[p.c]);var v=p.vertexNormals;if(v.length===3)this.normals.push(v[0],v[1],v[2]);else{var _=p.normal;this.normals.push(_,_,_)}var x=p.vertexColors;if(x.length===3)this.colors.push(x[0],x[1],x[2]);else{var b=p.color;this.colors.push(b,b,b)}if(i===!0){var T=r[0][l];T!==void 0?this.uvs.push(T[0],T[1],T[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new X,new X,new X))}if(a===!0){var T=r[1][l];T!==void 0?this.uvs2.push(T[0],T[1],T[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new X,new X,new X))}for(var C=0;C<s;C++){var N=o[C].vertices;c[C].data.push(N[p.a],N[p.b],N[p.c])}for(var C=0;C<h;C++){var O=u[C].vertexNormals[l];f[C].data.push(O.a,O.b,O.c)}g&&this.skinIndices.push(d[p.a],d[p.b],d[p.c]),y&&this.skinWeights.push(m[p.a],m[p.b],m[p.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,e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this}});function wu(e){if(e.length===0)return-1/0;let t=e[0];for(let n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}var Tp=1,xn=new We,gl=new ae,$r=new E,qt=new gn,ta=new gn,wt=new E;function ve(){Object.defineProperty(this,"id",{value:Tp+=2}),this.uuid=ke.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={}}ve.prototype=Object.assign(Object.create(sn.prototype),{constructor:ve,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(wu(e)>65535?ea:$i)(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:n!==void 0?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(n!==void 0){var r=new Ut().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},rotateX:function(e){return xn.makeRotationX(e),this.applyMatrix4(xn),this},rotateY:function(e){return xn.makeRotationY(e),this.applyMatrix4(xn),this},rotateZ:function(e){return xn.makeRotationZ(e),this.applyMatrix4(xn),this},translate:function(e,t,n){return xn.makeTranslation(e,t,n),this.applyMatrix4(xn),this},scale:function(e,t,n){return xn.makeScale(e,t,n),this.applyMatrix4(xn),this},lookAt:function(e){return gl.lookAt(e),gl.updateMatrix(),this.applyMatrix4(gl.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter($r).negate(),this.translate($r.x,$r.y,$r.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new ce(t.vertices.length*3,3),r=new ce(t.colors.length*3,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new ce(t.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(t.lineDistances))}t.boundingSphere!==null&&(this.boundingSphere=t.boundingSphere.clone()),t.boundingBox!==null&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new ce(t,3)),this},updateFromObject:function(e){var t=e.geometry;if(e.isMesh){var n=t.__directGeometry;if(t.elementsNeedUpdate===!0&&(n=void 0,t.elementsNeedUpdate=!1),n===void 0)return this.fromGeometry(t);n.verticesNeedUpdate=t.verticesNeedUpdate,n.normalsNeedUpdate=t.normalsNeedUpdate,n.colorsNeedUpdate=t.colorsNeedUpdate,n.uvsNeedUpdate=t.uvsNeedUpdate,n.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=n}var r;return t.verticesNeedUpdate===!0&&(r=this.attributes.position,r!==void 0&&(r.copyVector3sArray(t.vertices),r.needsUpdate=!0),t.verticesNeedUpdate=!1),t.normalsNeedUpdate===!0&&(r=this.attributes.normal,r!==void 0&&(r.copyVector3sArray(t.normals),r.needsUpdate=!0),t.normalsNeedUpdate=!1),t.colorsNeedUpdate===!0&&(r=this.attributes.color,r!==void 0&&(r.copyColorsArray(t.colors),r.needsUpdate=!0),t.colorsNeedUpdate=!1),t.uvsNeedUpdate&&(r=this.attributes.uv,r!==void 0&&(r.copyVector2sArray(t.uvs),r.needsUpdate=!0),t.uvsNeedUpdate=!1),t.lineDistancesNeedUpdate&&(r=this.attributes.lineDistance,r!==void 0&&(r.copyArray(t.lineDistances),r.needsUpdate=!0),t.lineDistancesNeedUpdate=!1),t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=new bu().fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(e.vertices.length*3);if(this.setAttribute("position",new De(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(e.normals.length*3);this.setAttribute("normal",new De(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(e.colors.length*3);this.setAttribute("color",new De(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(e.uvs.length*2);this.setAttribute("uv",new De(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(e.uvs2.length*2);this.setAttribute("uv2",new De(a,2).copyVector2sArray(e.uvs2))}this.groups=e.groups;for(var o in e.morphTargets){for(var s=[],c=e.morphTargets[o],l=0,u=c.length;l<u;l++){var h=c[l],f=new ce(h.data.length*3,3);f.name=h.name,s.push(f.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var d=new ce(e.skinIndices.length*4,4);this.setAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new ce(e.skinWeights.length*4,4);this.setAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new gn);var e=this.attributes.position,t=this.morphAttributes.position;if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var i=t[n];qt.setFromBufferAttribute(i),this.morphTargetsRelative?(wt.addVectors(this.boundingBox.min,qt.min),this.boundingBox.expandByPoint(wt),wt.addVectors(this.boundingBox.max,qt.max),this.boundingBox.expandByPoint(wt)):(this.boundingBox.expandByPoint(qt.min),this.boundingBox.expandByPoint(qt.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(){this.boundingSphere===null&&(this.boundingSphere=new Dn);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(qt.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];ta.setFromBufferAttribute(a),this.morphTargetsRelative?(wt.addVectors(qt.min,ta.min),qt.expandByPoint(wt),wt.addVectors(qt.max,ta.max),qt.expandByPoint(wt)):(qt.expandByPoint(ta.min),qt.expandByPoint(ta.max))}qt.getCenter(n);for(var o=0,r=0,i=e.count;r<i;r++)wt.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(wt));if(t)for(var r=0,i=t.length;r<i;r++)for(var a=t[r],s=this.morphTargetsRelative,c=0,l=a.count;c<l;c++)wt.fromBufferAttribute(a,c),s&&($r.fromBufferAttribute(e,c),wt.add($r)),o=Math.max(o,n.distanceToSquared(wt));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(t.normal===void 0)this.setAttribute("normal",new De(new Float32Array(n.length),3));else for(var r=t.normal.array,i=0,a=r.length;i<a;i++)r[i]=0;var o=t.normal.array,s,c,l,u=new E,h=new E,f=new E,d=new E,m=new E;if(e)for(var g=e.array,i=0,a=e.count;i<a;i+=3)s=g[i+0]*3,c=g[i+1]*3,l=g[i+2]*3,u.fromArray(n,s),h.fromArray(n,c),f.fromArray(n,l),d.subVectors(f,h),m.subVectors(u,h),d.cross(m),o[s]+=d.x,o[s+1]+=d.y,o[s+2]+=d.z,o[c]+=d.x,o[c+1]+=d.y,o[c+2]+=d.z,o[l]+=d.x,o[l+1]+=d.y,o[l+2]+=d.z;else for(var i=0,a=n.length;i<a;i+=9)u.fromArray(n,i),h.fromArray(n,i+3),f.fromArray(n,i+6),d.subVectors(f,h),m.subVectors(u,h),d.cross(m),o[i]=d.x,o[i+1]=d.y,o[i+2]=d.z,o[i+3]=d.x,o[i+4]=d.y,o[i+5]=d.z,o[i+6]=d.x,o[i+7]=d.y,o[i+8]=d.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(!(e&&e.isBufferGeometry)){console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);return}t===void 0&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(e.attributes[r]!==void 0)for(var i=n[r],a=i.array,o=e.attributes[r],s=o.array,c=o.itemSize*t,l=Math.min(s.length,a.length-c),u=0,h=c;u<l;u++,h++)a[h]=s[u];return this},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)wt.x=e.getX(t),wt.y=e.getY(t),wt.z=e.getZ(t),wt.normalize(),e.setXYZ(t,wt.x,wt.y,wt.z)},toNonIndexed:function(){function e(g,y){for(var p=g.array,v=g.itemSize,_=g.normalized,x=new p.constructor(y.length*v),b=0,T=0,C=0,N=y.length;C<N;C++){b=y[C]*v;for(var O=0;O<v;O++)x[T++]=p[b++]}return new De(x,v,_)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new ve,n=this.index.array,r=this.attributes;for(var i in r){var a=r[i],o=e(a,n);t.setAttribute(i,o)}var s=this.morphAttributes;for(i in s){for(var c=[],l=s[i],u=0,h=l.length;u<h;u++){var a=l[u],o=e(a,n);c.push(o)}t.morphAttributes[i]=c}t.morphTargetsRelative=this.morphTargetsRelative;for(var f=this.groups,u=0,d=f.length;u<d;u++){var m=f[u];t.addGroup(m.start,m.count,m.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),this.parameters!==void 0){var t=this.parameters;for(var n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;r!==null&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var n in i){var a=i[n],o=a.toJSON();a.name!==""&&(o.name=a.name),e.data.attributes[n]=o}var s={},c=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],u=[],h=0,f=l.length;h<f;h++){var a=l[h],o=a.toJSON();a.name!==""&&(o.name=a.name),u.push(o)}u.length>0&&(s[n]=u,c=!0)}c&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(e.data.groups=JSON.parse(JSON.stringify(d)));var m=this.boundingSphere;return m!==null&&(e.data.boundingSphere={center:m.center.toArray(),radius:m.radius}),e},clone:function(){return new ve().copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;i!==null&&this.setIndex(i.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,r=l.length;n<r;n++)c.push(l[n].clone());this.morphAttributes[t]=c}this.morphTargetsRelative=e.morphTargetsRelative;var u=e.groups;for(n=0,r=u.length;n<r;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var f=e.boundingBox;f!==null&&(this.boundingBox=f.clone());var d=e.boundingSphere;return d!==null&&(this.boundingSphere=d.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 Mu=new We,Mr=new Jr,yl=new Dn,nr=new E,rr=new E,ir=new E,xl=new E,_l=new E,bl=new E,bo=new E,wo=new E,Mo=new E,ei=new X,ti=new X,ni=new X,na=new E,Eo=new E;function ut(e,t){ae.call(this),this.type="Mesh",this.geometry=e!==void 0?e:new ve,this.material=t!==void 0?t:new hn,this.updateMorphTargets()}ut.prototype=Object.assign(Object.create(ae.prototype),{constructor:ut,isMesh:!0,copy:function(e){return ae.prototype.copy.call(this,e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e=this.geometry,t,n,r;if(e.isBufferGeometry){var i=e.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(o!==void 0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=o.length;t<n;t++)r=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}}else{var s=e.morphTargets;s!==void 0&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n=this.geometry,r=this.material,i=this.matrixWorld;if(r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),yl.copy(n.boundingSphere),yl.applyMatrix4(i),e.ray.intersectsSphere(yl)!==!1&&(Mu.getInverse(i),Mr.copy(e.ray).applyMatrix4(Mu),!(n.boundingBox!==null&&Mr.intersectsBox(n.boundingBox)===!1)))){var a;if(n.isBufferGeometry){var o,s,c,l=n.index,u=n.attributes.position,h=n.morphAttributes.position,f=n.morphTargetsRelative,d=n.attributes.uv,m=n.attributes.uv2,g=n.groups,y=n.drawRange,p,v,_,x,b,T,C,N;if(l!==null)if(Array.isArray(r))for(p=0,_=g.length;p<_;p++)for(b=g[p],T=r[b.materialIndex],C=Math.max(b.start,y.start),N=Math.min(b.start+b.count,y.start+y.count),v=C,x=N;v<x;v+=3)o=l.getX(v),s=l.getX(v+1),c=l.getX(v+2),a=To(this,T,e,Mr,u,h,f,d,m,o,s,c),a&&(a.faceIndex=Math.floor(v/3),a.face.materialIndex=b.materialIndex,t.push(a));else for(C=Math.max(0,y.start),N=Math.min(l.count,y.start+y.count),p=C,_=N;p<_;p+=3)o=l.getX(p),s=l.getX(p+1),c=l.getX(p+2),a=To(this,r,e,Mr,u,h,f,d,m,o,s,c),a&&(a.faceIndex=Math.floor(p/3),t.push(a));else if(u!==void 0)if(Array.isArray(r))for(p=0,_=g.length;p<_;p++)for(b=g[p],T=r[b.materialIndex],C=Math.max(b.start,y.start),N=Math.min(b.start+b.count,y.start+y.count),v=C,x=N;v<x;v+=3)o=v,s=v+1,c=v+2,a=To(this,T,e,Mr,u,h,f,d,m,o,s,c),a&&(a.faceIndex=Math.floor(v/3),a.face.materialIndex=b.materialIndex,t.push(a));else for(C=Math.max(0,y.start),N=Math.min(u.count,y.start+y.count),p=C,_=N;p<_;p+=3)o=p,s=p+1,c=p+2,a=To(this,r,e,Mr,u,h,f,d,m,o,s,c),a&&(a.faceIndex=Math.floor(p/3),t.push(a))}else if(n.isGeometry){var O,J,F,B=Array.isArray(r),V=n.vertices,Y=n.faces,D,z=n.faceVertexUvs[0];z.length>0&&(D=z);for(var k=0,q=Y.length;k<q;k++){var Z=Y[k],ee=B?r[Z.materialIndex]:r;if(ee!==void 0&&(O=V[Z.a],J=V[Z.b],F=V[Z.c],a=Eu(this,ee,e,Mr,O,J,F,na),a)){if(D&&D[k]){var te=D[k];ei.copy(te[0]),ti.copy(te[1]),ni.copy(te[2]),a.uv=Ot.getUV(na,O,J,F,ei,ti,ni,new X)}a.face=Z,a.faceIndex=k,t.push(a)}}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});function Eu(e,t,n,r,i,a,o,s){var c;if(t.side===At?c=r.intersectTriangle(o,a,i,!0,s):c=r.intersectTriangle(i,a,o,t.side!==$a,s),c===null)return null;Eo.copy(s),Eo.applyMatrix4(e.matrixWorld);var l=n.ray.origin.distanceTo(Eo);return l<n.near||l>n.far?null:{distance:l,point:Eo.clone(),object:e}}function To(e,t,n,r,i,a,o,s,c,l,u,h){nr.fromBufferAttribute(i,l),rr.fromBufferAttribute(i,u),ir.fromBufferAttribute(i,h);var f=e.morphTargetInfluences;if(t.morphTargets&&a&&f){bo.set(0,0,0),wo.set(0,0,0),Mo.set(0,0,0);for(var d=0,m=a.length;d<m;d++){var g=f[d],y=a[d];g!==0&&(xl.fromBufferAttribute(y,l),_l.fromBufferAttribute(y,u),bl.fromBufferAttribute(y,h),o?(bo.addScaledVector(xl,g),wo.addScaledVector(_l,g),Mo.addScaledVector(bl,g)):(bo.addScaledVector(xl.sub(nr),g),wo.addScaledVector(_l.sub(rr),g),Mo.addScaledVector(bl.sub(ir),g)))}nr.add(bo),rr.add(wo),ir.add(Mo)}e.isSkinnedMesh&&(e.boneTransform(l,nr),e.boneTransform(u,rr),e.boneTransform(h,ir));var p=Eu(e,t,n,r,nr,rr,ir,na);if(p){s&&(ei.fromBufferAttribute(s,l),ti.fromBufferAttribute(s,u),ni.fromBufferAttribute(s,h),p.uv=Ot.getUV(na,nr,rr,ir,ei,ti,ni,new X)),c&&(ei.fromBufferAttribute(c,l),ti.fromBufferAttribute(c,u),ni.fromBufferAttribute(c,h),p.uv2=Ot.getUV(na,nr,rr,ir,ei,ti,ni,new X));var v=new _o(l,u,h);Ot.getNormal(nr,rr,ir,v.normal),p.face=v}return p}var Sp=0,_n=new We,wl=new ae,So=new E;function Ne(){Object.defineProperty(this,"id",{value:Sp+=2}),this.uuid=ke.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}Ne.prototype=Object.assign(Object.create(sn.prototype),{constructor:Ne,isGeometry:!0,applyMatrix4:function(e){for(var t=new Ut().getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){var i=this.vertices[n];i.applyMatrix4(e)}for(var n=0,r=this.faces.length;n<r;n++){var a=this.faces[n];a.normal.applyMatrix3(t).normalize();for(var o=0,s=a.vertexNormals.length;o<s;o++)a.vertexNormals[o].applyMatrix3(t).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return _n.makeRotationX(e),this.applyMatrix4(_n),this},rotateY:function(e){return _n.makeRotationY(e),this.applyMatrix4(_n),this},rotateZ:function(e){return _n.makeRotationZ(e),this.applyMatrix4(_n),this},translate:function(e,t,n){return _n.makeTranslation(e,t,n),this.applyMatrix4(_n),this},scale:function(e,t,n){return _n.makeScale(e,t,n),this.applyMatrix4(_n),this},lookAt:function(e){return wl.lookAt(e),wl.updateMatrix(),this.applyMatrix4(wl.matrix),this},fromBufferGeometry:function(e){var t=this,n=e.index!==null?e.index.array:void 0,r=e.attributes;if(r.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=r.position.array,a=r.normal!==void 0?r.normal.array:void 0,o=r.color!==void 0?r.color.array:void 0,s=r.uv!==void 0?r.uv.array:void 0,c=r.uv2!==void 0?r.uv2.array:void 0;c!==void 0&&(this.faceVertexUvs[1]=[]);for(var l=0;l<i.length;l+=3)t.vertices.push(new E().fromArray(i,l)),o!==void 0&&t.colors.push(new de().fromArray(o,l));function u(p,v,_,x){var b=o===void 0?[]:[t.colors[p].clone(),t.colors[v].clone(),t.colors[_].clone()],T=a===void 0?[]:[new E().fromArray(a,p*3),new E().fromArray(a,v*3),new E().fromArray(a,_*3)],C=new _o(p,v,_,T,b,x);t.faces.push(C),s!==void 0&&t.faceVertexUvs[0].push([new X().fromArray(s,p*2),new X().fromArray(s,v*2),new X().fromArray(s,_*2)]),c!==void 0&&t.faceVertexUvs[1].push([new X().fromArray(c,p*2),new X().fromArray(c,v*2),new X().fromArray(c,_*2)])}var h=e.groups;if(h.length>0)for(var l=0;l<h.length;l++)for(var f=h[l],d=f.start,m=f.count,g=d,y=d+m;g<y;g+=3)n!==void 0?u(n[g],n[g+1],n[g+2],f.materialIndex):u(g,g+1,g+2,f.materialIndex);else if(n!==void 0)for(var l=0;l<n.length;l+=3)u(n[l],n[l+1],n[l+2]);else for(var l=0;l<i.length/3;l+=3)u(l,l+1,l+2);return this.computeFaceNormals(),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(So).negate(),this.translate(So.x,So.y,So.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=t===0?1:1/t,r=new We;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){for(var e=new E,t=new E,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){e===void 0&&(e=!0);var t,n,r,i,a,o;for(o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new E;if(e){var s,c,l,u=new E,h=new E;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],s=this.vertices[a.a],c=this.vertices[a.b],l=this.vertices[a.c],u.subVectors(l,c),h.subVectors(s,c),u.cross(h),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)a=this.faces[r],o[a.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(r=0,i=this.faces.length;r<i;r++){a=this.faces[r];var f=a.vertexNormals;f.length===3?(f[0].copy(o[a.a]),f[1].copy(o[a.b]),f[2].copy(o[a.c])):(f[0]=o[a.a].clone(),f[1]=o[a.b].clone(),f[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++){n=this.faces[e];var r=n.vertexNormals;r.length===3?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for(i=this.faces[n],i.__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var a=new Ne;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,l,u;for(n=0,r=this.faces.length;n<r;n++)l=new E,u={a:new E,b:new E,c:new E},o.push(l),s.push(u)}var c=this.morphNormals[e];a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals();var l,u;for(n=0,r=this.faces.length;n<r;n++)i=this.faces[n],l=c.faceNormals[n],u=c.vertexNormals[n],l.copy(i.normal),u.a.copy(i.vertexNormals[0]),u.b.copy(i.vertexNormals[1]),u.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)i=this.faces[n],i.normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new gn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new Dn),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(!(e&&e.isGeometry)){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);return}var r,i=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,c=e.faces,l=this.colors,u=e.colors;n===void 0&&(n=0),t!==void 0&&(r=new Ut().getNormalMatrix(t));for(var h=0,f=o.length;h<f;h++){var d=o[h],m=d.clone();t!==void 0&&m.applyMatrix4(t),a.push(m)}for(var h=0,f=u.length;h<f;h++)l.push(u[h].clone());for(h=0,f=c.length;h<f;h++){var g=c[h],y,p,v,_=g.vertexNormals,x=g.vertexColors;y=new _o(g.a+i,g.b+i,g.c+i),y.normal.copy(g.normal),r!==void 0&&y.normal.applyMatrix3(r).normalize();for(var b=0,T=_.length;b<T;b++)p=_[b].clone(),r!==void 0&&p.applyMatrix3(r).normalize(),y.vertexNormals.push(p);y.color.copy(g.color);for(var b=0,T=x.length;b<T;b++)v=x[b],y.vertexColors.push(v.clone());y.materialIndex=g.materialIndex+n,s.push(y)}for(var h=0,f=e.faceVertexUvs.length;h<f;h++){var C=e.faceVertexUvs[h];this.faceVertexUvs[h]===void 0&&(this.faceVertexUvs[h]=[]);for(var b=0,T=C.length;b<T;b++){for(var N=C[b],O=[],J=0,F=N.length;J<F;J++)O.push(N[J].clone());this.faceVertexUvs[h].push(O)}}},mergeMesh:function(e){if(!(e&&e.isMesh)){console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e);return}e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)},mergeVertices:function(){var e={},t=[],n=[],r,i,a=4,o=Math.pow(10,a),s,c,l,u,h,f;for(s=0,c=this.vertices.length;s<c;s++)r=this.vertices[s],i=Math.round(r.x*o)+"_"+Math.round(r.y*o)+"_"+Math.round(r.z*o),e[i]===void 0?(e[i]=s,t.push(this.vertices[s]),n[s]=t.length-1):n[s]=n[e[i]];var d=[];for(s=0,c=this.faces.length;s<c;s++){l=this.faces[s],l.a=n[l.a],l.b=n[l.b],l.c=n[l.c],u=[l.a,l.b,l.c];for(var m=0;m<3;m++)if(u[m]===u[(m+1)%3]){d.push(s);break}}for(s=d.length-1;s>=0;s--){var g=d[s];for(this.faces.splice(g,1),h=0,f=this.faceVertexUvs.length;h<f;h++)this.faceVertexUvs[h].splice(g,1)}var y=this.vertices.length-t.length;return this.vertices=t,y},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new E(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;function r(l,u){return l.materialIndex-u.materialIndex}e.sort(r);var i=this.faceVertexUvs[0],a=this.faceVertexUvs[1],o,s;i&&i.length===t&&(o=[]),a&&a.length===t&&(s=[]);for(var n=0;n<t;n++){var c=e[n]._id;o&&o.push(i[c]),s&&s.push(a[c])}o&&(this.faceVertexUvs[0]=o),s&&(this.faceVertexUvs[1]=s)},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),this.parameters!==void 0){var t=this.parameters;for(var n in t)t[n]!==void 0&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}for(var o=[],s=[],c={},l=[],u={},h=[],f={},i=0;i<this.faces.length;i++){var d=this.faces[i],m=!0,g=!1,y=this.faceVertexUvs[0][i]!==void 0,p=d.normal.length()>0,v=d.vertexNormals.length>0,_=d.color.r!==1||d.color.g!==1||d.color.b!==1,x=d.vertexColors.length>0,b=0;if(b=O(b,0,0),b=O(b,1,m),b=O(b,2,g),b=O(b,3,y),b=O(b,4,p),b=O(b,5,v),b=O(b,6,_),b=O(b,7,x),o.push(b),o.push(d.a,d.b,d.c),o.push(d.materialIndex),y){var T=this.faceVertexUvs[0][i];o.push(B(T[0]),B(T[1]),B(T[2]))}if(p&&o.push(J(d.normal)),v){var C=d.vertexNormals;o.push(J(C[0]),J(C[1]),J(C[2]))}if(_&&o.push(F(d.color)),x){var N=d.vertexColors;o.push(F(N[0]),F(N[1]),F(N[2]))}}function O(V,Y,D){return D?V|1<<Y:V&~(1<<Y)}function J(V){var Y=V.x.toString()+V.y.toString()+V.z.toString();return c[Y]!==void 0||(c[Y]=s.length/3,s.push(V.x,V.y,V.z)),c[Y]}function F(V){var Y=V.r.toString()+V.g.toString()+V.b.toString();return u[Y]!==void 0||(u[Y]=l.length,l.push(V.getHex())),u[Y]}function B(V){var Y=V.x.toString()+V.y.toString();return f[Y]!==void 0||(f[Y]=h.length/2,h.push(V.x,V.y)),f[Y]}return e.data={},e.data.vertices=r,e.data.normals=s,l.length>0&&(e.data.colors=l),h.length>0&&(e.data.uvs=[h]),e.data.faces=o,e},clone:function(){return new Ne().copy(this)},copy:function(e){var t,n,r,i,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 u=e.faceVertexUvs[t];for(this.faceVertexUvs[t]===void 0&&(this.faceVertexUvs[t]=[]),r=0,i=u.length;r<i;r++){var h=u[r],f=[];for(a=0,o=h.length;a<o;a++){var d=h[a];f.push(d.clone())}this.faceVertexUvs[t].push(f)}}var m=e.morphTargets;for(t=0,n=m.length;t<n;t++){var g={};if(g.name=m[t].name,m[t].vertices!==void 0)for(g.vertices=[],r=0,i=m[t].vertices.length;r<i;r++)g.vertices.push(m[t].vertices[r].clone());if(m[t].normals!==void 0)for(g.normals=[],r=0,i=m[t].normals.length;r<i;r++)g.normals.push(m[t].normals[r].clone());this.morphTargets.push(g)}var y=e.morphNormals;for(t=0,n=y.length;t<n;t++){var p={};if(y[t].vertexNormals!==void 0)for(p.vertexNormals=[],r=0,i=y[t].vertexNormals.length;r<i;r++){var v=y[t].vertexNormals[r],_={};_.a=v.a.clone(),_.b=v.b.clone(),_.c=v.c.clone(),p.vertexNormals.push(_)}if(y[t].faceNormals!==void 0)for(p.faceNormals=[],r=0,i=y[t].faceNormals.length;r<i;r++)p.faceNormals.push(y[t].faceNormals[r].clone());this.morphNormals.push(p)}var x=e.skinWeights;for(t=0,n=x.length;t<n;t++)this.skinWeights.push(x[t].clone());var b=e.skinIndices;for(t=0,n=b.length;t<n;t++)this.skinIndices.push(b[t].clone());var T=e.lineDistances;for(t=0,n=T.length;t<n;t++)this.lineDistances.push(T[t]);var C=e.boundingBox;C!==null&&(this.boundingBox=C.clone());var N=e.boundingSphere;return N!==null&&(this.boundingSphere=N.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"})}});class Ap extends Ne{constructor(t,n,r,i,a,o){super(),this.type="BoxGeometry",this.parameters={width:t,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:o},this.fromBufferGeometry(new Ao(t,n,r,i,a,o)),this.mergeVertices()}}class Ao extends ve{constructor(t,n,r,i,a,o){super(),this.type="BoxBufferGeometry",this.parameters={width:t,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:o};const s=this;t=t||1,n=n||1,r=r||1,i=Math.floor(i)||1,a=Math.floor(a)||1,o=Math.floor(o)||1;const c=[],l=[],u=[],h=[];let f=0,d=0;m("z","y","x",-1,-1,r,n,t,o,a,0),m("z","y","x",1,-1,r,n,-t,o,a,1),m("x","z","y",1,1,t,r,n,i,o,2),m("x","z","y",1,-1,t,r,-n,i,o,3),m("x","y","z",1,-1,t,n,r,i,a,4),m("x","y","z",-1,-1,t,n,-r,i,a,5),this.setIndex(c),this.setAttribute("position",new ce(l,3)),this.setAttribute("normal",new ce(u,3)),this.setAttribute("uv",new ce(h,2));function m(g,y,p,v,_,x,b,T,C,N,O){const J=x/C,F=b/N,B=x/2,V=b/2,Y=T/2,D=C+1,z=N+1;let k=0,q=0;const Z=new E;for(let ee=0;ee<z;ee++){const te=ee*F-V;for(let oe=0;oe<D;oe++){const Pe=oe*J-B;Z[g]=Pe*v,Z[y]=te*_,Z[p]=Y,l.push(Z.x,Z.y,Z.z),Z[g]=0,Z[y]=0,Z[p]=T>0?1:-1,u.push(Z.x,Z.y,Z.z),h.push(oe/C),h.push(1-ee/N),k+=1}}for(let ee=0;ee<N;ee++)for(let te=0;te<C;te++){const oe=f+te+D*ee,Pe=f+te+D*(ee+1),be=f+(te+1)+D*(ee+1),re=f+(te+1)+D*ee;c.push(oe,Pe,re),c.push(Pe,be,re),q+=6}s.addGroup(d,q,O),d+=q,f+=k}}}function ri(e){var t={};for(var n in e){t[n]={};for(var r in e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function Nt(e){for(var t={},n=0;n<e.length;n++){var r=ri(e[n]);for(var i in r)t[i]=r[i]}return t}var Lp={clone:ri,merge:Nt},Pp=`void main() {
357
357
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
358
- }`,Pp=`void main() {
358
+ }`,Cp=`void main() {
359
359
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
360
- }`;function Wt(e){Oe.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=Lp,this.fragmentShader=Pp,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,e!==void 0&&(e.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}Wt.prototype=Object.create(Oe.prototype),Wt.prototype.constructor=Wt,Wt.prototype.isShaderMaterial=!0,Wt.prototype.copy=function(e){return Oe.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ri(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=Object.assign({},e.extensions),this},Wt.prototype.toJSON=function(e){var t=Oe.prototype.toJSON.call(this,e);t.uniforms={};for(var n in this.uniforms){var r=this.uniforms[n],i=r.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 a={};for(var o in this.extensions)this.extensions[o]===!0&&(a[o]=!0);return Object.keys(a).length>0&&(t.extensions=a),t};function Bn(){ae.call(this),this.type="Camera",this.matrixWorldInverse=new We,this.projectionMatrix=new We,this.projectionMatrixInverse=new We}Bn.prototype=Object.assign(Object.create(ae.prototype),{constructor:Bn,isCamera:!0,copy:function(e,t){return ae.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){e===void 0&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new E),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){ae.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){ae.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return new this.constructor().copy(this)}});function Et(e,t,n,r){Bn.call(this),this.type="PerspectiveCamera",this.fov=e!==void 0?e:50,this.zoom=1,this.near=n!==void 0?n:.1,this.far=r!==void 0?r:2e3,this.focus=10,this.aspect=t!==void 0?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Et.prototype=Object.assign(Object.create(Bn.prototype),{constructor:Et,isPerspectiveCamera:!0,copy:function(e,t){return Bn.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=e.view===null?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=ke.RAD2DEG*2*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(ke.DEG2RAD*.5*this.fov);return .5*this.getFilmHeight()/e},getEffectiveFOV:function(){return ke.RAD2DEG*2*Math.atan(Math.tan(ke.DEG2RAD*.5*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,r,i,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(ke.DEG2RAD*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var c=this.filmOffset;c!==0&&(i+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=ae.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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var ii=90,ai=1;function ra(e,t,n){if(ae.call(this),this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;var r=new Et(ii,ai,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new E(1,0,0)),this.add(r);var i=new Et(ii,ai,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new E(-1,0,0)),this.add(i);var a=new Et(ii,ai,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new E(0,1,0)),this.add(a);var o=new Et(ii,ai,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new E(0,-1,0)),this.add(o);var s=new Et(ii,ai,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new E(0,0,1)),this.add(s);var c=new Et(ii,ai,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new E(0,0,-1)),this.add(c),this.update=function(l,u){this.parent===null&&this.updateMatrixWorld();var h=l.xr.enabled,f=l.getRenderTarget();l.xr.enabled=!1;var d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,l.setRenderTarget(n,0),l.render(u,r),l.setRenderTarget(n,1),l.render(u,i),l.setRenderTarget(n,2),l.render(u,a),l.setRenderTarget(n,3),l.render(u,o),l.setRenderTarget(n,4),l.render(u,s),n.texture.generateMipmaps=d,l.setRenderTarget(n,5),l.render(u,c),l.setRenderTarget(f),l.xr.enabled=h},this.clear=function(l,u,h,f){for(var d=l.getRenderTarget(),m=0;m<6;m++)l.setRenderTarget(n,m),l.clear(u,h,f);l.setRenderTarget(d)}}ra.prototype=Object.create(ae.prototype),ra.prototype.constructor=ra;function ia(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),$t.call(this,e,e,t)}ia.prototype=Object.create($t.prototype),ia.prototype.constructor=ia,ia.prototype.isWebGLCubeRenderTarget=!0,ia.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new Ji,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {"," return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {"," vWorldDirection = transformDirection( position, modelMatrix );"," #include <begin_vertex>"," #include <project_vertex>","}"].join(`
360
+ }`;function Wt(e){Oe.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=Pp,this.fragmentShader=Cp,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,e!==void 0&&(e.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}Wt.prototype=Object.create(Oe.prototype),Wt.prototype.constructor=Wt,Wt.prototype.isShaderMaterial=!0,Wt.prototype.copy=function(e){return Oe.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ri(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=Object.assign({},e.extensions),this},Wt.prototype.toJSON=function(e){var t=Oe.prototype.toJSON.call(this,e);t.uniforms={};for(var n in this.uniforms){var r=this.uniforms[n],i=r.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 a={};for(var o in this.extensions)this.extensions[o]===!0&&(a[o]=!0);return Object.keys(a).length>0&&(t.extensions=a),t};function Bn(){ae.call(this),this.type="Camera",this.matrixWorldInverse=new We,this.projectionMatrix=new We,this.projectionMatrixInverse=new We}Bn.prototype=Object.assign(Object.create(ae.prototype),{constructor:Bn,isCamera:!0,copy:function(e,t){return ae.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){e===void 0&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new E),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){ae.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){ae.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return new this.constructor().copy(this)}});function Et(e,t,n,r){Bn.call(this),this.type="PerspectiveCamera",this.fov=e!==void 0?e:50,this.zoom=1,this.near=n!==void 0?n:.1,this.far=r!==void 0?r:2e3,this.focus=10,this.aspect=t!==void 0?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Et.prototype=Object.assign(Object.create(Bn.prototype),{constructor:Et,isPerspectiveCamera:!0,copy:function(e,t){return Bn.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=e.view===null?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=ke.RAD2DEG*2*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(ke.DEG2RAD*.5*this.fov);return .5*this.getFilmHeight()/e},getEffectiveFOV:function(){return ke.RAD2DEG*2*Math.atan(Math.tan(ke.DEG2RAD*.5*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,r,i,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(ke.DEG2RAD*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var c=this.filmOffset;c!==0&&(i+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=ae.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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var ii=90,ai=1;function ra(e,t,n){if(ae.call(this),this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;var r=new Et(ii,ai,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new E(1,0,0)),this.add(r);var i=new Et(ii,ai,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new E(-1,0,0)),this.add(i);var a=new Et(ii,ai,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new E(0,1,0)),this.add(a);var o=new Et(ii,ai,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new E(0,-1,0)),this.add(o);var s=new Et(ii,ai,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new E(0,0,1)),this.add(s);var c=new Et(ii,ai,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new E(0,0,-1)),this.add(c),this.update=function(l,u){this.parent===null&&this.updateMatrixWorld();var h=l.xr.enabled,f=l.getRenderTarget();l.xr.enabled=!1;var d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,l.setRenderTarget(n,0),l.render(u,r),l.setRenderTarget(n,1),l.render(u,i),l.setRenderTarget(n,2),l.render(u,a),l.setRenderTarget(n,3),l.render(u,o),l.setRenderTarget(n,4),l.render(u,s),n.texture.generateMipmaps=d,l.setRenderTarget(n,5),l.render(u,c),l.setRenderTarget(f),l.xr.enabled=h},this.clear=function(l,u,h,f){for(var d=l.getRenderTarget(),m=0;m<6;m++)l.setRenderTarget(n,m),l.clear(u,h,f);l.setRenderTarget(d)}}ra.prototype=Object.create(ae.prototype),ra.prototype.constructor=ra;function ia(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),$t.call(this,e,e,t)}ia.prototype=Object.create($t.prototype),ia.prototype.constructor=ia,ia.prototype.isWebGLCubeRenderTarget=!0,ia.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new Ji,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {"," return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {"," vWorldDirection = transformDirection( position, modelMatrix );"," #include <begin_vertex>"," #include <project_vertex>","}"].join(`
361
361
  `),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#include <common>","void main() {"," vec3 direction = normalize( vWorldDirection );"," vec2 sampleUV = equirectUv( direction );"," gl_FragColor = texture2D( tEquirect, sampleUV );","}"].join(`
362
- `)},i=new Wt({type:"CubemapFromEquirect",uniforms:ri(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:At,blending:Jn});i.uniforms.tEquirect.value=t;var a=new ut(new Mo(5,5,5),i);n.add(a);var o=new ra(1,10,this);return o.update(e,n),a.geometry.dispose(),a.material.dispose(),this};function oi(e,t,n,r,i,a,o,s,c,l,u,h){ot.call(this,null,a,o,s,c,l,r,i,u,h),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=c!==void 0?c:_t,this.minFilter=l!==void 0?l:_t,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}oi.prototype=Object.create(ot.prototype),oi.prototype.constructor=oi,oi.prototype.isDataTexture=!0;var si=new Dn,Eo=new E;function aa(e,t,n,r,i,a){this.planes=[e!==void 0?e:new yn,t!==void 0?t:new yn,n!==void 0?n:new yn,r!==void 0?r:new yn,i!==void 0?i:new yn,a!==void 0?a:new yn]}Object.assign(aa.prototype,{set:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},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},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],f=n[9],d=n[10],m=n[11],g=n[12],y=n[13],p=n[14],v=n[15];return t[0].setComponents(o-r,u-s,m-h,v-g).normalize(),t[1].setComponents(o+r,u+s,m+h,v+g).normalize(),t[2].setComponents(o+i,u+c,m+f,v+y).normalize(),t[3].setComponents(o-i,u-c,m-f,v-y).normalize(),t[4].setComponents(o-a,u-l,m-d,v-p).normalize(),t[5].setComponents(o+a,u+l,m+d,v+p).normalize(),this},intersectsObject:function(e){var t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),si.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(si)},intersectsSprite:function(e){return si.center.set(0,0,0),si.radius=.7071067811865476,si.applyMatrix4(e.matrixWorld),this.intersectsSphere(si)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){var a=t[i].distanceToPoint(n);if(a<r)return!1}return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(Eo.x=r.normal.x>0?e.max.x:e.min.x,Eo.y=r.normal.y>0?e.max.y:e.min.y,Eo.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Eo)<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 le={common:{diffuse:{value:new de(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Ut},uv2Transform:{value:new Ut},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 X(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 de(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{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 de(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Ut}},sprite:{diffuse:{value:new de(15658734)},opacity:{value:1},center:{value:new X(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Ut}}};function Eu(){var e=null,t=!1,n=null;function r(i,a){t!==!1&&(n(i,a),e.requestAnimationFrame(r))}return{start:function(){t!==!0&&n!==null&&(e.requestAnimationFrame(r),t=!0)},stop:function(){t=!1},setAnimationLoop:function(i){n=i},setContext:function(i){e=i}}}function Cp(e,t){var n=t.isWebGL2,r=new WeakMap;function i(l,u){var h=l.array,f=l.usage,d=e.createBuffer();e.bindBuffer(u,d),e.bufferData(u,h,f),l.onUploadCallback();var m=5126;return h instanceof Float32Array?m=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?m=5123:h instanceof Int16Array?m=5122:h instanceof Uint32Array?m=5125:h instanceof Int32Array?m=5124:h instanceof Int8Array?m=5120:h instanceof Uint8Array&&(m=5121),{buffer:d,type:m,bytesPerElement:h.BYTES_PER_ELEMENT,version:l.version}}function a(l,u,h){var f=u.array,d=u.updateRange;e.bindBuffer(h,l),d.count===-1?e.bufferSubData(h,0,f):(n?e.bufferSubData(h,d.offset*f.BYTES_PER_ELEMENT,f,d.offset,d.count):e.bufferSubData(h,d.offset*f.BYTES_PER_ELEMENT,f.subarray(d.offset,d.offset+d.count)),d.count=-1)}function o(l){return l.isInterleavedBufferAttribute&&(l=l.data),r.get(l)}function s(l){l.isInterleavedBufferAttribute&&(l=l.data);var u=r.get(l);u&&(e.deleteBuffer(u.buffer),r.delete(l))}function c(l,u){l.isInterleavedBufferAttribute&&(l=l.data);var h=r.get(l);h===void 0?r.set(l,i(l,u)):h.version<l.version&&(a(h.buffer,l,u),h.version=l.version)}return{get:o,remove:s,update:c}}function To(e,t,n,r){Ne.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new li(e,t,n,r)),this.mergeVertices()}To.prototype=Object.create(Ne.prototype),To.prototype.constructor=To;function li(e,t,n,r){ve.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},e=e||1,t=t||1;var i=e/2,a=t/2,o=Math.floor(n)||1,s=Math.floor(r)||1,c=o+1,l=s+1,u=e/o,h=t/s,f,d,m=[],g=[],y=[],p=[];for(d=0;d<l;d++){var v=d*h-a;for(f=0;f<c;f++){var _=f*u-i;g.push(_,-v,0),y.push(0,0,1),p.push(f/o),p.push(1-d/s)}}for(d=0;d<s;d++)for(f=0;f<o;f++){var x=f+c*d,b=f+c*(d+1),T=f+1+c*(d+1),C=f+1+c*d;m.push(x,b,C),m.push(b,T,C)}this.setIndex(m),this.setAttribute("position",new ce(g,3)),this.setAttribute("normal",new ce(y,3)),this.setAttribute("uv",new ce(p,2))}li.prototype=Object.create(ve.prototype),li.prototype.constructor=li;var Rp=`#ifdef USE_ALPHAMAP
362
+ `)},i=new Wt({type:"CubemapFromEquirect",uniforms:ri(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:At,blending:Jn});i.uniforms.tEquirect.value=t;var a=new ut(new Ao(5,5,5),i);n.add(a);var o=new ra(1,10,this);return o.update(e,n),a.geometry.dispose(),a.material.dispose(),this};function oi(e,t,n,r,i,a,o,s,c,l,u,h){ot.call(this,null,a,o,s,c,l,r,i,u,h),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=c!==void 0?c:_t,this.minFilter=l!==void 0?l:_t,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}oi.prototype=Object.create(ot.prototype),oi.prototype.constructor=oi,oi.prototype.isDataTexture=!0;var si=new Dn,Lo=new E;function aa(e,t,n,r,i,a){this.planes=[e!==void 0?e:new yn,t!==void 0?t:new yn,n!==void 0?n:new yn,r!==void 0?r:new yn,i!==void 0?i:new yn,a!==void 0?a:new yn]}Object.assign(aa.prototype,{set:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},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},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],f=n[9],d=n[10],m=n[11],g=n[12],y=n[13],p=n[14],v=n[15];return t[0].setComponents(o-r,u-s,m-h,v-g).normalize(),t[1].setComponents(o+r,u+s,m+h,v+g).normalize(),t[2].setComponents(o+i,u+c,m+f,v+y).normalize(),t[3].setComponents(o-i,u-c,m-f,v-y).normalize(),t[4].setComponents(o-a,u-l,m-d,v-p).normalize(),t[5].setComponents(o+a,u+l,m+d,v+p).normalize(),this},intersectsObject:function(e){var t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),si.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(si)},intersectsSprite:function(e){return si.center.set(0,0,0),si.radius=.7071067811865476,si.applyMatrix4(e.matrixWorld),this.intersectsSphere(si)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){var a=t[i].distanceToPoint(n);if(a<r)return!1}return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(Lo.x=r.normal.x>0?e.max.x:e.min.x,Lo.y=r.normal.y>0?e.max.y:e.min.y,Lo.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Lo)<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 le={common:{diffuse:{value:new de(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Ut},uv2Transform:{value:new Ut},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 X(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 de(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{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 de(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Ut}},sprite:{diffuse:{value:new de(15658734)},opacity:{value:1},center:{value:new X(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Ut}}};function Tu(){var e=null,t=!1,n=null;function r(i,a){t!==!1&&(n(i,a),e.requestAnimationFrame(r))}return{start:function(){t!==!0&&n!==null&&(e.requestAnimationFrame(r),t=!0)},stop:function(){t=!1},setAnimationLoop:function(i){n=i},setContext:function(i){e=i}}}function Rp(e,t){var n=t.isWebGL2,r=new WeakMap;function i(l,u){var h=l.array,f=l.usage,d=e.createBuffer();e.bindBuffer(u,d),e.bufferData(u,h,f),l.onUploadCallback();var m=5126;return h instanceof Float32Array?m=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?m=5123:h instanceof Int16Array?m=5122:h instanceof Uint32Array?m=5125:h instanceof Int32Array?m=5124:h instanceof Int8Array?m=5120:h instanceof Uint8Array&&(m=5121),{buffer:d,type:m,bytesPerElement:h.BYTES_PER_ELEMENT,version:l.version}}function a(l,u,h){var f=u.array,d=u.updateRange;e.bindBuffer(h,l),d.count===-1?e.bufferSubData(h,0,f):(n?e.bufferSubData(h,d.offset*f.BYTES_PER_ELEMENT,f,d.offset,d.count):e.bufferSubData(h,d.offset*f.BYTES_PER_ELEMENT,f.subarray(d.offset,d.offset+d.count)),d.count=-1)}function o(l){return l.isInterleavedBufferAttribute&&(l=l.data),r.get(l)}function s(l){l.isInterleavedBufferAttribute&&(l=l.data);var u=r.get(l);u&&(e.deleteBuffer(u.buffer),r.delete(l))}function c(l,u){l.isInterleavedBufferAttribute&&(l=l.data);var h=r.get(l);h===void 0?r.set(l,i(l,u)):h.version<l.version&&(a(h.buffer,l,u),h.version=l.version)}return{get:o,remove:s,update:c}}function Po(e,t,n,r){Ne.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new li(e,t,n,r)),this.mergeVertices()}Po.prototype=Object.create(Ne.prototype),Po.prototype.constructor=Po;function li(e,t,n,r){ve.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},e=e||1,t=t||1;var i=e/2,a=t/2,o=Math.floor(n)||1,s=Math.floor(r)||1,c=o+1,l=s+1,u=e/o,h=t/s,f,d,m=[],g=[],y=[],p=[];for(d=0;d<l;d++){var v=d*h-a;for(f=0;f<c;f++){var _=f*u-i;g.push(_,-v,0),y.push(0,0,1),p.push(f/o),p.push(1-d/s)}}for(d=0;d<s;d++)for(f=0;f<o;f++){var x=f+c*d,b=f+c*(d+1),T=f+1+c*(d+1),C=f+1+c*d;m.push(x,b,C),m.push(b,T,C)}this.setIndex(m),this.setAttribute("position",new ce(g,3)),this.setAttribute("normal",new ce(y,3)),this.setAttribute("uv",new ce(p,2))}li.prototype=Object.create(ve.prototype),li.prototype.constructor=li;var Op=`#ifdef USE_ALPHAMAP
363
363
  diffuseColor.a *= texture2D( alphaMap, vUv ).g;
364
- #endif`,Op=`#ifdef USE_ALPHAMAP
364
+ #endif`,Dp=`#ifdef USE_ALPHAMAP
365
365
  uniform sampler2D alphaMap;
366
- #endif`,Dp=`#ifdef ALPHATEST
366
+ #endif`,Ip=`#ifdef ALPHATEST
367
367
  if ( diffuseColor.a < ALPHATEST ) discard;
368
- #endif`,Ip=`#ifdef USE_AOMAP
368
+ #endif`,Np=`#ifdef USE_AOMAP
369
369
  float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
370
370
  reflectedLight.indirectDiffuse *= ambientOcclusion;
371
371
  #if defined( USE_ENVMAP ) && defined( STANDARD )
372
372
  float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
373
373
  reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );
374
374
  #endif
375
- #endif`,Np=`#ifdef USE_AOMAP
375
+ #endif`,Fp=`#ifdef USE_AOMAP
376
376
  uniform sampler2D aoMap;
377
377
  uniform float aoMapIntensity;
378
- #endif`,Fp="vec3 transformed = vec3( position );",Bp=`vec3 objectNormal = vec3( normal );
378
+ #endif`,Bp="vec3 transformed = vec3( position );",Up=`vec3 objectNormal = vec3( normal );
379
379
  #ifdef USE_TANGENT
380
380
  vec3 objectTangent = vec3( tangent.xyz );
381
- #endif`,Up=`vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {
381
+ #endif`,zp=`vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {
382
382
  const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
383
383
  const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
384
384
  vec4 r = roughness * c0 + c1;
@@ -541,7 +541,7 @@ vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in Ge
541
541
  float dotNH = saturate( dot( N, H ) );
542
542
  return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );
543
543
  }
544
- #endif`,zp=`#ifdef USE_BUMPMAP
544
+ #endif`,Gp=`#ifdef USE_BUMPMAP
545
545
  uniform sampler2D bumpMap;
546
546
  uniform float bumpScale;
547
547
  vec2 dHdxy_fwd() {
@@ -563,7 +563,7 @@ vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in Ge
563
563
  vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
564
564
  return normalize( abs( fDet ) * surf_norm - vGrad );
565
565
  }
566
- #endif`,Gp=`#if NUM_CLIPPING_PLANES > 0
566
+ #endif`,Hp=`#if NUM_CLIPPING_PLANES > 0
567
567
  vec4 plane;
568
568
  #pragma unroll_loop_start
569
569
  for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
@@ -581,22 +581,22 @@ vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in Ge
581
581
  #pragma unroll_loop_end
582
582
  if ( clipped ) discard;
583
583
  #endif
584
- #endif`,Hp=`#if NUM_CLIPPING_PLANES > 0
585
- varying vec3 vClipPosition;
586
- uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
587
584
  #endif`,Vp=`#if NUM_CLIPPING_PLANES > 0
588
585
  varying vec3 vClipPosition;
586
+ uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
589
587
  #endif`,kp=`#if NUM_CLIPPING_PLANES > 0
588
+ varying vec3 vClipPosition;
589
+ #endif`,Wp=`#if NUM_CLIPPING_PLANES > 0
590
590
  vClipPosition = - mvPosition.xyz;
591
- #endif`,Wp=`#ifdef USE_COLOR
592
- diffuseColor.rgb *= vColor;
593
591
  #endif`,Xp=`#ifdef USE_COLOR
594
- varying vec3 vColor;
592
+ diffuseColor.rgb *= vColor;
595
593
  #endif`,jp=`#ifdef USE_COLOR
596
594
  varying vec3 vColor;
597
595
  #endif`,qp=`#ifdef USE_COLOR
596
+ varying vec3 vColor;
597
+ #endif`,Yp=`#ifdef USE_COLOR
598
598
  vColor.xyz = color.xyz;
599
- #endif`,Yp=`#define PI 3.14159265359
599
+ #endif`,Zp=`#define PI 3.14159265359
600
600
  #define PI2 6.28318530718
601
601
  #define PI_HALF 1.5707963267949
602
602
  #define RECIPROCAL_PI 0.31830988618
@@ -678,7 +678,7 @@ vec2 equirectUv( in vec3 dir ) {
678
678
  float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
679
679
  float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
680
680
  return vec2( u, v );
681
- }`,Zp=`#ifdef ENVMAP_TYPE_CUBE_UV
681
+ }`,Jp=`#ifdef ENVMAP_TYPE_CUBE_UV
682
682
  #define cubeUV_maxMipLevel 8.0
683
683
  #define cubeUV_minMipLevel 4.0
684
684
  #define cubeUV_maxTileSize 256.0
@@ -782,7 +782,7 @@ vec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {
782
782
  return vec4(mix(color0, color1, mipF), 1.0);
783
783
  }
784
784
  }
785
- #endif`,Jp=`vec3 transformedNormal = objectNormal;
785
+ #endif`,Qp=`vec3 transformedNormal = objectNormal;
786
786
  #ifdef USE_INSTANCING
787
787
  mat3 m = mat3( instanceMatrix );
788
788
  transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );
@@ -797,19 +797,19 @@ transformedNormal = normalMatrix * transformedNormal;
797
797
  #ifdef FLIP_SIDED
798
798
  transformedTangent = - transformedTangent;
799
799
  #endif
800
- #endif`,Qp=`#ifdef USE_DISPLACEMENTMAP
800
+ #endif`,Kp=`#ifdef USE_DISPLACEMENTMAP
801
801
  uniform sampler2D displacementMap;
802
802
  uniform float displacementScale;
803
803
  uniform float displacementBias;
804
- #endif`,Kp=`#ifdef USE_DISPLACEMENTMAP
804
+ #endif`,$p=`#ifdef USE_DISPLACEMENTMAP
805
805
  transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );
806
- #endif`,$p=`#ifdef USE_EMISSIVEMAP
806
+ #endif`,ev=`#ifdef USE_EMISSIVEMAP
807
807
  vec4 emissiveColor = texture2D( emissiveMap, vUv );
808
808
  emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;
809
809
  totalEmissiveRadiance *= emissiveColor.rgb;
810
- #endif`,ev=`#ifdef USE_EMISSIVEMAP
810
+ #endif`,tv=`#ifdef USE_EMISSIVEMAP
811
811
  uniform sampler2D emissiveMap;
812
- #endif`,tv="gl_FragColor = linearToOutputTexel( gl_FragColor );",nv=`
812
+ #endif`,nv="gl_FragColor = linearToOutputTexel( gl_FragColor );",rv=`
813
813
  vec4 LinearToLinear( in vec4 value ) {
814
814
  return value;
815
815
  }
@@ -871,7 +871,7 @@ vec4 LogLuvToLinear( in vec4 value ) {
871
871
  Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;
872
872
  vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;
873
873
  return vec4( max( vRGB, 0.0 ), 1.0 );
874
- }`,rv=`#ifdef USE_ENVMAP
874
+ }`,iv=`#ifdef USE_ENVMAP
875
875
  #ifdef ENV_WORLDPOS
876
876
  vec3 cameraToFrag;
877
877
 
@@ -914,7 +914,7 @@ vec4 LogLuvToLinear( in vec4 value ) {
914
914
  #elif defined( ENVMAP_BLENDING_ADD )
915
915
  outgoingLight += envColor.xyz * specularStrength * reflectivity;
916
916
  #endif
917
- #endif`,iv=`#ifdef USE_ENVMAP
917
+ #endif`,av=`#ifdef USE_ENVMAP
918
918
  uniform float envMapIntensity;
919
919
  uniform float flipEnvMap;
920
920
  uniform int maxMipLevel;
@@ -924,7 +924,7 @@ vec4 LogLuvToLinear( in vec4 value ) {
924
924
  uniform sampler2D envMap;
925
925
  #endif
926
926
 
927
- #endif`,av=`#ifdef USE_ENVMAP
927
+ #endif`,ov=`#ifdef USE_ENVMAP
928
928
  uniform float reflectivity;
929
929
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
930
930
  #define ENV_WORLDPOS
@@ -935,7 +935,7 @@ vec4 LogLuvToLinear( in vec4 value ) {
935
935
  #else
936
936
  varying vec3 vReflect;
937
937
  #endif
938
- #endif`,ov=`#ifdef USE_ENVMAP
938
+ #endif`,sv=`#ifdef USE_ENVMAP
939
939
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )
940
940
  #define ENV_WORLDPOS
941
941
  #endif
@@ -946,7 +946,7 @@ vec4 LogLuvToLinear( in vec4 value ) {
946
946
  varying vec3 vReflect;
947
947
  uniform float refractionRatio;
948
948
  #endif
949
- #endif`,sv=`#ifdef USE_ENVMAP
949
+ #endif`,lv=`#ifdef USE_ENVMAP
950
950
  #ifdef ENV_WORLDPOS
951
951
  vWorldPosition = worldPosition.xyz;
952
952
  #else
@@ -963,18 +963,18 @@ vec4 LogLuvToLinear( in vec4 value ) {
963
963
  vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
964
964
  #endif
965
965
  #endif
966
- #endif`,lv=`#ifdef USE_FOG
967
- fogDepth = -mvPosition.z;
968
966
  #endif`,cv=`#ifdef USE_FOG
969
- varying float fogDepth;
967
+ fogDepth = -mvPosition.z;
970
968
  #endif`,uv=`#ifdef USE_FOG
969
+ varying float fogDepth;
970
+ #endif`,hv=`#ifdef USE_FOG
971
971
  #ifdef FOG_EXP2
972
972
  float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );
973
973
  #else
974
974
  float fogFactor = smoothstep( fogNear, fogFar, fogDepth );
975
975
  #endif
976
976
  gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
977
- #endif`,hv=`#ifdef USE_FOG
977
+ #endif`,fv=`#ifdef USE_FOG
978
978
  uniform vec3 fogColor;
979
979
  varying float fogDepth;
980
980
  #ifdef FOG_EXP2
@@ -983,7 +983,7 @@ vec4 LogLuvToLinear( in vec4 value ) {
983
983
  uniform float fogNear;
984
984
  uniform float fogFar;
985
985
  #endif
986
- #endif`,fv=`#ifdef USE_GRADIENTMAP
986
+ #endif`,dv=`#ifdef USE_GRADIENTMAP
987
987
  uniform sampler2D gradientMap;
988
988
  #endif
989
989
  vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
@@ -994,13 +994,13 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
994
994
  #else
995
995
  return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );
996
996
  #endif
997
- }`,dv=`#ifdef USE_LIGHTMAP
997
+ }`,pv=`#ifdef USE_LIGHTMAP
998
998
  vec4 lightMapTexel= texture2D( lightMap, vUv2 );
999
999
  reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
1000
- #endif`,pv=`#ifdef USE_LIGHTMAP
1000
+ #endif`,vv=`#ifdef USE_LIGHTMAP
1001
1001
  uniform sampler2D lightMap;
1002
1002
  uniform float lightMapIntensity;
1003
- #endif`,vv=`vec3 diffuse = vec3( 1.0 );
1003
+ #endif`,mv=`vec3 diffuse = vec3( 1.0 );
1004
1004
  GeometricContext geometry;
1005
1005
  geometry.position = mvPosition.xyz;
1006
1006
  geometry.normal = normalize( transformedNormal );
@@ -1072,7 +1072,7 @@ vIndirectFront += getLightProbeIrradiance( lightProbe, geometry );
1072
1072
  #endif
1073
1073
  }
1074
1074
  #pragma unroll_loop_end
1075
- #endif`,mv=`uniform bool receiveShadow;
1075
+ #endif`,gv=`uniform bool receiveShadow;
1076
1076
  uniform vec3 ambientLightColor;
1077
1077
  uniform vec3 lightProbe[ 9 ];
1078
1078
  vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
@@ -1208,7 +1208,7 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
1208
1208
  #endif
1209
1209
  return irradiance;
1210
1210
  }
1211
- #endif`,gv=`#if defined( USE_ENVMAP )
1211
+ #endif`,yv=`#if defined( USE_ENVMAP )
1212
1212
  #ifdef ENVMAP_MODE_REFRACTION
1213
1213
  uniform float refractionRatio;
1214
1214
  #endif
@@ -1273,11 +1273,11 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
1273
1273
  #endif
1274
1274
  return envMapColor.rgb * envMapIntensity;
1275
1275
  }
1276
- #endif`,yv=`ToonMaterial material;
1276
+ #endif`,xv=`ToonMaterial material;
1277
1277
  material.diffuseColor = diffuseColor.rgb;
1278
1278
  material.specularColor = specular;
1279
1279
  material.specularShininess = shininess;
1280
- material.specularStrength = specularStrength;`,xv=`varying vec3 vViewPosition;
1280
+ material.specularStrength = specularStrength;`,_v=`varying vec3 vViewPosition;
1281
1281
  #ifndef FLAT_SHADED
1282
1282
  varying vec3 vNormal;
1283
1283
  #endif
@@ -1300,11 +1300,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContex
1300
1300
  }
1301
1301
  #define RE_Direct RE_Direct_Toon
1302
1302
  #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon
1303
- #define Material_LightProbeLOD( material ) (0)`,_v=`BlinnPhongMaterial material;
1303
+ #define Material_LightProbeLOD( material ) (0)`,bv=`BlinnPhongMaterial material;
1304
1304
  material.diffuseColor = diffuseColor.rgb;
1305
1305
  material.specularColor = specular;
1306
1306
  material.specularShininess = shininess;
1307
- material.specularStrength = specularStrength;`,bv=`varying vec3 vViewPosition;
1307
+ material.specularStrength = specularStrength;`,wv=`varying vec3 vViewPosition;
1308
1308
  #ifndef FLAT_SHADED
1309
1309
  varying vec3 vNormal;
1310
1310
  #endif
@@ -1328,7 +1328,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in Geometric
1328
1328
  }
1329
1329
  #define RE_Direct RE_Direct_BlinnPhong
1330
1330
  #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong
1331
- #define Material_LightProbeLOD( material ) (0)`,wv=`PhysicalMaterial material;
1331
+ #define Material_LightProbeLOD( material ) (0)`,Mv=`PhysicalMaterial material;
1332
1332
  material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
1333
1333
  vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );
1334
1334
  float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
@@ -1354,7 +1354,7 @@ material.specularRoughness = min( material.specularRoughness, 1.0 );
1354
1354
  #endif
1355
1355
  #ifdef USE_SHEEN
1356
1356
  material.sheenColor = sheen;
1357
- #endif`,Mv=`struct PhysicalMaterial {
1357
+ #endif`,Ev=`struct PhysicalMaterial {
1358
1358
  vec3 diffuseColor;
1359
1359
  float specularRoughness;
1360
1360
  vec3 specularColor;
@@ -1455,7 +1455,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia
1455
1455
  #define RE_IndirectSpecular RE_IndirectSpecular_Physical
1456
1456
  float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1457
1457
  return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1458
- }`,Ev=`
1458
+ }`,Tv=`
1459
1459
  GeometricContext geometry;
1460
1460
  geometry.position = - vViewPosition;
1461
1461
  geometry.normal = normal;
@@ -1539,7 +1539,7 @@ IncidentLight directLight;
1539
1539
  #if defined( RE_IndirectSpecular )
1540
1540
  vec3 radiance = vec3( 0.0 );
1541
1541
  vec3 clearcoatRadiance = vec3( 0.0 );
1542
- #endif`,Tv=`#if defined( RE_IndirectDiffuse )
1542
+ #endif`,Sv=`#if defined( RE_IndirectDiffuse )
1543
1543
  #ifdef USE_LIGHTMAP
1544
1544
  vec4 lightMapTexel= texture2D( lightMap, vUv2 );
1545
1545
  vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
@@ -1557,25 +1557,25 @@ IncidentLight directLight;
1557
1557
  #ifdef CLEARCOAT
1558
1558
  clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );
1559
1559
  #endif
1560
- #endif`,Sv=`#if defined( RE_IndirectDiffuse )
1560
+ #endif`,Av=`#if defined( RE_IndirectDiffuse )
1561
1561
  RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
1562
1562
  #endif
1563
1563
  #if defined( RE_IndirectSpecular )
1564
1564
  RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
1565
- #endif`,Av=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
1566
- gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1567
1565
  #endif`,Lv=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
1566
+ gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1567
+ #endif`,Pv=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
1568
1568
  uniform float logDepthBufFC;
1569
1569
  varying float vFragDepth;
1570
1570
  varying float vIsPerspective;
1571
- #endif`,Pv=`#ifdef USE_LOGDEPTHBUF
1571
+ #endif`,Cv=`#ifdef USE_LOGDEPTHBUF
1572
1572
  #ifdef USE_LOGDEPTHBUF_EXT
1573
1573
  varying float vFragDepth;
1574
1574
  varying float vIsPerspective;
1575
1575
  #else
1576
1576
  uniform float logDepthBufFC;
1577
1577
  #endif
1578
- #endif`,Cv=`#ifdef USE_LOGDEPTHBUF
1578
+ #endif`,Rv=`#ifdef USE_LOGDEPTHBUF
1579
1579
  #ifdef USE_LOGDEPTHBUF_EXT
1580
1580
  vFragDepth = 1.0 + gl_Position.w;
1581
1581
  vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
@@ -1585,13 +1585,13 @@ IncidentLight directLight;
1585
1585
  gl_Position.z *= gl_Position.w;
1586
1586
  }
1587
1587
  #endif
1588
- #endif`,Rv=`#ifdef USE_MAP
1588
+ #endif`,Ov=`#ifdef USE_MAP
1589
1589
  vec4 texelColor = texture2D( map, vUv );
1590
1590
  texelColor = mapTexelToLinear( texelColor );
1591
1591
  diffuseColor *= texelColor;
1592
- #endif`,Ov=`#ifdef USE_MAP
1592
+ #endif`,Dv=`#ifdef USE_MAP
1593
1593
  uniform sampler2D map;
1594
- #endif`,Dv=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1594
+ #endif`,Iv=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1595
1595
  vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1596
1596
  #endif
1597
1597
  #ifdef USE_MAP
@@ -1600,7 +1600,7 @@ IncidentLight directLight;
1600
1600
  #endif
1601
1601
  #ifdef USE_ALPHAMAP
1602
1602
  diffuseColor.a *= texture2D( alphaMap, uv ).g;
1603
- #endif`,Iv=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1603
+ #endif`,Nv=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1604
1604
  uniform mat3 uvTransform;
1605
1605
  #endif
1606
1606
  #ifdef USE_MAP
@@ -1608,26 +1608,26 @@ IncidentLight directLight;
1608
1608
  #endif
1609
1609
  #ifdef USE_ALPHAMAP
1610
1610
  uniform sampler2D alphaMap;
1611
- #endif`,Nv=`float metalnessFactor = metalness;
1611
+ #endif`,Fv=`float metalnessFactor = metalness;
1612
1612
  #ifdef USE_METALNESSMAP
1613
1613
  vec4 texelMetalness = texture2D( metalnessMap, vUv );
1614
1614
  metalnessFactor *= texelMetalness.b;
1615
- #endif`,Fv=`#ifdef USE_METALNESSMAP
1615
+ #endif`,Bv=`#ifdef USE_METALNESSMAP
1616
1616
  uniform sampler2D metalnessMap;
1617
- #endif`,Bv=`#ifdef USE_MORPHNORMALS
1617
+ #endif`,Uv=`#ifdef USE_MORPHNORMALS
1618
1618
  objectNormal *= morphTargetBaseInfluence;
1619
1619
  objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
1620
1620
  objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
1621
1621
  objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
1622
1622
  objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
1623
- #endif`,Uv=`#ifdef USE_MORPHTARGETS
1623
+ #endif`,zv=`#ifdef USE_MORPHTARGETS
1624
1624
  uniform float morphTargetBaseInfluence;
1625
1625
  #ifndef USE_MORPHNORMALS
1626
1626
  uniform float morphTargetInfluences[ 8 ];
1627
1627
  #else
1628
1628
  uniform float morphTargetInfluences[ 4 ];
1629
1629
  #endif
1630
- #endif`,zv=`#ifdef USE_MORPHTARGETS
1630
+ #endif`,Gv=`#ifdef USE_MORPHTARGETS
1631
1631
  transformed *= morphTargetBaseInfluence;
1632
1632
  transformed += morphTarget0 * morphTargetInfluences[ 0 ];
1633
1633
  transformed += morphTarget1 * morphTargetInfluences[ 1 ];
@@ -1639,7 +1639,7 @@ IncidentLight directLight;
1639
1639
  transformed += morphTarget6 * morphTargetInfluences[ 6 ];
1640
1640
  transformed += morphTarget7 * morphTargetInfluences[ 7 ];
1641
1641
  #endif
1642
- #endif`,Gv=`#ifdef FLAT_SHADED
1642
+ #endif`,Hv=`#ifdef FLAT_SHADED
1643
1643
  vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );
1644
1644
  vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );
1645
1645
  vec3 normal = normalize( cross( fdx, fdy ) );
@@ -1660,7 +1660,7 @@ IncidentLight directLight;
1660
1660
  #endif
1661
1661
  #endif
1662
1662
  #endif
1663
- vec3 geometryNormal = normal;`,Hv=`#ifdef OBJECTSPACE_NORMALMAP
1663
+ vec3 geometryNormal = normal;`,Vv=`#ifdef OBJECTSPACE_NORMALMAP
1664
1664
  normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
1665
1665
  #ifdef FLIP_SIDED
1666
1666
  normal = - normal;
@@ -1679,7 +1679,7 @@ vec3 geometryNormal = normal;`,Hv=`#ifdef OBJECTSPACE_NORMALMAP
1679
1679
  #endif
1680
1680
  #elif defined( USE_BUMPMAP )
1681
1681
  normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );
1682
- #endif`,Vv=`#ifdef USE_NORMALMAP
1682
+ #endif`,kv=`#ifdef USE_NORMALMAP
1683
1683
  uniform sampler2D normalMap;
1684
1684
  uniform vec2 normalScale;
1685
1685
  #endif
@@ -1700,9 +1700,9 @@ vec3 geometryNormal = normal;`,Hv=`#ifdef OBJECTSPACE_NORMALMAP
1700
1700
  mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );
1701
1701
  return normalize( tsn * mapN );
1702
1702
  }
1703
- #endif`,kv=`#ifdef CLEARCOAT
1703
+ #endif`,Wv=`#ifdef CLEARCOAT
1704
1704
  vec3 clearcoatNormal = geometryNormal;
1705
- #endif`,Wv=`#ifdef USE_CLEARCOAT_NORMALMAP
1705
+ #endif`,Xv=`#ifdef USE_CLEARCOAT_NORMALMAP
1706
1706
  vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;
1707
1707
  clearcoatMapN.xy *= clearcoatNormalScale;
1708
1708
  #ifdef USE_TANGENT
@@ -1710,7 +1710,7 @@ vec3 geometryNormal = normal;`,Hv=`#ifdef OBJECTSPACE_NORMALMAP
1710
1710
  #else
1711
1711
  clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );
1712
1712
  #endif
1713
- #endif`,Xv=`#ifdef USE_CLEARCOATMAP
1713
+ #endif`,jv=`#ifdef USE_CLEARCOATMAP
1714
1714
  uniform sampler2D clearcoatMap;
1715
1715
  #endif
1716
1716
  #ifdef USE_CLEARCOAT_ROUGHNESSMAP
@@ -1719,7 +1719,7 @@ vec3 geometryNormal = normal;`,Hv=`#ifdef OBJECTSPACE_NORMALMAP
1719
1719
  #ifdef USE_CLEARCOAT_NORMALMAP
1720
1720
  uniform sampler2D clearcoatNormalMap;
1721
1721
  uniform vec2 clearcoatNormalScale;
1722
- #endif`,jv=`vec3 packNormalToRGB( const in vec3 normal ) {
1722
+ #endif`,qv=`vec3 packNormalToRGB( const in vec3 normal ) {
1723
1723
  return normalize( normal ) * 0.5 + 0.5;
1724
1724
  }
1725
1725
  vec3 unpackRGBToNormal( const in vec3 rgb ) {
@@ -1754,29 +1754,29 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const
1754
1754
  }
1755
1755
  float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
1756
1756
  return ( near * far ) / ( ( far - near ) * invClipZ - far );
1757
- }`,qv=`#ifdef PREMULTIPLIED_ALPHA
1757
+ }`,Yv=`#ifdef PREMULTIPLIED_ALPHA
1758
1758
  gl_FragColor.rgb *= gl_FragColor.a;
1759
- #endif`,Yv=`vec4 mvPosition = vec4( transformed, 1.0 );
1759
+ #endif`,Zv=`vec4 mvPosition = vec4( transformed, 1.0 );
1760
1760
  #ifdef USE_INSTANCING
1761
1761
  mvPosition = instanceMatrix * mvPosition;
1762
1762
  #endif
1763
1763
  mvPosition = modelViewMatrix * mvPosition;
1764
- gl_Position = projectionMatrix * mvPosition;`,Zv=`#ifdef DITHERING
1764
+ gl_Position = projectionMatrix * mvPosition;`,Jv=`#ifdef DITHERING
1765
1765
  gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1766
- #endif`,Jv=`#ifdef DITHERING
1766
+ #endif`,Qv=`#ifdef DITHERING
1767
1767
  vec3 dithering( vec3 color ) {
1768
1768
  float grid_position = rand( gl_FragCoord.xy );
1769
1769
  vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1770
1770
  dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1771
1771
  return color + dither_shift_RGB;
1772
1772
  }
1773
- #endif`,Qv=`float roughnessFactor = roughness;
1773
+ #endif`,Kv=`float roughnessFactor = roughness;
1774
1774
  #ifdef USE_ROUGHNESSMAP
1775
1775
  vec4 texelRoughness = texture2D( roughnessMap, vUv );
1776
1776
  roughnessFactor *= texelRoughness.g;
1777
- #endif`,Kv=`#ifdef USE_ROUGHNESSMAP
1777
+ #endif`,$v=`#ifdef USE_ROUGHNESSMAP
1778
1778
  uniform sampler2D roughnessMap;
1779
- #endif`,$v=`#ifdef USE_SHADOWMAP
1779
+ #endif`,em=`#ifdef USE_SHADOWMAP
1780
1780
  #if NUM_DIR_LIGHT_SHADOWS > 0
1781
1781
  uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1782
1782
  varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
@@ -1927,7 +1927,7 @@ gl_Position = projectionMatrix * mvPosition;`,Zv=`#ifdef DITHERING
1927
1927
  return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
1928
1928
  #endif
1929
1929
  }
1930
- #endif`,em=`#ifdef USE_SHADOWMAP
1930
+ #endif`,tm=`#ifdef USE_SHADOWMAP
1931
1931
  #if NUM_DIR_LIGHT_SHADOWS > 0
1932
1932
  uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
1933
1933
  varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
@@ -1940,7 +1940,7 @@ gl_Position = projectionMatrix * mvPosition;`,Zv=`#ifdef DITHERING
1940
1940
  uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
1941
1941
  varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1942
1942
  #endif
1943
- #endif`,tm=`#ifdef USE_SHADOWMAP
1943
+ #endif`,nm=`#ifdef USE_SHADOWMAP
1944
1944
  #if NUM_DIR_LIGHT_SHADOWS > 0
1945
1945
  #pragma unroll_loop_start
1946
1946
  for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
@@ -1962,7 +1962,7 @@ gl_Position = projectionMatrix * mvPosition;`,Zv=`#ifdef DITHERING
1962
1962
  }
1963
1963
  #pragma unroll_loop_end
1964
1964
  #endif
1965
- #endif`,nm=`float getShadowMask() {
1965
+ #endif`,rm=`float getShadowMask() {
1966
1966
  float shadow = 1.0;
1967
1967
  #ifdef USE_SHADOWMAP
1968
1968
  #if NUM_DIR_LIGHT_SHADOWS > 0
@@ -1994,12 +1994,12 @@ gl_Position = projectionMatrix * mvPosition;`,Zv=`#ifdef DITHERING
1994
1994
  #endif
1995
1995
  #endif
1996
1996
  return shadow;
1997
- }`,rm=`#ifdef USE_SKINNING
1997
+ }`,im=`#ifdef USE_SKINNING
1998
1998
  mat4 boneMatX = getBoneMatrix( skinIndex.x );
1999
1999
  mat4 boneMatY = getBoneMatrix( skinIndex.y );
2000
2000
  mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2001
2001
  mat4 boneMatW = getBoneMatrix( skinIndex.w );
2002
- #endif`,im=`#ifdef USE_SKINNING
2002
+ #endif`,am=`#ifdef USE_SKINNING
2003
2003
  uniform mat4 bindMatrix;
2004
2004
  uniform mat4 bindMatrixInverse;
2005
2005
  #ifdef BONE_TEXTURE
@@ -2026,7 +2026,7 @@ gl_Position = projectionMatrix * mvPosition;`,Zv=`#ifdef DITHERING
2026
2026
  return bone;
2027
2027
  }
2028
2028
  #endif
2029
- #endif`,am=`#ifdef USE_SKINNING
2029
+ #endif`,om=`#ifdef USE_SKINNING
2030
2030
  vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2031
2031
  vec4 skinned = vec4( 0.0 );
2032
2032
  skinned += boneMatX * skinVertex * skinWeight.x;
@@ -2034,7 +2034,7 @@ gl_Position = projectionMatrix * mvPosition;`,Zv=`#ifdef DITHERING
2034
2034
  skinned += boneMatZ * skinVertex * skinWeight.z;
2035
2035
  skinned += boneMatW * skinVertex * skinWeight.w;
2036
2036
  transformed = ( bindMatrixInverse * skinned ).xyz;
2037
- #endif`,om=`#ifdef USE_SKINNING
2037
+ #endif`,sm=`#ifdef USE_SKINNING
2038
2038
  mat4 skinMatrix = mat4( 0.0 );
2039
2039
  skinMatrix += skinWeight.x * boneMatX;
2040
2040
  skinMatrix += skinWeight.y * boneMatY;
@@ -2045,17 +2045,17 @@ gl_Position = projectionMatrix * mvPosition;`,Zv=`#ifdef DITHERING
2045
2045
  #ifdef USE_TANGENT
2046
2046
  objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2047
2047
  #endif
2048
- #endif`,sm=`float specularStrength;
2048
+ #endif`,lm=`float specularStrength;
2049
2049
  #ifdef USE_SPECULARMAP
2050
2050
  vec4 texelSpecular = texture2D( specularMap, vUv );
2051
2051
  specularStrength = texelSpecular.r;
2052
2052
  #else
2053
2053
  specularStrength = 1.0;
2054
- #endif`,lm=`#ifdef USE_SPECULARMAP
2054
+ #endif`,cm=`#ifdef USE_SPECULARMAP
2055
2055
  uniform sampler2D specularMap;
2056
- #endif`,cm=`#if defined( TONE_MAPPING )
2056
+ #endif`,um=`#if defined( TONE_MAPPING )
2057
2057
  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2058
- #endif`,um=`#ifndef saturate
2058
+ #endif`,hm=`#ifndef saturate
2059
2059
  #define saturate(a) clamp( a, 0.0, 1.0 )
2060
2060
  #endif
2061
2061
  uniform float toneMappingExposure;
@@ -2080,44 +2080,44 @@ vec3 OptimizedCineonToneMapping( vec3 color ) {
2080
2080
  vec3 ACESFilmicToneMapping( vec3 color ) {
2081
2081
  color *= toneMappingExposure;
2082
2082
  return saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );
2083
- }`,hm=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
2083
+ }`,fm=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
2084
2084
  varying vec2 vUv;
2085
- #endif`,fm=`#ifdef USE_UV
2085
+ #endif`,dm=`#ifdef USE_UV
2086
2086
  #ifdef UVS_VERTEX_ONLY
2087
2087
  vec2 vUv;
2088
2088
  #else
2089
2089
  varying vec2 vUv;
2090
2090
  #endif
2091
2091
  uniform mat3 uvTransform;
2092
- #endif`,dm=`#ifdef USE_UV
2092
+ #endif`,pm=`#ifdef USE_UV
2093
2093
  vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2094
- #endif`,pm=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
2095
- varying vec2 vUv2;
2096
2094
  #endif`,vm=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
2095
+ varying vec2 vUv2;
2096
+ #endif`,mm=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
2097
2097
  attribute vec2 uv2;
2098
2098
  varying vec2 vUv2;
2099
2099
  uniform mat3 uv2Transform;
2100
- #endif`,mm=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
2100
+ #endif`,gm=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
2101
2101
  vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;
2102
- #endif`,gm=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )
2102
+ #endif`,ym=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )
2103
2103
  vec4 worldPosition = vec4( transformed, 1.0 );
2104
2104
  #ifdef USE_INSTANCING
2105
2105
  worldPosition = instanceMatrix * worldPosition;
2106
2106
  #endif
2107
2107
  worldPosition = modelMatrix * worldPosition;
2108
- #endif`,ym=`uniform sampler2D t2D;
2108
+ #endif`,xm=`uniform sampler2D t2D;
2109
2109
  varying vec2 vUv;
2110
2110
  void main() {
2111
2111
  vec4 texColor = texture2D( t2D, vUv );
2112
2112
  gl_FragColor = mapTexelToLinear( texColor );
2113
2113
  #include <tonemapping_fragment>
2114
2114
  #include <encodings_fragment>
2115
- }`,xm=`varying vec2 vUv;
2115
+ }`,_m=`varying vec2 vUv;
2116
2116
  uniform mat3 uvTransform;
2117
2117
  void main() {
2118
2118
  vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2119
2119
  gl_Position = vec4( position.xy, 1.0, 1.0 );
2120
- }`,_m=`#include <envmap_common_pars_fragment>
2120
+ }`,bm=`#include <envmap_common_pars_fragment>
2121
2121
  uniform float opacity;
2122
2122
  varying vec3 vWorldDirection;
2123
2123
  #include <cube_uv_reflection_fragment>
@@ -2128,14 +2128,14 @@ void main() {
2128
2128
  gl_FragColor.a *= opacity;
2129
2129
  #include <tonemapping_fragment>
2130
2130
  #include <encodings_fragment>
2131
- }`,bm=`varying vec3 vWorldDirection;
2131
+ }`,wm=`varying vec3 vWorldDirection;
2132
2132
  #include <common>
2133
2133
  void main() {
2134
2134
  vWorldDirection = transformDirection( position, modelMatrix );
2135
2135
  #include <begin_vertex>
2136
2136
  #include <project_vertex>
2137
2137
  gl_Position.z = gl_Position.w;
2138
- }`,wm=`#if DEPTH_PACKING == 3200
2138
+ }`,Mm=`#if DEPTH_PACKING == 3200
2139
2139
  uniform float opacity;
2140
2140
  #endif
2141
2141
  #include <common>
@@ -2162,7 +2162,7 @@ void main() {
2162
2162
  #elif DEPTH_PACKING == 3201
2163
2163
  gl_FragColor = packDepthToRGBA( fragCoordZ );
2164
2164
  #endif
2165
- }`,Mm=`#include <common>
2165
+ }`,Em=`#include <common>
2166
2166
  #include <uv_pars_vertex>
2167
2167
  #include <displacementmap_pars_vertex>
2168
2168
  #include <morphtarget_pars_vertex>
@@ -2186,7 +2186,7 @@ void main() {
2186
2186
  #include <logdepthbuf_vertex>
2187
2187
  #include <clipping_planes_vertex>
2188
2188
  vHighPrecisionZW = gl_Position.zw;
2189
- }`,Em=`#define DISTANCE
2189
+ }`,Tm=`#define DISTANCE
2190
2190
  uniform vec3 referencePosition;
2191
2191
  uniform float nearDistance;
2192
2192
  uniform float farDistance;
@@ -2207,7 +2207,7 @@ void main () {
2207
2207
  dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2208
2208
  dist = saturate( dist );
2209
2209
  gl_FragColor = packDepthToRGBA( dist );
2210
- }`,Tm=`#define DISTANCE
2210
+ }`,Sm=`#define DISTANCE
2211
2211
  varying vec3 vWorldPosition;
2212
2212
  #include <common>
2213
2213
  #include <uv_pars_vertex>
@@ -2231,7 +2231,7 @@ void main() {
2231
2231
  #include <worldpos_vertex>
2232
2232
  #include <clipping_planes_vertex>
2233
2233
  vWorldPosition = worldPosition.xyz;
2234
- }`,Sm=`uniform sampler2D tEquirect;
2234
+ }`,Am=`uniform sampler2D tEquirect;
2235
2235
  varying vec3 vWorldDirection;
2236
2236
  #include <common>
2237
2237
  void main() {
@@ -2241,13 +2241,13 @@ void main() {
2241
2241
  gl_FragColor = mapTexelToLinear( texColor );
2242
2242
  #include <tonemapping_fragment>
2243
2243
  #include <encodings_fragment>
2244
- }`,Am=`varying vec3 vWorldDirection;
2244
+ }`,Lm=`varying vec3 vWorldDirection;
2245
2245
  #include <common>
2246
2246
  void main() {
2247
2247
  vWorldDirection = transformDirection( position, modelMatrix );
2248
2248
  #include <begin_vertex>
2249
2249
  #include <project_vertex>
2250
- }`,Lm=`uniform vec3 diffuse;
2250
+ }`,Pm=`uniform vec3 diffuse;
2251
2251
  uniform float opacity;
2252
2252
  uniform float dashSize;
2253
2253
  uniform float totalSize;
@@ -2272,7 +2272,7 @@ void main() {
2272
2272
  #include <encodings_fragment>
2273
2273
  #include <fog_fragment>
2274
2274
  #include <premultiplied_alpha_fragment>
2275
- }`,Pm=`uniform float scale;
2275
+ }`,Cm=`uniform float scale;
2276
2276
  attribute float lineDistance;
2277
2277
  varying float vLineDistance;
2278
2278
  #include <common>
@@ -2290,7 +2290,7 @@ void main() {
2290
2290
  #include <logdepthbuf_vertex>
2291
2291
  #include <clipping_planes_vertex>
2292
2292
  #include <fog_vertex>
2293
- }`,Cm=`uniform vec3 diffuse;
2293
+ }`,Rm=`uniform vec3 diffuse;
2294
2294
  uniform float opacity;
2295
2295
  #ifndef FLAT_SHADED
2296
2296
  varying vec3 vNormal;
@@ -2338,7 +2338,7 @@ void main() {
2338
2338
  #include <fog_fragment>
2339
2339
  #include <premultiplied_alpha_fragment>
2340
2340
  #include <dithering_fragment>
2341
- }`,Rm=`#include <common>
2341
+ }`,Om=`#include <common>
2342
2342
  #include <uv_pars_vertex>
2343
2343
  #include <uv2_pars_vertex>
2344
2344
  #include <envmap_pars_vertex>
@@ -2368,7 +2368,7 @@ void main() {
2368
2368
  #include <clipping_planes_vertex>
2369
2369
  #include <envmap_vertex>
2370
2370
  #include <fog_vertex>
2371
- }`,Om=`uniform vec3 diffuse;
2371
+ }`,Dm=`uniform vec3 diffuse;
2372
2372
  uniform vec3 emissive;
2373
2373
  uniform float opacity;
2374
2374
  varying vec3 vLightFront;
@@ -2433,7 +2433,7 @@ void main() {
2433
2433
  #include <fog_fragment>
2434
2434
  #include <premultiplied_alpha_fragment>
2435
2435
  #include <dithering_fragment>
2436
- }`,Dm=`#define LAMBERT
2436
+ }`,Im=`#define LAMBERT
2437
2437
  varying vec3 vLightFront;
2438
2438
  varying vec3 vIndirectFront;
2439
2439
  #ifdef DOUBLE_SIDED
@@ -2473,7 +2473,7 @@ void main() {
2473
2473
  #include <lights_lambert_vertex>
2474
2474
  #include <shadowmap_vertex>
2475
2475
  #include <fog_vertex>
2476
- }`,Im=`#define MATCAP
2476
+ }`,Nm=`#define MATCAP
2477
2477
  uniform vec3 diffuse;
2478
2478
  uniform float opacity;
2479
2479
  uniform sampler2D matcap;
@@ -2519,7 +2519,7 @@ void main() {
2519
2519
  #include <fog_fragment>
2520
2520
  #include <premultiplied_alpha_fragment>
2521
2521
  #include <dithering_fragment>
2522
- }`,Nm=`#define MATCAP
2522
+ }`,Fm=`#define MATCAP
2523
2523
  varying vec3 vViewPosition;
2524
2524
  #ifndef FLAT_SHADED
2525
2525
  varying vec3 vNormal;
@@ -2553,7 +2553,7 @@ void main() {
2553
2553
  #include <clipping_planes_vertex>
2554
2554
  #include <fog_vertex>
2555
2555
  vViewPosition = - mvPosition.xyz;
2556
- }`,Fm=`#define TOON
2556
+ }`,Bm=`#define TOON
2557
2557
  uniform vec3 diffuse;
2558
2558
  uniform vec3 emissive;
2559
2559
  uniform vec3 specular;
@@ -2607,7 +2607,7 @@ void main() {
2607
2607
  #include <fog_fragment>
2608
2608
  #include <premultiplied_alpha_fragment>
2609
2609
  #include <dithering_fragment>
2610
- }`,Bm=`#define TOON
2610
+ }`,Um=`#define TOON
2611
2611
  varying vec3 vViewPosition;
2612
2612
  #ifndef FLAT_SHADED
2613
2613
  varying vec3 vNormal;
@@ -2646,7 +2646,7 @@ void main() {
2646
2646
  #include <worldpos_vertex>
2647
2647
  #include <shadowmap_vertex>
2648
2648
  #include <fog_vertex>
2649
- }`,Um=`#define PHONG
2649
+ }`,zm=`#define PHONG
2650
2650
  uniform vec3 diffuse;
2651
2651
  uniform vec3 emissive;
2652
2652
  uniform vec3 specular;
@@ -2703,7 +2703,7 @@ void main() {
2703
2703
  #include <fog_fragment>
2704
2704
  #include <premultiplied_alpha_fragment>
2705
2705
  #include <dithering_fragment>
2706
- }`,zm=`#define PHONG
2706
+ }`,Gm=`#define PHONG
2707
2707
  varying vec3 vViewPosition;
2708
2708
  #ifndef FLAT_SHADED
2709
2709
  varying vec3 vNormal;
@@ -2744,7 +2744,7 @@ void main() {
2744
2744
  #include <envmap_vertex>
2745
2745
  #include <shadowmap_vertex>
2746
2746
  #include <fog_vertex>
2747
- }`,Gm=`#define STANDARD
2747
+ }`,Hm=`#define STANDARD
2748
2748
  #ifdef PHYSICAL
2749
2749
  #define REFLECTIVITY
2750
2750
  #define CLEARCOAT
@@ -2834,7 +2834,7 @@ void main() {
2834
2834
  #include <fog_fragment>
2835
2835
  #include <premultiplied_alpha_fragment>
2836
2836
  #include <dithering_fragment>
2837
- }`,Hm=`#define STANDARD
2837
+ }`,Vm=`#define STANDARD
2838
2838
  varying vec3 vViewPosition;
2839
2839
  #ifndef FLAT_SHADED
2840
2840
  varying vec3 vNormal;
@@ -2881,7 +2881,7 @@ void main() {
2881
2881
  #include <worldpos_vertex>
2882
2882
  #include <shadowmap_vertex>
2883
2883
  #include <fog_vertex>
2884
- }`,Vm=`#define NORMAL
2884
+ }`,km=`#define NORMAL
2885
2885
  uniform float opacity;
2886
2886
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
2887
2887
  varying vec3 vViewPosition;
@@ -2905,7 +2905,7 @@ void main() {
2905
2905
  #include <normal_fragment_begin>
2906
2906
  #include <normal_fragment_maps>
2907
2907
  gl_FragColor = vec4( packNormalToRGB( normal ), opacity );
2908
- }`,km=`#define NORMAL
2908
+ }`,Wm=`#define NORMAL
2909
2909
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
2910
2910
  varying vec3 vViewPosition;
2911
2911
  #endif
@@ -2947,7 +2947,7 @@ void main() {
2947
2947
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
2948
2948
  vViewPosition = - mvPosition.xyz;
2949
2949
  #endif
2950
- }`,Wm=`uniform vec3 diffuse;
2950
+ }`,Xm=`uniform vec3 diffuse;
2951
2951
  uniform float opacity;
2952
2952
  #include <common>
2953
2953
  #include <color_pars_fragment>
@@ -2969,7 +2969,7 @@ void main() {
2969
2969
  #include <encodings_fragment>
2970
2970
  #include <fog_fragment>
2971
2971
  #include <premultiplied_alpha_fragment>
2972
- }`,Xm=`uniform float size;
2972
+ }`,jm=`uniform float size;
2973
2973
  uniform float scale;
2974
2974
  #include <common>
2975
2975
  #include <color_pars_vertex>
@@ -2991,7 +2991,7 @@ void main() {
2991
2991
  #include <clipping_planes_vertex>
2992
2992
  #include <worldpos_vertex>
2993
2993
  #include <fog_vertex>
2994
- }`,jm=`uniform vec3 color;
2994
+ }`,qm=`uniform vec3 color;
2995
2995
  uniform float opacity;
2996
2996
  #include <common>
2997
2997
  #include <packing>
@@ -3005,7 +3005,7 @@ void main() {
3005
3005
  #include <tonemapping_fragment>
3006
3006
  #include <encodings_fragment>
3007
3007
  #include <fog_fragment>
3008
- }`,qm=`#include <fog_pars_vertex>
3008
+ }`,Ym=`#include <fog_pars_vertex>
3009
3009
  #include <shadowmap_pars_vertex>
3010
3010
  void main() {
3011
3011
  #include <begin_vertex>
@@ -3013,7 +3013,7 @@ void main() {
3013
3013
  #include <worldpos_vertex>
3014
3014
  #include <shadowmap_vertex>
3015
3015
  #include <fog_vertex>
3016
- }`,Ym=`uniform vec3 diffuse;
3016
+ }`,Zm=`uniform vec3 diffuse;
3017
3017
  uniform float opacity;
3018
3018
  #include <common>
3019
3019
  #include <uv_pars_fragment>
@@ -3035,7 +3035,7 @@ void main() {
3035
3035
  #include <tonemapping_fragment>
3036
3036
  #include <encodings_fragment>
3037
3037
  #include <fog_fragment>
3038
- }`,Zm=`uniform float rotation;
3038
+ }`,Jm=`uniform float rotation;
3039
3039
  uniform vec2 center;
3040
3040
  #include <common>
3041
3041
  #include <uv_pars_vertex>
@@ -3061,30 +3061,30 @@ void main() {
3061
3061
  #include <logdepthbuf_vertex>
3062
3062
  #include <clipping_planes_vertex>
3063
3063
  #include <fog_vertex>
3064
- }`,je={alphamap_fragment:Rp,alphamap_pars_fragment:Op,alphatest_fragment:Dp,aomap_fragment:Ip,aomap_pars_fragment:Np,begin_vertex:Fp,beginnormal_vertex:Bp,bsdfs:Up,bumpmap_pars_fragment:zp,clipping_planes_fragment:Gp,clipping_planes_pars_fragment:Hp,clipping_planes_pars_vertex:Vp,clipping_planes_vertex:kp,color_fragment:Wp,color_pars_fragment:Xp,color_pars_vertex:jp,color_vertex:qp,common:Yp,cube_uv_reflection_fragment:Zp,defaultnormal_vertex:Jp,displacementmap_pars_vertex:Qp,displacementmap_vertex:Kp,emissivemap_fragment:$p,emissivemap_pars_fragment:ev,encodings_fragment:tv,encodings_pars_fragment:nv,envmap_fragment:rv,envmap_common_pars_fragment:iv,envmap_pars_fragment:av,envmap_pars_vertex:ov,envmap_physical_pars_fragment:gv,envmap_vertex:sv,fog_vertex:lv,fog_pars_vertex:cv,fog_fragment:uv,fog_pars_fragment:hv,gradientmap_pars_fragment:fv,lightmap_fragment:dv,lightmap_pars_fragment:pv,lights_lambert_vertex:vv,lights_pars_begin:mv,lights_toon_fragment:yv,lights_toon_pars_fragment:xv,lights_phong_fragment:_v,lights_phong_pars_fragment:bv,lights_physical_fragment:wv,lights_physical_pars_fragment:Mv,lights_fragment_begin:Ev,lights_fragment_maps:Tv,lights_fragment_end:Sv,logdepthbuf_fragment:Av,logdepthbuf_pars_fragment:Lv,logdepthbuf_pars_vertex:Pv,logdepthbuf_vertex:Cv,map_fragment:Rv,map_pars_fragment:Ov,map_particle_fragment:Dv,map_particle_pars_fragment:Iv,metalnessmap_fragment:Nv,metalnessmap_pars_fragment:Fv,morphnormal_vertex:Bv,morphtarget_pars_vertex:Uv,morphtarget_vertex:zv,normal_fragment_begin:Gv,normal_fragment_maps:Hv,normalmap_pars_fragment:Vv,clearcoat_normal_fragment_begin:kv,clearcoat_normal_fragment_maps:Wv,clearcoat_pars_fragment:Xv,packing:jv,premultiplied_alpha_fragment:qv,project_vertex:Yv,dithering_fragment:Zv,dithering_pars_fragment:Jv,roughnessmap_fragment:Qv,roughnessmap_pars_fragment:Kv,shadowmap_pars_fragment:$v,shadowmap_pars_vertex:em,shadowmap_vertex:tm,shadowmask_pars_fragment:nm,skinbase_vertex:rm,skinning_pars_vertex:im,skinning_vertex:am,skinnormal_vertex:om,specularmap_fragment:sm,specularmap_pars_fragment:lm,tonemapping_fragment:cm,tonemapping_pars_fragment:um,uv_pars_fragment:hm,uv_pars_vertex:fm,uv_vertex:dm,uv2_pars_fragment:pm,uv2_pars_vertex:vm,uv2_vertex:mm,worldpos_vertex:gm,background_frag:ym,background_vert:xm,cube_frag:_m,cube_vert:bm,depth_frag:wm,depth_vert:Mm,distanceRGBA_frag:Em,distanceRGBA_vert:Tm,equirect_frag:Sm,equirect_vert:Am,linedashed_frag:Lm,linedashed_vert:Pm,meshbasic_frag:Cm,meshbasic_vert:Rm,meshlambert_frag:Om,meshlambert_vert:Dm,meshmatcap_frag:Im,meshmatcap_vert:Nm,meshtoon_frag:Fm,meshtoon_vert:Bm,meshphong_frag:Um,meshphong_vert:zm,meshphysical_frag:Gm,meshphysical_vert:Hm,normal_frag:Vm,normal_vert:km,points_frag:Wm,points_vert:Xm,shadow_frag:jm,shadow_vert:qm,sprite_frag:Ym,sprite_vert:Zm},Un={basic:{uniforms:It([le.common,le.specularmap,le.envmap,le.aomap,le.lightmap,le.fog]),vertexShader:je.meshbasic_vert,fragmentShader:je.meshbasic_frag},lambert:{uniforms:It([le.common,le.specularmap,le.envmap,le.aomap,le.lightmap,le.emissivemap,le.fog,le.lights,{emissive:{value:new de(0)}}]),vertexShader:je.meshlambert_vert,fragmentShader:je.meshlambert_frag},phong:{uniforms:It([le.common,le.specularmap,le.envmap,le.aomap,le.lightmap,le.emissivemap,le.bumpmap,le.normalmap,le.displacementmap,le.fog,le.lights,{emissive:{value:new de(0)},specular:{value:new de(1118481)},shininess:{value:30}}]),vertexShader:je.meshphong_vert,fragmentShader:je.meshphong_frag},standard:{uniforms:It([le.common,le.envmap,le.aomap,le.lightmap,le.emissivemap,le.bumpmap,le.normalmap,le.displacementmap,le.roughnessmap,le.metalnessmap,le.fog,le.lights,{emissive:{value:new de(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:je.meshphysical_vert,fragmentShader:je.meshphysical_frag},toon:{uniforms:It([le.common,le.specularmap,le.aomap,le.lightmap,le.emissivemap,le.bumpmap,le.normalmap,le.displacementmap,le.gradientmap,le.fog,le.lights,{emissive:{value:new de(0)},specular:{value:new de(1118481)},shininess:{value:30}}]),vertexShader:je.meshtoon_vert,fragmentShader:je.meshtoon_frag},matcap:{uniforms:It([le.common,le.bumpmap,le.normalmap,le.displacementmap,le.fog,{matcap:{value:null}}]),vertexShader:je.meshmatcap_vert,fragmentShader:je.meshmatcap_frag},points:{uniforms:It([le.points,le.fog]),vertexShader:je.points_vert,fragmentShader:je.points_frag},dashed:{uniforms:It([le.common,le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:je.linedashed_vert,fragmentShader:je.linedashed_frag},depth:{uniforms:It([le.common,le.displacementmap]),vertexShader:je.depth_vert,fragmentShader:je.depth_frag},normal:{uniforms:It([le.common,le.bumpmap,le.normalmap,le.displacementmap,{opacity:{value:1}}]),vertexShader:je.normal_vert,fragmentShader:je.normal_frag},sprite:{uniforms:It([le.sprite,le.fog]),vertexShader:je.sprite_vert,fragmentShader:je.sprite_frag},background:{uniforms:{uvTransform:{value:new Ut},t2D:{value:null}},vertexShader:je.background_vert,fragmentShader:je.background_frag},cube:{uniforms:It([le.envmap,{opacity:{value:1}}]),vertexShader:je.cube_vert,fragmentShader:je.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:je.equirect_vert,fragmentShader:je.equirect_frag},distanceRGBA:{uniforms:It([le.common,le.displacementmap,{referencePosition:{value:new E},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:je.distanceRGBA_vert,fragmentShader:je.distanceRGBA_frag},shadow:{uniforms:It([le.lights,le.fog,{color:{value:new de(0)},opacity:{value:1}}]),vertexShader:je.shadow_vert,fragmentShader:je.shadow_frag}};Un.physical={uniforms:It([Un.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new X(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new de(0)},transparency:{value:0}}]),vertexShader:je.meshphysical_vert,fragmentShader:je.meshphysical_frag};function Jm(e,t,n,r){var i=new de(0),a=0,o,s,c=null,l=0,u=null;function h(d,m,g,y){var p=m.background,v=e.xr,_=v.getSession&&v.getSession();if(_&&_.environmentBlendMode==="additive"&&(p=null),p===null?f(i,a):p&&p.isColor&&(f(p,1),y=!0),(e.autoClear||y)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),p&&(p.isCubeTexture||p.isWebGLCubeRenderTarget||p.mapping===ki)){s===void 0&&(s=new ut(new Mo(1,1,1),new Wt({type:"BackgroundCubeMaterial",uniforms:ri(Un.cube.uniforms),vertexShader:Un.cube.vertexShader,fragmentShader:Un.cube.fragmentShader,side:At,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(b,T,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(s));var x=p.isWebGLCubeRenderTarget?p.texture:p;s.material.uniforms.envMap.value=x,s.material.uniforms.flipEnvMap.value=x.isCubeTexture?-1:1,(c!==p||l!==x.version||u!==e.toneMapping)&&(s.material.needsUpdate=!0,c=p,l=x.version,u=e.toneMapping),d.unshift(s,s.geometry,s.material,0,0,null)}else p&&p.isTexture&&(o===void 0&&(o=new ut(new li(2,2),new Wt({type:"BackgroundMaterial",uniforms:ri(Un.background.uniforms),vertexShader:Un.background.vertexShader,fragmentShader:Un.background.fragmentShader,side:Gi,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(o)),o.material.uniforms.t2D.value=p,p.matrixAutoUpdate===!0&&p.updateMatrix(),o.material.uniforms.uvTransform.value.copy(p.matrix),(c!==p||l!==p.version||u!==e.toneMapping)&&(o.material.needsUpdate=!0,c=p,l=p.version,u=e.toneMapping),d.unshift(o,o.geometry,o.material,0,0,null))}function f(d,m){t.buffers.color.setClear(d.r,d.g,d.b,m,r)}return{getClearColor:function(){return i},setClearColor:function(d,m){i.set(d),a=m!==void 0?m:1,f(i,a)},getClearAlpha:function(){return a},setClearAlpha:function(d){a=d,f(i,a)},render:h}}function Qm(e,t,n,r){var i=r.isWebGL2,a;function o(l){a=l}function s(l,u){e.drawArrays(a,l,u),n.update(u,a)}function c(l,u,h,f){if(f!==0){var d,m;if(i)d=e,m="drawArraysInstanced";else if(d=t.get("ANGLE_instanced_arrays"),m="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[m](a,u,h,f),n.update(h,a,f)}}this.setMode=o,this.render=s,this.renderInstances=c}function Km(e,t,n){var r;function i(){if(r!==void 0)return r;var T=t.get("EXT_texture_filter_anisotropic");return T!==null?r=e.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT):r=0,r}function a(T){if(T==="highp"){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";T="mediump"}return T==="mediump"&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o=typeof WebGL2RenderingContext!="undefined"&&e instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&e instanceof WebGL2ComputeRenderingContext,s=n.precision!==void 0?n.precision:"highp",c=a(s);c!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",c,"instead."),s=c);var l=n.logarithmicDepthBuffer===!0,u=e.getParameter(34930),h=e.getParameter(35660),f=e.getParameter(3379),d=e.getParameter(34076),m=e.getParameter(34921),g=e.getParameter(36347),y=e.getParameter(36348),p=e.getParameter(36349),v=h>0,_=o||!!t.get("OES_texture_float"),x=v&&_,b=o?e.getParameter(36183):0;return{isWebGL2:o,getMaxAnisotropy:i,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:h,maxTextureSize:f,maxCubemapSize:d,maxAttributes:m,maxVertexUniforms:g,maxVaryings:y,maxFragmentUniforms:p,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:x,maxSamples:b}}function $m(){var e=this,t=null,n=0,r=!1,i=!1,a=new yn,o=new Ut,s={value:null,needsUpdate:!1};this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(u,h,f){var d=u.length!==0||h||n!==0||r;return r=h,t=l(u,f,0),n=u.length,d},this.beginShadows=function(){i=!0,l(null)},this.endShadows=function(){i=!1,c()},this.setState=function(u,h,f,d,m,g){if(!r||u===null||u.length===0||i&&!f)i?l(null):c();else{var y=i?0:n,p=y*4,v=m.clippingState||null;s.value=v,v=l(u,d,p,g);for(var _=0;_!==p;++_)v[_]=t[_];m.clippingState=v,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=y}};function c(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function l(u,h,f,d){var m=u!==null?u.length:0,g=null;if(m!==0){if(g=s.value,d!==!0||g===null){var y=f+m*4,p=h.matrixWorldInverse;o.getNormalMatrix(p),(g===null||g.length<y)&&(g=new Float32Array(y));for(var v=0,_=f;v!==m;++v,_+=4)a.copy(u[v]).applyMatrix4(p,o),a.normal.toArray(g,_),g[_+3]=a.constant}s.value=g,s.needsUpdate=!0}return e.numPlanes=m,e.numIntersection=0,g}}function eg(e){var t={};return{get:function(n){if(t[n]!==void 0)return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=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":r=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":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return r===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=r,r}}}function tg(e,t,n){var r=new WeakMap,i=new WeakMap;function a(u){var h=u.target,f=r.get(h);f.index!==null&&t.remove(f.index);for(var d in f.attributes)t.remove(f.attributes[d]);h.removeEventListener("dispose",a),r.delete(h);var m=i.get(f);m&&(t.remove(m),i.delete(f)),n.memory.geometries--}function o(u,h){var f=r.get(h);return f||(h.addEventListener("dispose",a),h.isBufferGeometry?f=h:h.isGeometry&&(h._bufferGeometry===void 0&&(h._bufferGeometry=new ve().setFromObject(u)),f=h._bufferGeometry),r.set(h,f),n.memory.geometries++,f)}function s(u){var h=u.index,f=u.attributes;h!==null&&t.update(h,34963);for(var d in f)t.update(f[d],34962);var m=u.morphAttributes;for(var d in m)for(var g=m[d],y=0,p=g.length;y<p;y++)t.update(g[y],34962)}function c(u){var h=[],f=u.index,d=u.attributes.position,m=0;if(f!==null){var g=f.array;m=f.version;for(var y=0,p=g.length;y<p;y+=3){var v=g[y+0],_=g[y+1],x=g[y+2];h.push(v,_,_,x,x,v)}}else{var g=d.array;m=d.version;for(var y=0,p=g.length/3-1;y<p;y+=3){var v=y+0,_=y+1,x=y+2;h.push(v,_,_,x,x,v)}}var b=new(bu(h)>65535?ea:$i)(h,1);b.version=m,t.update(b,34963);var T=i.get(u);T&&t.remove(T),i.set(u,b)}function l(u){var h=i.get(u);if(h){var f=u.index;f!==null&&h.version<f.version&&c(u)}else c(u);return i.get(u)}return{get:o,update:s,getWireframeAttribute:l}}function ng(e,t,n,r){var i=r.isWebGL2,a;function o(f){a=f}var s,c;function l(f){s=f.type,c=f.bytesPerElement}function u(f,d){e.drawElements(a,d,s,f*c),n.update(d,a)}function h(f,d,m,g){if(g!==0){var y,p;if(i)y=e,p="drawElementsInstanced";else if(y=t.get("ANGLE_instanced_arrays"),p="drawElementsInstancedANGLE",y===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}y[p](a,m,s,d*c,g),n.update(m,a,g)}}this.setMode=o,this.setIndex=l,this.render=u,this.renderInstances=h}function rg(e){var t={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(a,o,s){switch(s=s||1,n.calls++,o){case 4:n.triangles+=s*(a/3);break;case 1:n.lines+=s*(a/2);break;case 3:n.lines+=s*(a-1);break;case 2:n.lines+=s*a;break;case 0:n.points+=s*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){n.frame++,n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:t,render:n,programs:null,autoReset:!0,reset:i,update:r}}function ig(e,t){return Math.abs(t[1])-Math.abs(e[1])}function ag(e){var t={},n=new Float32Array(8);function r(i,a,o,s){var c=i.morphTargetInfluences,l=c===void 0?0:c.length,u=t[a.id];if(u===void 0){u=[];for(var h=0;h<l;h++)u[h]=[h,0];t[a.id]=u}for(var f=o.morphTargets&&a.morphAttributes.position,d=o.morphNormals&&a.morphAttributes.normal,h=0;h<l;h++){var m=u[h];m[1]!==0&&(f&&a.deleteAttribute("morphTarget"+h),d&&a.deleteAttribute("morphNormal"+h))}for(var h=0;h<l;h++){var m=u[h];m[0]=h,m[1]=c[h]}u.sort(ig);for(var g=0,h=0;h<8;h++){var m=u[h];if(m){var y=m[0],p=m[1];if(p){f&&a.setAttribute("morphTarget"+h,f[y]),d&&a.setAttribute("morphNormal"+h,d[y]),n[h]=p,g+=p;continue}}n[h]=0}var v=a.morphTargetsRelative?1:1-g;s.getUniforms().setValue(e,"morphTargetBaseInfluence",v),s.getUniforms().setValue(e,"morphTargetInfluences",n)}return{update:r}}function og(e,t,n,r){var i=new WeakMap;function a(s){var c=r.render.frame,l=s.geometry,u=t.get(s,l);return i.get(u)!==c&&(l.isGeometry&&u.updateFromObject(s),t.update(u),i.set(u,c)),s.isInstancedMesh&&n.update(s.instanceMatrix,34962),u}function o(){i=new WeakMap}return{update:a,dispose:o}}function ar(e,t,n,r,i,a,o,s,c,l){e=e!==void 0?e:[],t=t!==void 0?t:Us,o=o!==void 0?o:xr,ot.call(this,e,t,n,r,i,a,o,s,c,l),this.flipY=!1}ar.prototype=Object.create(ot.prototype),ar.prototype.constructor=ar,ar.prototype.isCubeTexture=!0,Object.defineProperty(ar.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});function oa(e,t,n,r){ot.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=_t,this.minFilter=_t,this.wrapR=Vt,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}oa.prototype=Object.create(ot.prototype),oa.prototype.constructor=oa,oa.prototype.isDataTexture2DArray=!0;function sa(e,t,n,r){ot.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=_t,this.minFilter=_t,this.wrapR=Vt,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}sa.prototype=Object.create(ot.prototype),sa.prototype.constructor=sa,sa.prototype.isDataTexture3D=!0;var Tu=new ot,sg=new oa,lg=new sa,Su=new ar,Au=[],Lu=[],Pu=new Float32Array(16),Cu=new Float32Array(9),Ru=new Float32Array(4);function ci(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=Au[i];if(a===void 0&&(a=new Float32Array(i),Au[i]=a),t!==0){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function en(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Yt(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function Ou(e,t){var n=Lu[t];n===void 0&&(n=new Int32Array(t),Lu[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function cg(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function ug(e,t){var n=this.cache;if(t.x!==void 0)(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(en(n,t))return;e.uniform2fv(this.addr,t),Yt(n,t)}}function hg(e,t){var n=this.cache;if(t.x!==void 0)(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(t.r!==void 0)(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(en(n,t))return;e.uniform3fv(this.addr,t),Yt(n,t)}}function fg(e,t){var n=this.cache;if(t.x!==void 0)(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(en(n,t))return;e.uniform4fv(this.addr,t),Yt(n,t)}}function dg(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(en(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Yt(n,t)}else{if(en(n,r))return;Ru.set(r),e.uniformMatrix2fv(this.addr,!1,Ru),Yt(n,r)}}function pg(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(en(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Yt(n,t)}else{if(en(n,r))return;Cu.set(r),e.uniformMatrix3fv(this.addr,!1,Cu),Yt(n,r)}}function vg(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(en(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Yt(n,t)}else{if(en(n,r))return;Pu.set(r),e.uniformMatrix4fv(this.addr,!1,Pu),Yt(n,r)}}function mg(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||Tu,i)}function gg(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||sg,i)}function yg(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||lg,i)}function xg(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||Su,i)}function _g(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function bg(e,t){var n=this.cache;en(n,t)||(e.uniform2iv(this.addr,t),Yt(n,t))}function wg(e,t){var n=this.cache;en(n,t)||(e.uniform3iv(this.addr,t),Yt(n,t))}function Mg(e,t){var n=this.cache;en(n,t)||(e.uniform4iv(this.addr,t),Yt(n,t))}function Eg(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Tg(e){switch(e){case 5126:return cg;case 35664:return ug;case 35665:return hg;case 35666:return fg;case 35674:return dg;case 35675:return pg;case 35676:return vg;case 5124:case 35670:return _g;case 35667:case 35671:return bg;case 35668:case 35672:return wg;case 35669:case 35673:return Mg;case 5125:return Eg;case 35678:case 36198:case 36298:case 36306:case 35682:return mg;case 35679:case 36299:case 36307:return yg;case 35680:case 36300:case 36308:case 36293:return xg;case 36289:case 36303:case 36311:case 36292:return gg}}function Sg(e,t){e.uniform1fv(this.addr,t)}function Ag(e,t){e.uniform1iv(this.addr,t)}function Lg(e,t){e.uniform2iv(this.addr,t)}function Pg(e,t){e.uniform3iv(this.addr,t)}function Cg(e,t){e.uniform4iv(this.addr,t)}function Rg(e,t){var n=ci(t,this.size,2);e.uniform2fv(this.addr,n)}function Og(e,t){var n=ci(t,this.size,3);e.uniform3fv(this.addr,n)}function Dg(e,t){var n=ci(t,this.size,4);e.uniform4fv(this.addr,n)}function Ig(e,t){var n=ci(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Ng(e,t){var n=ci(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Fg(e,t){var n=ci(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Bg(e,t,n){var r=t.length,i=Ou(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(t[a]||Tu,i[a])}function Ug(e,t,n){var r=t.length,i=Ou(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(t[a]||Su,i[a])}function zg(e){switch(e){case 5126:return Sg;case 35664:return Rg;case 35665:return Og;case 35666:return Dg;case 35674:return Ig;case 35675:return Ng;case 35676:return Fg;case 5124:case 35670:return Ag;case 35667:case 35671:return Lg;case 35668:case 35672:return Pg;case 35669:case 35673:return Cg;case 35678:case 36198:case 36298:case 36306:case 35682:return Bg;case 35680:case 36300:case 36308:case 36293:return Ug}}function Gg(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=Tg(t.type)}function Du(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=zg(t.type)}Du.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Yt(t,e)};function Iu(e){this.id=e,this.seq=[],this.map={}}Iu.prototype.setValue=function(e,t,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(e,t[o.id],n)}};var wl=/([\w\d_]+)(\])?(\[|\.)?/g;function Nu(e,t){e.seq.push(t),e.map[t.id]=t}function Hg(e,t,n){var r=e.name,i=r.length;for(wl.lastIndex=0;;){var a=wl.exec(r),o=wl.lastIndex,s=a[1],c=a[2]==="]",l=a[3];if(c&&(s=s|0),l===void 0||l==="["&&o+2===i){Nu(n,l===void 0?new Gg(s,e,t):new Du(s,e,t));break}else{var u=n.map,h=u[s];h===void 0&&(h=new Iu(s),Nu(n,h)),n=h}}}function or(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r),a=e.getUniformLocation(t,i.name);Hg(i,a,this)}}or.prototype.setValue=function(e,t,n,r){var i=this.map[t];i!==void 0&&i.setValue(e,n,r)},or.prototype.setOptional=function(e,t,n){var r=t[n];r!==void 0&&this.setValue(e,n,r)},or.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];s.needsUpdate!==!1&&o.setValue(e,s.value,r)}},or.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};function Fu(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}var Vg=0;function kg(e){for(var t=e.split(`
3064
+ }`,je={alphamap_fragment:Op,alphamap_pars_fragment:Dp,alphatest_fragment:Ip,aomap_fragment:Np,aomap_pars_fragment:Fp,begin_vertex:Bp,beginnormal_vertex:Up,bsdfs:zp,bumpmap_pars_fragment:Gp,clipping_planes_fragment:Hp,clipping_planes_pars_fragment:Vp,clipping_planes_pars_vertex:kp,clipping_planes_vertex:Wp,color_fragment:Xp,color_pars_fragment:jp,color_pars_vertex:qp,color_vertex:Yp,common:Zp,cube_uv_reflection_fragment:Jp,defaultnormal_vertex:Qp,displacementmap_pars_vertex:Kp,displacementmap_vertex:$p,emissivemap_fragment:ev,emissivemap_pars_fragment:tv,encodings_fragment:nv,encodings_pars_fragment:rv,envmap_fragment:iv,envmap_common_pars_fragment:av,envmap_pars_fragment:ov,envmap_pars_vertex:sv,envmap_physical_pars_fragment:yv,envmap_vertex:lv,fog_vertex:cv,fog_pars_vertex:uv,fog_fragment:hv,fog_pars_fragment:fv,gradientmap_pars_fragment:dv,lightmap_fragment:pv,lightmap_pars_fragment:vv,lights_lambert_vertex:mv,lights_pars_begin:gv,lights_toon_fragment:xv,lights_toon_pars_fragment:_v,lights_phong_fragment:bv,lights_phong_pars_fragment:wv,lights_physical_fragment:Mv,lights_physical_pars_fragment:Ev,lights_fragment_begin:Tv,lights_fragment_maps:Sv,lights_fragment_end:Av,logdepthbuf_fragment:Lv,logdepthbuf_pars_fragment:Pv,logdepthbuf_pars_vertex:Cv,logdepthbuf_vertex:Rv,map_fragment:Ov,map_pars_fragment:Dv,map_particle_fragment:Iv,map_particle_pars_fragment:Nv,metalnessmap_fragment:Fv,metalnessmap_pars_fragment:Bv,morphnormal_vertex:Uv,morphtarget_pars_vertex:zv,morphtarget_vertex:Gv,normal_fragment_begin:Hv,normal_fragment_maps:Vv,normalmap_pars_fragment:kv,clearcoat_normal_fragment_begin:Wv,clearcoat_normal_fragment_maps:Xv,clearcoat_pars_fragment:jv,packing:qv,premultiplied_alpha_fragment:Yv,project_vertex:Zv,dithering_fragment:Jv,dithering_pars_fragment:Qv,roughnessmap_fragment:Kv,roughnessmap_pars_fragment:$v,shadowmap_pars_fragment:em,shadowmap_pars_vertex:tm,shadowmap_vertex:nm,shadowmask_pars_fragment:rm,skinbase_vertex:im,skinning_pars_vertex:am,skinning_vertex:om,skinnormal_vertex:sm,specularmap_fragment:lm,specularmap_pars_fragment:cm,tonemapping_fragment:um,tonemapping_pars_fragment:hm,uv_pars_fragment:fm,uv_pars_vertex:dm,uv_vertex:pm,uv2_pars_fragment:vm,uv2_pars_vertex:mm,uv2_vertex:gm,worldpos_vertex:ym,background_frag:xm,background_vert:_m,cube_frag:bm,cube_vert:wm,depth_frag:Mm,depth_vert:Em,distanceRGBA_frag:Tm,distanceRGBA_vert:Sm,equirect_frag:Am,equirect_vert:Lm,linedashed_frag:Pm,linedashed_vert:Cm,meshbasic_frag:Rm,meshbasic_vert:Om,meshlambert_frag:Dm,meshlambert_vert:Im,meshmatcap_frag:Nm,meshmatcap_vert:Fm,meshtoon_frag:Bm,meshtoon_vert:Um,meshphong_frag:zm,meshphong_vert:Gm,meshphysical_frag:Hm,meshphysical_vert:Vm,normal_frag:km,normal_vert:Wm,points_frag:Xm,points_vert:jm,shadow_frag:qm,shadow_vert:Ym,sprite_frag:Zm,sprite_vert:Jm},Un={basic:{uniforms:Nt([le.common,le.specularmap,le.envmap,le.aomap,le.lightmap,le.fog]),vertexShader:je.meshbasic_vert,fragmentShader:je.meshbasic_frag},lambert:{uniforms:Nt([le.common,le.specularmap,le.envmap,le.aomap,le.lightmap,le.emissivemap,le.fog,le.lights,{emissive:{value:new de(0)}}]),vertexShader:je.meshlambert_vert,fragmentShader:je.meshlambert_frag},phong:{uniforms:Nt([le.common,le.specularmap,le.envmap,le.aomap,le.lightmap,le.emissivemap,le.bumpmap,le.normalmap,le.displacementmap,le.fog,le.lights,{emissive:{value:new de(0)},specular:{value:new de(1118481)},shininess:{value:30}}]),vertexShader:je.meshphong_vert,fragmentShader:je.meshphong_frag},standard:{uniforms:Nt([le.common,le.envmap,le.aomap,le.lightmap,le.emissivemap,le.bumpmap,le.normalmap,le.displacementmap,le.roughnessmap,le.metalnessmap,le.fog,le.lights,{emissive:{value:new de(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:je.meshphysical_vert,fragmentShader:je.meshphysical_frag},toon:{uniforms:Nt([le.common,le.specularmap,le.aomap,le.lightmap,le.emissivemap,le.bumpmap,le.normalmap,le.displacementmap,le.gradientmap,le.fog,le.lights,{emissive:{value:new de(0)},specular:{value:new de(1118481)},shininess:{value:30}}]),vertexShader:je.meshtoon_vert,fragmentShader:je.meshtoon_frag},matcap:{uniforms:Nt([le.common,le.bumpmap,le.normalmap,le.displacementmap,le.fog,{matcap:{value:null}}]),vertexShader:je.meshmatcap_vert,fragmentShader:je.meshmatcap_frag},points:{uniforms:Nt([le.points,le.fog]),vertexShader:je.points_vert,fragmentShader:je.points_frag},dashed:{uniforms:Nt([le.common,le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:je.linedashed_vert,fragmentShader:je.linedashed_frag},depth:{uniforms:Nt([le.common,le.displacementmap]),vertexShader:je.depth_vert,fragmentShader:je.depth_frag},normal:{uniforms:Nt([le.common,le.bumpmap,le.normalmap,le.displacementmap,{opacity:{value:1}}]),vertexShader:je.normal_vert,fragmentShader:je.normal_frag},sprite:{uniforms:Nt([le.sprite,le.fog]),vertexShader:je.sprite_vert,fragmentShader:je.sprite_frag},background:{uniforms:{uvTransform:{value:new Ut},t2D:{value:null}},vertexShader:je.background_vert,fragmentShader:je.background_frag},cube:{uniforms:Nt([le.envmap,{opacity:{value:1}}]),vertexShader:je.cube_vert,fragmentShader:je.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:je.equirect_vert,fragmentShader:je.equirect_frag},distanceRGBA:{uniforms:Nt([le.common,le.displacementmap,{referencePosition:{value:new E},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:je.distanceRGBA_vert,fragmentShader:je.distanceRGBA_frag},shadow:{uniforms:Nt([le.lights,le.fog,{color:{value:new de(0)},opacity:{value:1}}]),vertexShader:je.shadow_vert,fragmentShader:je.shadow_frag}};Un.physical={uniforms:Nt([Un.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new X(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new de(0)},transparency:{value:0}}]),vertexShader:je.meshphysical_vert,fragmentShader:je.meshphysical_frag};function Qm(e,t,n,r){var i=new de(0),a=0,o,s,c=null,l=0,u=null;function h(d,m,g,y){var p=m.background,v=e.xr,_=v.getSession&&v.getSession();if(_&&_.environmentBlendMode==="additive"&&(p=null),p===null?f(i,a):p&&p.isColor&&(f(p,1),y=!0),(e.autoClear||y)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),p&&(p.isCubeTexture||p.isWebGLCubeRenderTarget||p.mapping===ki)){s===void 0&&(s=new ut(new Ao(1,1,1),new Wt({type:"BackgroundCubeMaterial",uniforms:ri(Un.cube.uniforms),vertexShader:Un.cube.vertexShader,fragmentShader:Un.cube.fragmentShader,side:At,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(b,T,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(s));var x=p.isWebGLCubeRenderTarget?p.texture:p;s.material.uniforms.envMap.value=x,s.material.uniforms.flipEnvMap.value=x.isCubeTexture?-1:1,(c!==p||l!==x.version||u!==e.toneMapping)&&(s.material.needsUpdate=!0,c=p,l=x.version,u=e.toneMapping),d.unshift(s,s.geometry,s.material,0,0,null)}else p&&p.isTexture&&(o===void 0&&(o=new ut(new li(2,2),new Wt({type:"BackgroundMaterial",uniforms:ri(Un.background.uniforms),vertexShader:Un.background.vertexShader,fragmentShader:Un.background.fragmentShader,side:Gi,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(o)),o.material.uniforms.t2D.value=p,p.matrixAutoUpdate===!0&&p.updateMatrix(),o.material.uniforms.uvTransform.value.copy(p.matrix),(c!==p||l!==p.version||u!==e.toneMapping)&&(o.material.needsUpdate=!0,c=p,l=p.version,u=e.toneMapping),d.unshift(o,o.geometry,o.material,0,0,null))}function f(d,m){t.buffers.color.setClear(d.r,d.g,d.b,m,r)}return{getClearColor:function(){return i},setClearColor:function(d,m){i.set(d),a=m!==void 0?m:1,f(i,a)},getClearAlpha:function(){return a},setClearAlpha:function(d){a=d,f(i,a)},render:h}}function Km(e,t,n,r){var i=r.isWebGL2,a;function o(l){a=l}function s(l,u){e.drawArrays(a,l,u),n.update(u,a)}function c(l,u,h,f){if(f!==0){var d,m;if(i)d=e,m="drawArraysInstanced";else if(d=t.get("ANGLE_instanced_arrays"),m="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[m](a,u,h,f),n.update(h,a,f)}}this.setMode=o,this.render=s,this.renderInstances=c}function $m(e,t,n){var r;function i(){if(r!==void 0)return r;var T=t.get("EXT_texture_filter_anisotropic");return T!==null?r=e.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT):r=0,r}function a(T){if(T==="highp"){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";T="mediump"}return T==="mediump"&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o=typeof WebGL2RenderingContext!="undefined"&&e instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&e instanceof WebGL2ComputeRenderingContext,s=n.precision!==void 0?n.precision:"highp",c=a(s);c!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",c,"instead."),s=c);var l=n.logarithmicDepthBuffer===!0,u=e.getParameter(34930),h=e.getParameter(35660),f=e.getParameter(3379),d=e.getParameter(34076),m=e.getParameter(34921),g=e.getParameter(36347),y=e.getParameter(36348),p=e.getParameter(36349),v=h>0,_=o||!!t.get("OES_texture_float"),x=v&&_,b=o?e.getParameter(36183):0;return{isWebGL2:o,getMaxAnisotropy:i,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:h,maxTextureSize:f,maxCubemapSize:d,maxAttributes:m,maxVertexUniforms:g,maxVaryings:y,maxFragmentUniforms:p,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:x,maxSamples:b}}function eg(){var e=this,t=null,n=0,r=!1,i=!1,a=new yn,o=new Ut,s={value:null,needsUpdate:!1};this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(u,h,f){var d=u.length!==0||h||n!==0||r;return r=h,t=l(u,f,0),n=u.length,d},this.beginShadows=function(){i=!0,l(null)},this.endShadows=function(){i=!1,c()},this.setState=function(u,h,f,d,m,g){if(!r||u===null||u.length===0||i&&!f)i?l(null):c();else{var y=i?0:n,p=y*4,v=m.clippingState||null;s.value=v,v=l(u,d,p,g);for(var _=0;_!==p;++_)v[_]=t[_];m.clippingState=v,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=y}};function c(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function l(u,h,f,d){var m=u!==null?u.length:0,g=null;if(m!==0){if(g=s.value,d!==!0||g===null){var y=f+m*4,p=h.matrixWorldInverse;o.getNormalMatrix(p),(g===null||g.length<y)&&(g=new Float32Array(y));for(var v=0,_=f;v!==m;++v,_+=4)a.copy(u[v]).applyMatrix4(p,o),a.normal.toArray(g,_),g[_+3]=a.constant}s.value=g,s.needsUpdate=!0}return e.numPlanes=m,e.numIntersection=0,g}}function tg(e){var t={};return{get:function(n){if(t[n]!==void 0)return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=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":r=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":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return r===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=r,r}}}function ng(e,t,n){var r=new WeakMap,i=new WeakMap;function a(u){var h=u.target,f=r.get(h);f.index!==null&&t.remove(f.index);for(var d in f.attributes)t.remove(f.attributes[d]);h.removeEventListener("dispose",a),r.delete(h);var m=i.get(f);m&&(t.remove(m),i.delete(f)),n.memory.geometries--}function o(u,h){var f=r.get(h);return f||(h.addEventListener("dispose",a),h.isBufferGeometry?f=h:h.isGeometry&&(h._bufferGeometry===void 0&&(h._bufferGeometry=new ve().setFromObject(u)),f=h._bufferGeometry),r.set(h,f),n.memory.geometries++,f)}function s(u){var h=u.index,f=u.attributes;h!==null&&t.update(h,34963);for(var d in f)t.update(f[d],34962);var m=u.morphAttributes;for(var d in m)for(var g=m[d],y=0,p=g.length;y<p;y++)t.update(g[y],34962)}function c(u){var h=[],f=u.index,d=u.attributes.position,m=0;if(f!==null){var g=f.array;m=f.version;for(var y=0,p=g.length;y<p;y+=3){var v=g[y+0],_=g[y+1],x=g[y+2];h.push(v,_,_,x,x,v)}}else{var g=d.array;m=d.version;for(var y=0,p=g.length/3-1;y<p;y+=3){var v=y+0,_=y+1,x=y+2;h.push(v,_,_,x,x,v)}}var b=new(wu(h)>65535?ea:$i)(h,1);b.version=m,t.update(b,34963);var T=i.get(u);T&&t.remove(T),i.set(u,b)}function l(u){var h=i.get(u);if(h){var f=u.index;f!==null&&h.version<f.version&&c(u)}else c(u);return i.get(u)}return{get:o,update:s,getWireframeAttribute:l}}function rg(e,t,n,r){var i=r.isWebGL2,a;function o(f){a=f}var s,c;function l(f){s=f.type,c=f.bytesPerElement}function u(f,d){e.drawElements(a,d,s,f*c),n.update(d,a)}function h(f,d,m,g){if(g!==0){var y,p;if(i)y=e,p="drawElementsInstanced";else if(y=t.get("ANGLE_instanced_arrays"),p="drawElementsInstancedANGLE",y===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}y[p](a,m,s,d*c,g),n.update(m,a,g)}}this.setMode=o,this.setIndex=l,this.render=u,this.renderInstances=h}function ig(e){var t={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(a,o,s){switch(s=s||1,n.calls++,o){case 4:n.triangles+=s*(a/3);break;case 1:n.lines+=s*(a/2);break;case 3:n.lines+=s*(a-1);break;case 2:n.lines+=s*a;break;case 0:n.points+=s*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){n.frame++,n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:t,render:n,programs:null,autoReset:!0,reset:i,update:r}}function ag(e,t){return Math.abs(t[1])-Math.abs(e[1])}function og(e){var t={},n=new Float32Array(8);function r(i,a,o,s){var c=i.morphTargetInfluences,l=c===void 0?0:c.length,u=t[a.id];if(u===void 0){u=[];for(var h=0;h<l;h++)u[h]=[h,0];t[a.id]=u}for(var f=o.morphTargets&&a.morphAttributes.position,d=o.morphNormals&&a.morphAttributes.normal,h=0;h<l;h++){var m=u[h];m[1]!==0&&(f&&a.deleteAttribute("morphTarget"+h),d&&a.deleteAttribute("morphNormal"+h))}for(var h=0;h<l;h++){var m=u[h];m[0]=h,m[1]=c[h]}u.sort(ag);for(var g=0,h=0;h<8;h++){var m=u[h];if(m){var y=m[0],p=m[1];if(p){f&&a.setAttribute("morphTarget"+h,f[y]),d&&a.setAttribute("morphNormal"+h,d[y]),n[h]=p,g+=p;continue}}n[h]=0}var v=a.morphTargetsRelative?1:1-g;s.getUniforms().setValue(e,"morphTargetBaseInfluence",v),s.getUniforms().setValue(e,"morphTargetInfluences",n)}return{update:r}}function sg(e,t,n,r){var i=new WeakMap;function a(s){var c=r.render.frame,l=s.geometry,u=t.get(s,l);return i.get(u)!==c&&(l.isGeometry&&u.updateFromObject(s),t.update(u),i.set(u,c)),s.isInstancedMesh&&n.update(s.instanceMatrix,34962),u}function o(){i=new WeakMap}return{update:a,dispose:o}}function ar(e,t,n,r,i,a,o,s,c,l){e=e!==void 0?e:[],t=t!==void 0?t:zs,o=o!==void 0?o:xr,ot.call(this,e,t,n,r,i,a,o,s,c,l),this.flipY=!1}ar.prototype=Object.create(ot.prototype),ar.prototype.constructor=ar,ar.prototype.isCubeTexture=!0,Object.defineProperty(ar.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});function oa(e,t,n,r){ot.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=_t,this.minFilter=_t,this.wrapR=Vt,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}oa.prototype=Object.create(ot.prototype),oa.prototype.constructor=oa,oa.prototype.isDataTexture2DArray=!0;function sa(e,t,n,r){ot.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=_t,this.minFilter=_t,this.wrapR=Vt,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}sa.prototype=Object.create(ot.prototype),sa.prototype.constructor=sa,sa.prototype.isDataTexture3D=!0;var Su=new ot,lg=new oa,cg=new sa,Au=new ar,Lu=[],Pu=[],Cu=new Float32Array(16),Ru=new Float32Array(9),Ou=new Float32Array(4);function ci(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=Lu[i];if(a===void 0&&(a=new Float32Array(i),Lu[i]=a),t!==0){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function en(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Yt(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function Du(e,t){var n=Pu[t];n===void 0&&(n=new Int32Array(t),Pu[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function ug(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function hg(e,t){var n=this.cache;if(t.x!==void 0)(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(en(n,t))return;e.uniform2fv(this.addr,t),Yt(n,t)}}function fg(e,t){var n=this.cache;if(t.x!==void 0)(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(t.r!==void 0)(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(en(n,t))return;e.uniform3fv(this.addr,t),Yt(n,t)}}function dg(e,t){var n=this.cache;if(t.x!==void 0)(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(en(n,t))return;e.uniform4fv(this.addr,t),Yt(n,t)}}function pg(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(en(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Yt(n,t)}else{if(en(n,r))return;Ou.set(r),e.uniformMatrix2fv(this.addr,!1,Ou),Yt(n,r)}}function vg(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(en(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Yt(n,t)}else{if(en(n,r))return;Ru.set(r),e.uniformMatrix3fv(this.addr,!1,Ru),Yt(n,r)}}function mg(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(en(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Yt(n,t)}else{if(en(n,r))return;Cu.set(r),e.uniformMatrix4fv(this.addr,!1,Cu),Yt(n,r)}}function gg(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||Su,i)}function yg(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||lg,i)}function xg(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||cg,i)}function _g(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||Au,i)}function bg(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function wg(e,t){var n=this.cache;en(n,t)||(e.uniform2iv(this.addr,t),Yt(n,t))}function Mg(e,t){var n=this.cache;en(n,t)||(e.uniform3iv(this.addr,t),Yt(n,t))}function Eg(e,t){var n=this.cache;en(n,t)||(e.uniform4iv(this.addr,t),Yt(n,t))}function Tg(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Sg(e){switch(e){case 5126:return ug;case 35664:return hg;case 35665:return fg;case 35666:return dg;case 35674:return pg;case 35675:return vg;case 35676:return mg;case 5124:case 35670:return bg;case 35667:case 35671:return wg;case 35668:case 35672:return Mg;case 35669:case 35673:return Eg;case 5125:return Tg;case 35678:case 36198:case 36298:case 36306:case 35682:return gg;case 35679:case 36299:case 36307:return xg;case 35680:case 36300:case 36308:case 36293:return _g;case 36289:case 36303:case 36311:case 36292:return yg}}function Ag(e,t){e.uniform1fv(this.addr,t)}function Lg(e,t){e.uniform1iv(this.addr,t)}function Pg(e,t){e.uniform2iv(this.addr,t)}function Cg(e,t){e.uniform3iv(this.addr,t)}function Rg(e,t){e.uniform4iv(this.addr,t)}function Og(e,t){var n=ci(t,this.size,2);e.uniform2fv(this.addr,n)}function Dg(e,t){var n=ci(t,this.size,3);e.uniform3fv(this.addr,n)}function Ig(e,t){var n=ci(t,this.size,4);e.uniform4fv(this.addr,n)}function Ng(e,t){var n=ci(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Fg(e,t){var n=ci(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Bg(e,t){var n=ci(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Ug(e,t,n){var r=t.length,i=Du(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(t[a]||Su,i[a])}function zg(e,t,n){var r=t.length,i=Du(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(t[a]||Au,i[a])}function Gg(e){switch(e){case 5126:return Ag;case 35664:return Og;case 35665:return Dg;case 35666:return Ig;case 35674:return Ng;case 35675:return Fg;case 35676:return Bg;case 5124:case 35670:return Lg;case 35667:case 35671:return Pg;case 35668:case 35672:return Cg;case 35669:case 35673:return Rg;case 35678:case 36198:case 36298:case 36306:case 35682:return Ug;case 35680:case 36300:case 36308:case 36293:return zg}}function Hg(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=Sg(t.type)}function Iu(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=Gg(t.type)}Iu.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Yt(t,e)};function Nu(e){this.id=e,this.seq=[],this.map={}}Nu.prototype.setValue=function(e,t,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(e,t[o.id],n)}};var Ml=/([\w\d_]+)(\])?(\[|\.)?/g;function Fu(e,t){e.seq.push(t),e.map[t.id]=t}function Vg(e,t,n){var r=e.name,i=r.length;for(Ml.lastIndex=0;;){var a=Ml.exec(r),o=Ml.lastIndex,s=a[1],c=a[2]==="]",l=a[3];if(c&&(s=s|0),l===void 0||l==="["&&o+2===i){Fu(n,l===void 0?new Hg(s,e,t):new Iu(s,e,t));break}else{var u=n.map,h=u[s];h===void 0&&(h=new Nu(s),Fu(n,h)),n=h}}}function or(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r),a=e.getUniformLocation(t,i.name);Vg(i,a,this)}}or.prototype.setValue=function(e,t,n,r){var i=this.map[t];i!==void 0&&i.setValue(e,n,r)},or.prototype.setOptional=function(e,t,n){var r=t[n];r!==void 0&&this.setValue(e,n,r)},or.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];s.needsUpdate!==!1&&o.setValue(e,s.value,r)}},or.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};function Bu(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}var kg=0;function Wg(e){for(var t=e.split(`
3065
3065
  `),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join(`
3066
- `)}function Bu(e){switch(e){case kt:return["Linear","( value )"];case oo:return["sRGB","( value )"];case qs:return["RGBE","( value )"];case su:return["RGBM","( value, 7.0 )"];case lu:return["RGBM","( value, 16.0 )"];case cu:return["RGBD","( value, 256.0 )"];case js:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case sp:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+e)}}function Uu(e,t,n){var r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();if(r&&i==="")return"";var a=e.getShaderSource(t);return"THREE.WebGLShader: gl.getShaderInfoLog() "+n+`
3067
- `+i+kg(a)}function la(e,t){var n=Bu(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Wg(e,t){var n=Bu(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Xg(e,t){var n;switch(t){case jc:n="Linear";break;case sd:n="Reinhard";break;case ld:n="Uncharted2";break;case cd:n="OptimizedCineon";break;case ud:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function jg(e){var t=[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||e.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""];return t.filter(ca).join(`
3068
- `)}function qg(e){var t=[];for(var n in e){var r=e[n];r!==!1&&t.push("#define "+n+" "+r)}return t.join(`
3069
- `)}function Yg(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var a=e.getActiveAttrib(t,i),o=a.name;n[o]=e.getAttribLocation(t,o)}return n}function ca(e){return e!==""}function zu(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 Gu(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var Zg=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ml(e){return e.replace(Zg,Jg)}function Jg(e,t){var n=je[t];if(n===void 0)throw new Error("Can not resolve #include <"+t+">");return Ml(n)}var Qg=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Kg=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function Hu(e){return e.replace(Kg,Vu).replace(Qg,$g)}function $g(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Vu(e,t,n,r)}function Vu(e,t,n,r){for(var i="",a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function ku(e){var t="precision "+e.precision+` float;
3066
+ `)}function Uu(e){switch(e){case kt:return["Linear","( value )"];case uo:return["sRGB","( value )"];case Ys:return["RGBE","( value )"];case lu:return["RGBM","( value, 7.0 )"];case cu:return["RGBM","( value, 16.0 )"];case uu:return["RGBD","( value, 256.0 )"];case qs:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case lp:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+e)}}function zu(e,t,n){var r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();if(r&&i==="")return"";var a=e.getShaderSource(t);return"THREE.WebGLShader: gl.getShaderInfoLog() "+n+`
3067
+ `+i+Wg(a)}function la(e,t){var n=Uu(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Xg(e,t){var n=Uu(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function jg(e,t){var n;switch(t){case qc:n="Linear";break;case ld:n="Reinhard";break;case cd:n="Uncharted2";break;case ud:n="OptimizedCineon";break;case hd:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function qg(e){var t=[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||e.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""];return t.filter(ca).join(`
3068
+ `)}function Yg(e){var t=[];for(var n in e){var r=e[n];r!==!1&&t.push("#define "+n+" "+r)}return t.join(`
3069
+ `)}function Zg(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var a=e.getActiveAttrib(t,i),o=a.name;n[o]=e.getAttribLocation(t,o)}return n}function ca(e){return e!==""}function Gu(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 Hu(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var Jg=/^[ \t]*#include +<([\w\d./]+)>/gm;function El(e){return e.replace(Jg,Qg)}function Qg(e,t){var n=je[t];if(n===void 0)throw new Error("Can not resolve #include <"+t+">");return El(n)}var Kg=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,$g=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function Vu(e){return e.replace($g,ku).replace(Kg,ey)}function ey(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ku(e,t,n,r)}function ku(e,t,n,r){for(var i="",a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function Wu(e){var t="precision "+e.precision+` float;
3070
3070
  precision `+e.precision+" int;";return e.precision==="highp"?t+=`
3071
3071
  #define HIGH_PRECISION`:e.precision==="mediump"?t+=`
3072
3072
  #define MEDIUM_PRECISION`:e.precision==="lowp"&&(t+=`
3073
- #define LOW_PRECISION`),t}function ey(e){var t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===Bc?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===zf?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===zi&&(t="SHADOWMAP_TYPE_VSM"),t}function ty(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case Us:case zs:t="ENVMAP_TYPE_CUBE";break;case ki:case Hs:t="ENVMAP_TYPE_CUBE_UV";break;case qc:case Gs:t="ENVMAP_TYPE_EQUIREC";break;case Yc:t="ENVMAP_TYPE_SPHERE";break}return t}function ny(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case zs:case Gs:t="ENVMAP_MODE_REFRACTION";break}return t}function ry(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case Ja:t="ENVMAP_BLENDING_MULTIPLY";break;case ad:t="ENVMAP_BLENDING_MIX";break;case od:t="ENVMAP_BLENDING_ADD";break}return t}function iy(e,t,n){var r=e.getContext(),i=n.defines,a=n.vertexShader,o=n.fragmentShader,s=ey(n),c=ty(n),l=ny(n),u=ry(n),h=e.gammaFactor>0?e.gammaFactor:1,f=n.isWebGL2?"":jg(n),d=qg(i),m=r.createProgram(),g,y;if(n.isRawShaderMaterial?(g=[d].filter(ca).join(`
3073
+ #define LOW_PRECISION`),t}function ty(e){var t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===Uc?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===Gf?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===zi&&(t="SHADOWMAP_TYPE_VSM"),t}function ny(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case zs:case Gs:t="ENVMAP_TYPE_CUBE";break;case ki:case Vs:t="ENVMAP_TYPE_CUBE_UV";break;case Yc:case Hs:t="ENVMAP_TYPE_EQUIREC";break;case Zc:t="ENVMAP_TYPE_SPHERE";break}return t}function ry(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case Gs:case Hs:t="ENVMAP_MODE_REFRACTION";break}return t}function iy(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case eo:t="ENVMAP_BLENDING_MULTIPLY";break;case od:t="ENVMAP_BLENDING_MIX";break;case sd:t="ENVMAP_BLENDING_ADD";break}return t}function ay(e,t,n){var r=e.getContext(),i=n.defines,a=n.vertexShader,o=n.fragmentShader,s=ty(n),c=ny(n),l=ry(n),u=iy(n),h=e.gammaFactor>0?e.gammaFactor:1,f=n.isWebGL2?"":qg(n),d=Yg(i),m=r.createProgram(),g,y;if(n.isRawShaderMaterial?(g=[d].filter(ca).join(`
3074
3074
  `),g.length>0&&(g+=`
3075
3075
  `),y=[f,d].filter(ca).join(`
3076
3076
  `),y.length>0&&(y+=`
3077
- `)):(g=[ku(n),"#define SHADER_NAME "+n.shaderName,d,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+h,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+s:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#ifdef USE_COLOR"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
3077
+ `)):(g=[Wu(n),"#define SHADER_NAME "+n.shaderName,d,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+h,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+s:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#ifdef USE_COLOR"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
3078
3078
  `].filter(ca).join(`
3079
- `),y=[f,ku(n),"#define SHADER_NAME "+n.shaderName,d,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+h,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+l:"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+s:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Vi?"#define TONE_MAPPING":"",n.toneMapping!==Vi?je.tonemapping_pars_fragment:"",n.toneMapping!==Vi?Xg("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?je.encodings_pars_fragment:"",n.mapEncoding?la("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?la("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?la("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?la("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?la("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?Wg("linearToOutputTexel",n.outputEncoding):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
3079
+ `),y=[f,Wu(n),"#define SHADER_NAME "+n.shaderName,d,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+h,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+l:"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+s:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Vi?"#define TONE_MAPPING":"",n.toneMapping!==Vi?je.tonemapping_pars_fragment:"",n.toneMapping!==Vi?jg("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?je.encodings_pars_fragment:"",n.mapEncoding?la("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?la("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?la("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?la("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?la("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?Xg("linearToOutputTexel",n.outputEncoding):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
3080
3080
  `].filter(ca).join(`
3081
- `)),a=Ml(a),a=zu(a,n),a=Gu(a,n),o=Ml(o),o=zu(o,n),o=Gu(o,n),a=Hu(a),o=Hu(o),n.isWebGL2&&!n.isRawShaderMaterial){var p=!1,v=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&a.match(v)!==null&&o.match(v)!==null&&(p=!0,a=a.replace(v,""),o=o.replace(v,"")),g=[`#version 300 es
3081
+ `)),a=El(a),a=Gu(a,n),a=Hu(a,n),o=El(o),o=Gu(o,n),o=Hu(o,n),a=Vu(a),o=Vu(o),n.isWebGL2&&!n.isRawShaderMaterial){var p=!1,v=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&a.match(v)!==null&&o.match(v)!==null&&(p=!0,a=a.replace(v,""),o=o.replace(v,"")),g=[`#version 300 es
3082
3082
  `,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3083
3083
  `)+`
3084
3084
  `+g,y=[`#version 300 es
3085
3085
  `,"#define varying in",p?"":"out highp vec4 pc_fragColor;",p?"":"#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(`
3086
3086
  `)+`
3087
- `+y}var _=g+a,x=y+o,b=Fu(r,35633,_),T=Fu(r,35632,x);if(r.attachShader(m,b),r.attachShader(m,T),n.index0AttributeName!==void 0?r.bindAttribLocation(m,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),e.debug.checkShaderErrors){var C=r.getProgramInfoLog(m).trim(),N=r.getShaderInfoLog(b).trim(),O=r.getShaderInfoLog(T).trim(),J=!0,F=!0;if(r.getProgramParameter(m,35714)===!1){J=!1;var B=Uu(r,b,"vertex"),V=Uu(r,T,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(m,35715),"gl.getProgramInfoLog",C,B,V)}else C!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",C):(N===""||O==="")&&(F=!1);F&&(this.diagnostics={runnable:J,programLog:C,vertexShader:{log:N,prefix:g},fragmentShader:{log:O,prefix:y}})}r.deleteShader(b),r.deleteShader(T);var Y;this.getUniforms=function(){return Y===void 0&&(Y=new or(r,m)),Y};var D;return this.getAttributes=function(){return D===void 0&&(D=Yg(r,m)),D},this.destroy=function(){r.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=Vg++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=b,this.fragmentShader=T,this}function ay(e,t,n){var r=[],i=n.isWebGL2,a=n.logarithmicDepthBuffer,o=n.floatVertexTextures,s=n.precision,c=n.maxVertexUniforms,l=n.vertexTextures,u={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},h=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","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(g,y){var p;if(y){var v=Un[y];p={name:g.type,uniforms:Ap.clone(v.uniforms),vertexShader:v.vertexShader,fragmentShader:v.fragmentShader}}else p={name:g.type,uniforms:g.uniforms,vertexShader:g.vertexShader,fragmentShader:g.fragmentShader};return p}function d(g){var y=g.skeleton,p=y.bones;if(o)return 1024;var v=c,_=Math.floor((v-20)/4),x=Math.min(_,p.length);return x<p.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+p.length+" bones. This GPU supports "+x+"."),0):x}function m(g){var y;return g?g.isTexture?y=g.encoding:g.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),y=g.texture.encoding):y=kt,y}this.getParameters=function(g,y,p,v,_,x,b){var T=v.fog,C=g.isMeshStandardMaterial?v.environment:null,N=g.envMap||C,O=u[g.type],J=b.isSkinnedMesh?d(b):0;g.precision!==null&&(s=n.getMaxPrecision(g.precision),s!==g.precision&&console.warn("THREE.WebGLProgram.getParameters:",g.precision,"not supported, using",s,"instead."));var F=f(g,O);g.onBeforeCompile(F,e);var B=e.getRenderTarget(),V={isWebGL2:i,shaderID:O,shaderName:F.name,uniforms:F.uniforms,vertexShader:F.vertexShader,fragmentShader:F.fragmentShader,defines:g.defines,isRawShaderMaterial:g.isRawShaderMaterial,isShaderMaterial:g.isShaderMaterial,precision:s,instancing:b.isInstancedMesh===!0,supportsVertexTextures:l,outputEncoding:B!==null?m(B.texture):e.outputEncoding,map:!!g.map,mapEncoding:m(g.map),matcap:!!g.matcap,matcapEncoding:m(g.matcap),envMap:!!N,envMapMode:N&&N.mapping,envMapEncoding:m(N),envMapCubeUV:!!N&&(N.mapping===ki||N.mapping===Hs),lightMap:!!g.lightMap,lightMapEncoding:m(g.lightMap),aoMap:!!g.aoMap,emissiveMap:!!g.emissiveMap,emissiveMapEncoding:m(g.emissiveMap),bumpMap:!!g.bumpMap,normalMap:!!g.normalMap,objectSpaceNormalMap:g.normalMapType===up,tangentSpaceNormalMap:g.normalMapType===Vr,clearcoatMap:!!g.clearcoatMap,clearcoatRoughnessMap:!!g.clearcoatRoughnessMap,clearcoatNormalMap:!!g.clearcoatNormalMap,displacementMap:!!g.displacementMap,roughnessMap:!!g.roughnessMap,metalnessMap:!!g.metalnessMap,specularMap:!!g.specularMap,alphaMap:!!g.alphaMap,gradientMap:!!g.gradientMap,sheen:!!g.sheen,combine:g.combine,vertexTangents:g.normalMap&&g.vertexTangents,vertexColors:g.vertexColors,vertexUvs:!!g.map||!!g.bumpMap||!!g.normalMap||!!g.specularMap||!!g.alphaMap||!!g.emissiveMap||!!g.roughnessMap||!!g.metalnessMap||!!g.clearcoatMap||!!g.clearcoatRoughnessMap||!!g.clearcoatNormalMap||!!g.displacementMap,uvsVertexOnly:!(g.map||g.bumpMap||g.normalMap||g.specularMap||g.alphaMap||g.emissiveMap||g.roughnessMap||g.metalnessMap||g.clearcoatNormalMap)&&!!g.displacementMap,fog:!!T,useFog:g.fog,fogExp2:T&&T.isFogExp2,flatShading:g.flatShading,sizeAttenuation:g.sizeAttenuation,logarithmicDepthBuffer:a,skinning:g.skinning&&J>0,maxBones:J,useVertexTexture:o,morphTargets:g.morphTargets,morphNormals:g.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:y.directional.length,numPointLights:y.point.length,numSpotLights:y.spot.length,numRectAreaLights:y.rectArea.length,numHemiLights:y.hemi.length,numDirLightShadows:y.directionalShadowMap.length,numPointLightShadows:y.pointShadowMap.length,numSpotLightShadows:y.spotShadowMap.length,numClippingPlanes:_,numClipIntersection:x,dithering:g.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:g.toneMapped?e.toneMapping:Vi,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:g.premultipliedAlpha,alphaTest:g.alphaTest,doubleSided:g.side===Za,flipSided:g.side===At,depthPacking:g.depthPacking!==void 0?g.depthPacking:!1,index0AttributeName:g.index0AttributeName,extensionDerivatives:g.extensions&&g.extensions.derivatives,extensionFragDepth:g.extensions&&g.extensions.fragDepth,extensionDrawBuffers:g.extensions&&g.extensions.drawBuffers,extensionShaderTextureLOD:g.extensions&&g.extensions.shaderTextureLOD,rendererExtensionFragDepth:i||t.get("EXT_frag_depth")!==null,rendererExtensionDrawBuffers:i||t.get("WEBGL_draw_buffers")!==null,rendererExtensionShaderTextureLod:i||t.get("EXT_shader_texture_lod")!==null,onBeforeCompile:g.onBeforeCompile};return V},this.getProgramCacheKey=function(g){var y=[];if(g.shaderID?y.push(g.shaderID):(y.push(g.fragmentShader),y.push(g.vertexShader)),g.defines!==void 0)for(var p in g.defines)y.push(p),y.push(g.defines[p]);if(g.isRawShaderMaterial===void 0){for(var v=0;v<h.length;v++)y.push(g[h[v]]);y.push(e.outputEncoding),y.push(e.gammaFactor)}return y.push(g.onBeforeCompile.toString()),y.join()},this.acquireProgram=function(g,y){for(var p,v=0,_=r.length;v<_;v++){var x=r[v];if(x.cacheKey===y){p=x,++p.usedTimes;break}}return p===void 0&&(p=new iy(e,y,g),r.push(p)),p},this.releaseProgram=function(g){if(--g.usedTimes===0){var y=r.indexOf(g);r[y]=r[r.length-1],r.pop(),g.destroy()}},this.programs=r}function oy(){var e=new WeakMap;function t(a){var o=e.get(a);return o===void 0&&(o={},e.set(a,o)),o}function n(a){e.delete(a)}function r(a,o,s){e.get(a)[o]=s}function i(){e=new WeakMap}return{get:t,remove:n,update:r,dispose:i}}function sy(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 ly(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 Wu(){var e=[],t=0,n=[],r=[],i={id:-1};function a(){t=0,n.length=0,r.length=0}function o(h,f,d,m,g,y){var p=e[t];return p===void 0?(p={id:h.id,object:h,geometry:f,material:d,program:d.program||i,groupOrder:m,renderOrder:h.renderOrder,z:g,group:y},e[t]=p):(p.id=h.id,p.object=h,p.geometry=f,p.material=d,p.program=d.program||i,p.groupOrder=m,p.renderOrder=h.renderOrder,p.z=g,p.group=y),t++,p}function s(h,f,d,m,g,y){var p=o(h,f,d,m,g,y);(d.transparent===!0?r:n).push(p)}function c(h,f,d,m,g,y){var p=o(h,f,d,m,g,y);(d.transparent===!0?r:n).unshift(p)}function l(h,f){n.length>1&&n.sort(h||sy),r.length>1&&r.sort(f||ly)}function u(){for(var h=t,f=e.length;h<f;h++){var d=e[h];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.program=null,d.group=null}}return{opaque:n,transparent:r,init:a,push:s,unshift:c,finish:u,sort:l}}function cy(){var e=new WeakMap;function t(i){var a=i.target;a.removeEventListener("dispose",t),e.delete(a)}function n(i,a){var o=e.get(i),s;return o===void 0?(s=new Wu,e.set(i,new WeakMap),e.get(i).set(a,s),i.addEventListener("dispose",t)):(s=o.get(a),s===void 0&&(s=new Wu,o.set(a,s))),s}function r(){e=new WeakMap}return{get:n,dispose:r}}function uy(){var e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new E,color:new de};break;case"SpotLight":n={position:new E,direction:new E,color:new de,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new E,color:new de,distance:0,decay:0};break;case"HemisphereLight":n={direction:new E,skyColor:new de,groundColor:new de};break;case"RectAreaLight":n={color:new de,position:new E,halfWidth:new E,halfHeight:new E};break}return e[t.id]=n,n}}}function hy(){var e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];var n;switch(t.type){case"DirectionalLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new X};break;case"SpotLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new X};break;case"PointLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new X,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}var fy=0;function dy(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function py(){for(var e=new uy,t=hy(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},r=0;r<9;r++)n.probe.push(new E);var i=new E,a=new We,o=new We;function s(c,l,u){for(var h=0,f=0,d=0,m=0;m<9;m++)n.probe[m].set(0,0,0);var g=0,y=0,p=0,v=0,_=0,x=0,b=0,T=0,C=u.matrixWorldInverse;c.sort(dy);for(var m=0,N=c.length;m<N;m++){var O=c[m],J=O.color,F=O.intensity,B=O.distance,V=O.shadow&&O.shadow.map?O.shadow.map.texture:null;if(O.isAmbientLight)h+=J.r*F,f+=J.g*F,d+=J.b*F;else if(O.isLightProbe)for(var Y=0;Y<9;Y++)n.probe[Y].addScaledVector(O.sh.coefficients[Y],F);else if(O.isDirectionalLight){var D=e.get(O);if(D.color.copy(O.color).multiplyScalar(O.intensity),D.direction.setFromMatrixPosition(O.matrixWorld),i.setFromMatrixPosition(O.target.matrixWorld),D.direction.sub(i),D.direction.transformDirection(C),O.castShadow){var z=O.shadow,k=t.get(O);k.shadowBias=z.bias,k.shadowRadius=z.radius,k.shadowMapSize=z.mapSize,n.directionalShadow[g]=k,n.directionalShadowMap[g]=V,n.directionalShadowMatrix[g]=O.shadow.matrix,x++}n.directional[g]=D,g++}else if(O.isSpotLight){var D=e.get(O);if(D.position.setFromMatrixPosition(O.matrixWorld),D.position.applyMatrix4(C),D.color.copy(J).multiplyScalar(F),D.distance=B,D.direction.setFromMatrixPosition(O.matrixWorld),i.setFromMatrixPosition(O.target.matrixWorld),D.direction.sub(i),D.direction.transformDirection(C),D.coneCos=Math.cos(O.angle),D.penumbraCos=Math.cos(O.angle*(1-O.penumbra)),D.decay=O.decay,O.castShadow){var z=O.shadow,k=t.get(O);k.shadowBias=z.bias,k.shadowRadius=z.radius,k.shadowMapSize=z.mapSize,n.spotShadow[p]=k,n.spotShadowMap[p]=V,n.spotShadowMatrix[p]=O.shadow.matrix,T++}n.spot[p]=D,p++}else if(O.isRectAreaLight){var D=e.get(O);D.color.copy(J).multiplyScalar(F),D.position.setFromMatrixPosition(O.matrixWorld),D.position.applyMatrix4(C),o.identity(),a.copy(O.matrixWorld),a.premultiply(C),o.extractRotation(a),D.halfWidth.set(O.width*.5,0,0),D.halfHeight.set(0,O.height*.5,0),D.halfWidth.applyMatrix4(o),D.halfHeight.applyMatrix4(o),n.rectArea[v]=D,v++}else if(O.isPointLight){var D=e.get(O);if(D.position.setFromMatrixPosition(O.matrixWorld),D.position.applyMatrix4(C),D.color.copy(O.color).multiplyScalar(O.intensity),D.distance=O.distance,D.decay=O.decay,O.castShadow){var z=O.shadow,k=t.get(O);k.shadowBias=z.bias,k.shadowRadius=z.radius,k.shadowMapSize=z.mapSize,k.shadowCameraNear=z.camera.near,k.shadowCameraFar=z.camera.far,n.pointShadow[y]=k,n.pointShadowMap[y]=V,n.pointShadowMatrix[y]=O.shadow.matrix,b++}n.point[y]=D,y++}else if(O.isHemisphereLight){var D=e.get(O);D.direction.setFromMatrixPosition(O.matrixWorld),D.direction.transformDirection(C),D.direction.normalize(),D.skyColor.copy(O.color).multiplyScalar(F),D.groundColor.copy(O.groundColor).multiplyScalar(F),n.hemi[_]=D,_++}}n.ambient[0]=h,n.ambient[1]=f,n.ambient[2]=d;var q=n.hash;(q.directionalLength!==g||q.pointLength!==y||q.spotLength!==p||q.rectAreaLength!==v||q.hemiLength!==_||q.numDirectionalShadows!==x||q.numPointShadows!==b||q.numSpotShadows!==T)&&(n.directional.length=g,n.spot.length=p,n.rectArea.length=v,n.point.length=y,n.hemi.length=_,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=b,n.pointShadowMap.length=b,n.spotShadow.length=T,n.spotShadowMap.length=T,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=b,n.spotShadowMatrix.length=T,q.directionalLength=g,q.pointLength=y,q.spotLength=p,q.rectAreaLength=v,q.hemiLength=_,q.numDirectionalShadows=x,q.numPointShadows=b,q.numSpotShadows=T,n.version=fy++)}return{setup:s,state:n}}function Xu(){var e=new py,t=[],n=[];function r(){t.length=0,n.length=0}function i(c){t.push(c)}function a(c){n.push(c)}function o(c){e.setup(t,n,c)}var s={lightsArray:t,shadowsArray:n,lights:e};return{init:r,state:s,setupLights:o,pushLight:i,pushShadow:a}}function vy(){var e=new WeakMap;function t(i){var a=i.target;a.removeEventListener("dispose",t),e.delete(a)}function n(i,a){var o;return e.has(i)===!1?(o=new Xu,e.set(i,new WeakMap),e.get(i).set(a,o),i.addEventListener("dispose",t)):e.get(i).has(a)===!1?(o=new Xu,e.get(i).set(a,o)):o=e.get(i).get(a),o}function r(){e=new WeakMap}return{get:n,dispose:r}}function Er(e){Oe.call(this),this.type="MeshDepthMaterial",this.depthPacking=lp,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)}Er.prototype=Object.create(Oe.prototype),Er.prototype.constructor=Er,Er.prototype.isMeshDepthMaterial=!0,Er.prototype.copy=function(e){return Oe.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};function Tr(e){Oe.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new E,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)}Tr.prototype=Object.create(Oe.prototype),Tr.prototype.constructor=Tr,Tr.prototype.isMeshDistanceMaterial=!0,Tr.prototype.copy=function(e){return Oe.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};var my=`uniform sampler2D shadow_pass;
3087
+ `+y}var _=g+a,x=y+o,b=Bu(r,35633,_),T=Bu(r,35632,x);if(r.attachShader(m,b),r.attachShader(m,T),n.index0AttributeName!==void 0?r.bindAttribLocation(m,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),e.debug.checkShaderErrors){var C=r.getProgramInfoLog(m).trim(),N=r.getShaderInfoLog(b).trim(),O=r.getShaderInfoLog(T).trim(),J=!0,F=!0;if(r.getProgramParameter(m,35714)===!1){J=!1;var B=zu(r,b,"vertex"),V=zu(r,T,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(m,35715),"gl.getProgramInfoLog",C,B,V)}else C!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",C):(N===""||O==="")&&(F=!1);F&&(this.diagnostics={runnable:J,programLog:C,vertexShader:{log:N,prefix:g},fragmentShader:{log:O,prefix:y}})}r.deleteShader(b),r.deleteShader(T);var Y;this.getUniforms=function(){return Y===void 0&&(Y=new or(r,m)),Y};var D;return this.getAttributes=function(){return D===void 0&&(D=Zg(r,m)),D},this.destroy=function(){r.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=kg++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=b,this.fragmentShader=T,this}function oy(e,t,n){var r=[],i=n.isWebGL2,a=n.logarithmicDepthBuffer,o=n.floatVertexTextures,s=n.precision,c=n.maxVertexUniforms,l=n.vertexTextures,u={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},h=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","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(g,y){var p;if(y){var v=Un[y];p={name:g.type,uniforms:Lp.clone(v.uniforms),vertexShader:v.vertexShader,fragmentShader:v.fragmentShader}}else p={name:g.type,uniforms:g.uniforms,vertexShader:g.vertexShader,fragmentShader:g.fragmentShader};return p}function d(g){var y=g.skeleton,p=y.bones;if(o)return 1024;var v=c,_=Math.floor((v-20)/4),x=Math.min(_,p.length);return x<p.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+p.length+" bones. This GPU supports "+x+"."),0):x}function m(g){var y;return g?g.isTexture?y=g.encoding:g.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),y=g.texture.encoding):y=kt,y}this.getParameters=function(g,y,p,v,_,x,b){var T=v.fog,C=g.isMeshStandardMaterial?v.environment:null,N=g.envMap||C,O=u[g.type],J=b.isSkinnedMesh?d(b):0;g.precision!==null&&(s=n.getMaxPrecision(g.precision),s!==g.precision&&console.warn("THREE.WebGLProgram.getParameters:",g.precision,"not supported, using",s,"instead."));var F=f(g,O);g.onBeforeCompile(F,e);var B=e.getRenderTarget(),V={isWebGL2:i,shaderID:O,shaderName:F.name,uniforms:F.uniforms,vertexShader:F.vertexShader,fragmentShader:F.fragmentShader,defines:g.defines,isRawShaderMaterial:g.isRawShaderMaterial,isShaderMaterial:g.isShaderMaterial,precision:s,instancing:b.isInstancedMesh===!0,supportsVertexTextures:l,outputEncoding:B!==null?m(B.texture):e.outputEncoding,map:!!g.map,mapEncoding:m(g.map),matcap:!!g.matcap,matcapEncoding:m(g.matcap),envMap:!!N,envMapMode:N&&N.mapping,envMapEncoding:m(N),envMapCubeUV:!!N&&(N.mapping===ki||N.mapping===Vs),lightMap:!!g.lightMap,lightMapEncoding:m(g.lightMap),aoMap:!!g.aoMap,emissiveMap:!!g.emissiveMap,emissiveMapEncoding:m(g.emissiveMap),bumpMap:!!g.bumpMap,normalMap:!!g.normalMap,objectSpaceNormalMap:g.normalMapType===hp,tangentSpaceNormalMap:g.normalMapType===Vr,clearcoatMap:!!g.clearcoatMap,clearcoatRoughnessMap:!!g.clearcoatRoughnessMap,clearcoatNormalMap:!!g.clearcoatNormalMap,displacementMap:!!g.displacementMap,roughnessMap:!!g.roughnessMap,metalnessMap:!!g.metalnessMap,specularMap:!!g.specularMap,alphaMap:!!g.alphaMap,gradientMap:!!g.gradientMap,sheen:!!g.sheen,combine:g.combine,vertexTangents:g.normalMap&&g.vertexTangents,vertexColors:g.vertexColors,vertexUvs:!!g.map||!!g.bumpMap||!!g.normalMap||!!g.specularMap||!!g.alphaMap||!!g.emissiveMap||!!g.roughnessMap||!!g.metalnessMap||!!g.clearcoatMap||!!g.clearcoatRoughnessMap||!!g.clearcoatNormalMap||!!g.displacementMap,uvsVertexOnly:!(g.map||g.bumpMap||g.normalMap||g.specularMap||g.alphaMap||g.emissiveMap||g.roughnessMap||g.metalnessMap||g.clearcoatNormalMap)&&!!g.displacementMap,fog:!!T,useFog:g.fog,fogExp2:T&&T.isFogExp2,flatShading:g.flatShading,sizeAttenuation:g.sizeAttenuation,logarithmicDepthBuffer:a,skinning:g.skinning&&J>0,maxBones:J,useVertexTexture:o,morphTargets:g.morphTargets,morphNormals:g.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:y.directional.length,numPointLights:y.point.length,numSpotLights:y.spot.length,numRectAreaLights:y.rectArea.length,numHemiLights:y.hemi.length,numDirLightShadows:y.directionalShadowMap.length,numPointLightShadows:y.pointShadowMap.length,numSpotLightShadows:y.spotShadowMap.length,numClippingPlanes:_,numClipIntersection:x,dithering:g.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:g.toneMapped?e.toneMapping:Vi,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:g.premultipliedAlpha,alphaTest:g.alphaTest,doubleSided:g.side===$a,flipSided:g.side===At,depthPacking:g.depthPacking!==void 0?g.depthPacking:!1,index0AttributeName:g.index0AttributeName,extensionDerivatives:g.extensions&&g.extensions.derivatives,extensionFragDepth:g.extensions&&g.extensions.fragDepth,extensionDrawBuffers:g.extensions&&g.extensions.drawBuffers,extensionShaderTextureLOD:g.extensions&&g.extensions.shaderTextureLOD,rendererExtensionFragDepth:i||t.get("EXT_frag_depth")!==null,rendererExtensionDrawBuffers:i||t.get("WEBGL_draw_buffers")!==null,rendererExtensionShaderTextureLod:i||t.get("EXT_shader_texture_lod")!==null,onBeforeCompile:g.onBeforeCompile};return V},this.getProgramCacheKey=function(g){var y=[];if(g.shaderID?y.push(g.shaderID):(y.push(g.fragmentShader),y.push(g.vertexShader)),g.defines!==void 0)for(var p in g.defines)y.push(p),y.push(g.defines[p]);if(g.isRawShaderMaterial===void 0){for(var v=0;v<h.length;v++)y.push(g[h[v]]);y.push(e.outputEncoding),y.push(e.gammaFactor)}return y.push(g.onBeforeCompile.toString()),y.join()},this.acquireProgram=function(g,y){for(var p,v=0,_=r.length;v<_;v++){var x=r[v];if(x.cacheKey===y){p=x,++p.usedTimes;break}}return p===void 0&&(p=new ay(e,y,g),r.push(p)),p},this.releaseProgram=function(g){if(--g.usedTimes===0){var y=r.indexOf(g);r[y]=r[r.length-1],r.pop(),g.destroy()}},this.programs=r}function sy(){var e=new WeakMap;function t(a){var o=e.get(a);return o===void 0&&(o={},e.set(a,o)),o}function n(a){e.delete(a)}function r(a,o,s){e.get(a)[o]=s}function i(){e=new WeakMap}return{get:t,remove:n,update:r,dispose:i}}function ly(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 cy(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 Xu(){var e=[],t=0,n=[],r=[],i={id:-1};function a(){t=0,n.length=0,r.length=0}function o(h,f,d,m,g,y){var p=e[t];return p===void 0?(p={id:h.id,object:h,geometry:f,material:d,program:d.program||i,groupOrder:m,renderOrder:h.renderOrder,z:g,group:y},e[t]=p):(p.id=h.id,p.object=h,p.geometry=f,p.material=d,p.program=d.program||i,p.groupOrder=m,p.renderOrder=h.renderOrder,p.z=g,p.group=y),t++,p}function s(h,f,d,m,g,y){var p=o(h,f,d,m,g,y);(d.transparent===!0?r:n).push(p)}function c(h,f,d,m,g,y){var p=o(h,f,d,m,g,y);(d.transparent===!0?r:n).unshift(p)}function l(h,f){n.length>1&&n.sort(h||ly),r.length>1&&r.sort(f||cy)}function u(){for(var h=t,f=e.length;h<f;h++){var d=e[h];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.program=null,d.group=null}}return{opaque:n,transparent:r,init:a,push:s,unshift:c,finish:u,sort:l}}function uy(){var e=new WeakMap;function t(i){var a=i.target;a.removeEventListener("dispose",t),e.delete(a)}function n(i,a){var o=e.get(i),s;return o===void 0?(s=new Xu,e.set(i,new WeakMap),e.get(i).set(a,s),i.addEventListener("dispose",t)):(s=o.get(a),s===void 0&&(s=new Xu,o.set(a,s))),s}function r(){e=new WeakMap}return{get:n,dispose:r}}function hy(){var e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new E,color:new de};break;case"SpotLight":n={position:new E,direction:new E,color:new de,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new E,color:new de,distance:0,decay:0};break;case"HemisphereLight":n={direction:new E,skyColor:new de,groundColor:new de};break;case"RectAreaLight":n={color:new de,position:new E,halfWidth:new E,halfHeight:new E};break}return e[t.id]=n,n}}}function fy(){var e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];var n;switch(t.type){case"DirectionalLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new X};break;case"SpotLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new X};break;case"PointLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new X,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}var dy=0;function py(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function vy(){for(var e=new hy,t=fy(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},r=0;r<9;r++)n.probe.push(new E);var i=new E,a=new We,o=new We;function s(c,l,u){for(var h=0,f=0,d=0,m=0;m<9;m++)n.probe[m].set(0,0,0);var g=0,y=0,p=0,v=0,_=0,x=0,b=0,T=0,C=u.matrixWorldInverse;c.sort(py);for(var m=0,N=c.length;m<N;m++){var O=c[m],J=O.color,F=O.intensity,B=O.distance,V=O.shadow&&O.shadow.map?O.shadow.map.texture:null;if(O.isAmbientLight)h+=J.r*F,f+=J.g*F,d+=J.b*F;else if(O.isLightProbe)for(var Y=0;Y<9;Y++)n.probe[Y].addScaledVector(O.sh.coefficients[Y],F);else if(O.isDirectionalLight){var D=e.get(O);if(D.color.copy(O.color).multiplyScalar(O.intensity),D.direction.setFromMatrixPosition(O.matrixWorld),i.setFromMatrixPosition(O.target.matrixWorld),D.direction.sub(i),D.direction.transformDirection(C),O.castShadow){var z=O.shadow,k=t.get(O);k.shadowBias=z.bias,k.shadowRadius=z.radius,k.shadowMapSize=z.mapSize,n.directionalShadow[g]=k,n.directionalShadowMap[g]=V,n.directionalShadowMatrix[g]=O.shadow.matrix,x++}n.directional[g]=D,g++}else if(O.isSpotLight){var D=e.get(O);if(D.position.setFromMatrixPosition(O.matrixWorld),D.position.applyMatrix4(C),D.color.copy(J).multiplyScalar(F),D.distance=B,D.direction.setFromMatrixPosition(O.matrixWorld),i.setFromMatrixPosition(O.target.matrixWorld),D.direction.sub(i),D.direction.transformDirection(C),D.coneCos=Math.cos(O.angle),D.penumbraCos=Math.cos(O.angle*(1-O.penumbra)),D.decay=O.decay,O.castShadow){var z=O.shadow,k=t.get(O);k.shadowBias=z.bias,k.shadowRadius=z.radius,k.shadowMapSize=z.mapSize,n.spotShadow[p]=k,n.spotShadowMap[p]=V,n.spotShadowMatrix[p]=O.shadow.matrix,T++}n.spot[p]=D,p++}else if(O.isRectAreaLight){var D=e.get(O);D.color.copy(J).multiplyScalar(F),D.position.setFromMatrixPosition(O.matrixWorld),D.position.applyMatrix4(C),o.identity(),a.copy(O.matrixWorld),a.premultiply(C),o.extractRotation(a),D.halfWidth.set(O.width*.5,0,0),D.halfHeight.set(0,O.height*.5,0),D.halfWidth.applyMatrix4(o),D.halfHeight.applyMatrix4(o),n.rectArea[v]=D,v++}else if(O.isPointLight){var D=e.get(O);if(D.position.setFromMatrixPosition(O.matrixWorld),D.position.applyMatrix4(C),D.color.copy(O.color).multiplyScalar(O.intensity),D.distance=O.distance,D.decay=O.decay,O.castShadow){var z=O.shadow,k=t.get(O);k.shadowBias=z.bias,k.shadowRadius=z.radius,k.shadowMapSize=z.mapSize,k.shadowCameraNear=z.camera.near,k.shadowCameraFar=z.camera.far,n.pointShadow[y]=k,n.pointShadowMap[y]=V,n.pointShadowMatrix[y]=O.shadow.matrix,b++}n.point[y]=D,y++}else if(O.isHemisphereLight){var D=e.get(O);D.direction.setFromMatrixPosition(O.matrixWorld),D.direction.transformDirection(C),D.direction.normalize(),D.skyColor.copy(O.color).multiplyScalar(F),D.groundColor.copy(O.groundColor).multiplyScalar(F),n.hemi[_]=D,_++}}n.ambient[0]=h,n.ambient[1]=f,n.ambient[2]=d;var q=n.hash;(q.directionalLength!==g||q.pointLength!==y||q.spotLength!==p||q.rectAreaLength!==v||q.hemiLength!==_||q.numDirectionalShadows!==x||q.numPointShadows!==b||q.numSpotShadows!==T)&&(n.directional.length=g,n.spot.length=p,n.rectArea.length=v,n.point.length=y,n.hemi.length=_,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=b,n.pointShadowMap.length=b,n.spotShadow.length=T,n.spotShadowMap.length=T,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=b,n.spotShadowMatrix.length=T,q.directionalLength=g,q.pointLength=y,q.spotLength=p,q.rectAreaLength=v,q.hemiLength=_,q.numDirectionalShadows=x,q.numPointShadows=b,q.numSpotShadows=T,n.version=dy++)}return{setup:s,state:n}}function ju(){var e=new vy,t=[],n=[];function r(){t.length=0,n.length=0}function i(c){t.push(c)}function a(c){n.push(c)}function o(c){e.setup(t,n,c)}var s={lightsArray:t,shadowsArray:n,lights:e};return{init:r,state:s,setupLights:o,pushLight:i,pushShadow:a}}function my(){var e=new WeakMap;function t(i){var a=i.target;a.removeEventListener("dispose",t),e.delete(a)}function n(i,a){var o;return e.has(i)===!1?(o=new ju,e.set(i,new WeakMap),e.get(i).set(a,o),i.addEventListener("dispose",t)):e.get(i).has(a)===!1?(o=new ju,e.get(i).set(a,o)):o=e.get(i).get(a),o}function r(){e=new WeakMap}return{get:n,dispose:r}}function Er(e){Oe.call(this),this.type="MeshDepthMaterial",this.depthPacking=cp,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)}Er.prototype=Object.create(Oe.prototype),Er.prototype.constructor=Er,Er.prototype.isMeshDepthMaterial=!0,Er.prototype.copy=function(e){return Oe.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};function Tr(e){Oe.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new E,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)}Tr.prototype=Object.create(Oe.prototype),Tr.prototype.constructor=Tr,Tr.prototype.isMeshDistanceMaterial=!0,Tr.prototype.copy=function(e){return Oe.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};var gy=`uniform sampler2D shadow_pass;
3088
3088
  uniform vec2 resolution;
3089
3089
  uniform float radius;
3090
3090
  #include <packing>
@@ -3107,10 +3107,10 @@ void main() {
3107
3107
  squared_mean = squared_mean * HALF_SAMPLE_RATE;
3108
3108
  float std_dev = sqrt( squared_mean - mean * mean );
3109
3109
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3110
- }`,gy=`void main() {
3110
+ }`,yy=`void main() {
3111
3111
  gl_Position = vec4( position, 1.0 );
3112
- }`;function ju(e,t,n){var r=new aa,i=new X,a=new X,o=new et,s=[],c=[],l={},u={0:At,1:Gi,2:Za},h=new Wt({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new X},radius:{value:4}},vertexShader:gy,fragmentShader:my}),f=h.clone();f.defines.HORIZONAL_PASS=1;var d=new ve;d.setAttribute("position",new De(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var m=new ut(d,h),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Bc,this.render=function(b,T,C){if(g.enabled!==!1&&!(g.autoUpdate===!1&&g.needsUpdate===!1)&&b.length!==0){var N=e.getRenderTarget(),O=e.getActiveCubeFace(),J=e.getActiveMipmapLevel(),F=e.state;F.setBlending(Jn),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);for(var B=0,V=b.length;B<V;B++){var Y=b[B],D=Y.shadow;if(D===void 0){console.warn("THREE.WebGLShadowMap:",Y,"has no shadow.");continue}i.copy(D.mapSize);var z=D.getFrameExtents();if(i.multiply(z),a.copy(D.mapSize),(i.x>n||i.y>n)&&(i.x>n&&(a.x=Math.floor(n/z.x),i.x=a.x*z.x,D.mapSize.x=a.x),i.y>n&&(a.y=Math.floor(n/z.y),i.y=a.y*z.y,D.mapSize.y=a.y)),D.map===null&&!D.isPointLightShadow&&this.type===zi){var k={minFilter:Dt,magFilter:Dt,format:on};D.map=new $t(i.x,i.y,k),D.map.texture.name=Y.name+".shadowMap",D.mapPass=new $t(i.x,i.y,k),D.camera.updateProjectionMatrix()}if(D.map===null){var k={minFilter:_t,magFilter:_t,format:on};D.map=new $t(i.x,i.y,k),D.map.texture.name=Y.name+".shadowMap",D.camera.updateProjectionMatrix()}e.setRenderTarget(D.map),e.clear();for(var q=D.getViewportCount(),Z=0;Z<q;Z++){var ee=D.getViewport(Z);o.set(a.x*ee.x,a.y*ee.y,a.x*ee.z,a.y*ee.w),F.viewport(o),D.updateMatrices(Y,Z),r=D.getFrustum(),x(T,C,D.camera,Y,this.type)}!D.isPointLightShadow&&this.type===zi&&y(D,C)}g.needsUpdate=!1,e.setRenderTarget(N,O,J)}};function y(b,T){var C=t.update(m);h.uniforms.shadow_pass.value=b.map.texture,h.uniforms.resolution.value=b.mapSize,h.uniforms.radius.value=b.radius,e.setRenderTarget(b.mapPass),e.clear(),e.renderBufferDirect(T,null,C,h,m,null),f.uniforms.shadow_pass.value=b.mapPass.texture,f.uniforms.resolution.value=b.mapSize,f.uniforms.radius.value=b.radius,e.setRenderTarget(b.map),e.clear(),e.renderBufferDirect(T,null,C,f,m,null)}function p(b,T,C){var N=b<<0|T<<1|C<<2,O=s[N];return O===void 0&&(O=new Er({depthPacking:cp,morphTargets:b,skinning:T}),s[N]=O),O}function v(b,T,C){var N=b<<0|T<<1|C<<2,O=c[N];return O===void 0&&(O=new Tr({morphTargets:b,skinning:T}),c[N]=O),O}function _(b,T,C,N,O,J,F){var B=null,V=p,Y=b.customDepthMaterial;if(N.isPointLight===!0&&(V=v,Y=b.customDistanceMaterial),Y===void 0){var D=!1;C.morphTargets===!0&&(D=T.morphAttributes&&T.morphAttributes.position&&T.morphAttributes.position.length>0);var z=!1;b.isSkinnedMesh===!0&&(C.skinning===!0?z=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",b));var k=b.isInstancedMesh===!0;B=V(D,z,k)}else B=Y;if(e.localClippingEnabled&&C.clipShadows===!0&&C.clippingPlanes.length!==0){var q=B.uuid,Z=C.uuid,ee=l[q];ee===void 0&&(ee={},l[q]=ee);var te=ee[Z];te===void 0&&(te=B.clone(),ee[Z]=te),B=te}return B.visible=C.visible,B.wireframe=C.wireframe,F===zi?B.side=C.shadowSide!==null?C.shadowSide:C.side:B.side=C.shadowSide!==null?C.shadowSide:u[C.side],B.clipShadows=C.clipShadows,B.clippingPlanes=C.clippingPlanes,B.clipIntersection=C.clipIntersection,B.wireframeLinewidth=C.wireframeLinewidth,B.linewidth=C.linewidth,N.isPointLight===!0&&B.isMeshDistanceMaterial===!0&&(B.referencePosition.setFromMatrixPosition(N.matrixWorld),B.nearDistance=O,B.farDistance=J),B}function x(b,T,C,N,O){if(b.visible!==!1){var J=b.layers.test(T.layers);if(J&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&O===zi)&&(!b.frustumCulled||r.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,b.matrixWorld);var F=t.update(b),B=b.material;if(Array.isArray(B))for(var V=F.groups,Y=0,D=V.length;Y<D;Y++){var z=V[Y],k=B[z.materialIndex];if(k&&k.visible){var q=_(b,F,k,N,C.near,C.far,O);e.renderBufferDirect(C,null,F,q,b,z)}}else if(B.visible){var q=_(b,F,B,N,C.near,C.far,O);e.renderBufferDirect(C,null,F,q,b,null)}}for(var Z=b.children,ee=0,te=Z.length;ee<te;ee++)x(Z[ee],T,C,N,O)}}}function yy(e,t,n){var r=n.isWebGL2;function i(){var I=!1,we=new et,Me=null,Ve=new et(0,0,0,0);return{setMask:function(Ee){Me!==Ee&&!I&&(e.colorMask(Ee,Ee,Ee,Ee),Me=Ee)},setLocked:function(Ee){I=Ee},setClear:function(Ee,Ze,it,pt,Ht){Ht===!0&&(Ee*=pt,Ze*=pt,it*=pt),we.set(Ee,Ze,it,pt),Ve.equals(we)===!1&&(e.clearColor(Ee,Ze,it,pt),Ve.copy(we))},reset:function(){I=!1,Me=null,Ve.set(-1,0,0,0)}}}function a(){var I=!1,we=null,Me=null,Ve=null;return{setTest:function(Ee){Ee?Te(2929):ue(2929)},setMask:function(Ee){we!==Ee&&!I&&(e.depthMask(Ee),we=Ee)},setFunc:function(Ee){if(Me!==Ee){if(Ee)switch(Ee){case Kf:e.depthFunc(512);break;case $f:e.depthFunc(519);break;case ed:e.depthFunc(513);break;case Fs:e.depthFunc(515);break;case td:e.depthFunc(514);break;case nd:e.depthFunc(518);break;case rd:e.depthFunc(516);break;case id:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);Me=Ee}},setLocked:function(Ee){I=Ee},setClear:function(Ee){Ve!==Ee&&(e.clearDepth(Ee),Ve=Ee)},reset:function(){I=!1,we=null,Me=null,Ve=null}}}function o(){var I=!1,we=null,Me=null,Ve=null,Ee=null,Ze=null,it=null,pt=null,Ht=null;return{setTest:function(at){I||(at?Te(2960):ue(2960))},setMask:function(at){we!==at&&!I&&(e.stencilMask(at),we=at)},setFunc:function(at,Pt,Ot){(Me!==at||Ve!==Pt||Ee!==Ot)&&(e.stencilFunc(at,Pt,Ot),Me=at,Ve=Pt,Ee=Ot)},setOp:function(at,Pt,Ot){(Ze!==at||it!==Pt||pt!==Ot)&&(e.stencilOp(at,Pt,Ot),Ze=at,it=Pt,pt=Ot)},setLocked:function(at){I=at},setClear:function(at){Ht!==at&&(e.clearStencil(at),Ht=at)},reset:function(){I=!1,we=null,Me=null,Ve=null,Ee=null,Ze=null,it=null,pt=null,Ht=null}}}var s=new i,c=new a,l=new o,u=e.getParameter(34921),h=new Uint8Array(u),f=new Uint8Array(u),d=new Uint8Array(u),m={},g=null,y=null,p=null,v=null,_=null,x=null,b=null,T=null,C=null,N=!1,O=null,J=null,F=null,B=null,V=null,Y=e.getParameter(35661),D=!1,z=0,k=e.getParameter(7938);k.indexOf("WebGL")!==-1?(z=parseFloat(/^WebGL\ ([0-9])/.exec(k)[1]),D=z>=1):k.indexOf("OpenGL ES")!==-1&&(z=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(k)[1]),D=z>=2);var q=null,Z={},ee=new et,te=new et;function oe(I,we,Me){var Ve=new Uint8Array(4),Ee=e.createTexture();e.bindTexture(I,Ee),e.texParameteri(I,10241,9728),e.texParameteri(I,10240,9728);for(var Ze=0;Ze<Me;Ze++)e.texImage2D(we+Ze,0,6408,1,1,0,6408,5121,Ve);return Ee}var Pe={};Pe[3553]=oe(3553,3553,1),Pe[34067]=oe(34067,34069,6),s.setClear(0,0,0,1),c.setClear(1),l.setClear(0),Te(2929),c.setFunc(Fs),A(!1),L(Fc),Te(2884),nt(Jn);function be(){for(var I=0,we=h.length;I<we;I++)h[I]=0}function re(I){G(I,0)}function G(I,we){if(h[I]=1,f[I]===0&&(e.enableVertexAttribArray(I),f[I]=1),d[I]!==we){var Me=r?e:t.get("ANGLE_instanced_arrays");Me[r?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](I,we),d[I]=we}}function Be(){for(var I=0,we=f.length;I!==we;++I)f[I]!==h[I]&&(e.disableVertexAttribArray(I),f[I]=0)}function xe(I,we,Me,Ve,Ee,Ze){r===!0&&(Me===5124||Me===5125)?e.vertexAttribIPointer(I,we,Me,Ve,Ee,Ze):e.vertexAttribPointer(I,we,Me,Ve,Ee,Ze)}function Te(I){m[I]!==!0&&(e.enable(I),m[I]=!0)}function ue(I){m[I]!==!1&&(e.disable(I),m[I]=!1)}function $(I){return g!==I?(e.useProgram(I),g=I,!0):!1}var Ce={[Ur]:32774,[Hf]:32778,[Vf]:32779};if(r)Ce[Vc]=32775,Ce[kc]=32776;else{var Ye=t.get("EXT_blend_minmax");Ye!==null&&(Ce[Vc]=Ye.MIN_EXT,Ce[kc]=Ye.MAX_EXT)}var Qe={[kf]:0,[Wf]:1,[Xf]:768,[Wc]:770,[Qf]:776,[Zf]:774,[qf]:772,[jf]:769,[Xc]:771,[Jf]:775,[Yf]:773};function nt(I,we,Me,Ve,Ee,Ze,it,pt){if(I===Jn){y&&(ue(3042),y=!1);return}if(y||(Te(3042),y=!0),I!==Gf){if(I!==p||pt!==N){if((v!==Ur||b!==Ur)&&(e.blendEquation(32774),v=Ur,b=Ur),pt)switch(I){case Hi:e.blendFuncSeparate(1,771,1,771);break;case zc:e.blendFunc(1,1);break;case Gc:e.blendFuncSeparate(0,0,769,771);break;case Hc:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",I);break}else switch(I){case Hi:e.blendFuncSeparate(770,771,1,771);break;case zc:e.blendFunc(770,1);break;case Gc:e.blendFunc(0,769);break;case Hc:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",I);break}_=null,x=null,T=null,C=null,p=I,N=pt}return}Ee=Ee||we,Ze=Ze||Me,it=it||Ve,(we!==v||Ee!==b)&&(e.blendEquationSeparate(Ce[we],Ce[Ee]),v=we,b=Ee),(Me!==_||Ve!==x||Ze!==T||it!==C)&&(e.blendFuncSeparate(Qe[Me],Qe[Ve],Qe[Ze],Qe[it]),_=Me,x=Ve,T=Ze,C=it),p=I,N=null}function $e(I,we){I.side===Za?ue(2884):Te(2884);var Me=I.side===At;we&&(Me=!Me),A(Me),I.blending===Hi&&I.transparent===!1?nt(Jn):nt(I.blending,I.blendEquation,I.blendSrc,I.blendDst,I.blendEquationAlpha,I.blendSrcAlpha,I.blendDstAlpha,I.premultipliedAlpha),c.setFunc(I.depthFunc),c.setTest(I.depthTest),c.setMask(I.depthWrite),s.setMask(I.colorWrite);var Ve=I.stencilWrite;l.setTest(Ve),Ve&&(l.setMask(I.stencilWriteMask),l.setFunc(I.stencilFunc,I.stencilRef,I.stencilFuncMask),l.setOp(I.stencilFail,I.stencilZFail,I.stencilZPass)),K(I.polygonOffset,I.polygonOffsetFactor,I.polygonOffsetUnits)}function A(I){O!==I&&(I?e.frontFace(2304):e.frontFace(2305),O=I)}function L(I){I!==Bf?(Te(2884),I!==J&&(I===Fc?e.cullFace(1029):I===Uf?e.cullFace(1028):e.cullFace(1032))):ue(2884),J=I}function ne(I){I!==F&&(D&&e.lineWidth(I),F=I)}function K(I,we,Me){I?(Te(32823),(B!==we||V!==Me)&&(e.polygonOffset(we,Me),B=we,V=Me)):ue(32823)}function Fe(I){I?Te(3089):ue(3089)}function ye(I){I===void 0&&(I=33984+Y-1),q!==I&&(e.activeTexture(I),q=I)}function R(I,we){q===null&&ye();var Me=Z[q];Me===void 0&&(Me={type:void 0,texture:void 0},Z[q]=Me),(Me.type!==I||Me.texture!==we)&&(e.bindTexture(I,we||Pe[I]),Me.type=I,Me.texture=we)}function he(){var I=Z[q];I!==void 0&&I.type!==void 0&&(e.bindTexture(I.type,null),I.type=void 0,I.texture=void 0)}function fe(){try{e.compressedTexImage2D.apply(e,arguments)}catch(I){console.error("THREE.WebGLState:",I)}}function me(){try{e.texImage2D.apply(e,arguments)}catch(I){console.error("THREE.WebGLState:",I)}}function ie(){try{e.texImage3D.apply(e,arguments)}catch(I){console.error("THREE.WebGLState:",I)}}function Se(I){ee.equals(I)===!1&&(e.scissor(I.x,I.y,I.z,I.w),ee.copy(I))}function pe(I){te.equals(I)===!1&&(e.viewport(I.x,I.y,I.z,I.w),te.copy(I))}function Re(){for(var I=0;I<f.length;I++)f[I]===1&&(e.disableVertexAttribArray(I),f[I]=0);m={},q=null,Z={},g=null,p=null,O=null,J=null,s.reset(),c.reset(),l.reset()}return{buffers:{color:s,depth:c,stencil:l},initAttributes:be,enableAttribute:re,enableAttributeAndDivisor:G,disableUnusedAttributes:Be,vertexAttribPointer:xe,enable:Te,disable:ue,useProgram:$,setBlending:nt,setMaterial:$e,setFlipSided:A,setCullFace:L,setLineWidth:ne,setPolygonOffset:K,setScissorTest:Fe,activeTexture:ye,bindTexture:R,unbindTexture:he,compressedTexImage2D:fe,texImage2D:me,texImage3D:ie,scissor:Se,viewport:pe,reset:Re}}function xy(e,t,n,r,i,a,o){var s=i.isWebGL2,c=i.maxTextures,l=i.maxCubemapSize,u=i.maxTextureSize,h=i.maxSamples,f=new WeakMap,d,m=!1;try{m=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(A){}function g(A,L){return m?new OffscreenCanvas(A,L):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function y(A,L,ne,K){var Fe=1;if((A.width>K||A.height>K)&&(Fe=K/Math.max(A.width,A.height)),Fe<1||L===!0)if(typeof HTMLImageElement!="undefined"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&A instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&A instanceof ImageBitmap){var ye=L?ke.floorPowerOfTwo:Math.floor,R=ye(Fe*A.width),he=ye(Fe*A.height);d===void 0&&(d=g(R,he));var fe=ne?g(R,he):d;fe.width=R,fe.height=he;var me=fe.getContext("2d");return me.drawImage(A,0,0,R,he),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+A.width+"x"+A.height+") to ("+R+"x"+he+")."),fe}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+A.width+"x"+A.height+")."),A;return A}function p(A){return ke.isPowerOfTwo(A.width)&&ke.isPowerOfTwo(A.height)}function v(A){return s?!1:A.wrapS!==Vt||A.wrapT!==Vt||A.minFilter!==_t&&A.minFilter!==Dt}function _(A,L){return A.generateMipmaps&&L&&A.minFilter!==_t&&A.minFilter!==Dt}function x(A,L,ne,K){e.generateMipmap(A);var Fe=r.get(L);Fe.__maxMipLevel=Math.log(Math.max(ne,K))*Math.LOG2E}function b(A,L,ne){if(s===!1)return L;if(A!==null){if(e[A]!==void 0)return e[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}var K=L;return L===6403&&(ne===5126&&(K=33326),ne===5131&&(K=33325),ne===5121&&(K=33321)),L===6407&&(ne===5126&&(K=34837),ne===5131&&(K=34843),ne===5121&&(K=32849)),L===6408&&(ne===5126&&(K=34836),ne===5131&&(K=34842),ne===5121&&(K=32856)),(K===33325||K===33326||K===34842||K===34836)&&t.get("EXT_color_buffer_float"),K}function T(A){return A===_t||A===Vs||A===ks?9728:9729}function C(A){var L=A.target;L.removeEventListener("dispose",C),O(L),L.isVideoTexture&&f.delete(L),o.memory.textures--}function N(A){var L=A.target;L.removeEventListener("dispose",N),J(L),o.memory.textures--}function O(A){var L=r.get(A);L.__webglInit!==void 0&&(e.deleteTexture(L.__webglTexture),r.remove(A))}function J(A){var L=r.get(A),ne=r.get(A.texture);if(A){if(ne.__webglTexture!==void 0&&e.deleteTexture(ne.__webglTexture),A.depthTexture&&A.depthTexture.dispose(),A.isWebGLCubeRenderTarget)for(var K=0;K<6;K++)e.deleteFramebuffer(L.__webglFramebuffer[K]),L.__webglDepthbuffer&&e.deleteRenderbuffer(L.__webglDepthbuffer[K]);else e.deleteFramebuffer(L.__webglFramebuffer),L.__webglDepthbuffer&&e.deleteRenderbuffer(L.__webglDepthbuffer),L.__webglMultisampledFramebuffer&&e.deleteFramebuffer(L.__webglMultisampledFramebuffer),L.__webglColorRenderbuffer&&e.deleteRenderbuffer(L.__webglColorRenderbuffer),L.__webglDepthRenderbuffer&&e.deleteRenderbuffer(L.__webglDepthRenderbuffer);r.remove(A.texture),r.remove(A)}}var F=0;function B(){F=0}function V(){var A=F;return A>=c&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+c),F+=1,A}function Y(A,L){var ne=r.get(A);if(A.isVideoTexture&&Ce(A),A.version>0&&ne.__version!==A.version){var K=A.image;if(K===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(K.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Pe(ne,A,L);return}}n.activeTexture(33984+L),n.bindTexture(3553,ne.__webglTexture)}function D(A,L){var ne=r.get(A);if(A.version>0&&ne.__version!==A.version){Pe(ne,A,L);return}n.activeTexture(33984+L),n.bindTexture(35866,ne.__webglTexture)}function z(A,L){var ne=r.get(A);if(A.version>0&&ne.__version!==A.version){Pe(ne,A,L);return}n.activeTexture(33984+L),n.bindTexture(32879,ne.__webglTexture)}function k(A,L){if(A.image.length===6){var ne=r.get(A);if(A.version>0&&ne.__version!==A.version){oe(ne,A),n.activeTexture(33984+L),n.bindTexture(34067,ne.__webglTexture),e.pixelStorei(37440,A.flipY);for(var K=A&&(A.isCompressedTexture||A.image[0].isCompressedTexture),Fe=A.image[0]&&A.image[0].isDataTexture,ye=[],R=0;R<6;R++)!K&&!Fe?ye[R]=y(A.image[R],!1,!0,l):ye[R]=Fe?A.image[R].image:A.image[R];var he=ye[0],fe=p(he)||s,me=a.convert(A.format),ie=a.convert(A.type),Se=b(A.internalFormat,me,ie);te(34067,A,fe);var pe;if(K){for(var R=0;R<6;R++){pe=ye[R].mipmaps;for(var Re=0;Re<pe.length;Re++){var I=pe[Re];A.format!==on&&A.format!==xr?me!==null?n.compressedTexImage2D(34069+R,Re,Se,I.width,I.height,0,I.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+R,Re,Se,I.width,I.height,0,me,ie,I.data)}}ne.__maxMipLevel=pe.length-1}else{pe=A.mipmaps;for(var R=0;R<6;R++)if(Fe){n.texImage2D(34069+R,0,Se,ye[R].width,ye[R].height,0,me,ie,ye[R].data);for(var Re=0;Re<pe.length;Re++){var I=pe[Re],we=I.image[R].image;n.texImage2D(34069+R,Re+1,Se,we.width,we.height,0,me,ie,we.data)}}else{n.texImage2D(34069+R,0,Se,me,ie,ye[R]);for(var Re=0;Re<pe.length;Re++){var I=pe[Re];n.texImage2D(34069+R,Re+1,Se,me,ie,I.image[R])}}ne.__maxMipLevel=pe.length}_(A,fe)&&x(34067,A,he.width,he.height),ne.__version=A.version,A.onUpdate&&A.onUpdate(A)}else n.activeTexture(33984+L),n.bindTexture(34067,ne.__webglTexture)}}function q(A,L){n.activeTexture(33984+L),n.bindTexture(34067,r.get(A).__webglTexture)}var Z={[Qa]:10497,[Vt]:33071,[Ka]:33648},ee={[_t]:9728,[Vs]:9984,[ks]:9986,[Dt]:9729,[Zc]:9985,[$a]:9987};function te(A,L,ne){ne?(e.texParameteri(A,10242,Z[L.wrapS]),e.texParameteri(A,10243,Z[L.wrapT]),(A===32879||A===35866)&&e.texParameteri(A,32882,Z[L.wrapR]),e.texParameteri(A,10240,ee[L.magFilter]),e.texParameteri(A,10241,ee[L.minFilter])):(e.texParameteri(A,10242,33071),e.texParameteri(A,10243,33071),(A===32879||A===35866)&&e.texParameteri(A,32882,33071),(L.wrapS!==Vt||L.wrapT!==Vt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(A,10240,T(L.magFilter)),e.texParameteri(A,10241,T(L.minFilter)),L.minFilter!==_t&&L.minFilter!==Dt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var K=t.get("EXT_texture_filter_anisotropic");if(K){if(L.type===Qn&&t.get("OES_texture_float_linear")===null||L.type===no&&(s||t.get("OES_texture_half_float_linear"))===null)return;(L.anisotropy>1||r.get(L).__currentAnisotropy)&&(e.texParameterf(A,K.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,i.getMaxAnisotropy())),r.get(L).__currentAnisotropy=L.anisotropy)}}function oe(A,L){A.__webglInit===void 0&&(A.__webglInit=!0,L.addEventListener("dispose",C),A.__webglTexture=e.createTexture(),o.memory.textures++)}function Pe(A,L,ne){var K=3553;L.isDataTexture2DArray&&(K=35866),L.isDataTexture3D&&(K=32879),oe(A,L),n.activeTexture(33984+ne),n.bindTexture(K,A.__webglTexture),e.pixelStorei(37440,L.flipY),e.pixelStorei(37441,L.premultiplyAlpha),e.pixelStorei(3317,L.unpackAlignment);var Fe=v(L)&&p(L.image)===!1,ye=y(L.image,Fe,!1,u),R=p(ye)||s,he=a.convert(L.format),fe=a.convert(L.type),me=b(L.internalFormat,he,fe);te(K,L,R);var ie,Se=L.mipmaps;if(L.isDepthTexture)me=6402,s?L.type===Qn?me=36012:L.type===to?me=33190:L.type===Xi?me=35056:me=33189:L.type===Qn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),L.format===zr&&me===6402&&L.type!==eo&&L.type!==to&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),L.type=eo,fe=a.convert(L.type)),L.format===ji&&me===6402&&(me=34041,L.type!==Xi&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),L.type=Xi,fe=a.convert(L.type))),n.texImage2D(3553,0,me,ye.width,ye.height,0,he,fe,null);else if(L.isDataTexture)if(Se.length>0&&R){for(var pe=0,Re=Se.length;pe<Re;pe++)ie=Se[pe],n.texImage2D(3553,pe,me,ie.width,ie.height,0,he,fe,ie.data);L.generateMipmaps=!1,A.__maxMipLevel=Se.length-1}else n.texImage2D(3553,0,me,ye.width,ye.height,0,he,fe,ye.data),A.__maxMipLevel=0;else if(L.isCompressedTexture){for(var pe=0,Re=Se.length;pe<Re;pe++)ie=Se[pe],L.format!==on&&L.format!==xr?he!==null?n.compressedTexImage2D(3553,pe,me,ie.width,ie.height,0,ie.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,pe,me,ie.width,ie.height,0,he,fe,ie.data);A.__maxMipLevel=Se.length-1}else if(L.isDataTexture2DArray)n.texImage3D(35866,0,me,ye.width,ye.height,ye.depth,0,he,fe,ye.data),A.__maxMipLevel=0;else if(L.isDataTexture3D)n.texImage3D(32879,0,me,ye.width,ye.height,ye.depth,0,he,fe,ye.data),A.__maxMipLevel=0;else if(Se.length>0&&R){for(var pe=0,Re=Se.length;pe<Re;pe++)ie=Se[pe],n.texImage2D(3553,pe,me,he,fe,ie);L.generateMipmaps=!1,A.__maxMipLevel=Se.length-1}else n.texImage2D(3553,0,me,he,fe,ye),A.__maxMipLevel=0;_(L,R)&&x(K,L,ye.width,ye.height),A.__version=L.version,L.onUpdate&&L.onUpdate(L)}function be(A,L,ne,K){var Fe=a.convert(L.texture.format),ye=a.convert(L.texture.type),R=b(L.texture.internalFormat,Fe,ye);n.texImage2D(K,0,R,L.width,L.height,0,Fe,ye,null),e.bindFramebuffer(36160,A),e.framebufferTexture2D(36160,ne,K,r.get(L.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function re(A,L,ne){if(e.bindRenderbuffer(36161,A),L.depthBuffer&&!L.stencilBuffer){var K=33189;if(ne){var Fe=L.depthTexture;Fe&&Fe.isDepthTexture&&(Fe.type===Qn?K=36012:Fe.type===to&&(K=33190));var ye=$(L);e.renderbufferStorageMultisample(36161,ye,K,L.width,L.height)}else e.renderbufferStorage(36161,K,L.width,L.height);e.framebufferRenderbuffer(36160,36096,36161,A)}else if(L.depthBuffer&&L.stencilBuffer){if(ne){var ye=$(L);e.renderbufferStorageMultisample(36161,ye,35056,L.width,L.height)}else e.renderbufferStorage(36161,34041,L.width,L.height);e.framebufferRenderbuffer(36160,33306,36161,A)}else{var R=a.convert(L.texture.format),he=a.convert(L.texture.type),K=b(L.texture.internalFormat,R,he);if(ne){var ye=$(L);e.renderbufferStorageMultisample(36161,ye,K,L.width,L.height)}else e.renderbufferStorage(36161,K,L.width,L.height)}e.bindRenderbuffer(36161,null)}function G(A,L){var ne=L&&L.isWebGLCubeRenderTarget;if(ne)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,A),!(L.depthTexture&&L.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(L.depthTexture).__webglTexture||L.depthTexture.image.width!==L.width||L.depthTexture.image.height!==L.height)&&(L.depthTexture.image.width=L.width,L.depthTexture.image.height=L.height,L.depthTexture.needsUpdate=!0),Y(L.depthTexture,0);var K=r.get(L.depthTexture).__webglTexture;if(L.depthTexture.format===zr)e.framebufferTexture2D(36160,36096,3553,K,0);else if(L.depthTexture.format===ji)e.framebufferTexture2D(36160,33306,3553,K,0);else throw new Error("Unknown depthTexture format")}function Be(A){var L=r.get(A),ne=A.isWebGLCubeRenderTarget===!0;if(A.depthTexture){if(ne)throw new Error("target.depthTexture not supported in Cube render targets");G(L.__webglFramebuffer,A)}else if(ne){L.__webglDepthbuffer=[];for(var K=0;K<6;K++)e.bindFramebuffer(36160,L.__webglFramebuffer[K]),L.__webglDepthbuffer[K]=e.createRenderbuffer(),re(L.__webglDepthbuffer[K],A,!1)}else e.bindFramebuffer(36160,L.__webglFramebuffer),L.__webglDepthbuffer=e.createRenderbuffer(),re(L.__webglDepthbuffer,A,!1);e.bindFramebuffer(36160,null)}function xe(A){var L=r.get(A),ne=r.get(A.texture);A.addEventListener("dispose",N),ne.__webglTexture=e.createTexture(),o.memory.textures++;var K=A.isWebGLCubeRenderTarget===!0,Fe=A.isWebGLMultisampleRenderTarget===!0,ye=p(A)||s;if(s&&A.texture.format===xr&&(A.texture.type===Qn||A.texture.type===no)&&(A.texture.format=on,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),K){L.__webglFramebuffer=[];for(var R=0;R<6;R++)L.__webglFramebuffer[R]=e.createFramebuffer()}else if(L.__webglFramebuffer=e.createFramebuffer(),Fe)if(s){L.__webglMultisampledFramebuffer=e.createFramebuffer(),L.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,L.__webglColorRenderbuffer);var he=a.convert(A.texture.format),fe=a.convert(A.texture.type),me=b(A.texture.internalFormat,he,fe),ie=$(A);e.renderbufferStorageMultisample(36161,ie,me,A.width,A.height),e.bindFramebuffer(36160,L.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,L.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),A.depthBuffer&&(L.__webglDepthRenderbuffer=e.createRenderbuffer(),re(L.__webglDepthRenderbuffer,A,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(K){n.bindTexture(34067,ne.__webglTexture),te(34067,A.texture,ye);for(var R=0;R<6;R++)be(L.__webglFramebuffer[R],A,36064,34069+R);_(A.texture,ye)&&x(34067,A.texture,A.width,A.height),n.bindTexture(34067,null)}else n.bindTexture(3553,ne.__webglTexture),te(3553,A.texture,ye),be(L.__webglFramebuffer,A,36064,3553),_(A.texture,ye)&&x(3553,A.texture,A.width,A.height),n.bindTexture(3553,null);A.depthBuffer&&Be(A)}function Te(A){var L=A.texture,ne=p(A)||s;if(_(L,ne)){var K=A.isWebGLCubeRenderTarget?34067:3553,Fe=r.get(L).__webglTexture;n.bindTexture(K,Fe),x(K,L,A.width,A.height),n.bindTexture(K,null)}}function ue(A){if(A.isWebGLMultisampleRenderTarget)if(s){var L=r.get(A);e.bindFramebuffer(36008,L.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,L.__webglFramebuffer);var ne=A.width,K=A.height,Fe=16384;A.depthBuffer&&(Fe|=256),A.stencilBuffer&&(Fe|=1024),e.blitFramebuffer(0,0,ne,K,0,0,ne,K,Fe,9728),e.bindFramebuffer(36160,L.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function $(A){return s&&A.isWebGLMultisampleRenderTarget?Math.min(h,A.samples):0}function Ce(A){var L=o.render.frame;f.get(A)!==L&&(f.set(A,L),A.update())}var Ye=!1,Qe=!1;function nt(A,L){A&&A.isWebGLRenderTarget&&(Ye===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Ye=!0),A=A.texture),Y(A,L)}function $e(A,L){A&&A.isWebGLCubeRenderTarget&&(Qe===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Qe=!0),A=A.texture),A&&A.isCubeTexture||Array.isArray(A.image)&&A.image.length===6?k(A,L):q(A,L)}this.allocateTextureUnit=V,this.resetTextureUnits=B,this.setTexture2D=Y,this.setTexture2DArray=D,this.setTexture3D=z,this.setTextureCube=k,this.setTextureCubeDynamic=q,this.setupRenderTarget=xe,this.updateRenderTargetMipmap=Te,this.updateMultisampleRenderTarget=ue,this.safeSetTexture2D=nt,this.safeSetTextureCube=$e}function _y(e,t,n){var r=n.isWebGL2;function i(a){var o;if(a===Wi)return 5121;if(a===pd)return 32819;if(a===vd)return 32820;if(a===md)return 33635;if(a===hd)return 5120;if(a===fd)return 5122;if(a===eo)return 5123;if(a===dd)return 5124;if(a===to)return 5125;if(a===Qn)return 5126;if(a===no)return r?5131:(o=t.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(a===gd)return 6406;if(a===xr)return 6407;if(a===on)return 6408;if(a===yd)return 6409;if(a===xd)return 6410;if(a===zr)return 6402;if(a===ji)return 34041;if(a===bd)return 6403;if(a===wd)return 36244;if(a===Md)return 33319;if(a===Ed)return 33320;if(a===Td)return 36248;if(a===Sd)return 36249;if(a===Jc||a===Qc||a===Kc||a===$c)if(o=t.get("WEBGL_compressed_texture_s3tc"),o!==null){if(a===Jc)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===Qc)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===Kc)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===$c)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===eu||a===tu||a===nu||a===ru)if(o=t.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(a===eu)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===tu)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===nu)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===ru)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===Ad)return o=t.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((a===iu||a===au)&&(o=t.get("WEBGL_compressed_texture_etc"),o!==null)){if(a===iu)return o.COMPRESSED_RGB8_ETC2;if(a===au)return o.COMPRESSED_RGBA8_ETC2_EAC}if(a===Ld||a===Pd||a===Cd||a===Rd||a===Od||a===Dd||a===Id||a===Nd||a===Fd||a===Bd||a===Ud||a===zd||a===Gd||a===Hd||a===kd||a===Wd||a===Xd||a===jd||a===qd||a===Yd||a===Zd||a===Jd||a===Qd||a===Kd||a===$d||a===ep||a===tp||a===np)return o=t.get("WEBGL_compressed_texture_astc"),o!==null?a:null;if(a===Vd)return o=t.get("EXT_texture_compression_bptc"),o!==null?a:null;if(a===Xi)return r?34042:(o=t.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:i}}function El(e){Et.call(this),this.cameras=e||[]}El.prototype=Object.assign(Object.create(Et.prototype),{constructor:El,isArrayCamera:!0});function ua(){ae.call(this),this.type="Group"}ua.prototype=Object.assign(Object.create(ae.prototype),{constructor:ua,isGroup:!0});function So(){this._targetRay=null,this._grip=null}Object.assign(So.prototype,{constructor:So,getTargetRaySpace:function(){return this._targetRay===null&&(this._targetRay=new ua,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return this._grip===null&&(this._grip=new ua,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this},update:function(e,t,n){var r=null,i=null,a=this._targetRay,o=this._grip;return e&&(a!==null&&(r=t.getPose(e.targetRaySpace,n),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),o!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)))),a!==null&&(a.visible=r!==null),o!==null&&(o.visible=i!==null),this}});function qu(e,t){var n=this,r=null,i=1,a=null,o="local-floor",s=null,c=[],l=new Map,u=new Et;u.layers.enable(1),u.viewport=new et;var h=new Et;h.layers.enable(2),h.viewport=new et;var f=[u,h],d=new El;d.layers.enable(1),d.layers.enable(2);var m=null,g=null;this.enabled=!1,this.isPresenting=!1,this.getController=function(F){var B=c[F];return B===void 0&&(B=new So,c[F]=B),B.getTargetRaySpace()},this.getControllerGrip=function(F){var B=c[F];return B===void 0&&(B=new So,c[F]=B),B.getGripSpace()};function y(F){var B=l.get(F.inputSource);B&&B.dispatchEvent({type:F.type})}function p(){l.forEach(function(F,B){F.disconnect(B)}),l.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),J.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function v(F){a=F,J.setContext(r),J.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}this.setFramebufferScaleFactor=function(F){i=F,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(F){o=F,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return r},this.setSession=function(F){if(r=F,r!==null){r.addEventListener("select",y),r.addEventListener("selectstart",y),r.addEventListener("selectend",y),r.addEventListener("squeeze",y),r.addEventListener("squeezestart",y),r.addEventListener("squeezeend",y),r.addEventListener("end",p);var B=t.getContextAttributes();B.xrCompatible!==!0&&t.makeXRCompatible();var V={antialias:B.antialias,alpha:B.alpha,depth:B.depth,stencil:B.stencil,framebufferScaleFactor:i},Y=new XRWebGLLayer(r,t,V);r.updateRenderState({baseLayer:Y}),r.requestReferenceSpace(o).then(v),r.addEventListener("inputsourceschange",_)}};function _(F){for(var B=r.inputSources,V=0;V<c.length;V++)l.set(B[V],c[V]);for(var V=0;V<F.removed.length;V++){var Y=F.removed[V],D=l.get(Y);D&&(D.dispatchEvent({type:"disconnected",data:Y}),l.delete(Y))}for(var V=0;V<F.added.length;V++){var Y=F.added[V],D=l.get(Y);D&&D.dispatchEvent({type:"connected",data:Y})}}var x=new E,b=new E;function T(F,B,V){x.setFromMatrixPosition(B.matrixWorld),b.setFromMatrixPosition(V.matrixWorld);var Y=x.distanceTo(b),D=B.projectionMatrix.elements,z=V.projectionMatrix.elements,k=D[14]/(D[10]-1),q=D[14]/(D[10]+1),Z=(D[9]+1)/D[5],ee=(D[9]-1)/D[5],te=(D[8]-1)/D[0],oe=(z[8]+1)/z[0],Pe=k*te,be=k*oe,re=Y/(-te+oe),G=re*-te;B.matrixWorld.decompose(F.position,F.quaternion,F.scale),F.translateX(G),F.translateZ(re),F.matrixWorld.compose(F.position,F.quaternion,F.scale),F.matrixWorldInverse.getInverse(F.matrixWorld);var Be=k+re,xe=q+re,Te=Pe-G,ue=be+(Y-G),$=Z*q/xe*Be,Ce=ee*q/xe*Be;F.projectionMatrix.makePerspective(Te,ue,$,Ce,Be,xe)}function C(F,B){B===null?F.matrixWorld.copy(F.matrix):F.matrixWorld.multiplyMatrices(B.matrixWorld,F.matrix),F.matrixWorldInverse.getInverse(F.matrixWorld)}this.getCamera=function(F){d.near=h.near=u.near=F.near,d.far=h.far=u.far=F.far,(m!==d.near||g!==d.far)&&(r.updateRenderState({depthNear:d.near,depthFar:d.far}),m=d.near,g=d.far);var B=F.parent,V=d.cameras;C(d,B);for(var Y=0;Y<V.length;Y++)C(V[Y],B);F.matrixWorld.copy(d.matrixWorld);for(var D=F.children,Y=0,z=D.length;Y<z;Y++)D[Y].updateMatrixWorld(!0);return V.length===2?T(d,u,h):d.projectionMatrix.copy(u.projectionMatrix),d};var N=null;function O(F,B){if(s=B.getViewerPose(a),s!==null){var V=s.views,Y=r.renderState.baseLayer;e.setFramebuffer(Y.framebuffer);var D=!1;V.length!==d.cameras.length&&(d.cameras.length=0,D=!0);for(var z=0;z<V.length;z++){var k=V[z],q=Y.getViewport(k),Z=f[z];Z.matrix.fromArray(k.transform.matrix),Z.projectionMatrix.fromArray(k.projectionMatrix),Z.viewport.set(q.x,q.y,q.width,q.height),z===0&&d.matrix.copy(Z.matrix),D===!0&&d.cameras.push(Z)}}for(var ee=r.inputSources,z=0;z<c.length;z++){var te=c[z],oe=ee[z];te.update(oe,B,a)}N&&N(F,B)}var J=new Eu;J.setAnimationLoop(O),this.setAnimationLoop=function(F){N=F},this.dispose=function(){}}Object.assign(qu.prototype,sn.prototype);function by(e){function t(p,v){p.fogColor.value.copy(v.color),v.isFog?(p.fogNear.value=v.near,p.fogFar.value=v.far):v.isFogExp2&&(p.fogDensity.value=v.density)}function n(p,v,_,x,b){v.isMeshBasicMaterial?r(p,v):v.isMeshLambertMaterial?(r(p,v),c(p,v)):v.isMeshToonMaterial?(r(p,v),u(p,v)):v.isMeshPhongMaterial?(r(p,v),l(p,v)):v.isMeshStandardMaterial?(r(p,v,_),v.isMeshPhysicalMaterial?f(p,v,_):h(p,v,_)):v.isMeshMatcapMaterial?(r(p,v),d(p,v)):v.isMeshDepthMaterial?(r(p,v),m(p,v)):v.isMeshDistanceMaterial?(r(p,v),g(p,v)):v.isMeshNormalMaterial?(r(p,v),y(p,v)):v.isLineBasicMaterial?(i(p,v),v.isLineDashedMaterial&&a(p,v)):v.isPointsMaterial?o(p,v,x,b):v.isSpriteMaterial?s(p,v):v.isShadowMaterial?(p.color.value.copy(v.color),p.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function r(p,v,_){p.opacity.value=v.opacity,v.color&&p.diffuse.value.copy(v.color),v.emissive&&p.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(p.map.value=v.map),v.alphaMap&&(p.alphaMap.value=v.alphaMap),v.specularMap&&(p.specularMap.value=v.specularMap);var x=v.envMap||_;x&&(p.envMap.value=x,p.flipEnvMap.value=x.isCubeTexture?-1:1,p.reflectivity.value=v.reflectivity,p.refractionRatio.value=v.refractionRatio,p.maxMipLevel.value=e.get(x).__maxMipLevel),v.lightMap&&(p.lightMap.value=v.lightMap,p.lightMapIntensity.value=v.lightMapIntensity),v.aoMap&&(p.aoMap.value=v.aoMap,p.aoMapIntensity.value=v.aoMapIntensity);var b;v.map?b=v.map:v.specularMap?b=v.specularMap:v.displacementMap?b=v.displacementMap:v.normalMap?b=v.normalMap:v.bumpMap?b=v.bumpMap:v.roughnessMap?b=v.roughnessMap:v.metalnessMap?b=v.metalnessMap:v.alphaMap?b=v.alphaMap:v.emissiveMap&&(b=v.emissiveMap),b!==void 0&&(b.isWebGLRenderTarget&&(b=b.texture),b.matrixAutoUpdate===!0&&b.updateMatrix(),p.uvTransform.value.copy(b.matrix));var T;v.aoMap?T=v.aoMap:v.lightMap&&(T=v.lightMap),T!==void 0&&(T.isWebGLRenderTarget&&(T=T.texture),T.matrixAutoUpdate===!0&&T.updateMatrix(),p.uv2Transform.value.copy(T.matrix))}function i(p,v){p.diffuse.value.copy(v.color),p.opacity.value=v.opacity}function a(p,v){p.dashSize.value=v.dashSize,p.totalSize.value=v.dashSize+v.gapSize,p.scale.value=v.scale}function o(p,v,_,x){p.diffuse.value.copy(v.color),p.opacity.value=v.opacity,p.size.value=v.size*_,p.scale.value=x*.5,v.map&&(p.map.value=v.map),v.alphaMap&&(p.alphaMap.value=v.alphaMap);var b;v.map?b=v.map:v.alphaMap&&(b=v.alphaMap),b!==void 0&&(b.matrixAutoUpdate===!0&&b.updateMatrix(),p.uvTransform.value.copy(b.matrix))}function s(p,v){p.diffuse.value.copy(v.color),p.opacity.value=v.opacity,p.rotation.value=v.rotation,v.map&&(p.map.value=v.map),v.alphaMap&&(p.alphaMap.value=v.alphaMap);var _;v.map?_=v.map:v.alphaMap&&(_=v.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),p.uvTransform.value.copy(_.matrix))}function c(p,v){v.emissiveMap&&(p.emissiveMap.value=v.emissiveMap)}function l(p,v){p.specular.value.copy(v.specular),p.shininess.value=Math.max(v.shininess,1e-4),v.emissiveMap&&(p.emissiveMap.value=v.emissiveMap),v.bumpMap&&(p.bumpMap.value=v.bumpMap,p.bumpScale.value=v.bumpScale,v.side===At&&(p.bumpScale.value*=-1)),v.normalMap&&(p.normalMap.value=v.normalMap,p.normalScale.value.copy(v.normalScale),v.side===At&&p.normalScale.value.negate()),v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias)}function u(p,v){p.specular.value.copy(v.specular),p.shininess.value=Math.max(v.shininess,1e-4),v.gradientMap&&(p.gradientMap.value=v.gradientMap),v.emissiveMap&&(p.emissiveMap.value=v.emissiveMap),v.bumpMap&&(p.bumpMap.value=v.bumpMap,p.bumpScale.value=v.bumpScale,v.side===At&&(p.bumpScale.value*=-1)),v.normalMap&&(p.normalMap.value=v.normalMap,p.normalScale.value.copy(v.normalScale),v.side===At&&p.normalScale.value.negate()),v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias)}function h(p,v,_){p.roughness.value=v.roughness,p.metalness.value=v.metalness,v.roughnessMap&&(p.roughnessMap.value=v.roughnessMap),v.metalnessMap&&(p.metalnessMap.value=v.metalnessMap),v.emissiveMap&&(p.emissiveMap.value=v.emissiveMap),v.bumpMap&&(p.bumpMap.value=v.bumpMap,p.bumpScale.value=v.bumpScale,v.side===At&&(p.bumpScale.value*=-1)),v.normalMap&&(p.normalMap.value=v.normalMap,p.normalScale.value.copy(v.normalScale),v.side===At&&p.normalScale.value.negate()),v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias),(v.envMap||_)&&(p.envMapIntensity.value=v.envMapIntensity)}function f(p,v,_){h(p,v,_),p.reflectivity.value=v.reflectivity,p.clearcoat.value=v.clearcoat,p.clearcoatRoughness.value=v.clearcoatRoughness,v.sheen&&p.sheen.value.copy(v.sheen),v.clearcoatMap&&(p.clearcoatMap.value=v.clearcoatMap),v.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap),v.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),p.clearcoatNormalMap.value=v.clearcoatNormalMap,v.side===At&&p.clearcoatNormalScale.value.negate()),p.transparency.value=v.transparency}function d(p,v){v.matcap&&(p.matcap.value=v.matcap),v.bumpMap&&(p.bumpMap.value=v.bumpMap,p.bumpScale.value=v.bumpScale,v.side===At&&(p.bumpScale.value*=-1)),v.normalMap&&(p.normalMap.value=v.normalMap,p.normalScale.value.copy(v.normalScale),v.side===At&&p.normalScale.value.negate()),v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias)}function m(p,v){v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias)}function g(p,v){v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias),p.referencePosition.value.copy(v.referencePosition),p.nearDistance.value=v.nearDistance,p.farDistance.value=v.farDistance}function y(p,v){v.bumpMap&&(p.bumpMap.value=v.bumpMap,p.bumpScale.value=v.bumpScale,v.side===At&&(p.bumpScale.value*=-1)),v.normalMap&&(p.normalMap.value=v.normalMap,p.normalScale.value.copy(v.normalScale),v.side===At&&p.normalScale.value.negate()),v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias)}return{refreshFogUniforms:t,refreshMaterialUniforms:n}}function Yu(e){e=e||{};var t=e.canvas!==void 0?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=e.context!==void 0?e.context:null,r=e.alpha!==void 0?e.alpha:!1,i=e.depth!==void 0?e.depth:!0,a=e.stencil!==void 0?e.stencil:!0,o=e.antialias!==void 0?e.antialias:!1,s=e.premultipliedAlpha!==void 0?e.premultipliedAlpha:!0,c=e.preserveDrawingBuffer!==void 0?e.preserveDrawingBuffer:!1,l=e.powerPreference!==void 0?e.powerPreference:"default",u=e.failIfMajorPerformanceCaveat!==void 0?e.failIfMajorPerformanceCaveat:!1,h=null,f=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.outputEncoding=kt,this.physicallyCorrectLights=!1,this.toneMapping=Vi,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d=this,m=!1,g=null,y=0,p=0,v=null,_=null,x=-1,b={geometry:null,program:null,wireframe:!1},T=null,C=null,N=new et,O=new et,J=null,F=t.width,B=t.height,V=1,Y=null,D=null,z=new et(0,0,F,B),k=new et(0,0,F,B),q=!1,Z=new aa,ee=new $m,te=!1,oe=!1,Pe=new We,be=new E;function re(){return v===null?V:1}var G;try{var Be={alpha:r,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",Re,!1),G=n||t.getContext("webgl",Be)||t.getContext("experimental-webgl",Be),G===null)throw t.getContext("webgl")!==null?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");G.getShaderPrecisionFormat===void 0&&(G.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(S){throw console.error("THREE.WebGLRenderer: "+S.message),S}var xe,Te,ue,$,Ce,Ye,Qe,nt,$e,A,L,ne,K,Fe,ye,R,he,fe;function me(){xe=new eg(G),Te=new Km(G,xe,e),Te.isWebGL2===!1&&(xe.get("WEBGL_depth_texture"),xe.get("OES_texture_float"),xe.get("OES_texture_half_float"),xe.get("OES_texture_half_float_linear"),xe.get("OES_standard_derivatives"),xe.get("OES_element_index_uint"),xe.get("ANGLE_instanced_arrays")),xe.get("OES_texture_float_linear"),fe=new _y(G,xe,Te),ue=new yy(G,xe,Te),ue.scissor(O.copy(k).multiplyScalar(V).floor()),ue.viewport(N.copy(z).multiplyScalar(V).floor()),$=new rg,Ce=new oy,Ye=new xy(G,xe,ue,Ce,Te,fe,$),Qe=new Cp(G,Te),nt=new tg(G,Qe,$),$e=new og(G,nt,Qe,$),ye=new ag(G),A=new ay(d,xe,Te),L=new by(Ce),ne=new cy,K=new vy,Fe=new Jm(d,ue,$e,s),R=new Qm(G,xe,$,Te),he=new ng(G,xe,$,Te),$.programs=A.programs,d.capabilities=Te,d.extensions=xe,d.properties=Ce,d.renderLists=ne,d.state=ue,d.info=$}me();var ie=new qu(d,G);this.xr=ie;var Se=new ju(d,$e,Te.maxTextureSize);this.shadowMap=Se,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){var S=xe.get("WEBGL_lose_context");S&&S.loseContext()},this.forceContextRestore=function(){var S=xe.get("WEBGL_lose_context");S&&S.restoreContext()},this.getPixelRatio=function(){return V},this.setPixelRatio=function(S){S!==void 0&&(V=S,this.setSize(F,B,!1))},this.getSize=function(S){return S===void 0&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),S=new X),S.set(F,B)},this.setSize=function(S,W,H){if(ie.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}F=S,B=W,t.width=Math.floor(S*V),t.height=Math.floor(W*V),H!==!1&&(t.style.width=S+"px",t.style.height=W+"px"),this.setViewport(0,0,S,W)},this.getDrawingBufferSize=function(S){return S===void 0&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),S=new X),S.set(F*V,B*V).floor()},this.setDrawingBufferSize=function(S,W,H){F=S,B=W,V=H,t.width=Math.floor(S*H),t.height=Math.floor(W*H),this.setViewport(0,0,S,W)},this.getCurrentViewport=function(S){return S===void 0&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),S=new et),S.copy(N)},this.getViewport=function(S){return S.copy(z)},this.setViewport=function(S,W,H,j){S.isVector4?z.set(S.x,S.y,S.z,S.w):z.set(S,W,H,j),ue.viewport(N.copy(z).multiplyScalar(V).floor())},this.getScissor=function(S){return S.copy(k)},this.setScissor=function(S,W,H,j){S.isVector4?k.set(S.x,S.y,S.z,S.w):k.set(S,W,H,j),ue.scissor(O.copy(k).multiplyScalar(V).floor())},this.getScissorTest=function(){return q},this.setScissorTest=function(S){ue.setScissorTest(q=S)},this.setOpaqueSort=function(S){Y=S},this.setTransparentSort=function(S){D=S},this.getClearColor=function(){return Fe.getClearColor()},this.setClearColor=function(){Fe.setClearColor.apply(Fe,arguments)},this.getClearAlpha=function(){return Fe.getClearAlpha()},this.setClearAlpha=function(){Fe.setClearAlpha.apply(Fe,arguments)},this.clear=function(S,W,H){var j=0;(S===void 0||S)&&(j|=16384),(W===void 0||W)&&(j|=256),(H===void 0||H)&&(j|=1024),G.clear(j)},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",pe,!1),t.removeEventListener("webglcontextrestored",Re,!1),ne.dispose(),K.dispose(),Ce.dispose(),$e.dispose(),ie.dispose(),Ht.stop()};function pe(S){S.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),m=!0}function Re(){console.log("THREE.WebGLRenderer: Context Restored."),m=!1,me()}function I(S){var W=S.target;W.removeEventListener("dispose",I),we(W)}function we(S){Me(S),Ce.remove(S)}function Me(S){var W=Ce.get(S).program;S.program=void 0,W!==void 0&&A.releaseProgram(W)}function Ve(S,W){S.render(function(H){d.renderBufferImmediate(H,W)})}this.renderBufferImmediate=function(S,W){ue.initAttributes();var H=Ce.get(S);S.hasPositions&&!H.position&&(H.position=G.createBuffer()),S.hasNormals&&!H.normal&&(H.normal=G.createBuffer()),S.hasUvs&&!H.uv&&(H.uv=G.createBuffer()),S.hasColors&&!H.color&&(H.color=G.createBuffer());var j=W.getAttributes();S.hasPositions&&(G.bindBuffer(34962,H.position),G.bufferData(34962,S.positionArray,35048),ue.enableAttribute(j.position),G.vertexAttribPointer(j.position,3,5126,!1,0,0)),S.hasNormals&&(G.bindBuffer(34962,H.normal),G.bufferData(34962,S.normalArray,35048),ue.enableAttribute(j.normal),G.vertexAttribPointer(j.normal,3,5126,!1,0,0)),S.hasUvs&&(G.bindBuffer(34962,H.uv),G.bufferData(34962,S.uvArray,35048),ue.enableAttribute(j.uv),G.vertexAttribPointer(j.uv,2,5126,!1,0,0)),S.hasColors&&(G.bindBuffer(34962,H.color),G.bufferData(34962,S.colorArray,35048),ue.enableAttribute(j.color),G.vertexAttribPointer(j.color,3,5126,!1,0,0)),ue.disableUnusedAttributes(),G.drawArrays(4,0,S.count),S.count=0};var Ee=new Ji;this.renderBufferDirect=function(S,W,H,j,se,Ge){W===null&&(W=Ee);var Ie=se.isMesh&&se.matrixWorld.determinant()<0,Ae=Ii(S,W,j,se);ue.setMaterial(j,Ie);var Ue=!1;(b.geometry!==H.id||b.program!==Ae.id||b.wireframe!==(j.wireframe===!0))&&(b.geometry=H.id,b.program=Ae.id,b.wireframe=j.wireframe===!0,Ue=!0),(j.morphTargets||j.morphNormals)&&(ye.update(se,H,j,Ae),Ue=!0),se.isInstancedMesh===!0&&(Ue=!0);var He=H.index,ct=H.attributes.position;if(He===null){if(ct===void 0||ct.count===0)return}else if(He.count===0)return;var Ke=1;j.wireframe===!0&&(He=nt.getWireframeAttribute(H),Ke=2);var Je,ze=R;He!==null&&(Je=Qe.get(He),ze=he,ze.setIndex(Je)),Ue&&(Ze(se,H,j,Ae),He!==null&&G.bindBuffer(34963,Je.buffer));var qe=He!==null?He.count:ct.count,yt=H.drawRange.start*Ke,Tt=H.drawRange.count*Ke,xt=Ge!==null?Ge.start*Ke:0,vn=Ge!==null?Ge.count*Ke:1/0,st=Math.max(yt,xt),Xn=Math.min(qe,yt+Tt,xt+vn)-1,mr=Math.max(0,Xn-st+1);if(mr!==0){if(se.isMesh)j.wireframe===!0?(ue.setLineWidth(j.wireframeLinewidth*re()),ze.setMode(1)):ze.setMode(4);else if(se.isLine){var Xa=j.linewidth;Xa===void 0&&(Xa=1),ue.setLineWidth(Xa*re()),se.isLineSegments?ze.setMode(1):se.isLineLoop?ze.setMode(2):ze.setMode(3)}else se.isPoints?ze.setMode(0):se.isSprite&&ze.setMode(4);if(se.isInstancedMesh)ze.renderInstances(H,st,mr,se.count);else if(H.isInstancedBufferGeometry){var Fi=Math.min(H.instanceCount,H._maxInstanceCount);ze.renderInstances(H,st,mr,Fi)}else ze.render(st,mr)}};function Ze(S,W,H,j){if(!(Te.isWebGL2===!1&&(S.isInstancedMesh||W.isInstancedBufferGeometry)&&xe.get("ANGLE_instanced_arrays")===null)){ue.initAttributes();var se=W.attributes,Ge=j.getAttributes(),Ie=H.defaultAttributeValues;for(var Ae in Ge){var Ue=Ge[Ae];if(Ue>=0){var He=se[Ae];if(He!==void 0){var ct=He.normalized,Ke=He.itemSize,Je=Qe.get(He);if(Je===void 0)continue;var ze=Je.buffer,qe=Je.type,yt=Je.bytesPerElement;if(He.isInterleavedBufferAttribute){var Tt=He.data,xt=Tt.stride,vn=He.offset;Tt&&Tt.isInstancedInterleavedBuffer?(ue.enableAttributeAndDivisor(Ue,Tt.meshPerAttribute),W._maxInstanceCount===void 0&&(W._maxInstanceCount=Tt.meshPerAttribute*Tt.count)):ue.enableAttribute(Ue),G.bindBuffer(34962,ze),ue.vertexAttribPointer(Ue,Ke,qe,ct,xt*yt,vn*yt)}else He.isInstancedBufferAttribute?(ue.enableAttributeAndDivisor(Ue,He.meshPerAttribute),W._maxInstanceCount===void 0&&(W._maxInstanceCount=He.meshPerAttribute*He.count)):ue.enableAttribute(Ue),G.bindBuffer(34962,ze),ue.vertexAttribPointer(Ue,Ke,qe,ct,0,0)}else if(Ae==="instanceMatrix"){var Je=Qe.get(S.instanceMatrix);if(Je===void 0)continue;var ze=Je.buffer,qe=Je.type;ue.enableAttributeAndDivisor(Ue+0,1),ue.enableAttributeAndDivisor(Ue+1,1),ue.enableAttributeAndDivisor(Ue+2,1),ue.enableAttributeAndDivisor(Ue+3,1),G.bindBuffer(34962,ze),G.vertexAttribPointer(Ue+0,4,qe,!1,64,0),G.vertexAttribPointer(Ue+1,4,qe,!1,64,16),G.vertexAttribPointer(Ue+2,4,qe,!1,64,32),G.vertexAttribPointer(Ue+3,4,qe,!1,64,48)}else if(Ie!==void 0){var st=Ie[Ae];if(st!==void 0)switch(st.length){case 2:G.vertexAttrib2fv(Ue,st);break;case 3:G.vertexAttrib3fv(Ue,st);break;case 4:G.vertexAttrib4fv(Ue,st);break;default:G.vertexAttrib1fv(Ue,st)}}}}ue.disableUnusedAttributes()}}this.compile=function(S,W){f=K.get(S,W),f.init(),S.traverse(function(j){j.isLight&&(f.pushLight(j),j.castShadow&&f.pushShadow(j))}),f.setupLights(W);const H={};S.traverse(function(j){let se=j.material;if(se)if(Array.isArray(se))for(let Ge=0;Ge<se.length;Ge++){let Ie=se[Ge];Ie.uuid in H||(Kt(Ie,S,j),H[Ie.uuid]=!0)}else se.uuid in H||(Kt(se,S,j),H[se.uuid]=!0)})};var it=null;function pt(S){ie.isPresenting||it&&it(S)}var Ht=new Eu;Ht.setAnimationLoop(pt),typeof window!="undefined"&&Ht.setContext(window),this.setAnimationLoop=function(S){it=S,ie.setAnimationLoop(S),Ht.start()},this.render=function(S,W){var H,j;if(arguments[2]!==void 0&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),H=arguments[2]),arguments[3]!==void 0&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),j=arguments[3]),!(W&&W.isCamera)){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(!m){b.geometry=null,b.program=null,b.wireframe=!1,x=-1,T=null,S.autoUpdate===!0&&S.updateMatrixWorld(),W.parent===null&&W.updateMatrixWorld(),ie.enabled&&ie.isPresenting&&(W=ie.getCamera(W)),S.onBeforeRender(d,S,W,H||v),f=K.get(S,W),f.init(),Pe.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Z.setFromProjectionMatrix(Pe),oe=this.localClippingEnabled,te=ee.init(this.clippingPlanes,oe,W),h=ne.get(S,W),h.init(),at(S,W,0,d.sortObjects),h.finish(),d.sortObjects===!0&&h.sort(Y,D),te&&ee.beginShadows();var se=f.state.shadowsArray;Se.render(se,S,W),f.setupLights(W),te&&ee.endShadows(),this.info.autoReset&&this.info.reset(),H!==void 0&&this.setRenderTarget(H),Fe.render(h,S,W,j);var Ge=h.opaque,Ie=h.transparent;if(S.overrideMaterial){var Ae=S.overrideMaterial;Ge.length&&Pt(Ge,S,W,Ae),Ie.length&&Pt(Ie,S,W,Ae)}else Ge.length&&Pt(Ge,S,W),Ie.length&&Pt(Ie,S,W);S.onAfterRender(d,S,W),v!==null&&(Ye.updateRenderTargetMipmap(v),Ye.updateMultisampleRenderTarget(v)),ue.buffers.depth.setTest(!0),ue.buffers.depth.setMask(!0),ue.buffers.color.setMask(!0),ue.setPolygonOffset(!1),h=null,f=null}};function at(S,W,H,j){if(S.visible!==!1){var se=S.layers.test(W.layers);if(se){if(S.isGroup)H=S.renderOrder;else if(S.isLOD)S.autoUpdate===!0&&S.update(W);else if(S.isLight)f.pushLight(S),S.castShadow&&f.pushShadow(S);else if(S.isSprite){if(!S.frustumCulled||Z.intersectsSprite(S)){j&&be.setFromMatrixPosition(S.matrixWorld).applyMatrix4(Pe);var Ge=$e.update(S),Ie=S.material;Ie.visible&&h.push(S,Ge,Ie,H,be.z,null)}}else if(S.isImmediateRenderObject)j&&be.setFromMatrixPosition(S.matrixWorld).applyMatrix4(Pe),h.push(S,null,S.material,H,be.z,null);else if((S.isMesh||S.isLine||S.isPoints)&&(S.isSkinnedMesh&&S.skeleton.frame!==$.render.frame&&(S.skeleton.update(),S.skeleton.frame=$.render.frame),!S.frustumCulled||Z.intersectsObject(S))){j&&be.setFromMatrixPosition(S.matrixWorld).applyMatrix4(Pe);var Ge=$e.update(S),Ie=S.material;if(Array.isArray(Ie))for(var Ae=Ge.groups,Ue=0,He=Ae.length;Ue<He;Ue++){var ct=Ae[Ue],Ke=Ie[ct.materialIndex];Ke&&Ke.visible&&h.push(S,Ge,Ke,H,be.z,ct)}else Ie.visible&&h.push(S,Ge,Ie,H,be.z,null)}}for(var Je=S.children,Ue=0,He=Je.length;Ue<He;Ue++)at(Je[Ue],W,H,j)}}function Pt(S,W,H,j){for(var se=0,Ge=S.length;se<Ge;se++){var Ie=S[se],Ae=Ie.object,Ue=Ie.geometry,He=j===void 0?Ie.material:j,ct=Ie.group;if(H.isArrayCamera){C=H;for(var Ke=H.cameras,Je=0,ze=Ke.length;Je<ze;Je++){var qe=Ke[Je];Ae.layers.test(qe.layers)&&(ue.viewport(N.copy(qe.viewport)),f.setupLights(qe),Ot(Ae,W,qe,Ue,He,ct))}}else C=null,Ot(Ae,W,H,Ue,He,ct)}}function Ot(S,W,H,j,se,Ge){if(S.onBeforeRender(d,W,H,j,se,Ge),f=K.get(W,C||H),S.modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,S.matrixWorld),S.normalMatrix.getNormalMatrix(S.modelViewMatrix),S.isImmediateRenderObject){var Ie=Ii(H,W,se,S);ue.setMaterial(se),b.geometry=null,b.program=null,b.wireframe=!1,Ve(S,Ie)}else d.renderBufferDirect(H,W,j,se,S,Ge);S.onAfterRender(d,W,H,j,se,Ge),f=K.get(W,C||H)}function Kt(S,W,H){var j=Ce.get(S),se=f.state.lights,Ge=f.state.shadowsArray,Ie=se.state.version,Ae=A.getParameters(S,se.state,Ge,W,ee.numPlanes,ee.numIntersection,H),Ue=A.getProgramCacheKey(Ae),He=j.program,ct=!0;if(He===void 0)S.addEventListener("dispose",I);else if(He.cacheKey!==Ue)Me(S);else if(j.lightsStateVersion!==Ie)j.lightsStateVersion=Ie,ct=!1;else{if(Ae.shaderID!==void 0)return;ct=!1}ct&&(He=A.acquireProgram(Ae,Ue),j.program=He,j.uniforms=Ae.uniforms,j.outputEncoding=Ae.outputEncoding,S.program=He);var Ke=He.getAttributes();if(S.morphTargets){S.numSupportedMorphTargets=0;for(var Je=0;Je<d.maxMorphTargets;Je++)Ke["morphTarget"+Je]>=0&&S.numSupportedMorphTargets++}if(S.morphNormals){S.numSupportedMorphNormals=0;for(var Je=0;Je<d.maxMorphNormals;Je++)Ke["morphNormal"+Je]>=0&&S.numSupportedMorphNormals++}var ze=j.uniforms;(!S.isShaderMaterial&&!S.isRawShaderMaterial||S.clipping===!0)&&(j.numClippingPlanes=ee.numPlanes,j.numIntersection=ee.numIntersection,ze.clippingPlanes=ee.uniform),j.environment=S.isMeshStandardMaterial?W.environment:null,j.fog=W.fog,j.needsLights=Br(S),j.lightsStateVersion=Ie,j.needsLights&&(ze.ambientLightColor.value=se.state.ambient,ze.lightProbe.value=se.state.probe,ze.directionalLights.value=se.state.directional,ze.directionalLightShadows.value=se.state.directionalShadow,ze.spotLights.value=se.state.spot,ze.spotLightShadows.value=se.state.spotShadow,ze.rectAreaLights.value=se.state.rectArea,ze.pointLights.value=se.state.point,ze.pointLightShadows.value=se.state.pointShadow,ze.hemisphereLights.value=se.state.hemi,ze.directionalShadowMap.value=se.state.directionalShadowMap,ze.directionalShadowMatrix.value=se.state.directionalShadowMatrix,ze.spotShadowMap.value=se.state.spotShadowMap,ze.spotShadowMatrix.value=se.state.spotShadowMatrix,ze.pointShadowMap.value=se.state.pointShadowMap,ze.pointShadowMatrix.value=se.state.pointShadowMatrix);var qe=j.program.getUniforms(),yt=or.seqWithValue(qe.seq,ze);j.uniformsList=yt}function Ii(S,W,H,j){Ye.resetTextureUnits();var se=W.fog,Ge=H.isMeshStandardMaterial?W.environment:null,Ie=v===null?d.outputEncoding:v.texture.encoding,Ae=Ce.get(H),Ue=f.state.lights;if(te&&(oe||S!==T)){var He=S===T&&H.id===x;ee.setState(H.clippingPlanes,H.clipIntersection,H.clipShadows,S,Ae,He)}H.version===Ae.__version?(Ae.program===void 0||H.fog&&Ae.fog!==se||Ae.environment!==Ge||Ae.needsLights&&Ae.lightsStateVersion!==Ue.state.version||Ae.numClippingPlanes!==void 0&&(Ae.numClippingPlanes!==ee.numPlanes||Ae.numIntersection!==ee.numIntersection)||Ae.outputEncoding!==Ie)&&Kt(H,W,j):(Kt(H,W,j),Ae.__version=H.version);var ct=!1,Ke=!1,Je=!1,ze=Ae.program,qe=ze.getUniforms(),yt=Ae.uniforms;if(ue.useProgram(ze.program)&&(ct=!0,Ke=!0,Je=!0),H.id!==x&&(x=H.id,Ke=!0),ct||T!==S){if(qe.setValue(G,"projectionMatrix",S.projectionMatrix),Te.logarithmicDepthBuffer&&qe.setValue(G,"logDepthBufFC",2/(Math.log(S.far+1)/Math.LN2)),T!==S&&(T=S,Ke=!0,Je=!0),H.isShaderMaterial||H.isMeshPhongMaterial||H.isMeshToonMaterial||H.isMeshStandardMaterial||H.envMap){var Tt=qe.map.cameraPosition;Tt!==void 0&&Tt.setValue(G,be.setFromMatrixPosition(S.matrixWorld))}(H.isMeshPhongMaterial||H.isMeshToonMaterial||H.isMeshLambertMaterial||H.isMeshBasicMaterial||H.isMeshStandardMaterial||H.isShaderMaterial)&&qe.setValue(G,"isOrthographic",S.isOrthographicCamera===!0),(H.isMeshPhongMaterial||H.isMeshToonMaterial||H.isMeshLambertMaterial||H.isMeshBasicMaterial||H.isMeshStandardMaterial||H.isShaderMaterial||H.skinning)&&qe.setValue(G,"viewMatrix",S.matrixWorldInverse)}if(H.skinning){qe.setOptional(G,j,"bindMatrix"),qe.setOptional(G,j,"bindMatrixInverse");var xt=j.skeleton;if(xt){var vn=xt.bones;if(Te.floatVertexTextures){if(xt.boneTexture===void 0){var st=Math.sqrt(vn.length*4);st=ke.ceilPowerOfTwo(st),st=Math.max(st,4);var Xn=new Float32Array(st*st*4);Xn.set(xt.boneMatrices);var mr=new oi(Xn,st,st,on,Qn);xt.boneMatrices=Xn,xt.boneTexture=mr,xt.boneTextureSize=st}qe.setValue(G,"boneTexture",xt.boneTexture,Ye),qe.setValue(G,"boneTextureSize",xt.boneTextureSize)}else qe.setOptional(G,xt,"boneMatrices")}}return(Ke||Ae.receiveShadow!==j.receiveShadow)&&(Ae.receiveShadow=j.receiveShadow,qe.setValue(G,"receiveShadow",j.receiveShadow)),Ke&&(qe.setValue(G,"toneMappingExposure",d.toneMappingExposure),qe.setValue(G,"toneMappingWhitePoint",d.toneMappingWhitePoint),Ae.needsLights&&Ni(yt,Je),se&&H.fog&&L.refreshFogUniforms(yt,se),L.refreshMaterialUniforms(yt,H,Ge,V,B),yt.ltc_1!==void 0&&(yt.ltc_1.value=le.LTC_1),yt.ltc_2!==void 0&&(yt.ltc_2.value=le.LTC_2),or.upload(G,Ae.uniformsList,yt,Ye)),H.isShaderMaterial&&H.uniformsNeedUpdate===!0&&(or.upload(G,Ae.uniformsList,yt,Ye),H.uniformsNeedUpdate=!1),H.isSpriteMaterial&&qe.setValue(G,"center",j.center),qe.setValue(G,"modelViewMatrix",j.modelViewMatrix),qe.setValue(G,"normalMatrix",j.normalMatrix),qe.setValue(G,"modelMatrix",j.matrixWorld),ze}function Ni(S,W){S.ambientLightColor.needsUpdate=W,S.lightProbe.needsUpdate=W,S.directionalLights.needsUpdate=W,S.directionalLightShadows.needsUpdate=W,S.pointLights.needsUpdate=W,S.pointLightShadows.needsUpdate=W,S.spotLights.needsUpdate=W,S.spotLightShadows.needsUpdate=W,S.rectAreaLights.needsUpdate=W,S.hemisphereLights.needsUpdate=W}function Br(S){return S.isMeshLambertMaterial||S.isMeshToonMaterial||S.isMeshPhongMaterial||S.isMeshStandardMaterial||S.isShadowMaterial||S.isShaderMaterial&&S.lights===!0}this.setFramebuffer=function(S){g!==S&&v===null&&G.bindFramebuffer(36160,S),g=S},this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return p},this.getRenderTarget=function(){return v},this.setRenderTarget=function(S,W,H){v=S,y=W,p=H,S&&Ce.get(S).__webglFramebuffer===void 0&&Ye.setupRenderTarget(S);var j=g,se=!1;if(S){var Ge=Ce.get(S).__webglFramebuffer;S.isWebGLCubeRenderTarget?(j=Ge[W||0],se=!0):S.isWebGLMultisampleRenderTarget?j=Ce.get(S).__webglMultisampledFramebuffer:j=Ge,N.copy(S.viewport),O.copy(S.scissor),J=S.scissorTest}else N.copy(z).multiplyScalar(V).floor(),O.copy(k).multiplyScalar(V).floor(),J=q;if(_!==j&&(G.bindFramebuffer(36160,j),_=j),ue.viewport(N),ue.scissor(O),ue.setScissorTest(J),se){var Ie=Ce.get(S.texture);G.framebufferTexture2D(36160,36064,34069+(W||0),Ie.__webglTexture,H||0)}},this.readRenderTargetPixels=function(S,W,H,j,se,Ge,Ie){if(!(S&&S.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}var Ae=Ce.get(S).__webglFramebuffer;if(S.isWebGLCubeRenderTarget&&Ie!==void 0&&(Ae=Ae[Ie]),Ae){var Ue=!1;Ae!==_&&(G.bindFramebuffer(36160,Ae),Ue=!0);try{var He=S.texture,ct=He.format,Ke=He.type;if(ct!==on&&fe.convert(ct)!==G.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(Ke!==Wi&&fe.convert(Ke)!==G.getParameter(35738)&&!(Ke===Qn&&(Te.isWebGL2||xe.get("OES_texture_float")||xe.get("WEBGL_color_buffer_float")))&&!(Ke===no&&(Te.isWebGL2?xe.get("EXT_color_buffer_float"):xe.get("EXT_color_buffer_half_float")))){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}G.checkFramebufferStatus(36160)===36053?W>=0&&W<=S.width-j&&H>=0&&H<=S.height-se&&G.readPixels(W,H,j,se,fe.convert(ct),fe.convert(Ke),Ge):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{Ue&&G.bindFramebuffer(36160,_)}}},this.copyFramebufferToTexture=function(S,W,H){H===void 0&&(H=0);var j=Math.pow(2,-H),se=Math.floor(W.image.width*j),Ge=Math.floor(W.image.height*j),Ie=fe.convert(W.format);Ye.setTexture2D(W,0),G.copyTexImage2D(3553,H,Ie,S.x,S.y,se,Ge,0),ue.unbindTexture()},this.copyTextureToTexture=function(S,W,H,j){j===void 0&&(j=0);var se=W.image.width,Ge=W.image.height,Ie=fe.convert(H.format),Ae=fe.convert(H.type);Ye.setTexture2D(H,0),W.isDataTexture?G.texSubImage2D(3553,j,S.x,S.y,se,Ge,Ie,Ae,W.image.data):W.isCompressedTexture?G.compressedTexSubImage2D(3553,j,S.x,S.y,W.mipmaps[0].width,W.mipmaps[0].height,Ie,W.mipmaps[0].data):G.texSubImage2D(3553,j,S.x,S.y,Ie,Ae,W.image),j===0&&H.generateMipmaps&&G.generateMipmap(3553),ue.unbindTexture()},this.initTexture=function(S){Ye.setTexture2D(S,0),ue.unbindTexture()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Tl(e,t){this.name="",this.color=new de(e),this.density=t!==void 0?t:25e-5}Object.assign(Tl.prototype,{isFogExp2:!0,clone:function(){return new Tl(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}});function Sl(e,t,n){this.name="",this.color=new de(e),this.near=t!==void 0?t:1,this.far=n!==void 0?n:1e3}Object.assign(Sl.prototype,{isFog:!0,clone:function(){return new Sl(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}});function sr(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=so,this.updateRange={offset:0,count:-1},this.version=0}Object.defineProperty(sr.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),Object.assign(sr.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 r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this},set:function(e,t){return t===void 0&&(t=0),this.array.set(e,t),this},clone:function(){return new this.constructor().copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}});var Sr=new E;function Ao(e,t,n,r){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r===!0}Object.defineProperties(Ao.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Ao.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)Sr.x=this.getX(t),Sr.y=this.getY(t),Sr.z=this.getZ(t),Sr.applyMatrix4(e),this.setXYZ(t,Sr.x,Sr.y,Sr.z);return this},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,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,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]=r,this.data.array[e+3]=i,this},clone:function(){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");for(var e=[],t=0;t<this.count;t++)for(var n=t*this.data.stride+this.offset,r=0;r<this.itemSize;r++)e.push(this.data.array[n+r]);return new De(new this.array.constructor(e),this.itemSize,this.normalized)},toJSON:function(){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");for(var e=[],t=0;t<this.count;t++)for(var n=t*this.data.stride+this.offset,r=0;r<this.itemSize;r++)e.push(this.data.array[n+r]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}});function Ar(e){Oe.call(this),this.type="SpriteMaterial",this.color=new de(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}Ar.prototype=Object.create(Oe.prototype),Ar.prototype.constructor=Ar,Ar.prototype.isSpriteMaterial=!0,Ar.prototype.copy=function(e){return Oe.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 ui,ha=new E,hi=new E,fi=new E,di=new X,fa=new X,Zu=new We,Lo=new E,da=new E,Po=new E,Ju=new X,Al=new X,Qu=new X;function Ll(e){if(ae.call(this),this.type="Sprite",ui===void 0){ui=new ve;var t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new sr(t,5);ui.setIndex([0,1,2,0,2,3]),ui.setAttribute("position",new Ao(n,3,0,!1)),ui.setAttribute("uv",new Ao(n,2,3,!1))}this.geometry=ui,this.material=e!==void 0?e:new Ar,this.center=new X(.5,.5)}Ll.prototype=Object.assign(Object.create(ae.prototype),{constructor:Ll,isSprite:!0,raycast:function(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),hi.setFromMatrixScale(this.matrixWorld),Zu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),fi.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&hi.multiplyScalar(-fi.z);var n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));var a=this.center;Co(Lo.set(-.5,-.5,0),fi,a,hi,r,i),Co(da.set(.5,-.5,0),fi,a,hi,r,i),Co(Po.set(.5,.5,0),fi,a,hi,r,i),Ju.set(0,0),Al.set(1,0),Qu.set(1,1);var o=e.ray.intersectTriangle(Lo,da,Po,!1,ha);if(!(o===null&&(Co(da.set(-.5,.5,0),fi,a,hi,r,i),Al.set(0,1),o=e.ray.intersectTriangle(Lo,Po,da,!1,ha),o===null))){var s=e.ray.origin.distanceTo(ha);s<e.near||s>e.far||t.push({distance:s,point:ha.clone(),uv:Rt.getUV(ha,Lo,da,Po,Ju,Al,Qu,new X),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return ae.prototype.copy.call(this,e),e.center!==void 0&&this.center.copy(e.center),this}});function Co(e,t,n,r,i,a){di.subVectors(e,n).addScalar(.5).multiply(r),i!==void 0?(fa.x=a*di.x-i*di.y,fa.y=i*di.x+a*di.y):fa.copy(di),e.copy(t),e.x+=fa.x,e.y+=fa.y,e.applyMatrix4(Zu)}var Ro=new E,Ku=new E;function Oo(){ae.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}Oo.prototype=Object.assign(Object.create(ae.prototype),{constructor:Oo,isLOD:!0,copy:function(e){ae.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){t===void 0&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,object:e}),this.add(e),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(e){var t=this.levels;if(t.length>0){for(var n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){var n=this.levels;if(n.length>0){Ro.setFromMatrixPosition(this.matrixWorld);var r=e.ray.origin.distanceTo(Ro);this.getObjectForDistance(r).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){Ro.setFromMatrixPosition(e.matrixWorld),Ku.setFromMatrixPosition(this.matrixWorld);var n=Ro.distanceTo(Ku)/e.zoom;t[0].object.visible=!0;for(var r=1,i=t.length;r<i&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}},toJSON:function(e){var t=ae.prototype.toJSON.call(this,e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}});function Pl(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),ut.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new We,this.bindMatrixInverse=new We}Pl.prototype=Object.assign(Object.create(ut.prototype),{constructor:Pl,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,t===void 0&&(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 et,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var i=1/e.manhattanLength();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){ut.prototype.updateMatrixWorld.call(this,e),this.bindMode==="attached"?this.bindMatrixInverse.getInverse(this.matrixWorld):this.bindMode==="detached"?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)},boneTransform:function(){var e=new E,t=new et,n=new et,r=new E,i=new We;return function(a,o){var s=this.skeleton,c=this.geometry;t.fromBufferAttribute(c.attributes.skinIndex,a),n.fromBufferAttribute(c.attributes.skinWeight,a),e.fromBufferAttribute(c.attributes.position,a).applyMatrix4(this.bindMatrix),o.set(0,0,0);for(var l=0;l<4;l++){var u=n.getComponent(l);if(u!==0){var h=t.getComponent(l);i.multiplyMatrices(s.bones[h].matrixWorld,s.boneInverses[h]),o.addScaledVector(r.copy(e).applyMatrix4(i),u)}}return o.applyMatrix4(this.bindMatrixInverse)}}()});var $u=new We,wy=new We;function Cl(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(this.bones.length*16),this.frame=-1,t===void 0)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,r=this.bones.length;n<r;n++)this.boneInverses.push(new We)}}Object.assign(Cl.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new We;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&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)e=this.bones[t],e&&(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,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:wy;$u.multiplyMatrices(o,t[i]),$u.toArray(n,i*16)}r!==void 0&&(r.needsUpdate=!0)},clone:function(){return new Cl(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}});function eh(){ae.call(this),this.type="Bone"}eh.prototype=Object.assign(Object.create(ae.prototype),{constructor:eh,isBone:!0});var th=new We,nh=new We,Do=[],pa=new ut;function Rl(e,t,n){ut.call(this,e,t),this.instanceMatrix=new De(new Float32Array(n*16),16),this.count=n,this.frustumCulled=!1}Rl.prototype=Object.assign(Object.create(ut.prototype),{constructor:Rl,isInstancedMesh:!0,getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,e*16)},raycast:function(e,t){var n=this.matrixWorld,r=this.count;if(pa.geometry=this.geometry,pa.material=this.material,pa.material!==void 0)for(var i=0;i<r;i++){this.getMatrixAt(i,th),nh.multiplyMatrices(n,th),pa.matrixWorld=nh,pa.raycast(e,Do);for(var a=0,o=Do.length;a<o;a++){var s=Do[a];s.instanceId=i,s.object=this,t.push(s)}Do.length=0}},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,e*16)},updateMorphTargets:function(){}});function mt(e){Oe.call(this),this.type="LineBasicMaterial",this.color=new de(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}mt.prototype=Object.create(Oe.prototype),mt.prototype.constructor=mt,mt.prototype.isLineBasicMaterial=!0,mt.prototype.copy=function(e){return Oe.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this};var rh=new E,ih=new E,ah=new We,Io=new Jr,No=new Dn;function tn(e,t,n){n===1&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),ae.call(this),this.type="Line",this.geometry=e!==void 0?e:new ve,this.material=t!==void 0?t:new mt,this.updateMorphTargets()}tn.prototype=Object.assign(Object.create(ae.prototype),{constructor:tn,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(e.index===null){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)rh.fromBufferAttribute(t,r-1),ih.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=rh.distanceTo(ih);e.setAttribute("lineDistance",new ce(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices,n=e.lineDistances;n[0]=0;for(var r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold;if(n.boundingSphere===null&&n.computeBoundingSphere(),No.copy(n.boundingSphere),No.applyMatrix4(r),No.radius+=i,e.ray.intersectsSphere(No)!==!1){ah.getInverse(r),Io.copy(e.ray).applyMatrix4(ah);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new E,c=new E,l=new E,u=new E,h=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var f=n.index,d=n.attributes,m=d.position.array;if(f!==null)for(var g=f.array,y=0,p=g.length-1;y<p;y+=h){var v=g[y],_=g[y+1];s.fromArray(m,v*3),c.fromArray(m,_*3);var x=Io.distanceSqToSegment(s,c,u,l);if(!(x>o)){u.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(u);b<e.near||b>e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else for(var y=0,p=m.length/3-1;y<p;y+=h){s.fromArray(m,3*y),c.fromArray(m,3*y+3);var x=Io.distanceSqToSegment(s,c,u,l);if(!(x>o)){u.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(u);b<e.near||b>e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}else if(n.isGeometry)for(var T=n.vertices,C=T.length,y=0;y<C-1;y+=h){var x=Io.distanceSqToSegment(T[y],T[y+1],u,l);if(!(x>o)){u.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(u);b<e.near||b>e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}},updateMorphTargets:function(){var e=this.geometry,t,n,r;if(e.isBufferGeometry){var i=e.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(o!==void 0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=o.length;t<n;t++)r=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}}else{var s=e.morphTargets;s!==void 0&&s.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Fo=new E,Bo=new E;function Mt(e,t){tn.call(this,e,t),this.type="LineSegments"}Mt.prototype=Object.assign(Object.create(tn.prototype),{constructor:Mt,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(e.index===null){for(var t=e.attributes.position,n=[],r=0,i=t.count;r<i;r+=2)Fo.fromBufferAttribute(t,r),Bo.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Fo.distanceTo(Bo);e.setAttribute("lineDistance",new ce(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry)for(var a=e.vertices,n=e.lineDistances,r=0,i=a.length;r<i;r+=2)Fo.copy(a[r]),Bo.copy(a[r+1]),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Fo.distanceTo(Bo);return this}});function Ol(e,t){tn.call(this,e,t),this.type="LineLoop"}Ol.prototype=Object.assign(Object.create(tn.prototype),{constructor:Ol,isLineLoop:!0});function Lr(e){Oe.call(this),this.type="PointsMaterial",this.color=new de(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}Lr.prototype=Object.create(Oe.prototype),Lr.prototype.constructor=Lr,Lr.prototype.isPointsMaterial=!0,Lr.prototype.copy=function(e){return Oe.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 oh=new We,Dl=new Jr,Uo=new Dn,zo=new E;function Il(e,t){ae.call(this),this.type="Points",this.geometry=e!==void 0?e:new ve,this.material=t!==void 0?t:new Lr,this.updateMorphTargets()}Il.prototype=Object.assign(Object.create(ae.prototype),{constructor:Il,isPoints:!0,raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(n.boundingSphere===null&&n.computeBoundingSphere(),Uo.copy(n.boundingSphere),Uo.applyMatrix4(r),Uo.radius+=i,e.ray.intersectsSphere(Uo)!==!1){oh.getInverse(r),Dl.copy(e.ray).applyMatrix4(oh);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,c=n.attributes,l=c.position.array;if(s!==null)for(var u=s.array,h=0,f=u.length;h<f;h++){var d=u[h];zo.fromArray(l,d*3),Nl(zo,d,o,r,e,t,this)}else for(var h=0,m=l.length/3;h<m;h++)zo.fromArray(l,h*3),Nl(zo,h,o,r,e,t,this)}else for(var g=n.vertices,h=0,m=g.length;h<m;h++)Nl(g[h],h,o,r,e,t,this)}},updateMorphTargets:function(){var e=this.geometry,t,n,r;if(e.isBufferGeometry){var i=e.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(o!==void 0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=o.length;t<n;t++)r=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}}else{var s=e.morphTargets;s!==void 0&&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)}});function Nl(e,t,n,r,i,a,o){var s=Dl.distanceSqToPoint(e);if(s<n){var c=new E;Dl.closestPointToPoint(e,c),c.applyMatrix4(r);var l=i.ray.origin.distanceTo(c);if(l<i.near||l>i.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:c,index:t,face:null,object:o})}}function sh(e,t,n,r,i,a,o,s,c){ot.call(this,e,t,n,r,i,a,o,s,c),this.format=o!==void 0?o:xr,this.minFilter=a!==void 0?a:Dt,this.magFilter=i!==void 0?i:Dt,this.generateMipmaps=!1}sh.prototype=Object.assign(Object.create(ot.prototype),{constructor:sh,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});function va(e,t,n,r,i,a,o,s,c,l,u,h){ot.call(this,null,a,o,s,c,l,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}va.prototype=Object.create(ot.prototype),va.prototype.constructor=va,va.prototype.isCompressedTexture=!0;function Go(e,t,n,r,i,a,o,s,c){ot.call(this,e,t,n,r,i,a,o,s,c),this.needsUpdate=!0}Go.prototype=Object.create(ot.prototype),Go.prototype.constructor=Go,Go.prototype.isCanvasTexture=!0;function Ho(e,t,n,r,i,a,o,s,c,l){if(l=l!==void 0?l:zr,l!==zr&&l!==ji)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&l===zr&&(n=eo),n===void 0&&l===ji&&(n=Xi),ot.call(this,null,r,i,a,o,s,l,n,c),this.image={width:e,height:t},this.magFilter=o!==void 0?o:_t,this.minFilter=s!==void 0?s:_t,this.flipY=!1,this.generateMipmaps=!1}Ho.prototype=Object.create(ot.prototype),Ho.prototype.constructor=Ho,Ho.prototype.isDepthTexture=!0;function Vo(e){ve.call(this),this.type="WireframeGeometry";var t=[],n,r,i,a,o,s=[0,0],c={},l,u,h,f,d=["a","b","c"],m;if(e&&e.isGeometry){var g=e.faces;for(n=0,i=g.length;n<i;n++){var y=g[n];for(r=0;r<3;r++)u=y[d[r]],h=y[d[(r+1)%3]],s[0]=Math.min(u,h),s[1]=Math.max(u,h),f=s[0]+","+s[1],c[f]===void 0&&(c[f]={index1:s[0],index2:s[1]})}for(f in c)l=c[f],m=e.vertices[l.index1],t.push(m.x,m.y,m.z),m=e.vertices[l.index2],t.push(m.x,m.y,m.z)}else if(e&&e.isBufferGeometry){var p,v,_,x,b,T,C,N;if(m=new E,e.index!==null){for(p=e.attributes.position,v=e.index,_=e.groups,_.length===0&&(_=[{start:0,count:v.count,materialIndex:0}]),a=0,o=_.length;a<o;++a)for(x=_[a],b=x.start,T=x.count,n=b,i=b+T;n<i;n+=3)for(r=0;r<3;r++)u=v.getX(n+r),h=v.getX(n+(r+1)%3),s[0]=Math.min(u,h),s[1]=Math.max(u,h),f=s[0]+","+s[1],c[f]===void 0&&(c[f]={index1:s[0],index2:s[1]});for(f in c)l=c[f],m.fromBufferAttribute(p,l.index1),t.push(m.x,m.y,m.z),m.fromBufferAttribute(p,l.index2),t.push(m.x,m.y,m.z)}else for(p=e.attributes.position,n=0,i=p.count/3;n<i;n++)for(r=0;r<3;r++)C=3*n+r,m.fromBufferAttribute(p,C),t.push(m.x,m.y,m.z),N=3*n+(r+1)%3,m.fromBufferAttribute(p,N),t.push(m.x,m.y,m.z)}this.setAttribute("position",new ce(t,3))}Vo.prototype=Object.create(ve.prototype),Vo.prototype.constructor=Vo;function ko(e,t,n){Ne.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new ma(e,t,n)),this.mergeVertices()}ko.prototype=Object.create(Ne.prototype),ko.prototype.constructor=ko;function ma(e,t,n){ve.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r=[],i=[],a=[],o=[],s=1e-5,c=new E,l=new E,u=new E,h=new E,f=new E,d,m;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var g=t+1;for(d=0;d<=n;d++){var y=d/n;for(m=0;m<=t;m++){var p=m/t;e(p,y,l),i.push(l.x,l.y,l.z),p-s>=0?(e(p-s,y,u),h.subVectors(l,u)):(e(p+s,y,u),h.subVectors(u,l)),y-s>=0?(e(p,y-s,u),f.subVectors(l,u)):(e(p,y+s,u),f.subVectors(u,l)),c.crossVectors(h,f).normalize(),a.push(c.x,c.y,c.z),o.push(p,y)}}for(d=0;d<n;d++)for(m=0;m<t;m++){var v=d*g+m,_=d*g+m+1,x=(d+1)*g+m+1,b=(d+1)*g+m;r.push(v,_,b),r.push(_,x,b)}this.setIndex(r),this.setAttribute("position",new ce(i,3)),this.setAttribute("normal",new ce(a,3)),this.setAttribute("uv",new ce(o,2))}ma.prototype=Object.create(ve.prototype),ma.prototype.constructor=ma;function Wo(e,t,n,r){Ne.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new Zt(e,t,n,r)),this.mergeVertices()}Wo.prototype=Object.create(Ne.prototype),Wo.prototype.constructor=Wo;function Zt(e,t,n,r){ve.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},n=n||1,r=r||0;var i=[],a=[];o(r),c(n),l(),this.setAttribute("position",new ce(i,3)),this.setAttribute("normal",new ce(i.slice(),3)),this.setAttribute("uv",new ce(a,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(p){for(var v=new E,_=new E,x=new E,b=0;b<t.length;b+=3)f(t[b+0],v),f(t[b+1],_),f(t[b+2],x),s(v,_,x,p)}function s(p,v,_,x){var b=Math.pow(2,x),T=[],C,N;for(C=0;C<=b;C++){T[C]=[];var O=p.clone().lerp(_,C/b),J=v.clone().lerp(_,C/b),F=b-C;for(N=0;N<=F;N++)N===0&&C===b?T[C][N]=O:T[C][N]=O.clone().lerp(J,N/F)}for(C=0;C<b;C++)for(N=0;N<2*(b-C)-1;N++){var B=Math.floor(N/2);N%2===0?(h(T[C][B+1]),h(T[C+1][B]),h(T[C][B])):(h(T[C][B+1]),h(T[C+1][B+1]),h(T[C+1][B]))}}function c(p){for(var v=new E,_=0;_<i.length;_+=3)v.x=i[_+0],v.y=i[_+1],v.z=i[_+2],v.normalize().multiplyScalar(p),i[_+0]=v.x,i[_+1]=v.y,i[_+2]=v.z}function l(){for(var p=new E,v=0;v<i.length;v+=3){p.x=i[v+0],p.y=i[v+1],p.z=i[v+2];var _=g(p)/2/Math.PI+.5,x=y(p)/Math.PI+.5;a.push(_,1-x)}d(),u()}function u(){for(var p=0;p<a.length;p+=6){var v=a[p+0],_=a[p+2],x=a[p+4],b=Math.max(v,_,x),T=Math.min(v,_,x);b>.9&&T<.1&&(v<.2&&(a[p+0]+=1),_<.2&&(a[p+2]+=1),x<.2&&(a[p+4]+=1))}}function h(p){i.push(p.x,p.y,p.z)}function f(p,v){var _=p*3;v.x=e[_+0],v.y=e[_+1],v.z=e[_+2]}function d(){for(var p=new E,v=new E,_=new E,x=new E,b=new X,T=new X,C=new X,N=0,O=0;N<i.length;N+=9,O+=6){p.set(i[N+0],i[N+1],i[N+2]),v.set(i[N+3],i[N+4],i[N+5]),_.set(i[N+6],i[N+7],i[N+8]),b.set(a[O+0],a[O+1]),T.set(a[O+2],a[O+3]),C.set(a[O+4],a[O+5]),x.copy(p).add(v).add(_).divideScalar(3);var J=g(x);m(b,O+0,p,J),m(T,O+2,v,J),m(C,O+4,_,J)}}function m(p,v,_,x){x<0&&p.x===1&&(a[v]=p.x-1),_.x===0&&_.z===0&&(a[v]=x/2/Math.PI+.5)}function g(p){return Math.atan2(p.z,-p.x)}function y(p){return Math.atan2(-p.y,Math.sqrt(p.x*p.x+p.z*p.z))}}Zt.prototype=Object.create(ve.prototype),Zt.prototype.constructor=Zt;function Xo(e,t){Ne.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ga(e,t)),this.mergeVertices()}Xo.prototype=Object.create(Ne.prototype),Xo.prototype.constructor=Xo;function ga(e,t){var n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];Zt.call(this,n,r,e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}ga.prototype=Object.create(Zt.prototype),ga.prototype.constructor=ga;function jo(e,t){Ne.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new pi(e,t)),this.mergeVertices()}jo.prototype=Object.create(Ne.prototype),jo.prototype.constructor=jo;function pi(e,t){var n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];Zt.call(this,n,r,e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}pi.prototype=Object.create(Zt.prototype),pi.prototype.constructor=pi;function qo(e,t){Ne.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ya(e,t)),this.mergeVertices()}qo.prototype=Object.create(Ne.prototype),qo.prototype.constructor=qo;function ya(e,t){var n=(1+Math.sqrt(5))/2,r=[-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],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];Zt.call(this,r,i,e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}ya.prototype=Object.create(Zt.prototype),ya.prototype.constructor=ya;function Yo(e,t){Ne.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new xa(e,t)),this.mergeVertices()}Yo.prototype=Object.create(Ne.prototype),Yo.prototype.constructor=Yo;function xa(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],a=[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];Zt.call(this,i,a,e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}xa.prototype=Object.create(Zt.prototype),xa.prototype.constructor=xa;function Zo(e,t,n,r,i,a){Ne.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},a!==void 0&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new vi(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}Zo.prototype=Object.create(Ne.prototype),Zo.prototype.constructor=Zo;function vi(e,t,n,r,i){ve.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},t=t||64,n=n||1,r=r||8,i=i||!1;var a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o=new E,s=new E,c=new X,l=new E,u,h,f=[],d=[],m=[],g=[];y(),this.setIndex(g),this.setAttribute("position",new ce(f,3)),this.setAttribute("normal",new ce(d,3)),this.setAttribute("uv",new ce(m,2));function y(){for(u=0;u<t;u++)p(u);p(i===!1?t:0),_(),v()}function p(x){l=e.getPointAt(x/t,l);var b=a.normals[x],T=a.binormals[x];for(h=0;h<=r;h++){var C=h/r*Math.PI*2,N=Math.sin(C),O=-Math.cos(C);s.x=O*b.x+N*T.x,s.y=O*b.y+N*T.y,s.z=O*b.z+N*T.z,s.normalize(),d.push(s.x,s.y,s.z),o.x=l.x+n*s.x,o.y=l.y+n*s.y,o.z=l.z+n*s.z,f.push(o.x,o.y,o.z)}}function v(){for(h=1;h<=t;h++)for(u=1;u<=r;u++){var x=(r+1)*(h-1)+(u-1),b=(r+1)*h+(u-1),T=(r+1)*h+u,C=(r+1)*(h-1)+u;g.push(x,b,C),g.push(b,T,C)}}function _(){for(u=0;u<=t;u++)for(h=0;h<=r;h++)c.x=u/t,c.y=h/r,m.push(c.x,c.y)}}vi.prototype=Object.create(ve.prototype),vi.prototype.constructor=vi,vi.prototype.toJSON=function(){var e=ve.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e};function Jo(e,t,n,r,i,a,o){Ne.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},o!==void 0&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new _a(e,t,n,r,i,a)),this.mergeVertices()}Jo.prototype=Object.create(Ne.prototype),Jo.prototype.constructor=Jo;function _a(e,t,n,r,i,a){ve.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var o=[],s=[],c=[],l=[],u,h,f=new E,d=new E,m=new E,g=new E,y=new E,p=new E,v=new E;for(u=0;u<=n;++u){var _=u/n*i*Math.PI*2;for(F(_,i,a,e,m),F(_+.01,i,a,e,g),p.subVectors(g,m),v.addVectors(g,m),y.crossVectors(p,v),v.crossVectors(y,p),y.normalize(),v.normalize(),h=0;h<=r;++h){var x=h/r*Math.PI*2,b=-t*Math.cos(x),T=t*Math.sin(x);f.x=m.x+(b*v.x+T*y.x),f.y=m.y+(b*v.y+T*y.y),f.z=m.z+(b*v.z+T*y.z),s.push(f.x,f.y,f.z),d.subVectors(f,m).normalize(),c.push(d.x,d.y,d.z),l.push(u/n),l.push(h/r)}}for(h=1;h<=n;h++)for(u=1;u<=r;u++){var C=(r+1)*(h-1)+(u-1),N=(r+1)*h+(u-1),O=(r+1)*h+u,J=(r+1)*(h-1)+u;o.push(C,N,J),o.push(N,O,J)}this.setIndex(o),this.setAttribute("position",new ce(s,3)),this.setAttribute("normal",new ce(c,3)),this.setAttribute("uv",new ce(l,2));function F(B,V,Y,D,z){var k=Math.cos(B),q=Math.sin(B),Z=Y/V*B,ee=Math.cos(Z);z.x=D*(2+ee)*.5*k,z.y=D*(2+ee)*q*.5,z.z=D*Math.sin(Z)*.5}}_a.prototype=Object.create(ve.prototype),_a.prototype.constructor=_a;function Qo(e,t,n,r,i){Ne.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new ba(e,t,n,r,i)),this.mergeVertices()}Qo.prototype=Object.create(Ne.prototype),Qo.prototype.constructor=Qo;function ba(e,t,n,r,i){ve.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||Math.PI*2;var a=[],o=[],s=[],c=[],l=new E,u=new E,h=new E,f,d;for(f=0;f<=n;f++)for(d=0;d<=r;d++){var m=d/r*i,g=f/n*Math.PI*2;u.x=(e+t*Math.cos(g))*Math.cos(m),u.y=(e+t*Math.cos(g))*Math.sin(m),u.z=t*Math.sin(g),o.push(u.x,u.y,u.z),l.x=e*Math.cos(m),l.y=e*Math.sin(m),h.subVectors(u,l).normalize(),s.push(h.x,h.y,h.z),c.push(d/r),c.push(f/n)}for(f=1;f<=n;f++)for(d=1;d<=r;d++){var y=(r+1)*f+d-1,p=(r+1)*(f-1)+d-1,v=(r+1)*(f-1)+d,_=(r+1)*f+d;a.push(y,p,_),a.push(p,v,_)}this.setIndex(a),this.setAttribute("position",new ce(o,3)),this.setAttribute("normal",new ce(s,3)),this.setAttribute("uv",new ce(c,2))}ba.prototype=Object.create(ve.prototype),ba.prototype.constructor=ba;var My={triangulate:function(e,t,n){n=n||2;var r=t&&t.length,i=r?t[0]*n:e.length,a=lh(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;var s,c,l,u,h,f,d;if(r&&(a=Ly(e,t,a,n)),e.length>80*n){s=l=e[0],c=u=e[1];for(var m=n;m<i;m+=n)h=e[m],f=e[m+1],h<s&&(s=h),f<c&&(c=f),h>l&&(l=h),f>u&&(u=f);d=Math.max(l-s,u-c),d=d!==0?1/d:0}return wa(a,o,n,s,c,d),o}};function lh(e,t,n,r,i){var a,o;if(i===zy(e,t,n,r)>0)for(a=t;a<n;a+=r)o=hh(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=hh(a,e[a],e[a+1],o);return o&&Ko(o,o.next)&&(Ea(o),o=o.next),o}function lr(e,t){if(!e)return e;t||(t=e);var n=e,r;do if(r=!1,!n.steiner&&(Ko(n,n.next)||ht(n.prev,n,n.next)===0)){if(Ea(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function wa(e,t,n,r,i,a,o){if(e){!o&&a&&Dy(e,r,i,a);for(var s=e,c,l;e.prev!==e.next;){if(c=e.prev,l=e.next,a?Ty(e,r,i,a):Ey(e)){t.push(c.i/n),t.push(e.i/n),t.push(l.i/n),Ea(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=Sy(lr(e),t,n),wa(e,t,n,r,i,a,2)):o===2&&Ay(e,t,n,r,i,a):wa(lr(e),t,n,r,i,a,1);break}}}}function Ey(e){var t=e.prev,n=e,r=e.next;if(ht(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(mi(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&ht(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ty(e,t,n,r){var i=e.prev,a=e,o=e.next;if(ht(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,c=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,l=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=Fl(s,c,t,n,r),f=Fl(l,u,t,n,r),d=e.prevZ,m=e.nextZ;d&&d.z>=h&&m&&m.z<=f;){if(d!==e.prev&&d!==e.next&&mi(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ht(d.prev,d,d.next)>=0||(d=d.prevZ,m!==e.prev&&m!==e.next&&mi(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&ht(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&&mi(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ht(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;m&&m.z<=f;){if(m!==e.prev&&m!==e.next&&mi(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&ht(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Sy(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!Ko(i,a)&&ch(i,r,r.next,a)&&Ma(i,a)&&Ma(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),Ea(r),Ea(r.next),r=e=a),r=r.next}while(r!==e);return lr(r)}function Ay(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Fy(o,s)){var c=uh(o,s);o=lr(o,o.next),c=lr(c,c.next),wa(o,t,n,r,i,a),wa(c,t,n,r,i,a);return}s=s.next}o=o.next}while(o!==e)}function Ly(e,t,n,r){var i=[],a,o,s,c,l;for(a=0,o=t.length;a<o;a++)s=t[a]*r,c=a<o-1?t[a+1]*r:e.length,l=lh(e,s,c,r,!1),l===l.next&&(l.steiner=!0),i.push(Ny(l));for(i.sort(Py),a=0;a<i.length;a++)Cy(i[a],n),n=lr(n,n.next);return n}function Py(e,t){return e.x-t.x}function Cy(e,t){if(t=Ry(e,t),t){var n=uh(t,e);lr(t,t.next),lr(n,n.next)}}function Ry(e,t){var n=t,r=e.x,i=e.y,a=-1/0,o;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a){if(a=s,s===r){if(i===n.y)return n;if(i===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!o)return null;if(r===a)return o;var c=o,l=o.x,u=o.y,h=1/0,f;n=o;do r>=n.x&&n.x>=l&&r!==n.x&&mi(i<u?r:a,i,l,u,i<u?a:r,i,n.x,n.y)&&(f=Math.abs(i-n.y)/(r-n.x),Ma(n,e)&&(f<h||f===h&&(n.x>o.x||n.x===o.x&&Oy(o,n)))&&(o=n,h=f)),n=n.next;while(n!==c);return o}function Oy(e,t){return ht(e.prev,e,t.prev)<0&&ht(t.next,e,e.next)<0}function Dy(e,t,n,r){var i=e;do i.z===null&&(i.z=Fl(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,Iy(i)}function Iy(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ,!!r);t++);for(c=l;s>0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function Fl(e,t,n,r,i){return e=32767*(e-n)*i,t=32767*(t-r)*i,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Ny(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 mi(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function Fy(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!By(e,t)&&(Ma(e,t)&&Ma(t,e)&&Uy(e,t)&&(ht(e.prev,e,t.prev)||ht(e,t.prev,t))||Ko(e,t)&&ht(e.prev,e,e.next)>0&&ht(t.prev,t,t.next)>0)}function ht(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Ko(e,t){return e.x===t.x&&e.y===t.y}function ch(e,t,n,r){var i=es(ht(e,t,n)),a=es(ht(e,t,r)),o=es(ht(n,r,e)),s=es(ht(n,r,t));return!!(i!==a&&o!==s||i===0&&$o(e,n,t)||a===0&&$o(e,r,t)||o===0&&$o(n,e,r)||s===0&&$o(n,t,r))}function $o(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function es(e){return e>0?1:e<0?-1:0}function By(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&&ch(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Ma(e,t){return ht(e.prev,e,e.next)<0?ht(e,t,e.next)>=0&&ht(e,e.prev,t)>=0:ht(e,t,e.prev)<0||ht(e,e.next,t)<0}function Uy(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function uh(e,t){var n=new Bl(e.i,e.x,e.y),r=new Bl(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function hh(e,t,n,r){var i=new Bl(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ea(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 Bl(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}function zy(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}var cr={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return n*.5},isClockWise:function(e){return cr.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];fh(e),dh(n,e);var a=e.length;t.forEach(fh);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,dh(n,t[o]);for(var s=My.triangulate(n,r),o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};function fh(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function dh(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function gi(e,t){Ne.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new zn(e,t)),this.mergeVertices()}gi.prototype=Object.create(Ne.prototype),gi.prototype.constructor=gi,gi.prototype.toJSON=function(){var e=Ne.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return ph(t,n,e)};function zn(e,t){ve.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];for(var n=this,r=[],i=[],a=0,o=e.length;a<o;a++){var s=e[a];c(s)}this.setAttribute("position",new ce(r,3)),this.setAttribute("uv",new ce(i,2)),this.computeVertexNormals();function c(l){var u=[],h=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1,d=t.depth!==void 0?t.depth:100,m=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:6,y=t.bevelSize!==void 0?t.bevelSize:g-2,p=t.bevelOffset!==void 0?t.bevelOffset:0,v=t.bevelSegments!==void 0?t.bevelSegments:3,_=t.extrudePath,x=t.UVGenerator!==void 0?t.UVGenerator:Gy;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),d=t.amount);var b,T=!1,C,N,O,J;_&&(b=_.getSpacedPoints(f),T=!0,m=!1,C=_.computeFrenetFrames(f,!1),N=new E,O=new E,J=new E),m||(v=0,g=0,y=0,p=0);var F,B,V,Y=l.extractPoints(h),D=Y.shape,z=Y.holes,k=!cr.isClockWise(D);if(k)for(D=D.reverse(),B=0,V=z.length;B<V;B++)F=z[B],cr.isClockWise(F)&&(z[B]=F.reverse());var q=cr.triangulateShape(D,z),Z=D;for(B=0,V=z.length;B<V;B++)F=z[B],D=D.concat(F);function ee(ie,Se,pe){return Se||console.error("THREE.ExtrudeGeometry: vec does not exist"),Se.clone().multiplyScalar(pe).add(ie)}var te,oe,Pe,be,re,G=D.length,Be,xe=q.length;function Te(ie,Se,pe){var Re,I,we,Me=ie.x-Se.x,Ve=ie.y-Se.y,Ee=pe.x-ie.x,Ze=pe.y-ie.y,it=Me*Me+Ve*Ve,pt=Me*Ze-Ve*Ee;if(Math.abs(pt)>Number.EPSILON){var Ht=Math.sqrt(it),at=Math.sqrt(Ee*Ee+Ze*Ze),Pt=Se.x-Ve/Ht,Ot=Se.y+Me/Ht,Kt=pe.x-Ze/at,Ii=pe.y+Ee/at,Ni=((Kt-Pt)*Ze-(Ii-Ot)*Ee)/(Me*Ze-Ve*Ee);Re=Pt+Me*Ni-ie.x,I=Ot+Ve*Ni-ie.y;var Br=Re*Re+I*I;if(Br<=2)return new X(Re,I);we=Math.sqrt(Br/2)}else{var S=!1;Me>Number.EPSILON?Ee>Number.EPSILON&&(S=!0):Me<-Number.EPSILON?Ee<-Number.EPSILON&&(S=!0):Math.sign(Ve)===Math.sign(Ze)&&(S=!0),S?(Re=-Ve,I=Me,we=Math.sqrt(it)):(Re=Me,I=Ve,we=Math.sqrt(it/2))}return new X(Re/we,I/we)}for(var ue=[],$=0,Ce=Z.length,Ye=Ce-1,Qe=$+1;$<Ce;$++,Ye++,Qe++)Ye===Ce&&(Ye=0),Qe===Ce&&(Qe=0),ue[$]=Te(Z[$],Z[Ye],Z[Qe]);var nt=[],$e,A=ue.concat();for(B=0,V=z.length;B<V;B++){for(F=z[B],$e=[],$=0,Ce=F.length,Ye=Ce-1,Qe=$+1;$<Ce;$++,Ye++,Qe++)Ye===Ce&&(Ye=0),Qe===Ce&&(Qe=0),$e[$]=Te(F[$],F[Ye],F[Qe]);nt.push($e),A=A.concat($e)}for(te=0;te<v;te++){for(Pe=te/v,be=g*Math.cos(Pe*Math.PI/2),oe=y*Math.sin(Pe*Math.PI/2)+p,$=0,Ce=Z.length;$<Ce;$++)re=ee(Z[$],ue[$],oe),ye(re.x,re.y,-be);for(B=0,V=z.length;B<V;B++)for(F=z[B],$e=nt[B],$=0,Ce=F.length;$<Ce;$++)re=ee(F[$],$e[$],oe),ye(re.x,re.y,-be)}for(oe=y+p,$=0;$<G;$++)re=m?ee(D[$],A[$],oe):D[$],T?(O.copy(C.normals[0]).multiplyScalar(re.x),N.copy(C.binormals[0]).multiplyScalar(re.y),J.copy(b[0]).add(O).add(N),ye(J.x,J.y,J.z)):ye(re.x,re.y,0);var L;for(L=1;L<=f;L++)for($=0;$<G;$++)re=m?ee(D[$],A[$],oe):D[$],T?(O.copy(C.normals[L]).multiplyScalar(re.x),N.copy(C.binormals[L]).multiplyScalar(re.y),J.copy(b[L]).add(O).add(N),ye(J.x,J.y,J.z)):ye(re.x,re.y,d/f*L);for(te=v-1;te>=0;te--){for(Pe=te/v,be=g*Math.cos(Pe*Math.PI/2),oe=y*Math.sin(Pe*Math.PI/2)+p,$=0,Ce=Z.length;$<Ce;$++)re=ee(Z[$],ue[$],oe),ye(re.x,re.y,d+be);for(B=0,V=z.length;B<V;B++)for(F=z[B],$e=nt[B],$=0,Ce=F.length;$<Ce;$++)re=ee(F[$],$e[$],oe),T?ye(re.x,re.y+b[f-1].y,b[f-1].x+be):ye(re.x,re.y,d+be)}ne(),K();function ne(){var ie=r.length/3;if(m){var Se=0,pe=G*Se;for($=0;$<xe;$++)Be=q[$],R(Be[2]+pe,Be[1]+pe,Be[0]+pe);for(Se=f+v*2,pe=G*Se,$=0;$<xe;$++)Be=q[$],R(Be[0]+pe,Be[1]+pe,Be[2]+pe)}else{for($=0;$<xe;$++)Be=q[$],R(Be[2],Be[1],Be[0]);for($=0;$<xe;$++)Be=q[$],R(Be[0]+G*f,Be[1]+G*f,Be[2]+G*f)}n.addGroup(ie,r.length/3-ie,0)}function K(){var ie=r.length/3,Se=0;for(Fe(Z,Se),Se+=Z.length,B=0,V=z.length;B<V;B++)F=z[B],Fe(F,Se),Se+=F.length;n.addGroup(ie,r.length/3-ie,1)}function Fe(ie,Se){var pe,Re;for($=ie.length;--$>=0;){pe=$,Re=$-1,Re<0&&(Re=ie.length-1);var I=0,we=f+v*2;for(I=0;I<we;I++){var Me=G*I,Ve=G*(I+1),Ee=Se+pe+Me,Ze=Se+Re+Me,it=Se+Re+Ve,pt=Se+pe+Ve;he(Ee,Ze,it,pt)}}}function ye(ie,Se,pe){u.push(ie),u.push(Se),u.push(pe)}function R(ie,Se,pe){fe(ie),fe(Se),fe(pe);var Re=r.length/3,I=x.generateTopUV(n,r,Re-3,Re-2,Re-1);me(I[0]),me(I[1]),me(I[2])}function he(ie,Se,pe,Re){fe(ie),fe(Se),fe(Re),fe(Se),fe(pe),fe(Re);var I=r.length/3,we=x.generateSideWallUV(n,r,I-6,I-3,I-2,I-1);me(we[0]),me(we[1]),me(we[3]),me(we[1]),me(we[2]),me(we[3])}function fe(ie){r.push(u[ie*3+0]),r.push(u[ie*3+1]),r.push(u[ie*3+2])}function me(ie){i.push(ie.x),i.push(ie.y)}}}zn.prototype=Object.create(ve.prototype),zn.prototype.constructor=zn,zn.prototype.toJSON=function(){var e=ve.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return ph(t,n,e)};var Gy={generateTopUV:function(e,t,n,r,i){var a=t[n*3],o=t[n*3+1],s=t[r*3],c=t[r*3+1],l=t[i*3],u=t[i*3+1];return[new X(a,o),new X(s,c),new X(l,u)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[n*3],s=t[n*3+1],c=t[n*3+2],l=t[r*3],u=t[r*3+1],h=t[r*3+2],f=t[i*3],d=t[i*3+1],m=t[i*3+2],g=t[a*3],y=t[a*3+1],p=t[a*3+2];return Math.abs(s-u)<.01?[new X(o,1-c),new X(l,1-h),new X(f,1-m),new X(g,1-p)]:[new X(s,1-c),new X(u,1-h),new X(d,1-m),new X(y,1-p)]}};function ph(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,i=e.length;r<i;r++){var a=e[r];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return t.extrudePath!==void 0&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function ts(e,t){Ne.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new Ta(e,t)),this.mergeVertices()}ts.prototype=Object.create(Ne.prototype),ts.prototype.constructor=ts;function Ta(e,t){t=t||{};var n=t.font;if(!(n&&n.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Ne;var r=n.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),zn.call(this,r,t),this.type="TextBufferGeometry"}Ta.prototype=Object.create(zn.prototype),Ta.prototype.constructor=Ta;function ns(e,t,n,r,i,a,o){Ne.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new yi(e,t,n,r,i,a,o)),this.mergeVertices()}ns.prototype=Object.create(Ne.prototype),ns.prototype.constructor=ns;function yi(e,t,n,r,i,a,o){ve.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=r!==void 0?r:0,i=i!==void 0?i:Math.PI*2,a=a!==void 0?a:0,o=o!==void 0?o:Math.PI;var s=Math.min(a+o,Math.PI),c,l,u=0,h=[],f=new E,d=new E,m=[],g=[],y=[],p=[];for(l=0;l<=n;l++){var v=[],_=l/n,x=0;for(l==0&&a==0?x=.5/t:l==n&&s==Math.PI&&(x=-.5/t),c=0;c<=t;c++){var b=c/t;f.x=-e*Math.cos(r+b*i)*Math.sin(a+_*o),f.y=e*Math.cos(a+_*o),f.z=e*Math.sin(r+b*i)*Math.sin(a+_*o),g.push(f.x,f.y,f.z),d.copy(f).normalize(),y.push(d.x,d.y,d.z),p.push(b+x,1-_),v.push(u++)}h.push(v)}for(l=0;l<n;l++)for(c=0;c<t;c++){var T=h[l][c+1],C=h[l][c],N=h[l+1][c],O=h[l+1][c+1];(l!==0||a>0)&&m.push(T,C,O),(l!==n-1||s<Math.PI)&&m.push(C,N,O)}this.setIndex(m),this.setAttribute("position",new ce(g,3)),this.setAttribute("normal",new ce(y,3)),this.setAttribute("uv",new ce(p,2))}yi.prototype=Object.create(ve.prototype),yi.prototype.constructor=yi;function rs(e,t,n,r,i,a){Ne.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new Sa(e,t,n,r,i,a)),this.mergeVertices()}rs.prototype=Object.create(Ne.prototype),rs.prototype.constructor=rs;function Sa(e,t,n,r,i,a){ve.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},e=e||.5,t=t||1,i=i!==void 0?i:0,a=a!==void 0?a:Math.PI*2,n=n!==void 0?Math.max(3,n):8,r=r!==void 0?Math.max(1,r):1;var o=[],s=[],c=[],l=[],u,h=e,f=(t-e)/r,d=new E,m=new X,g,y;for(g=0;g<=r;g++){for(y=0;y<=n;y++)u=i+y/n*a,d.x=h*Math.cos(u),d.y=h*Math.sin(u),s.push(d.x,d.y,d.z),c.push(0,0,1),m.x=(d.x/t+1)/2,m.y=(d.y/t+1)/2,l.push(m.x,m.y);h+=f}for(g=0;g<r;g++){var p=g*(n+1);for(y=0;y<n;y++){u=y+p;var v=u,_=u+n+1,x=u+n+2,b=u+1;o.push(v,_,b),o.push(_,x,b)}}this.setIndex(o),this.setAttribute("position",new ce(s,3)),this.setAttribute("normal",new ce(c,3)),this.setAttribute("uv",new ce(l,2))}Sa.prototype=Object.create(ve.prototype),Sa.prototype.constructor=Sa;function is(e,t,n,r){Ne.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new Aa(e,t,n,r)),this.mergeVertices()}is.prototype=Object.create(Ne.prototype),is.prototype.constructor=is;function Aa(e,t,n,r){ve.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||Math.PI*2,r=ke.clamp(r,0,Math.PI*2);var i=[],a=[],o=[],s,c=1/t,l=new E,u=new X,h,f;for(h=0;h<=t;h++){var d=n+h*c*r,m=Math.sin(d),g=Math.cos(d);for(f=0;f<=e.length-1;f++)l.x=e[f].x*m,l.y=e[f].y,l.z=e[f].x*g,a.push(l.x,l.y,l.z),u.x=h/t,u.y=f/(e.length-1),o.push(u.x,u.y)}for(h=0;h<t;h++)for(f=0;f<e.length-1;f++){s=f+h*e.length;var y=s,p=s+e.length,v=s+e.length+1,_=s+1;i.push(y,p,_),i.push(p,v,_)}if(this.setIndex(i),this.setAttribute("position",new ce(a,3)),this.setAttribute("uv",new ce(o,2)),this.computeVertexNormals(),r===Math.PI*2){var x=this.attributes.normal.array,b=new E,T=new E,C=new E;for(s=t*e.length*3,h=0,f=0;h<e.length;h++,f+=3)b.x=x[f+0],b.y=x[f+1],b.z=x[f+2],T.x=x[s+f+0],T.y=x[s+f+1],T.z=x[s+f+2],C.addVectors(b,T).normalize(),x[f+0]=x[s+f+0]=C.x,x[f+1]=x[s+f+1]=C.y,x[f+2]=x[s+f+2]=C.z}}Aa.prototype=Object.create(ve.prototype),Aa.prototype.constructor=Aa;function xi(e,t){Ne.call(this),this.type="ShapeGeometry",typeof t=="object"&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new _i(e,t)),this.mergeVertices()}xi.prototype=Object.create(Ne.prototype),xi.prototype.constructor=xi,xi.prototype.toJSON=function(){var e=Ne.prototype.toJSON.call(this),t=this.parameters.shapes;return vh(t,e)};function _i(e,t){ve.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],r=[],i=[],a=[],o=0,s=0;if(Array.isArray(e)===!1)l(e);else for(var c=0;c<e.length;c++)l(e[c]),this.addGroup(o,s,c),o+=s,s=0;this.setIndex(n),this.setAttribute("position",new ce(r,3)),this.setAttribute("normal",new ce(i,3)),this.setAttribute("uv",new ce(a,2));function l(u){var h,f,d,m=r.length/3,g=u.extractPoints(t),y=g.shape,p=g.holes;for(cr.isClockWise(y)===!1&&(y=y.reverse()),h=0,f=p.length;h<f;h++)d=p[h],cr.isClockWise(d)===!0&&(p[h]=d.reverse());var v=cr.triangulateShape(y,p);for(h=0,f=p.length;h<f;h++)d=p[h],y=y.concat(d);for(h=0,f=y.length;h<f;h++){var _=y[h];r.push(_.x,_.y,0),i.push(0,0,1),a.push(_.x,_.y)}for(h=0,f=v.length;h<f;h++){var x=v[h],b=x[0]+m,T=x[1]+m,C=x[2]+m;n.push(b,T,C),s+=3}}}_i.prototype=Object.create(ve.prototype),_i.prototype.constructor=_i,_i.prototype.toJSON=function(){var e=ve.prototype.toJSON.call(this),t=this.parameters.shapes;return vh(t,e)};function vh(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function as(e,t){ve.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1;var n=[],r=Math.cos(ke.DEG2RAD*t),i=[0,0],a={},o,s,c,l=["a","b","c"],u;e.isBufferGeometry?(u=new Ne,u.fromBufferGeometry(e)):u=e.clone(),u.mergeVertices(),u.computeFaceNormals();for(var h=u.vertices,f=u.faces,d=0,m=f.length;d<m;d++)for(var g=f[d],y=0;y<3;y++)o=g[l[y]],s=g[l[(y+1)%3]],i[0]=Math.min(o,s),i[1]=Math.max(o,s),c=i[0]+","+i[1],a[c]===void 0?a[c]={index1:i[0],index2:i[1],face1:d,face2:void 0}:a[c].face2=d;for(c in a){var p=a[c];if(p.face2===void 0||f[p.face1].normal.dot(f[p.face2].normal)<=r){var v=h[p.index1];n.push(v.x,v.y,v.z),v=h[p.index2],n.push(v.x,v.y,v.z)}}this.setAttribute("position",new ce(n,3))}as.prototype=Object.create(ve.prototype),as.prototype.constructor=as;function bi(e,t,n,r,i,a,o,s){Ne.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new ur(e,t,n,r,i,a,o,s)),this.mergeVertices()}bi.prototype=Object.create(Ne.prototype),bi.prototype.constructor=bi;function ur(e,t,n,r,i,a,o,s){ve.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};var c=this;e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,a=a!==void 0?a:!1,o=o!==void 0?o:0,s=s!==void 0?s:Math.PI*2;var l=[],u=[],h=[],f=[],d=0,m=[],g=n/2,y=0;p(),a===!1&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute("position",new ce(u,3)),this.setAttribute("normal",new ce(h,3)),this.setAttribute("uv",new ce(f,2));function p(){var _,x,b=new E,T=new E,C=0,N=(t-e)/n;for(x=0;x<=i;x++){var O=[],J=x/i,F=J*(t-e)+e;for(_=0;_<=r;_++){var B=_/r,V=B*s+o,Y=Math.sin(V),D=Math.cos(V);T.x=F*Y,T.y=-J*n+g,T.z=F*D,u.push(T.x,T.y,T.z),b.set(Y,N,D).normalize(),h.push(b.x,b.y,b.z),f.push(B,1-J),O.push(d++)}m.push(O)}for(_=0;_<r;_++)for(x=0;x<i;x++){var z=m[x][_],k=m[x+1][_],q=m[x+1][_+1],Z=m[x][_+1];l.push(z,k,Z),l.push(k,q,Z),C+=6}c.addGroup(y,C,0),y+=C}function v(_){var x,b,T,C=new X,N=new E,O=0,J=_===!0?e:t,F=_===!0?1:-1;for(b=d,x=1;x<=r;x++)u.push(0,g*F,0),h.push(0,F,0),f.push(.5,.5),d++;for(T=d,x=0;x<=r;x++){var B=x/r,V=B*s+o,Y=Math.cos(V),D=Math.sin(V);N.x=J*D,N.y=g*F,N.z=J*Y,u.push(N.x,N.y,N.z),h.push(0,F,0),C.x=Y*.5+.5,C.y=D*.5*F+.5,f.push(C.x,C.y),d++}for(x=0;x<r;x++){var z=b+x,k=T+x;_===!0?l.push(k,k+1,z):l.push(k+1,k,z),O+=3}c.addGroup(y,O,_===!0?1:2),y+=O}}ur.prototype=Object.create(ve.prototype),ur.prototype.constructor=ur;function os(e,t,n,r,i,a,o){bi.call(this,0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}os.prototype=Object.create(bi.prototype),os.prototype.constructor=os;function ss(e,t,n,r,i,a,o){ur.call(this,0,e,t,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}ss.prototype=Object.create(ur.prototype),ss.prototype.constructor=ss;function ls(e,t,n,r){Ne.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new La(e,t,n,r)),this.mergeVertices()}ls.prototype=Object.create(Ne.prototype),ls.prototype.constructor=ls;function La(e,t,n,r){ve.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=t!==void 0?Math.max(3,t):8,n=n!==void 0?n:0,r=r!==void 0?r:Math.PI*2;var i=[],a=[],o=[],s=[],c,l,u=new E,h=new X;for(a.push(0,0,0),o.push(0,0,1),s.push(.5,.5),l=0,c=3;l<=t;l++,c+=3){var f=n+l/t*r;u.x=e*Math.cos(f),u.y=e*Math.sin(f),a.push(u.x,u.y,u.z),o.push(0,0,1),h.x=(a[c]/e+1)/2,h.y=(a[c+1]/e+1)/2,s.push(h.x,h.y)}for(c=1;c<=t;c++)i.push(c,c+1,0);this.setIndex(i),this.setAttribute("position",new ce(a,3)),this.setAttribute("normal",new ce(o,3)),this.setAttribute("uv",new ce(s,2))}La.prototype=Object.create(ve.prototype),La.prototype.constructor=La;var zt=Object.freeze({__proto__:null,WireframeGeometry:Vo,ParametricGeometry:ko,ParametricBufferGeometry:ma,TetrahedronGeometry:Xo,TetrahedronBufferGeometry:ga,OctahedronGeometry:jo,OctahedronBufferGeometry:pi,IcosahedronGeometry:qo,IcosahedronBufferGeometry:ya,DodecahedronGeometry:Yo,DodecahedronBufferGeometry:xa,PolyhedronGeometry:Wo,PolyhedronBufferGeometry:Zt,TubeGeometry:Zo,TubeBufferGeometry:vi,TorusKnotGeometry:Jo,TorusKnotBufferGeometry:_a,TorusGeometry:Qo,TorusBufferGeometry:ba,TextGeometry:ts,TextBufferGeometry:Ta,SphereGeometry:ns,SphereBufferGeometry:yi,RingGeometry:rs,RingBufferGeometry:Sa,PlaneGeometry:To,PlaneBufferGeometry:li,LatheGeometry:is,LatheBufferGeometry:Aa,ShapeGeometry:xi,ShapeBufferGeometry:_i,ExtrudeGeometry:gi,ExtrudeBufferGeometry:zn,EdgesGeometry:as,ConeGeometry:os,ConeBufferGeometry:ss,CylinderGeometry:bi,CylinderBufferGeometry:ur,CircleGeometry:ls,CircleBufferGeometry:La,BoxGeometry:Sp,BoxBufferGeometry:Mo});function wi(e){Oe.call(this),this.type="ShadowMaterial",this.color=new de(0),this.transparent=!0,this.setValues(e)}wi.prototype=Object.create(Oe.prototype),wi.prototype.constructor=wi,wi.prototype.isShadowMaterial=!0,wi.prototype.copy=function(e){return Oe.prototype.copy.call(this,e),this.color.copy(e.color),this};function hr(e){Wt.call(this,e),this.type="RawShaderMaterial"}hr.prototype=Object.create(Wt.prototype),hr.prototype.constructor=hr,hr.prototype.isRawShaderMaterial=!0;function Gn(e){Oe.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new de(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vr,this.normalScale=new X(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.vertexTangents=!1,this.setValues(e)}Gn.prototype=Object.create(Oe.prototype),Gn.prototype.constructor=Gn,Gn.prototype.isMeshStandardMaterial=!0,Gn.prototype.copy=function(e){return Oe.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.vertexTangents=e.vertexTangents,this};function Mi(e){Gn.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new X(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(e)}Mi.prototype=Object.create(Gn.prototype),Mi.prototype.constructor=Mi,Mi.prototype.isMeshPhysicalMaterial=!0,Mi.prototype.copy=function(e){return Gn.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new de).copy(e.sheen):this.sheen=null,this.transparency=e.transparency,this};function Pr(e){Oe.call(this),this.type="MeshPhongMaterial",this.color=new de(16777215),this.specular=new de(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vr,this.normalScale=new X(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ja,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)}Pr.prototype=Object.create(Oe.prototype),Pr.prototype.constructor=Pr,Pr.prototype.isMeshPhongMaterial=!0,Pr.prototype.copy=function(e){return Oe.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};function Ei(e){Oe.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new de(16777215),this.specular=new de(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vr,this.normalScale=new X(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}Ei.prototype=Object.create(Oe.prototype),Ei.prototype.constructor=Ei,Ei.prototype.isMeshToonMaterial=!0,Ei.prototype.copy=function(e){return Oe.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,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};function Ti(e){Oe.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vr,this.normalScale=new X(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)}Ti.prototype=Object.create(Oe.prototype),Ti.prototype.constructor=Ti,Ti.prototype.isMeshNormalMaterial=!0,Ti.prototype.copy=function(e){return Oe.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};function Si(e){Oe.call(this),this.type="MeshLambertMaterial",this.color=new de(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ja,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)}Si.prototype=Object.create(Oe.prototype),Si.prototype.constructor=Si,Si.prototype.isMeshLambertMaterial=!0,Si.prototype.copy=function(e){return Oe.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};function Ai(e){Oe.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new de(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vr,this.normalScale=new X(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)}Ai.prototype=Object.create(Oe.prototype),Ai.prototype.constructor=Ai,Ai.prototype.isMeshMatcapMaterial=!0,Ai.prototype.copy=function(e){return Oe.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};function Li(e){mt.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Li.prototype=Object.create(mt.prototype),Li.prototype.constructor=Li,Li.prototype.isLineDashedMaterial=!0,Li.prototype.copy=function(e){return mt.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Hy=Object.freeze({__proto__:null,ShadowMaterial:wi,SpriteMaterial:Ar,RawShaderMaterial:hr,ShaderMaterial:Wt,PointsMaterial:Lr,MeshPhysicalMaterial:Mi,MeshStandardMaterial:Gn,MeshPhongMaterial:Pr,MeshToonMaterial:Ei,MeshNormalMaterial:Ti,MeshLambertMaterial:Si,MeshDepthMaterial:Er,MeshDistanceMaterial:Tr,MeshBasicMaterial:hn,MeshMatcapMaterial:Ai,LineDashedMaterial:Li,LineBasicMaterial:mt,Material:Oe}),ft={arraySlice:function(e,t,n){return ft.isTypedArray(e)?new e.constructor(e.subarray(t,n!==void 0?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:typeof t.BYTES_PER_ELEMENT=="number"?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){function t(a,o){return e[a]-e[o]}for(var n=e.length,r=new Array(n),i=0;i!==n;++i)r[i]=i;return r.sort(t),r},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,c=0;c!==t;++c)i[o++]=e[s+c];return i},flattenJSON:function(e,t,n,r){for(var i=1,a=e[0];a!==void 0&&a[r]===void 0;)a=e[i++];if(a!==void 0){var o=a[r];if(o!==void 0)if(Array.isArray(o))do o=a[r],o!==void 0&&(t.push(a.time),n.push.apply(n,o)),a=e[i++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[r],o!==void 0&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++];while(a!==void 0);else do o=a[r],o!==void 0&&(t.push(a.time),n.push(o)),a=e[i++];while(a!==void 0)}},subclip:function(e,t,n,r,i){i=i||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(),u=[],h=[],f=0;f<c.times.length;++f){var d=c.times[f]*i;if(!(d<n||d>=r)){u.push(c.times[f]);for(var m=0;m<l;++m)h.push(c.values[f*l+m])}}u.length!==0&&(c.times=ft.convertArray(u,c.times.constructor),c.values=ft.convertArray(h,c.values.constructor),o.push(c))}a.tracks=o;for(var g=1/0,s=0;s<a.tracks.length;++s)g>a.tracks[s].times[0]&&(g=a.tracks[s].times[0]);for(var s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*g);return a.resetDuration(),a},makeClipAdditive:function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=e),(r===void 0||r<=0)&&(r=30);for(var i=e.tracks.length,a=t/r,o=0;o<i;++o){var s=n.tracks[o],c=s.ValueTypeName;if(!(c==="bool"||c==="string")){var l=e.tracks.find(function(x){return x.name===s.name&&x.ValueTypeName===c});if(l!==void 0){var u=s.getValueSize(),h=s.times.length-1,f;if(a<=s.times[0])f=ft.arraySlice(s.values,0,s.valueSize);else if(a>=s.times[h]){var d=h*u;f=ft.arraySlice(s.values,d)}else{var m=s.createInterpolant();m.evaluate(a),f=m.resultBuffer}if(c==="quaternion"){var g=new bt(f[0],f[1],f[2],f[3]).normalize().conjugate();g.toArray(f)}for(var y=l.times.length,p=0;p<y;++p){var v=p*u;if(c==="quaternion")bt.multiplyQuaternionsFlat(l.values,v,f,0,l.values,v);else for(var _=0;_<u;++_)l.values[v+_]-=f[_]}}}}return e.blendMode=ou,e}};function nn(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}Object.assign(nn.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(r===void 0){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,r=t[++n],e<r)break t}a=t.length;break n}if(!(e>=i)){var s=t[1];e<s&&(n=2,i=s);for(var o=n-2;;){if(i===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===o)break;if(r=i,i=t[--n-1],e>=i)break t}a=n,n=0;break n}break e}for(;n<a;){var c=n+a>>>1;e<t[c]?a=c:n=c+1}if(r=t[n],i=t[n-1],i===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(nn.prototype,{beforeStart_:nn.prototype.copySampleValue_,afterEnd_:nn.prototype.copySampleValue_});function Ul(e,t,n,r){nn.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}Ul.prototype=Object.assign(Object.create(nn.prototype),{constructor:Ul,DefaultSettings_:{endingStart:Gr,endingEnd:Gr},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(o===void 0)switch(this.getSettings_().endingStart){case Hr:i=e,o=2*t-n;break;case ao:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(s===void 0)switch(this.getSettings_().endingEnd){case Hr:a=e,s=2*n-t;break;case ao:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}var c=(n-t)*.5,l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,f=this._weightNext,d=(n-t)/(r-t),m=d*d,g=m*d,y=-h*g+2*h*m-h*d,p=(1+h)*g+(-1.5-2*h)*m+(-.5+h)*d+1,v=(-1-f)*g+(1.5+f)*m+.5*d,_=f*g-f*m,x=0;x!==o;++x)i[x]=y*a[l+x]+p*a[c+x]+v*a[s+x]+_*a[u+x];return i}});function cs(e,t,n,r){nn.call(this,e,t,n,r)}cs.prototype=Object.assign(Object.create(nn.prototype),{constructor:cs,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(r-t),u=1-l,h=0;h!==o;++h)i[h]=a[c+h]*u+a[s+h]*l;return i}});function zl(e,t,n,r){nn.call(this,e,t,n,r)}zl.prototype=Object.assign(Object.create(nn.prototype),{constructor:zl,interpolate_:function(e){return this.copySampleValue_(e-1)}});function Nt(e,t,n,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ft.convertArray(t,this.TimeBufferType),this.values=ft.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}Object.assign(Nt,{toJSON:function(e){var t=e.constructor,n;if(t.toJSON!==void 0)n=t.toJSON(e);else{n={name:e.name,times:ft.convertArray(e.times,Array),values:ft.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(n.interpolation=r)}return n.type=e.ValueTypeName,n}}),Object.assign(Nt.prototype,{constructor:Nt,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:io,InterpolantFactoryMethodDiscrete:function(e){return new zl(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new cs(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Ul(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case ro:t=this.InterpolantFactoryMethodDiscrete;break;case io:t=this.InterpolantFactoryMethodLinear;break;case Ws:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ro;case this.InterpolantFactoryMethodLinear:return io;case this.InterpolantFactoryMethodSmooth:return Ws}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(e!==0)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(e!==1)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;a!==-1&&n[a]>t;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);var o=this.getValueSize();this.times=ft.arraySlice(n,i,a),this.values=ft.arraySlice(this.values,i*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,r=this.values,i=n.length;i===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if(typeof s=="number"&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(a!==null&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(r!==void 0&&ft.isTypedArray(r))for(var o=0,c=r.length;o!==c;++o){var l=r[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=ft.arraySlice(this.times),t=ft.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===Ws,i=1,a=e.length-1,o=1;o<a;++o){var s=!1,c=e[o],l=e[o+1];if(c!==l&&(o!==1||c!==c[0]))if(r)s=!0;else for(var u=o*n,h=u-n,f=u+n,d=0;d!==n;++d){var m=t[u+d];if(m!==t[h+d]||m!==t[f+d]){s=!0;break}}if(s){if(o!==i){e[i]=e[o];for(var g=o*n,y=i*n,d=0;d!==n;++d)t[y+d]=t[g+d]}++i}}if(a>0){e[i]=e[a];for(var g=a*n,y=i*n,d=0;d!==n;++d)t[y+d]=t[g+d];++i}return i!==e.length?(this.times=ft.arraySlice(e,0,i),this.values=ft.arraySlice(t,0,i*n)):(this.times=e,this.values=t),this},clone:function(){var e=ft.arraySlice(this.times,0),t=ft.arraySlice(this.values,0),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}});function Gl(e,t,n){Nt.call(this,e,t,n)}Gl.prototype=Object.assign(Object.create(Nt.prototype),{constructor:Gl,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:ro,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});function Hl(e,t,n,r){Nt.call(this,e,t,n,r)}Hl.prototype=Object.assign(Object.create(Nt.prototype),{constructor:Hl,ValueTypeName:"color"});function Pa(e,t,n,r){Nt.call(this,e,t,n,r)}Pa.prototype=Object.assign(Object.create(Nt.prototype),{constructor:Pa,ValueTypeName:"number"});function Vl(e,t,n,r){nn.call(this,e,t,n,r)}Vl.prototype=Object.assign(Object.create(nn.prototype),{constructor:Vl,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=(n-t)/(r-t),l=s+o;s!==l;s+=4)bt.slerpFlat(i,0,a,s-o,a,s,c);return i}});function us(e,t,n,r){Nt.call(this,e,t,n,r)}us.prototype=Object.assign(Object.create(Nt.prototype),{constructor:us,ValueTypeName:"quaternion",DefaultInterpolation:io,InterpolantFactoryMethodLinear:function(e){return new Vl(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0});function kl(e,t,n,r){Nt.call(this,e,t,n,r)}kl.prototype=Object.assign(Object.create(Nt.prototype),{constructor:kl,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:ro,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});function Ca(e,t,n,r){Nt.call(this,e,t,n,r)}Ca.prototype=Object.assign(Object.create(Nt.prototype),{constructor:Ca,ValueTypeName:"vector"});function fn(e,t,n,r){this.name=e,this.tracks=n,this.duration=t!==void 0?t:-1,this.blendMode=r!==void 0?r:Xs,this.uuid=ke.generateUUID(),this.duration<0&&this.resetDuration()}function Vy(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Pa;case"vector":case"vector2":case"vector3":case"vector4":return Ca;case"color":return Hl;case"quaternion":return us;case"bool":case"boolean":return Gl;case"string":return kl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function ky(e){if(e.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=Vy(e.type);if(e.times===void 0){var n=[],r=[];ft.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return t.parse!==void 0?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(fn,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(ky(n[i]).scale(r));return new fn(e.name,e.duration,t,e.blendMode)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode},i=0,a=n.length;i!==a;++i)t.push(Nt.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],c=[];s.push((o+i-1)%i,o,(o+1)%i),c.push(0,1,0);var l=ft.getKeyframeOrder(s);s=ft.sortedArray(s,1,l),c=ft.sortedArray(c,1,l),!r&&s[0]===0&&(s.push(i),c.push(c[0])),a.push(new Pa(".morphTargetInfluences["+t[o].name+"]",s,c).scale(1/n))}return new fn(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],c=s.name.match(i);if(c&&c.length>1){var l=c[1],u=r[l];u||(r[l]=u=[]),u.push(s)}}var h=[];for(var l in r)h.push(fn.CreateFromMorphTargetSequence(l,r[l],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(x,b,T,C,N){if(T.length!==0){var O=[],J=[];ft.flattenJSON(T,O,J,C),O.length!==0&&N.push(new x(b,O,J))}},r=[],i=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.blendMode,c=e.hierarchy||[],l=0;l<c.length;l++){var u=c[l].keys;if(!(!u||u.length===0))if(u[0].morphTargets){for(var h={},f=0;f<u.length;f++)if(u[f].morphTargets)for(var d=0;d<u[f].morphTargets.length;d++)h[u[f].morphTargets[d]]=-1;for(var m in h){for(var g=[],y=[],d=0;d!==u[f].morphTargets.length;++d){var p=u[f];g.push(p.time),y.push(p.morphTarget===m?1:0)}r.push(new Pa(".morphTargetInfluence["+m+"]",g,y))}a=h.length*(o||1)}else{var v=".bones["+t[l].name+"]";n(Ca,v+".position",u,"pos",r),n(us,v+".quaternion",u,"rot",r),n(Ca,v+".scale",u,"scl",r)}}if(r.length===0)return null;var _=new fn(i,a,r,s);return _}}),Object.assign(fn.prototype,{resetDuration:function(){for(var e=this.tracks,t=0,n=0,r=e.length;n!==r;++n){var i=this.tracks[n];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,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 fn(this.name,this.duration,e,this.blendMode)}});var Pi={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function mh(e,t,n){var r=this,i=!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(l){o++,i===!1&&r.onStart!==void 0&&r.onStart(l,a,o),i=!0},this.itemEnd=function(l){a++,r.onProgress!==void 0&&r.onProgress(l,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(l){r.onError!==void 0&&r.onError(l)},this.resolveURL=function(l){return s?s(l):l},this.setURLModifier=function(l){return s=l,this},this.addHandler=function(l,u){return c.push(l,u),this},this.removeHandler=function(l){var u=c.indexOf(l);return u!==-1&&c.splice(u,2),this},this.getHandler=function(l){for(var u=0,h=c.length;u<h;u+=2){var f=c[u],d=c[u+1];if(f.global&&(f.lastIndex=0),f.test(l))return d}return null}}var Wy=new mh;function tt(e){this.manager=e!==void 0?e:Wy,this.crossOrigin="anonymous",this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(tt.prototype,{load:function(){},loadAsync:function(e,t){var n=this;return new Promise(function(r,i){n.load(e,r,t,i)})},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},setRequestHeader:function(e){return this.requestHeader=e,this}});var dn={};function bn(e){tt.call(this,e)}bn.prototype=Object.assign(Object.create(tt.prototype),{constructor:bn,load:function(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Pi.get(e);if(a!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;if(dn[e]!==void 0){dn[e].push({onLoad:t,onProgress:n,onError:r});return}var o=/^data:(.*?)(;base64)?,(.*)$/,s=e.match(o);if(s){var c=s[1],l=!!s[2],u=s[3];u=decodeURIComponent(u),l&&(u=atob(u));try{var h,f=(this.responseType||"").toLowerCase();switch(f){case"arraybuffer":case"blob":for(var d=new Uint8Array(u.length),m=0;m<u.length;m++)d[m]=u.charCodeAt(m);f==="blob"?h=new Blob([d.buffer],{type:c}):h=d.buffer;break;case"document":var g=new DOMParser;h=g.parseFromString(u,c);break;case"json":h=JSON.parse(u);break;default:h=u;break}setTimeout(function(){t&&t(h),i.manager.itemEnd(e)},0)}catch(v){setTimeout(function(){r&&r(v),i.manager.itemError(e),i.manager.itemEnd(e)},0)}}else{dn[e]=[],dn[e].push({onLoad:t,onProgress:n,onError:r});var y=new XMLHttpRequest;y.open("GET",e,!0),y.addEventListener("load",function(v){var _=this.response,x=dn[e];if(delete dn[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Pi.add(e,_);for(var b=0,T=x.length;b<T;b++){var C=x[b];C.onLoad&&C.onLoad(_)}i.manager.itemEnd(e)}else{for(var b=0,T=x.length;b<T;b++){var C=x[b];C.onError&&C.onError(v)}i.manager.itemError(e),i.manager.itemEnd(e)}},!1),y.addEventListener("progress",function(v){for(var _=dn[e],x=0,b=_.length;x<b;x++){var T=_[x];T.onProgress&&T.onProgress(v)}},!1),y.addEventListener("error",function(v){var _=dn[e];delete dn[e];for(var x=0,b=_.length;x<b;x++){var T=_[x];T.onError&&T.onError(v)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),y.addEventListener("abort",function(v){var _=dn[e];delete dn[e];for(var x=0,b=_.length;x<b;x++){var T=_[x];T.onError&&T.onError(v)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),this.responseType!==void 0&&(y.responseType=this.responseType),this.withCredentials!==void 0&&(y.withCredentials=this.withCredentials),y.overrideMimeType&&y.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(var p in this.requestHeader)y.setRequestHeader(p,this.requestHeader[p]);y.send(null)}return i.manager.itemStart(e),y},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this}});function gh(e){tt.call(this,e)}gh.prototype=Object.assign(Object.create(tt.prototype),{constructor:gh,load:function(e,t,n,r){var i=this,a=new bn(i.manager);a.setPath(i.path),a.load(e,function(o){try{t(i.parse(JSON.parse(o)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}},n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=fn.parse(e[n]);t.push(r)}return t}});function yh(e){tt.call(this,e)}yh.prototype=Object.assign(Object.create(tt.prototype),{constructor:yh,load:function(e,t,n,r){var i=this,a=[],o=new va;o.image=a;var s=new bn(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer");function c(f){s.load(e[f],function(d){var m=i.parse(d,!0);a[f]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},l+=1,l===6&&(m.mipmapCount===1&&(o.minFilter=Dt),o.format=m.format,o.needsUpdate=!0,t&&t(o))},n,r)}if(Array.isArray(e))for(var l=0,u=0,h=e.length;u<h;++u)c(u);else s.load(e,function(f){var d=i.parse(f,!0);if(d.isCubemap)for(var m=d.mipmaps.length/d.mipmapCount,g=0;g<m;g++){a[g]={mipmaps:[]};for(var y=0;y<d.mipmapCount;y++)a[g].mipmaps.push(d.mipmaps[g*d.mipmapCount+y]),a[g].format=d.format,a[g].width=d.width,a[g].height=d.height}else o.image.width=d.width,o.image.height=d.height,o.mipmaps=d.mipmaps;d.mipmapCount===1&&(o.minFilter=Dt),o.format=d.format,o.needsUpdate=!0,t&&t(o)},n,r);return o}});function xh(e){tt.call(this,e)}xh.prototype=Object.assign(Object.create(tt.prototype),{constructor:xh,load:function(e,t,n,r){var i=this,a=new oi,o=new bn(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,function(s){var c=i.parse(s);c&&(c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Vt,a.wrapT=c.wrapT!==void 0?c.wrapT:Vt,a.magFilter=c.magFilter!==void 0?c.magFilter:Dt,a.minFilter=c.minFilter!==void 0?c.minFilter:Dt,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=$a),c.mipmapCount===1&&(a.minFilter=Dt),a.needsUpdate=!0,t&&t(a,c))},n,r),a}});function Ra(e){tt.call(this,e)}Ra.prototype=Object.assign(Object.create(tt.prototype),{constructor:Ra,load:function(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Pi.get(e);if(a!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.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),Pi.add(e,this),t&&t(this),i.manager.itemEnd(e)}function c(l){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),r&&r(l),i.manager.itemError(e),i.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}});function Wl(e){tt.call(this,e)}Wl.prototype=Object.assign(Object.create(tt.prototype),{constructor:Wl,load:function(e,t,n,r){var i=new ar,a=new Ra(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(l){a.load(e[l],function(u){i.images[l]=u,o++,o===6&&(i.needsUpdate=!0,t&&t(i))},void 0,r)}for(var c=0;c<e.length;++c)s(c);return i}});function Xl(e){tt.call(this,e)}Xl.prototype=Object.assign(Object.create(tt.prototype),{constructor:Xl,load:function(e,t,n,r){var i=new ot,a=new Ra(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){i.image=o;var s=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;i.format=s?xr:on,i.needsUpdate=!0,t!==void 0&&t(i)},n,r),i}});function Le(){this.type="Curve",this.arcLengthDivisions=200}Object.assign(Le.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){e===void 0&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){e===void 0&&(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(e===void 0&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t=[],n,r=this.getPoint(0),i,a=0;for(t.push(0),i=1;i<=e;i++)n=this.getPoint(i/e),a+=n.distanceTo(r),t.push(a),r=n;return this.cacheArcLengths=t,t},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n=this.getLengths(),r=0,i=n.length,a;t?a=t:a=e*n[i-1];for(var o=0,s=i-1,c;o<=s;)if(r=Math.floor(o+(s-o)/2),c=n[r]-a,c<0)o=r+1;else if(c>0)s=r-1;else{s=r;break}if(r=s,n[r]===a)return r/(i-1);var l=n[r],u=n[r+1],h=u-l,f=(a-l)/h,d=(r+f)/(i-1);return d},getTangent:function(e,t){var n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);var a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new X:new E);return s.copy(o).sub(a).normalize(),s},getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){var n=new E,r=[],i=[],a=[],o=new E,s=new We,c,l,u;for(c=0;c<=e;c++)l=c/e,r[c]=this.getTangentAt(l,new E),r[c].normalize();i[0]=new E,a[0]=new E;var h=Number.MAX_VALUE,f=Math.abs(r[0].x),d=Math.abs(r[0].y),m=Math.abs(r[0].z);for(f<=h&&(h=f,n.set(1,0,0)),d<=h&&(h=d,n.set(0,1,0)),m<=h&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]),c=1;c<=e;c++)i[c]=i[c-1].clone(),a[c]=a[c-1].clone(),o.crossVectors(r[c-1],r[c]),o.length()>Number.EPSILON&&(o.normalize(),u=Math.acos(ke.clamp(r[c-1].dot(r[c]),-1,1)),i[c].applyMatrix4(s.makeRotationAxis(o,u))),a[c].crossVectors(r[c],i[c]);if(t===!0)for(u=Math.acos(ke.clamp(i[0].dot(i[e]),-1,1)),u/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(u=-u),c=1;c<=e;c++)i[c].applyMatrix4(s.makeRotationAxis(r[c],u*c)),a[c].crossVectors(r[c],i[c]);return{tangents:r,normals:i,binormals:a}},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}});function rn(e,t,n,r,i,a,o,s){Le.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}rn.prototype=Object.create(Le.prototype),rn.prototype.constructor=rn,rn.prototype.isEllipseCurve=!0,rn.prototype.getPoint=function(e,t){for(var n=t||new X,r=Math.PI*2,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(a?i=0:i=r),this.aClockwise===!0&&!a&&(i===r?i=-r:i=i-r);var o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){var l=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,f=c-this.aY;s=h*l-f*u+this.aX,c=h*u+f*l+this.aY}return n.set(s,c)},rn.prototype.copy=function(e){return Le.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},rn.prototype.toJSON=function(){var e=Le.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},rn.prototype.fromJSON=function(e){return Le.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};function Oa(e,t,n,r,i,a){rn.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}Oa.prototype=Object.create(rn.prototype),Oa.prototype.constructor=Oa,Oa.prototype.isArcCurve=!0;function jl(){var e=0,t=0,n=0,r=0;function i(a,o,s,c){e=a,t=s,n=-3*a+3*o-2*s-c,r=2*a-2*o+s+c}return{initCatmullRom:function(a,o,s,c,l){i(o,s,l*(s-a),l*(c-o))},initNonuniformCatmullRom:function(a,o,s,c,l,u,h){var f=(o-a)/l-(s-a)/(l+u)+(s-o)/u,d=(s-o)/u-(c-o)/(u+h)+(c-s)/h;f*=u,d*=u,i(o,s,f,d)},calc:function(a){var o=a*a,s=o*a;return e+t*a+n*o+r*s}}}var hs=new E,ql=new jl,Yl=new jl,Zl=new jl;function Jt(e,t,n,r){Le.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}Jt.prototype=Object.create(Le.prototype),Jt.prototype.constructor=Jt,Jt.prototype.isCatmullRomCurve3=!0,Jt.prototype.getPoint=function(e,t){var n=t||new E,r=this.points,i=r.length,a=(i-(this.closed?0:1))*e,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:s===0&&o===i-1&&(o=i-2,s=1);var c,l,u,h;if(this.closed||o>0?c=r[(o-1)%i]:(hs.subVectors(r[0],r[1]).add(r[0]),c=hs),l=r[o%i],u=r[(o+1)%i],this.closed||o+2<i?h=r[(o+2)%i]:(hs.subVectors(r[i-1],r[i-2]).add(r[i-1]),h=hs),this.curveType==="centripetal"||this.curveType==="chordal"){var f=this.curveType==="chordal"?.5:.25,d=Math.pow(c.distanceToSquared(l),f),m=Math.pow(l.distanceToSquared(u),f),g=Math.pow(u.distanceToSquared(h),f);m<1e-4&&(m=1),d<1e-4&&(d=m),g<1e-4&&(g=m),ql.initNonuniformCatmullRom(c.x,l.x,u.x,h.x,d,m,g),Yl.initNonuniformCatmullRom(c.y,l.y,u.y,h.y,d,m,g),Zl.initNonuniformCatmullRom(c.z,l.z,u.z,h.z,d,m,g)}else this.curveType==="catmullrom"&&(ql.initCatmullRom(c.x,l.x,u.x,h.x,this.tension),Yl.initCatmullRom(c.y,l.y,u.y,h.y,this.tension),Zl.initCatmullRom(c.z,l.z,u.z,h.z,this.tension));return n.set(ql.calc(s),Yl.calc(s),Zl.calc(s)),n},Jt.prototype.copy=function(e){Le.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Jt.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Jt.prototype.fromJSON=function(e){Le.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(new E().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this};function _h(e,t,n,r,i){var a=(r-t)*.5,o=(i-n)*.5,s=e*e,c=e*s;return(2*n-2*r+a+o)*c+(-3*n+3*r-2*a-o)*s+a*e+n}function Xy(e,t){var n=1-e;return n*n*t}function jy(e,t){return 2*(1-e)*e*t}function qy(e,t){return e*e*t}function Da(e,t,n,r){return Xy(e,t)+jy(e,n)+qy(e,r)}function Yy(e,t){var n=1-e;return n*n*n*t}function Zy(e,t){var n=1-e;return 3*n*n*e*t}function Jy(e,t){return 3*(1-e)*e*e*t}function Qy(e,t){return e*e*e*t}function Ia(e,t,n,r,i){return Yy(e,t)+Zy(e,n)+Jy(e,r)+Qy(e,i)}function wn(e,t,n,r){Le.call(this),this.type="CubicBezierCurve",this.v0=e||new X,this.v1=t||new X,this.v2=n||new X,this.v3=r||new X}wn.prototype=Object.create(Le.prototype),wn.prototype.constructor=wn,wn.prototype.isCubicBezierCurve=!0,wn.prototype.getPoint=function(e,t){var n=t||new X,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Ia(e,r.x,i.x,a.x,o.x),Ia(e,r.y,i.y,a.y,o.y)),n},wn.prototype.copy=function(e){return Le.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},wn.prototype.toJSON=function(){var e=Le.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},wn.prototype.fromJSON=function(e){return Le.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};function Hn(e,t,n,r){Le.call(this),this.type="CubicBezierCurve3",this.v0=e||new E,this.v1=t||new E,this.v2=n||new E,this.v3=r||new E}Hn.prototype=Object.create(Le.prototype),Hn.prototype.constructor=Hn,Hn.prototype.isCubicBezierCurve3=!0,Hn.prototype.getPoint=function(e,t){var n=t||new E,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Ia(e,r.x,i.x,a.x,o.x),Ia(e,r.y,i.y,a.y,o.y),Ia(e,r.z,i.z,a.z,o.z)),n},Hn.prototype.copy=function(e){return Le.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},Hn.prototype.toJSON=function(){var e=Le.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},Hn.prototype.fromJSON=function(e){return Le.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};function Qt(e,t){Le.call(this),this.type="LineCurve",this.v1=e||new X,this.v2=t||new X}Qt.prototype=Object.create(Le.prototype),Qt.prototype.constructor=Qt,Qt.prototype.isLineCurve=!0,Qt.prototype.getPoint=function(e,t){var n=t||new X;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Qt.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Qt.prototype.getTangent=function(e,t){var n=t||new X,n=n.copy(this.v2).sub(this.v1).normalize();return n},Qt.prototype.copy=function(e){return Le.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Qt.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Qt.prototype.fromJSON=function(e){return Le.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this};function Mn(e,t){Le.call(this),this.type="LineCurve3",this.v1=e||new E,this.v2=t||new E}Mn.prototype=Object.create(Le.prototype),Mn.prototype.constructor=Mn,Mn.prototype.isLineCurve3=!0,Mn.prototype.getPoint=function(e,t){var n=t||new E;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Mn.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Mn.prototype.copy=function(e){return Le.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Mn.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Mn.prototype.fromJSON=function(e){return Le.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this};function En(e,t,n){Le.call(this),this.type="QuadraticBezierCurve",this.v0=e||new X,this.v1=t||new X,this.v2=n||new X}En.prototype=Object.create(Le.prototype),En.prototype.constructor=En,En.prototype.isQuadraticBezierCurve=!0,En.prototype.getPoint=function(e,t){var n=t||new X,r=this.v0,i=this.v1,a=this.v2;return n.set(Da(e,r.x,i.x,a.x),Da(e,r.y,i.y,a.y)),n},En.prototype.copy=function(e){return Le.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},En.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},En.prototype.fromJSON=function(e){return Le.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this};function Vn(e,t,n){Le.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new E,this.v1=t||new E,this.v2=n||new E}Vn.prototype=Object.create(Le.prototype),Vn.prototype.constructor=Vn,Vn.prototype.isQuadraticBezierCurve3=!0,Vn.prototype.getPoint=function(e,t){var n=t||new E,r=this.v0,i=this.v1,a=this.v2;return n.set(Da(e,r.x,i.x,a.x),Da(e,r.y,i.y,a.y),Da(e,r.z,i.z,a.z)),n},Vn.prototype.copy=function(e){return Le.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Vn.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Vn.prototype.fromJSON=function(e){return Le.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this};function Tn(e){Le.call(this),this.type="SplineCurve",this.points=e||[]}Tn.prototype=Object.create(Le.prototype),Tn.prototype.constructor=Tn,Tn.prototype.isSplineCurve=!0,Tn.prototype.getPoint=function(e,t){var n=t||new X,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[a===0?a:a-1],c=r[a],l=r[a>r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(_h(o,s.x,c.x,l.x,u.x),_h(o,s.y,c.y,l.y,u.y)),n},Tn.prototype.copy=function(e){Le.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},Tn.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},Tn.prototype.fromJSON=function(e){Le.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(new X().fromArray(r))}return this};var Jl=Object.freeze({__proto__:null,ArcCurve:Oa,CatmullRomCurve3:Jt,CubicBezierCurve:wn,CubicBezierCurve3:Hn,EllipseCurve:rn,LineCurve:Qt,LineCurve3:Mn,QuadraticBezierCurve:En,QuadraticBezierCurve3:Vn,SplineCurve:Tn});function fr(){Le.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}fr.prototype=Object.assign(Object.create(Le.prototype),{constructor:fr,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 Qt(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=o===0?0:1-i/o;return a.getPointAt(s)}r++}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,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){e===void 0&&(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,r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?e*2: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];n&&n.equals(l)||(t.push(l),n=l)}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t},copy:function(e){Le.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=Le.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){Le.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(new Jl[r.type]().fromJSON(r))}return this}});function Sn(e){fr.call(this),this.type="Path",this.currentPoint=new X,e&&this.setFromPoints(e)}Sn.prototype=Object.assign(Object.create(fr.prototype),{constructor:Sn,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 Qt(this.currentPoint.clone(),new X(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,r){var i=new En(this.currentPoint.clone(),new X(e,t),new X(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(e,t,n,r,i,a){var o=new wn(this.currentPoint.clone(),new X(e,t),new X(n,r),new X(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this},splineThru:function(e){var t=[this.currentPoint.clone()].concat(e),n=new Tn(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this},absarc:function(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this},ellipse:function(e,t,n,r,i,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(e+c,t+l,n,r,i,a,o,s),this},absellipse:function(e,t,n,r,i,a,o,s){var c=new rn(e,t,n,r,i,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 u=c.getPoint(1);return this.currentPoint.copy(u),this},copy:function(e){return fr.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=fr.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return fr.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}});function Cr(e){Sn.call(this,e),this.uuid=ke.generateUUID(),this.type="Shape",this.holes=[]}Cr.prototype=Object.assign(Object.create(Sn.prototype),{constructor:Cr,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;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){Sn.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Sn.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Sn.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(new Sn().fromJSON(r))}return this}});function lt(e,t){ae.call(this),this.type="Light",this.color=new de(e),this.intensity=t!==void 0?t:1,this.receiveShadow=void 0}lt.prototype=Object.assign(Object.create(ae.prototype),{constructor:lt,isLight:!0,copy:function(e){return ae.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=ae.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}});function Ql(e,t,n){lt.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(ae.DefaultUp),this.updateMatrix(),this.groundColor=new de(t)}Ql.prototype=Object.assign(Object.create(lt.prototype),{constructor:Ql,isHemisphereLight:!0,copy:function(e){return lt.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}});function kn(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new X(512,512),this.map=null,this.mapPass=null,this.matrix=new We,this._frustum=new aa,this._frameExtents=new X(1,1),this._viewportCount=1,this._viewports=[new et(0,0,1,1)]}Object.assign(kn.prototype,{_projScreenMatrix:new We,_lightPositionWorld:new E,_lookTarget:new E,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),i.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(i),t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),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 this.bias!==0&&(e.bias=this.bias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}});function Kl(){kn.call(this,new Et(50,1,.5,500))}Kl.prototype=Object.assign(Object.create(kn.prototype),{constructor:Kl,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=ke.RAD2DEG*2*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;(n!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),kn.prototype.updateMatrices.call(this,e)}});function $l(e,t,n,r,i,a){lt.call(this,e,t),this.type="SpotLight",this.position.copy(ae.DefaultUp),this.updateMatrix(),this.target=new ae,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(o){this.intensity=o/Math.PI}}),this.distance=n!==void 0?n:0,this.angle=r!==void 0?r:Math.PI/3,this.penumbra=i!==void 0?i:0,this.decay=a!==void 0?a:1,this.shadow=new Kl}$l.prototype=Object.assign(Object.create(lt.prototype),{constructor:$l,isSpotLight:!0,copy:function(e){return lt.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}});function ec(){kn.call(this,new Et(90,1,.5,500)),this._frameExtents=new X(4,2),this._viewportCount=6,this._viewports=[new et(2,1,1,1),new et(0,1,1,1),new et(3,1,1,1),new et(1,1,1,1),new et(3,0,1,1),new et(1,0,1,1)],this._cubeDirections=[new E(1,0,0),new E(-1,0,0),new E(0,0,1),new E(0,0,-1),new E(0,1,0),new E(0,-1,0)],this._cubeUps=[new E(0,1,0),new E(0,1,0),new E(0,1,0),new E(0,1,0),new E(0,0,1),new E(0,0,-1)]}ec.prototype=Object.assign(Object.create(kn.prototype),{constructor:ec,isPointLightShadow:!0,updateMatrices:function(e,t){t===void 0&&(t=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;i.setFromMatrixPosition(e.matrixWorld),n.position.copy(i),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}});function tc(e,t,n,r){lt.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return this.intensity*4*Math.PI},set:function(i){this.intensity=i/(4*Math.PI)}}),this.distance=n!==void 0?n:0,this.decay=r!==void 0?r:1,this.shadow=new ec}tc.prototype=Object.assign(Object.create(lt.prototype),{constructor:tc,isPointLight:!0,copy:function(e){return lt.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}});function Na(e,t,n,r,i,a){Bn.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e!==void 0?e:-1,this.right=t!==void 0?t:1,this.top=n!==void 0?n:1,this.bottom=r!==void 0?r:-1,this.near=i!==void 0?i:.1,this.far=a!==void 0?a:2e3,this.updateProjectionMatrix()}Na.prototype=Object.assign(Object.create(Bn.prototype),{constructor:Na,isOrthographicCamera:!0,copy:function(e,t){return Bn.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=e.view===null?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){this.view!==null&&(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,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(this.view!==null&&this.view.enabled){var c=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=c*this.view.offsetX,a=i+c*this.view.width,o-=l*this.view.offsetY,s=o-l*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=ae.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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}});function nc(){kn.call(this,new Na(-5,5,5,-5,.5,500))}nc.prototype=Object.assign(Object.create(kn.prototype),{constructor:nc,isDirectionalLightShadow:!0,updateMatrices:function(e){kn.prototype.updateMatrices.call(this,e)}});function rc(e,t){lt.call(this,e,t),this.type="DirectionalLight",this.position.copy(ae.DefaultUp),this.updateMatrix(),this.target=new ae,this.shadow=new nc}rc.prototype=Object.assign(Object.create(lt.prototype),{constructor:rc,isDirectionalLight:!0,copy:function(e){return lt.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}});function ic(e,t){lt.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}ic.prototype=Object.assign(Object.create(lt.prototype),{constructor:ic,isAmbientLight:!0});function ac(e,t,n,r){lt.call(this,e,t),this.type="RectAreaLight",this.width=n!==void 0?n:10,this.height=r!==void 0?r:10}ac.prototype=Object.assign(Object.create(lt.prototype),{constructor:ac,isRectAreaLight:!0,copy:function(e){return lt.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=lt.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}});function oc(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new E)}Object.assign(oc.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,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],1.092548*(n*r)),t.addScaledVector(a[5],1.092548*(r*i)),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],1.092548*(n*i)),t.addScaledVector(a[8],.546274*(n*n-r*r)),t},getIrradianceAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],2*.511664*r),t.addScaledVector(a[2],2*.511664*i),t.addScaledVector(a[3],2*.511664*n),t.addScaledVector(a[4],2*.429043*n*r),t.addScaledVector(a[5],2*.429043*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],2*.429043*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},addScaledSH:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],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){t===void 0&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+r*3);return this},toArray:function(e,t){e===void 0&&(e=[]),t===void 0&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+r*3);return e}}),Object.assign(oc,{getBasisAt:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}});function pn(e,t){lt.call(this,void 0,t),this.type="LightProbe",this.sh=e!==void 0?e:new oc}pn.prototype=Object.assign(Object.create(lt.prototype),{constructor:pn,isLightProbe:!0,copy:function(e){return lt.prototype.copy.call(this,e),this.sh.copy(e.sh),this},fromJSON:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this},toJSON:function(e){var t=lt.prototype.toJSON.call(this,e);return t.object.sh=this.sh.toArray(),t}});function sc(e){tt.call(this,e),this.textures={}}sc.prototype=Object.assign(Object.create(tt.prototype),{constructor:sc,load:function(e,t,n,r){var i=this,a=new bn(i.manager);a.setPath(i.path),a.load(e,function(o){try{t(i.parse(JSON.parse(o)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}},n,r)},parse:function(e){var t=this.textures;function n(c){return t[c]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",c),t[c]}var r=new Hy[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new de().setHex(e.sheen)),e.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.skinning!==void 0&&(r.skinning=e.skinning),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(var i in e.uniforms){var a=e.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=new de().setHex(a.value);break;case"v2":r.uniforms[i].value=new X().fromArray(a.value);break;case"v3":r.uniforms[i].value=new E().fromArray(a.value);break;case"v4":r.uniforms[i].value=new et().fromArray(a.value);break;case"m3":r.uniforms[i].value=new Ut().fromArray(a.value);case"m4":r.uniforms[i].value=new We().fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(var o in e.extensions)r.extensions[o]=e.extensions[o];if(e.shading!==void 0&&(r.flatShading=e.shading===1),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=n(e.map)),e.matcap!==void 0&&(r.matcap=n(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){var s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new X().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=n(e.specularMap)),e.envMap!==void 0&&(r.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new X().fromArray(e.clearcoatNormalScale)),r},setTextures:function(e){return this.textures=e,this}});var bh={decodeText:function(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(i){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}};function fs(){ve.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}fs.prototype=Object.assign(Object.create(ve.prototype),{constructor:fs,isInstancedBufferGeometry:!0,copy:function(e){return ve.prototype.copy.call(this,e),this.instanceCount=e.instanceCount,this},clone:function(){return new this.constructor().copy(this)},toJSON:function(){var e=ve.prototype.toJSON.call(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}});function lc(e,t,n,r){typeof n=="number"&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),De.call(this,e,t,n),this.meshPerAttribute=r||1}lc.prototype=Object.assign(Object.create(De.prototype),{constructor:lc,isInstancedBufferAttribute:!0,copy:function(e){return De.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=De.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}});function cc(e){tt.call(this,e)}cc.prototype=Object.assign(Object.create(tt.prototype),{constructor:cc,load:function(e,t,n,r){var i=this,a=new bn(i.manager);a.setPath(i.path),a.load(e,function(o){try{t(i.parse(JSON.parse(o)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}},n,r)},parse:function(e){var t=e.isInstancedBufferGeometry?new fs:new ve,n=e.data.index;if(n!==void 0){var r=new uc[n.type](n.array);t.setIndex(new De(r,1))}var i=e.data.attributes;for(var a in i){var o=i[a],r=new uc[o.type](o.array),s=o.isInstancedBufferAttribute?lc:De,c=new s(r,o.itemSize,o.normalized);o.name!==void 0&&(c.name=o.name),t.setAttribute(a,c)}var l=e.data.morphAttributes;if(l)for(var a in l){for(var u=l[a],h=[],f=0,d=u.length;f<d;f++){var o=u[f],r=new uc[o.type](o.array),c=new De(r,o.itemSize,o.normalized);o.name!==void 0&&(c.name=o.name),h.push(c)}t.morphAttributes[a]=h}var m=e.data.morphTargetsRelative;m&&(t.morphTargetsRelative=!0);var g=e.data.groups||e.data.drawcalls||e.data.offsets;if(g!==void 0)for(var f=0,y=g.length;f!==y;++f){var p=g[f];t.addGroup(p.start,p.count,p.materialIndex)}var v=e.data.boundingSphere;if(v!==void 0){var _=new E;v.center!==void 0&&_.fromArray(v.center),t.boundingSphere=new Dn(_,v.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var uc={Int8Array,Uint8Array,Uint8ClampedArray:typeof Uint8ClampedArray!="undefined"?Uint8ClampedArray:Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function hc(e){tt.call(this,e)}hc.prototype=Object.assign(Object.create(tt.prototype),{constructor:hc,load:function(e,t,n,r){var i=this,a=this.path===""?bh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new bn(i.manager);o.setPath(this.path),o.load(e,function(s){var c=null;try{c=JSON.parse(s)}catch(u){r!==void 0&&r(u),console.error("THREE:ObjectLoader: Can't parse "+e+".",u.message);return}var l=c.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}i.parse(c,t)},n,r)},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,function(){t!==void 0&&t(s)}),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(s),s},parseShape:function(e){var t={};if(e!==void 0)for(var n=0,r=e.length;n<r;n++){var i=new Cr().fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(e!==void 0)for(var r=new cc,i=0,a=e.length;i<a;i++){var o,s=e[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new zt[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new zt[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new zt[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new zt[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 zt[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new zt[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 zt[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new zt[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new zt[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new zt[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new zt[s.type](new Jl[s.path.type]().fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new zt[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new zt[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var h=[],c=0,l=s.shapes.length;c<l;c++){var u=t[s.shapes[c]];h.push(u)}o=new zt[s.type](h,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(var h=[],c=0,l=s.shapes.length;c<l;c++){var u=t[s.shapes[c]];h.push(u)}var f=s.options.extrudePath;f!==void 0&&(s.options.extrudePath=new Jl[f.type]().fromJSON(f)),o=new zt[s.type](h,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,s.name!==void 0&&(o.name=s.name),o.isBufferGeometry===!0&&s.userData!==void 0&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},r={};if(e!==void 0){var i=new sc;i.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if(s.type==="MultiMaterial"){for(var c=[],l=0;l<s.materials.length;l++){var u=s.materials[l];n[u.uuid]===void 0&&(n[u.uuid]=i.parse(u)),c.push(n[u.uuid])}r[s.uuid]=c}else n[s.uuid]===void 0&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=fn.parse(r);r.uuid!==void 0&&(i.uuid=r.uuid),t.push(i)}return t},parseImages:function(e,t){var n=this,r={};function i(g){return n.manager.itemStart(g),o.load(g,function(){n.manager.itemEnd(g)},void 0,function(){n.manager.itemError(g),n.manager.itemEnd(g)})}if(e!==void 0&&e.length>0){var a=new mh(t),o=new Ra(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,c=e.length;s<c;s++){var l=e[s],u=l.url;if(Array.isArray(u)){r[l.uuid]=[];for(var h=0,f=u.length;h<f;h++){var d=u[h],m=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;r[l.uuid].push(i(m))}}else{var m=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url;r[l.uuid]=i(m)}}}return r},parseTextures:function(e,t){function n(c,l){return typeof c=="number"?c:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",c),l[c])}var r={};if(e!==void 0)for(var i=0,a=e.length;i<a;i++){var o=e[i];o.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),t[o.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var s;Array.isArray(t[o.image])?s=new ar(t[o.image]):s=new ot(t[o.image]),s.needsUpdate=!0,s.uuid=o.uuid,o.name!==void 0&&(s.name=o.name),o.mapping!==void 0&&(s.mapping=n(o.mapping,Ky)),o.offset!==void 0&&s.offset.fromArray(o.offset),o.repeat!==void 0&&s.repeat.fromArray(o.repeat),o.center!==void 0&&s.center.fromArray(o.center),o.rotation!==void 0&&(s.rotation=o.rotation),o.wrap!==void 0&&(s.wrapS=n(o.wrap[0],wh),s.wrapT=n(o.wrap[1],wh)),o.format!==void 0&&(s.format=o.format),o.type!==void 0&&(s.type=o.type),o.encoding!==void 0&&(s.encoding=o.encoding),o.minFilter!==void 0&&(s.minFilter=n(o.minFilter,Mh)),o.magFilter!==void 0&&(s.magFilter=n(o.magFilter,Mh)),o.anisotropy!==void 0&&(s.anisotropy=o.anisotropy),o.flipY!==void 0&&(s.flipY=o.flipY),o.premultiplyAlpha!==void 0&&(s.premultiplyAlpha=o.premultiplyAlpha),o.unpackAlignment!==void 0&&(s.unpackAlignment=o.unpackAlignment),r[o.uuid]=s}return r},parseObject:function(e,t,n){var r;function i(y){return t[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",y),t[y]}function a(y){if(y!==void 0){if(Array.isArray(y)){for(var p=[],v=0,_=y.length;v<_;v++){var x=y[v];n[x]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",x),p.push(n[x])}return p}return n[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",y),n[y]}}switch(e.type){case"Scene":r=new Ji,e.background!==void 0&&Number.isInteger(e.background)&&(r.background=new de(e.background)),e.fog!==void 0&&(e.fog.type==="Fog"?r.fog=new Sl(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(r.fog=new Tl(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new Et(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(r.focus=e.focus),e.zoom!==void 0&&(r.zoom=e.zoom),e.filmGauge!==void 0&&(r.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(r.filmOffset=e.filmOffset),e.view!==void 0&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new Na(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(r.zoom=e.zoom),e.view!==void 0&&(r.view=Object.assign({},e.view));break;case"AmbientLight":r=new ic(e.color,e.intensity);break;case"DirectionalLight":r=new rc(e.color,e.intensity);break;case"PointLight":r=new tc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new ac(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new $l(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new Ql(e.color,e.groundColor,e.intensity);break;case"LightProbe":r=new pn().fromJSON(e);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=i(e.geometry),s=a(e.material);r=new ut(o,s);break;case"InstancedMesh":var o=i(e.geometry),s=a(e.material),c=e.count,l=e.instanceMatrix;r=new Rl(o,s,c),r.instanceMatrix=new De(new Float32Array(l.array),16);break;case"LOD":r=new Oo;break;case"Line":r=new tn(i(e.geometry),a(e.material),e.mode);break;case"LineLoop":r=new Ol(i(e.geometry),a(e.material));break;case"LineSegments":r=new Mt(i(e.geometry),a(e.material));break;case"PointCloud":case"Points":r=new Il(i(e.geometry),a(e.material));break;case"Sprite":r=new Ll(a(e.material));break;case"Group":r=new ua;break;default:r=new ae}if(r.uuid=e.uuid,e.name!==void 0&&(r.name=e.name),e.matrix!==void 0?(r.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(e.position!==void 0&&r.position.fromArray(e.position),e.rotation!==void 0&&r.rotation.fromArray(e.rotation),e.quaternion!==void 0&&r.quaternion.fromArray(e.quaternion),e.scale!==void 0&&r.scale.fromArray(e.scale)),e.castShadow!==void 0&&(r.castShadow=e.castShadow),e.receiveShadow!==void 0&&(r.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(r.shadow.bias=e.shadow.bias),e.shadow.radius!==void 0&&(r.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&r.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(r.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(r.visible=e.visible),e.frustumCulled!==void 0&&(r.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(r.renderOrder=e.renderOrder),e.userData!==void 0&&(r.userData=e.userData),e.layers!==void 0&&(r.layers.mask=e.layers),e.children!==void 0)for(var u=e.children,h=0;h<u.length;h++)r.add(this.parseObject(u[h],t,n));if(e.type==="LOD"){e.autoUpdate!==void 0&&(r.autoUpdate=e.autoUpdate);for(var f=e.levels,d=0;d<f.length;d++){var m=f[d],g=r.getObjectByProperty("uuid",m.object);g!==void 0&&r.addLevel(g,m.distance)}}return r}});var Ky={UVMapping:Bs,CubeReflectionMapping:Us,CubeRefractionMapping:zs,EquirectangularReflectionMapping:qc,EquirectangularRefractionMapping:Gs,SphericalReflectionMapping:Yc,CubeUVReflectionMapping:ki,CubeUVRefractionMapping:Hs},wh={RepeatWrapping:Qa,ClampToEdgeWrapping:Vt,MirroredRepeatWrapping:Ka},Mh={NearestFilter:_t,NearestMipmapNearestFilter:Vs,NearestMipmapLinearFilter:ks,LinearFilter:Dt,LinearMipmapNearestFilter:Zc,LinearMipmapLinearFilter:$a};function Eh(e){typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),tt.call(this,e),this.options=void 0}Eh.prototype=Object.assign(Object.create(tt.prototype),{constructor:Eh,setOptions:function(t){return this.options=t,this},load:function(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Pi.get(e);if(a!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;fetch(e).then(function(o){return o.blob()}).then(function(o){return i.options===void 0?createImageBitmap(o):createImageBitmap(o,i.options)}).then(function(o){Pi.add(e,o),t&&t(o),i.manager.itemEnd(e)}).catch(function(o){r&&r(o),i.manager.itemError(e),i.manager.itemEnd(e)}),i.manager.itemStart(e)}});function Th(){this.type="ShapePath",this.color=new de,this.subPaths=[],this.currentPath=null}Object.assign(Th.prototype,{moveTo:function(e,t){return this.currentPath=new Sn,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,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this},bezierCurveTo:function(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(D){for(var z=[],k=0,q=D.length;k<q;k++){var Z=D[k],ee=new Cr;ee.curves=Z.curves,z.push(ee)}return z}function r(D,z){for(var k=z.length,q=!1,Z=k-1,ee=0;ee<k;Z=ee++){var te=z[Z],oe=z[ee],Pe=oe.x-te.x,be=oe.y-te.y;if(Math.abs(be)>Number.EPSILON){if(be<0&&(te=z[ee],Pe=-Pe,oe=z[Z],be=-be),D.y<te.y||D.y>oe.y)continue;if(D.y===te.y){if(D.x===te.x)return!0}else{var re=be*(D.x-te.x)-Pe*(D.y-te.y);if(re===0)return!0;if(re<0)continue;q=!q}}else{if(D.y!==te.y)continue;if(oe.x<=D.x&&D.x<=te.x||te.x<=D.x&&D.x<=oe.x)return!0}}return q}var i=cr.isClockWise,a=this.subPaths;if(a.length===0)return[];if(t===!0)return n(a);var o,s,c,l=[];if(a.length===1)return s=a[0],c=new Cr,c.curves=s.curves,l.push(c),l;var u=!i(a[0].getPoints());u=e?!u:u;var h=[],f=[],d=[],m=0,g;f[m]=void 0,d[m]=[];for(var y=0,p=a.length;y<p;y++)s=a[y],g=s.getPoints(),o=i(g),o=e?!o:o,o?(!u&&f[m]&&m++,f[m]={s:new Cr,p:g},f[m].s.curves=s.curves,u&&m++,d[m]=[]):d[m].push({h:s,p:g[0]});if(!f[0])return n(a);if(f.length>1){for(var v=!1,_=[],x=0,b=f.length;x<b;x++)h[x]=[];for(var x=0,b=f.length;x<b;x++)for(var T=d[x],C=0;C<T.length;C++){for(var N=T[C],O=!0,J=0;J<f.length;J++)r(N.p,f[J].p)&&(x!==J&&_.push({froms:x,tos:J,hole:C}),O?(O=!1,h[J].push(N)):v=!0);O&&h[x].push(N)}_.length>0&&(v||(d=h))}for(var F,y=0,B=f.length;y<B;y++){c=f[y].s,l.push(c),F=d[y];for(var V=0,Y=F.length;V<Y;V++)c.holes.push(F[V].h)}return l}});function Sh(e){this.type="Font",this.data=e}Object.assign(Sh.prototype,{isFont:!0,generateShapes:function(e,t){t===void 0&&(t=100);for(var n=[],r=$y(e,t,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}});function $y(e,t,n){for(var r=Array.from?Array.from(e):String(e).split(""),i=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,c=0,l=0;l<r.length;l++){var u=r[l];if(u===`
3113
- `)s=0,c-=a;else{var h=e0(u,i,s,c,n);s+=h.offsetX,o.push(h.path)}}return o}function e0(e,t,n,r,i){var a=i.glyphs[e]||i.glyphs["?"];if(!a){console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".");return}var o=new Th,s,c,l,u,h,f,d,m;if(a.o)for(var g=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),y=0,p=g.length;y<p;){var v=g[y++];switch(v){case"m":s=g[y++]*t+n,c=g[y++]*t+r,o.moveTo(s,c);break;case"l":s=g[y++]*t+n,c=g[y++]*t+r,o.lineTo(s,c);break;case"q":l=g[y++]*t+n,u=g[y++]*t+r,h=g[y++]*t+n,f=g[y++]*t+r,o.quadraticCurveTo(h,f,l,u);break;case"b":l=g[y++]*t+n,u=g[y++]*t+r,h=g[y++]*t+n,f=g[y++]*t+r,d=g[y++]*t+n,m=g[y++]*t+r,o.bezierCurveTo(h,f,d,m,l,u);break}}return{offsetX:a.ha*t,path:o}}function Ah(e){tt.call(this,e)}Ah.prototype=Object.assign(Object.create(tt.prototype),{constructor:Ah,load:function(e,t,n,r){var i=this,a=new bn(this.manager);a.setPath(this.path),a.load(e,function(o){var s;try{s=JSON.parse(o)}catch(l){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),s=JSON.parse(o.substring(65,o.length-2))}var c=i.parse(s);t&&t(c)},n,r)},parse:function(e){return new Sh(e)}});var ds,Lh={getContext:function(){return ds===void 0&&(ds=new(window.AudioContext||window.webkitAudioContext)),ds},setContext:function(e){ds=e}};function fc(e){tt.call(this,e)}fc.prototype=Object.assign(Object.create(tt.prototype),{constructor:fc,load:function(e,t,n,r){var i=this,a=new bn(i.manager);a.setResponseType("arraybuffer"),a.setPath(i.path),a.load(e,function(o){try{var s=o.slice(0),c=Lh.getContext();c.decodeAudioData(s,function(l){t(l)})}catch(l){r?r(l):console.error(l),i.manager.itemError(e)}},n,r)}});function Ph(e,t,n){pn.call(this,void 0,n);var r=new de().set(e),i=new de().set(t),a=new E(r.r,r.g,r.b),o=new E(i.r,i.g,i.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)}Ph.prototype=Object.assign(Object.create(pn.prototype),{constructor:Ph,isHemisphereLightProbe:!0,copy:function(e){return pn.prototype.copy.call(this,e),this},toJSON:function(e){var t=pn.prototype.toJSON.call(this,e);return t}});function Ch(e,t){pn.call(this,void 0,t);var n=new de().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}Ch.prototype=Object.assign(Object.create(pn.prototype),{constructor:Ch,isAmbientLightProbe:!0,copy:function(e){return pn.prototype.copy.call(this,e),this},toJSON:function(e){var t=pn.prototype.toJSON.call(this,e);return t}});var Rh=new We,Oh=new We;function t0(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Et,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Et,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}}Object.assign(t0.prototype,{update:function(e){var t=this._cache,n=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;if(n){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 r=e.projectionMatrix.clone(),i=t.eyeSep/2,a=i*t.near/t.focus,o=t.near*Math.tan(ke.DEG2RAD*t.fov*.5)/t.zoom,s,c;Oh.elements[12]=-i,Rh.elements[12]=i,s=-o*t.aspect+a,c=o*t.aspect+a,r.elements[0]=2*t.near/(c-s),r.elements[8]=(c+s)/(c-s),this.cameraL.projectionMatrix.copy(r),s=-o*t.aspect-a,c=o*t.aspect-a,r.elements[0]=2*t.near/(c-s),r.elements[8]=(c+s)/(c-s),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Oh),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Rh)}});function Dh(e){this.autoStart=e!==void 0?e:!0,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(Dh.prototype,{start:function(){this.startTime=(typeof performance=="undefined"?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=(typeof performance=="undefined"?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var Rr=new E,Ih=new bt,n0=new E,Or=new E;function Nh(){ae.call(this),this.type="AudioListener",this.context=Lh.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Dh}Nh.prototype=Object.assign(Object.create(ae.prototype),{constructor:Nh,getInput:function(){return this.gain},removeFilter:function(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){ae.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Rr,Ih,n0),Or.set(0,0,-1).applyQuaternion(Ih),t.positionX){var r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Rr.x,r),t.positionY.linearRampToValueAtTime(Rr.y,r),t.positionZ.linearRampToValueAtTime(Rr.z,r),t.forwardX.linearRampToValueAtTime(Or.x,r),t.forwardY.linearRampToValueAtTime(Or.y,r),t.forwardZ.linearRampToValueAtTime(Or.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(Rr.x,Rr.y,Rr.z),t.setOrientation(Or.x,Or.y,Or.z,n.x,n.y,n.z)}});function Fa(e){ae.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._progress=0,this.filters=[]}Fa.prototype=Object.assign(Object.create(ae.prototype),{constructor:Fa,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(e===void 0&&(e=0),this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}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._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()},pause:function(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this},stop:function(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this},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=[]),this.isPlaying===!0?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this},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 Dr=new E,Fh=new bt,r0=new E,Ir=new E;function Bh(e){Fa.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}Bh.prototype=Object.assign(Object.create(Fa.prototype),{constructor:Bh,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(ae.prototype.updateMatrixWorld.call(this,e),!(this.hasPlaybackControl===!0&&this.isPlaying===!1)){this.matrixWorld.decompose(Dr,Fh,r0),Ir.set(0,0,1).applyQuaternion(Fh);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Dr.x,n),t.positionY.linearRampToValueAtTime(Dr.y,n),t.positionZ.linearRampToValueAtTime(Dr.z,n),t.orientationX.linearRampToValueAtTime(Ir.x,n),t.orientationY.linearRampToValueAtTime(Ir.y,n),t.orientationZ.linearRampToValueAtTime(Ir.z,n)}else t.setPosition(Dr.x,Dr.y,Dr.z),t.setOrientation(Ir.x,Ir.y,Ir.z)}}});function Uh(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t!==void 0?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}Object.assign(Uh.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}});function zh(e,t,n){this.binding=e,this.valueSize=n;var r,i,a;switch(t){case"quaternion":r=this._slerp,i=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:r=this._lerp,i=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}Object.assign(zh.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(a===0){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{a+=t;var s=t/a;this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},accumulateAdditive:function(e){var t=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){var s=t*this._origIndex;this._mixBufferRegion(n,r,s,1-i,t)}a>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(var c=t,l=t+t;c!==l;++c)if(n[c]!==n[c+t]){o.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var e=this.valueSize*3;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,n=e;n<t;n++)this.buffer[n]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*4+3]=1},_setAdditiveIdentityOther:function(){for(var e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]},_select:function(e,t,n,r,i){if(r>=.5)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){bt.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){var a=this._workIndex*i;bt.multiplyQuaternionsFlat(e,a,e,t,e,n),bt.slerpFlat(e,t,e,t,e,a,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}},_lerpAdditive:function(e,t,n,r,i){for(var a=0;a!==i;++a){var o=t+a;e[o]=e[o]+e[n+a]*r}}});var dc="\\[\\]\\.:\\/",i0=new RegExp("["+dc+"]","g"),pc="[^"+dc+"]",a0="[^"+dc.replace("\\.","")+"]",o0=/((?:WC+[\/:])*)/.source.replace("WC",pc),s0=/(WCOD+)?/.source.replace("WCOD",a0),l0=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",pc),c0=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",pc),u0=new RegExp("^"+o0+s0+l0+c0+"$"),h0=["material","materials","bones"];function Gh(e,t,n){var r=n||Gt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}Object.assign(Gh.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].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()}});function Gt(e,t,n){this.path=t,this.parsedPath=n||Gt.parseTrackName(t),this.node=Gt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}Object.assign(Gt,{Composite:Gh,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Gt.Composite(e,t,n):new Gt(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(i0,"")},parseTrackName:function(e){var t=u0.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]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){var i=n.nodeName.substring(r+1);h0.indexOf(i)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){var r=function(a){for(var o=0;o<a.length;o++){var s=a[o];if(s.name===t||s.uuid===t)return s;var c=r(s.children);if(c)return c}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(Gt.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(t,n){t[n]=this.node[this.propertyName]},function(t,n){for(var r=this.resolvedProperty,i=0,a=r.length;i!==a;++i)t[n++]=r[i]},function(t,n){t[n]=this.resolvedProperty[this.propertyIndex]},function(t,n){this.resolvedProperty.toArray(t,n)}],SetterByBindingTypeAndVersioning:[[function(t,n){this.targetObject[this.propertyName]=t[n]},function(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.needsUpdate=!0},function(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){for(var r=this.resolvedProperty,i=0,a=r.length;i!==a;++i)r[i]=t[n++]},function(t,n){for(var r=this.resolvedProperty,i=0,a=r.length;i!==a;++i)r[i]=t[n++];this.targetObject.needsUpdate=!0},function(t,n){for(var r=this.resolvedProperty,i=0,a=r.length;i!==a;++i)r[i]=t[n++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){this.resolvedProperty[this.propertyIndex]=t[n]},function(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.needsUpdate=!0},function(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){this.resolvedProperty.fromArray(t,n)},function(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.needsUpdate=!0},function(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,n){this.bind(),this.getValue(t,n)},setValue:function(t,n){this.bind(),this.setValue(t,n)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=Gt.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(a!==void 0){if(e[a]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[a]}}var s=e[r];if(s===void 0){var c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}var l=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(i!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[i]!==void 0&&(i=e.morphTargetDictionary[i])}else{console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);return}}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else s.fromArray!==void 0&&s.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Gt.prototype,{_getValue_unbound:Gt.prototype.getValue,_setValue_unbound:Gt.prototype.setValue});function f0(){this.uuid=ke.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 r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}Object.assign(f0.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,c=void 0,l=0,u=arguments.length;l!==u;++l){var h=arguments[l],f=h.uuid,d=r[f];if(d===void 0){d=t++,r[f]=d,e.push(h);for(var m=0,g=s;m!==g;++m)o[m].push(new Gt(h,i[m],a[m]))}else if(d<n){c=e[d];var y=--n,p=e[y];r[p.uuid]=d,e[d]=p,r[f]=y,e[y]=h;for(var m=0,g=s;m!==g;++m){var v=o[m],_=v[y],x=v[d];v[d]=_,x===void 0&&(x=new Gt(h,i[m],a[m])),v[y]=x}}else e[d]!==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,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,l=n[c];if(l!==void 0&&l>=t){var u=t++,h=e[u];n[h.uuid]=l,e[l]=h,n[c]=u,e[u]=s;for(var f=0,d=i;f!==d;++f){var m=r[f],g=m[u],y=m[l];m[l]=g,m[u]=y}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],l=c.uuid,u=r[l];if(u!==void 0)if(delete r[l],u<n){var h=--n,f=e[h],d=--t,m=e[d];r[f.uuid]=u,e[u]=f,r[m.uuid]=h,e[h]=m,e.pop();for(var g=0,y=a;g!==y;++g){var p=i[g],v=p[h],_=p[d];p[u]=v,p[h]=_,p.pop()}}else{var d=--t,m=e[d];r[m.uuid]=u,e[u]=m,e.pop();for(var g=0,y=a;g!==y;++g){var p=i[g];p[u]=p[d],p.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(r!==void 0)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=new Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(var h=l,f=s.length;h!==f;++h){var d=s[h];u[h]=new Gt(d,e,t)}return u},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],c=e[o];t[c]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}});function Hh(e,t,n,r){this._mixer=e,this._clip=t,this._localRoot=n||null,this.blendMode=r||t.blendMode;for(var i=t.tracks,a=i.length,o=new Array(a),s={endingStart:Gr,endingEnd:Gr},c=0;c!==a;++c){var l=i[c].createInterpolant(null);o[c]=l,l.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ip,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}Object.assign(Hh.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&&this.timeScale!==0&&this._startTime===null&&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 r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;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 e!==null&&(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 r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/o,c[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return e!==null&&(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,r){if(!this.enabled){this._updateWeight(e);return}var i=this._startTime;if(i!==null){var a=(e-i)*n;if(a<0||n===0)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0){var c=this._interpolants,l=this._propertyBindings;switch(this.blendMode){case ou:for(var u=0,h=c.length;u!==h;++u)c[u].evaluate(o),l[u].accumulateAdditive(s);break;case Xs:default:for(var u=0,h=c.length;u!==h;++u)c[u].evaluate(o),l[u].accumulate(r,s)}}},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(n!==null){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(n!==null){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,r=this.loop,i=this._loopCount,a=r===ap;if(e===0)return i===-1?t:a&&(i&1)===1?n-t:t;if(r===rp){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else if(t<0)t=0;else{this.time=t;break e}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(i===-1&&(e>=0?(i=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,i+=Math.abs(o);var s=this.repetitions-i;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(s===1){var c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&(i&1)===1)return n-t}return t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=Hr,r.endingEnd=Hr):(e?r.endingStart=this.zeroSlopeAtStart?Hr:Gr:r.endingStart=ao,t?r.endingEnd=this.zeroSlopeAtEnd?Hr:Gr:r.endingEnd=ao)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}});function Vh(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}Vh.prototype=Object.assign(Object.create(sn.prototype),{constructor:Vh,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];l===void 0&&(l={},c[s]=l);for(var u=0;u!==i;++u){var h=r[u],f=h.name,d=l[f];if(d!==void 0)a[u]=d;else{if(d=a[u],d!==void 0){d._cacheIndex===null&&(++d.referenceCount,this._addInactiveBinding(d,s,f));continue}var m=t&&t._propertyBindings[u].binding.parsedPath;d=new zh(Gt.create(n,f,m),h.ValueTypeName,h.getValueSize()),++d.referenceCount,this._addInactiveBinding(d,s,f),a[u]=d}o[u].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];--i.useCount===0&&(i.restoreOriginalState(),this._takeBackBinding(i))}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 t!==null&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,a=i[t];if(a===void 0)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,c=s[s.length-1],l=e._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),e._byClipCacheIndex=null;var u=o.actionByRoot,h=(e._localRoot||this._root).uuid;delete u[h],s.length===0&&delete a[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];--i.referenceCount===0&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=r[t],a=this._bindings;i===void 0&&(i={},r[t]=i),i[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete o[i],Object.keys(o).length===0&&delete a[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return n===void 0&&(n=new cs(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t,n){var r=t||this._root,i=r.uuid,a=typeof e=="string"?fn.findByName(r,e):e,o=a!==null?a.uuid:e,s=this._actionsByClip[o],c=null;if(n===void 0&&(a!==null?n=a.blendMode:n=Xs),s!==void 0){var l=s.actionByRoot[i];if(l!==void 0&&l.blendMode===n)return l;c=s.knownActions[0],a===null&&(a=c._clip)}if(a===null)return null;var u=new Hh(this,a,t,n);return this._bindAction(u,c),this._addInactiveAction(u,o,i),u},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i=typeof e=="string"?fn.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return o!==void 0&&o.actionByRoot[r]||null},stopAllAction:function(){for(var e=this._actions,t=this._nActiveActions,n=t-1;n>=0;--n)e[n].stop();return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){var s=t[o];s._update(r,e,i,a)}for(var c=this._bindings,l=this._nActiveBindings,o=0;o!==l;++o)c[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,r=this._actionsByClip,i=r[n];if(i!==void 0){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var l=c._cacheIndex,u=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=l,t[l]=u,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot,a=i[t];a!==void 0&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[t];if(s!==void 0)for(var c in s){var l=s[c];l.restoreOriginalState(),this._removeInactiveBinding(l)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}});function vc(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}vc.prototype.clone=function(){return new vc(this.value.clone===void 0?this.value:this.value.clone())};function kh(e,t,n){sr.call(this,e,t),this.meshPerAttribute=n||1}kh.prototype=Object.assign(Object.create(sr.prototype),{constructor:kh,isInstancedInterleavedBuffer:!0,copy:function(e){return sr.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}});function Wh(e,t,n,r){this.ray=new Jr(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new Js,this.params={Mesh:{},Line:{threshold:1},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 Xh(e,t){return e.distance-t.distance}function mc(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),r===!0)for(var i=e.children,a=0,o=i.length;a<o;a++)mc(i[a],t,n,!0)}Object.assign(Wh.prototype,{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 r=n||[];return mc(e,this,r,t),r.sort(Xh),r},intersectObjects:function(e,t,n){var r=n||[];if(Array.isArray(e)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=e.length;i<a;i++)mc(e[i],this,r,t);return r.sort(Xh),r}});function gc(e,t,n){return this.radius=e!==void 0?e:1,this.phi=t!==void 0?t:0,this.theta=n!==void 0?n:0,this}Object.assign(gc.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),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(ke.clamp(t/this.radius,-1,1))),this}});function d0(e,t,n){return this.radius=e!==void 0?e:1,this.theta=t!==void 0?t:0,this.y=n!==void 0?n:0,this}Object.assign(d0.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 jh=new X;function qh(e,t){this.min=e!==void 0?e:new X(1/0,1/0),this.max=t!==void 0?t:new X(-1/0,-1/0)}Object.assign(qh.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=jh.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 e===void 0&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new X),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return e===void 0&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new X),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 t===void 0&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new X),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 t===void 0&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new X),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){var t=jh.copy(e).clamp(this.min,this.max);return t.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 Yh=new E,ps=new E;function Zh(e,t){this.start=e!==void 0?e:new E,this.end=t!==void 0?t:new E}Object.assign(Zh.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 e===void 0&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new E),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return e===void 0&&(console.warn("THREE.Line3: .delta() target is now required"),e=new E),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 t===void 0&&(console.warn("THREE.Line3: .at() target is now required"),t=new E),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){Yh.subVectors(e,this.start),ps.subVectors(this.end,this.start);var n=ps.dot(ps),r=ps.dot(Yh),i=r/n;return t&&(i=ke.clamp(i,0,1)),i},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return n===void 0&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new E),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)}});function vs(e){ae.call(this),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}vs.prototype=Object.create(ae.prototype),vs.prototype.constructor=vs,vs.prototype.isImmediateRenderObject=!0;var Jh=new E;function Ba(e,t){ae.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new ve,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1,o=32;i<o;i++,a++){var s=i/o*Math.PI*2,c=a/o*Math.PI*2;r.push(Math.cos(s),Math.sin(s),1,Math.cos(c),Math.sin(c),1)}n.setAttribute("position",new ce(r,3));var l=new mt({fog:!1,toneMapped:!1});this.cone=new Mt(n,l),this.add(this.cone),this.update()}Ba.prototype=Object.create(ae.prototype),Ba.prototype.constructor=Ba,Ba.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Ba.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),Jh.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Jh),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var dr=new E,ms=new We,yc=new We;function Qh(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,Qh(e.children[n]));return t}function Ci(e){for(var t=Qh(e),n=new ve,r=[],i=[],a=new de(0,0,1),o=new de(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new ce(r,3)),n.setAttribute("color",new ce(i,3));var l=new mt({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});Mt.call(this,n,l),this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}Ci.prototype=Object.create(Mt.prototype),Ci.prototype.constructor=Ci,Ci.prototype.isSkeletonHelper=!0,Ci.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,r=n.getAttribute("position");yc.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<t.length;i++){var o=t[i];o.parent&&o.parent.isBone&&(ms.multiplyMatrices(yc,o.matrixWorld),dr.setFromMatrixPosition(ms),r.setXYZ(a,dr.x,dr.y,dr.z),ms.multiplyMatrices(yc,o.parent.matrixWorld),dr.setFromMatrixPosition(ms),r.setXYZ(a+1,dr.x,dr.y,dr.z),a+=2)}n.getAttribute("position").needsUpdate=!0,ae.prototype.updateMatrixWorld.call(this,e)};function Ua(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new yi(t,4,2),i=new hn({wireframe:!0,fog:!1,toneMapped:!1});ut.call(this,r,i),this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}Ua.prototype=Object.create(ut.prototype),Ua.prototype.constructor=Ua,Ua.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Ua.prototype.update=function(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var p0=new E,Kh=new de,$h=new de;function za(e,t,n){ae.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new pi(t);r.rotateY(Math.PI*.5),this.material=new hn({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);var i=r.getAttribute("position"),a=new Float32Array(i.count*3);r.setAttribute("color",new De(a,3)),this.add(new ut(r,this.material)),this.update()}za.prototype=Object.create(ae.prototype),za.prototype.constructor=za,za.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},za.prototype.update=function(){var e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");Kh.copy(this.light.color),$h.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?Kh:$h;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(p0.setFromMatrixPosition(this.light.matrixWorld).negate())};function xc(e,t,n,r){e=e||10,t=t||10,n=new de(n!==void 0?n:4473924),r=new de(r!==void 0?r:8947848);for(var i=t/2,a=e/t,o=e/2,s=[],c=[],l=0,u=0,h=-o;l<=t;l++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var f=l===i?n:r;f.toArray(c,u),u+=3,f.toArray(c,u),u+=3,f.toArray(c,u),u+=3,f.toArray(c,u),u+=3}var d=new ve;d.setAttribute("position",new ce(s,3)),d.setAttribute("color",new ce(c,3));var m=new mt({vertexColors:!0,toneMapped:!1});Mt.call(this,d,m),this.type="GridHelper"}xc.prototype=Object.assign(Object.create(Mt.prototype),{constructor:xc,copy:function(e){return Mt.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return new this.constructor().copy(this)}});function _c(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new de(i!==void 0?i:4473924),a=new de(a!==void 0?a:8947848);var o=[],s=[],c,l,u,h,f,d,m;for(h=0;h<=t;h++)u=h/t*(Math.PI*2),c=Math.sin(u)*e,l=Math.cos(u)*e,o.push(0,0,0),o.push(c,0,l),m=h&1?i:a,s.push(m.r,m.g,m.b),s.push(m.r,m.g,m.b);for(h=0;h<=n;h++)for(m=h&1?i:a,d=e-e/n*h,f=0;f<r;f++)u=f/r*(Math.PI*2),c=Math.sin(u)*d,l=Math.cos(u)*d,o.push(c,0,l),s.push(m.r,m.g,m.b),u=(f+1)/r*(Math.PI*2),c=Math.sin(u)*d,l=Math.cos(u)*d,o.push(c,0,l),s.push(m.r,m.g,m.b);var g=new ve;g.setAttribute("position",new ce(o,3)),g.setAttribute("color",new ce(s,3));var y=new mt({vertexColors:!0,toneMapped:!1});Mt.call(this,g,y),this.type="PolarGridHelper"}_c.prototype=Object.create(Mt.prototype),_c.prototype.constructor=_c;var ef=new E,gs=new E,tf=new E;function Ga(e,t,n){ae.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,t===void 0&&(t=1);var r=new ve;r.setAttribute("position",new ce([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new mt({fog:!1,toneMapped:!1});this.lightPlane=new tn(r,i),this.add(this.lightPlane),r=new ve,r.setAttribute("position",new ce([0,0,0,0,0,1],3)),this.targetLine=new tn(r,i),this.add(this.targetLine),this.update()}Ga.prototype=Object.create(ae.prototype),Ga.prototype.constructor=Ga,Ga.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Ga.prototype.update=function(){ef.setFromMatrixPosition(this.light.matrixWorld),gs.setFromMatrixPosition(this.light.target.matrixWorld),tf.subVectors(gs,ef),this.lightPlane.lookAt(gs),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(gs),this.targetLine.scale.z=tf.length()};var ys=new E,dt=new Bn;function xs(e){var t=new ve,n=new mt({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],a={},o=new de(16755200),s=new de(16711680),c=new de(43775),l=new de(16777215),u=new de(3355443);h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c),h("c","t",l),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u);function h(d,m,g){f(d,g),f(m,g)}function f(d,m){r.push(0,0,0),i.push(m.r,m.g,m.b),a[d]===void 0&&(a[d]=[]),a[d].push(r.length/3-1)}t.setAttribute("position",new ce(r,3)),t.setAttribute("color",new ce(i,3)),Mt.call(this,t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}xs.prototype=Object.create(Mt.prototype),xs.prototype.constructor=xs,xs.prototype.update=function(){var e=this.geometry,t=this.pointMap,n=1,r=1;dt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),gt("c",t,e,dt,0,0,-1),gt("t",t,e,dt,0,0,1),gt("n1",t,e,dt,-n,-r,-1),gt("n2",t,e,dt,n,-r,-1),gt("n3",t,e,dt,-n,r,-1),gt("n4",t,e,dt,n,r,-1),gt("f1",t,e,dt,-n,-r,1),gt("f2",t,e,dt,n,-r,1),gt("f3",t,e,dt,-n,r,1),gt("f4",t,e,dt,n,r,1),gt("u1",t,e,dt,n*.7,r*1.1,-1),gt("u2",t,e,dt,-n*.7,r*1.1,-1),gt("u3",t,e,dt,0,r*2,-1),gt("cf1",t,e,dt,-n,0,1),gt("cf2",t,e,dt,n,0,1),gt("cf3",t,e,dt,0,-r,1),gt("cf4",t,e,dt,0,r,1),gt("cn1",t,e,dt,-n,0,-1),gt("cn2",t,e,dt,n,0,-1),gt("cn3",t,e,dt,0,-r,-1),gt("cn4",t,e,dt,0,r,-1),e.getAttribute("position").needsUpdate=!0};function gt(e,t,n,r,i,a,o){ys.set(i,a,o).unproject(r);var s=t[e];if(s!==void 0)for(var c=n.getAttribute("position"),l=0,u=s.length;l<u;l++)c.setXYZ(s[l],ys.x,ys.y,ys.z)}var _s=new gn;function Nr(e,t){this.object=e,t===void 0&&(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]),r=new Float32Array(8*3),i=new ve;i.setIndex(new De(n,1)),i.setAttribute("position",new De(r,3)),Mt.call(this,i,new mt({color:t,toneMapped:!1})),this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}Nr.prototype=Object.create(Mt.prototype),Nr.prototype.constructor=Nr,Nr.prototype.update=function(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&_s.setFromObject(this.object),!_s.isEmpty()){var t=_s.min,n=_s.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Nr.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Nr.prototype.copy=function(e){return Mt.prototype.copy.call(this,e),this.object=e.object,this},Nr.prototype.clone=function(){return new this.constructor().copy(this)};function bs(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]),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],i=new ve;i.setIndex(new De(n,1)),i.setAttribute("position",new ce(r,3)),Mt.call(this,i,new mt({color:t,toneMapped:!1})),this.type="Box3Helper",this.geometry.computeBoundingSphere()}bs.prototype=Object.create(Mt.prototype),bs.prototype.constructor=bs,bs.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),ae.prototype.updateMatrixWorld.call(this,e))};function ws(e,t,n){this.plane=e,this.size=t===void 0?1:t;var r=n!==void 0?n:16776960,i=[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],a=new ve;a.setAttribute("position",new ce(i,3)),a.computeBoundingSphere(),tn.call(this,a,new mt({color:r,toneMapped:!1})),this.type="PlaneHelper";var o=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],s=new ve;s.setAttribute("position",new ce(o,3)),s.computeBoundingSphere(),this.add(new ut(s,new hn({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}ws.prototype=Object.create(tn.prototype),ws.prototype.constructor=ws,ws.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?At:Gi,this.lookAt(this.plane.normal),ae.prototype.updateMatrixWorld.call(this,e)};var nf=new E,Ms,bc;function pr(e,t,n,r,i,a){ae.call(this),this.type="ArrowHelper",e===void 0&&(e=new E(0,0,1)),t===void 0&&(t=new E(0,0,0)),n===void 0&&(n=1),r===void 0&&(r=16776960),i===void 0&&(i=.2*n),a===void 0&&(a=.2*i),Ms===void 0&&(Ms=new ve,Ms.setAttribute("position",new ce([0,0,0,0,1,0],3)),bc=new ur(0,.5,1,5,1),bc.translate(0,-.5,0)),this.position.copy(t),this.line=new tn(Ms,new mt({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ut(bc,new hn({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}pr.prototype=Object.create(ae.prototype),pr.prototype.constructor=pr,pr.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{nf.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(nf,t)}},pr.prototype.setLength=function(e,t,n){t===void 0&&(t=.2*e),n===void 0&&(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()},pr.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},pr.prototype.copy=function(e){return ae.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},pr.prototype.clone=function(){return new this.constructor().copy(this)};function wc(e){e=e||1;var t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new ve;r.setAttribute("position",new ce(t,3)),r.setAttribute("color",new ce(n,3));var i=new mt({vertexColors:!0,toneMapped:!1});Mt.call(this,r,i),this.type="AxesHelper"}wc.prototype=Object.create(Mt.prototype),wc.prototype.constructor=wc;var Ri=4,vr=8,An=Math.pow(2,vr),rf=[.125,.215,.35,.446,.526,.582],af=vr-Ri+1+rf.length,Oi=20,Ln={[kt]:0,[oo]:1,[qs]:2,[su]:3,[lu]:4,[cu]:5,[js]:6},Mc=new Na,{_lodPlanes:Ha,_sizeLods:of,_sigmas:Es}=m0(),Ec=null,Fr=(1+Math.sqrt(5))/2,Di=1/Fr,sf=[new E(1,1,1),new E(-1,1,1),new E(1,1,-1),new E(-1,1,-1),new E(0,Fr,Di),new E(0,Fr,-Di),new E(Di,0,Fr),new E(-Di,0,Fr),new E(Fr,Di,0),new E(-Fr,Di,0)];function lf(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=g0(Oi),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}lf.prototype={constructor:lf,fromScene:function(e,t=0,n=.1,r=100){Ec=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i},fromEquirectangular:function(e){return e.magFilter=_t,e.minFilter=_t,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){Ec=this._renderer.getRenderTarget();var t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t},compileCubemapShader:function(){this._cubemapShader===null&&(this._cubemapShader=hf(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){this._equirectShader===null&&(this._equirectShader=uf(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(var e=0;e<Ha.length;e++)Ha[e].dispose()},_cleanup:function(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Ec),e.scissorTest=!1,e.setSize(e.width,e.height)},_allocateTargets:function(e){var t={magFilter:_t,minFilter:_t,generateMipmaps:!1,type:Wi,format:_d,encoding:v0(e)?e.encoding:qs,depthBuffer:!1,stencilBuffer:!1},n=cf(t);return n.depthBuffer=!e,this._pingPongRenderTarget=cf(t),n},_compileMaterial:function(e){var t=new ut(Ha[0],e);this._renderer.compile(t,Mc)},_sceneToCubeUV:function(e,t,n,r){var i=90,a=1,o=new Et(i,a,t,n),s=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],l=this._renderer,u=l.outputEncoding,h=l.toneMapping,f=l.toneMappingExposure,d=l.getClearColor(),m=l.getClearAlpha();l.toneMapping=jc,l.toneMappingExposure=1,l.outputEncoding=kt;var g=e.background;if(g&&g.isColor){g.convertSRGBToLinear();var y=Math.max(g.r,g.g,g.b),p=Math.min(Math.max(Math.ceil(Math.log2(y)),-128),127);g=g.multiplyScalar(Math.pow(2,-p));var v=(p+128)/255;l.setClearColor(g,v),e.background=null}for(var _=0;_<6;_++){var x=_%3;x==0?(o.up.set(0,s[_],0),o.lookAt(c[_],0,0)):x==1?(o.up.set(0,0,s[_]),o.lookAt(0,c[_],0)):(o.up.set(0,s[_],0),o.lookAt(0,0,c[_])),Tc(r,x*An,_>2?An:0,An,An),l.setRenderTarget(r),l.render(e,o)}l.toneMapping=h,l.toneMappingExposure=f,l.outputEncoding=u,l.setClearColor(d,m)},_textureToCubeUV:function(e,t){var n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=hf()):this._equirectShader==null&&(this._equirectShader=uf());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new ut(Ha[0],r),a=r.uniforms;a.envMap.value=e,e.isCubeTexture||a.texelSize.value.set(1/e.image.width,1/e.image.height),a.inputEncoding.value=Ln[e.encoding],a.outputEncoding.value=Ln[t.texture.encoding],Tc(t,0,0,3*An,2*An),n.setRenderTarget(t),n.render(i,Mc)},_applyPMREM:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;r<af;r++){var i=Math.sqrt(Es[r]*Es[r]-Es[r-1]*Es[r-1]),a=sf[(r-1)%sf.length];this._blur(e,r-1,r,i,a)}t.autoClear=n},_blur:function(e,t,n,r,i){var a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,"latitudinal",i),this._halfBlur(a,e,n,n,r,"longitudinal",i)},_halfBlur:function(e,t,n,r,i,a,o){var s=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");var l=3,u=new ut(Ha[r],c),h=c.uniforms,f=of[n]-1,d=isFinite(i)?Math.PI/(2*f):2*Math.PI/(2*Oi-1),m=i/d,g=isFinite(i)?1+Math.floor(l*m):Oi;g>Oi&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Oi}`);for(var y=[],p=0,v=0;v<Oi;++v){var b=v/m,_=Math.exp(-b*b/2);y.push(_),v==0?p+=_:v<g&&(p+=2*_)}for(var v=0;v<y.length;v++)y[v]=y[v]/p;h.envMap.value=e.texture,h.samples.value=g,h.weights.value=y,h.latitudinal.value=a==="latitudinal",o&&(h.poleAxis.value=o),h.dTheta.value=d,h.mipInt.value=vr-n,h.inputEncoding.value=Ln[e.texture.encoding],h.outputEncoding.value=Ln[e.texture.encoding];var x=of[r],b=3*Math.max(0,An-2*x),T=(r===0?0:2*An)+2*x*(r>vr-Ri?r-vr+Ri:0);Tc(t,b,T,3*x,2*x),s.setRenderTarget(t),s.render(u,Mc)}};function v0(e){return e===void 0||e.type!==Wi?!1:e.encoding===kt||e.encoding===oo||e.encoding===js}function m0(){for(var e=[],t=[],n=[],r=vr,i=0;i<af;i++){var a=Math.pow(2,r);t.push(a);var o=1/a;i>vr-Ri?o=rf[i-vr+Ri-1]:i==0&&(o=0),n.push(o);for(var s=1/(a-1),c=-s/2,l=1+s/2,u=[c,c,l,c,l,l,c,c,l,l,c,l],h=6,f=6,d=3,m=2,g=1,y=new Float32Array(d*f*h),p=new Float32Array(m*f*h),v=new Float32Array(g*f*h),_=0;_<h;_++){var x=_%3*2/3-1,b=_>2?0:-1,T=[x,b,0,x+2/3,b,0,x+2/3,b+1,0,x,b,0,x+2/3,b+1,0,x,b+1,0];y.set(T,d*f*_),p.set(u,m*f*_);var C=[_,_,_,_,_,_];v.set(C,g*f*_)}var N=new ve;N.setAttribute("position",new De(y,d)),N.setAttribute("uv",new De(p,m)),N.setAttribute("faceIndex",new De(v,g)),e.push(N),r>Ri&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function cf(e){var t=new $t(3*An,3*An,e);return t.texture.mapping=ki,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Tc(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function g0(e){var t=new Float32Array(e),n=new E(0,1,0),r=new hr({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:Ln[kt]},outputEncoding:{value:Ln[kt]}},vertexShader:Sc(),fragmentShader:`
3112
+ }`;function qu(e,t,n){var r=new aa,i=new X,a=new X,o=new et,s=[],c=[],l={},u={0:At,1:Gi,2:$a},h=new Wt({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new X},radius:{value:4}},vertexShader:yy,fragmentShader:gy}),f=h.clone();f.defines.HORIZONAL_PASS=1;var d=new ve;d.setAttribute("position",new De(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var m=new ut(d,h),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Uc,this.render=function(b,T,C){if(g.enabled!==!1&&!(g.autoUpdate===!1&&g.needsUpdate===!1)&&b.length!==0){var N=e.getRenderTarget(),O=e.getActiveCubeFace(),J=e.getActiveMipmapLevel(),F=e.state;F.setBlending(Jn),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);for(var B=0,V=b.length;B<V;B++){var Y=b[B],D=Y.shadow;if(D===void 0){console.warn("THREE.WebGLShadowMap:",Y,"has no shadow.");continue}i.copy(D.mapSize);var z=D.getFrameExtents();if(i.multiply(z),a.copy(D.mapSize),(i.x>n||i.y>n)&&(i.x>n&&(a.x=Math.floor(n/z.x),i.x=a.x*z.x,D.mapSize.x=a.x),i.y>n&&(a.y=Math.floor(n/z.y),i.y=a.y*z.y,D.mapSize.y=a.y)),D.map===null&&!D.isPointLightShadow&&this.type===zi){var k={minFilter:It,magFilter:It,format:on};D.map=new $t(i.x,i.y,k),D.map.texture.name=Y.name+".shadowMap",D.mapPass=new $t(i.x,i.y,k),D.camera.updateProjectionMatrix()}if(D.map===null){var k={minFilter:_t,magFilter:_t,format:on};D.map=new $t(i.x,i.y,k),D.map.texture.name=Y.name+".shadowMap",D.camera.updateProjectionMatrix()}e.setRenderTarget(D.map),e.clear();for(var q=D.getViewportCount(),Z=0;Z<q;Z++){var ee=D.getViewport(Z);o.set(a.x*ee.x,a.y*ee.y,a.x*ee.z,a.y*ee.w),F.viewport(o),D.updateMatrices(Y,Z),r=D.getFrustum(),x(T,C,D.camera,Y,this.type)}!D.isPointLightShadow&&this.type===zi&&y(D,C)}g.needsUpdate=!1,e.setRenderTarget(N,O,J)}};function y(b,T){var C=t.update(m);h.uniforms.shadow_pass.value=b.map.texture,h.uniforms.resolution.value=b.mapSize,h.uniforms.radius.value=b.radius,e.setRenderTarget(b.mapPass),e.clear(),e.renderBufferDirect(T,null,C,h,m,null),f.uniforms.shadow_pass.value=b.mapPass.texture,f.uniforms.resolution.value=b.mapSize,f.uniforms.radius.value=b.radius,e.setRenderTarget(b.map),e.clear(),e.renderBufferDirect(T,null,C,f,m,null)}function p(b,T,C){var N=b<<0|T<<1|C<<2,O=s[N];return O===void 0&&(O=new Er({depthPacking:up,morphTargets:b,skinning:T}),s[N]=O),O}function v(b,T,C){var N=b<<0|T<<1|C<<2,O=c[N];return O===void 0&&(O=new Tr({morphTargets:b,skinning:T}),c[N]=O),O}function _(b,T,C,N,O,J,F){var B=null,V=p,Y=b.customDepthMaterial;if(N.isPointLight===!0&&(V=v,Y=b.customDistanceMaterial),Y===void 0){var D=!1;C.morphTargets===!0&&(D=T.morphAttributes&&T.morphAttributes.position&&T.morphAttributes.position.length>0);var z=!1;b.isSkinnedMesh===!0&&(C.skinning===!0?z=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",b));var k=b.isInstancedMesh===!0;B=V(D,z,k)}else B=Y;if(e.localClippingEnabled&&C.clipShadows===!0&&C.clippingPlanes.length!==0){var q=B.uuid,Z=C.uuid,ee=l[q];ee===void 0&&(ee={},l[q]=ee);var te=ee[Z];te===void 0&&(te=B.clone(),ee[Z]=te),B=te}return B.visible=C.visible,B.wireframe=C.wireframe,F===zi?B.side=C.shadowSide!==null?C.shadowSide:C.side:B.side=C.shadowSide!==null?C.shadowSide:u[C.side],B.clipShadows=C.clipShadows,B.clippingPlanes=C.clippingPlanes,B.clipIntersection=C.clipIntersection,B.wireframeLinewidth=C.wireframeLinewidth,B.linewidth=C.linewidth,N.isPointLight===!0&&B.isMeshDistanceMaterial===!0&&(B.referencePosition.setFromMatrixPosition(N.matrixWorld),B.nearDistance=O,B.farDistance=J),B}function x(b,T,C,N,O){if(b.visible!==!1){var J=b.layers.test(T.layers);if(J&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&O===zi)&&(!b.frustumCulled||r.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,b.matrixWorld);var F=t.update(b),B=b.material;if(Array.isArray(B))for(var V=F.groups,Y=0,D=V.length;Y<D;Y++){var z=V[Y],k=B[z.materialIndex];if(k&&k.visible){var q=_(b,F,k,N,C.near,C.far,O);e.renderBufferDirect(C,null,F,q,b,z)}}else if(B.visible){var q=_(b,F,B,N,C.near,C.far,O);e.renderBufferDirect(C,null,F,q,b,null)}}for(var Z=b.children,ee=0,te=Z.length;ee<te;ee++)x(Z[ee],T,C,N,O)}}}function xy(e,t,n){var r=n.isWebGL2;function i(){var I=!1,we=new et,Me=null,Ve=new et(0,0,0,0);return{setMask:function(Ee){Me!==Ee&&!I&&(e.colorMask(Ee,Ee,Ee,Ee),Me=Ee)},setLocked:function(Ee){I=Ee},setClear:function(Ee,Ze,it,pt,Ht){Ht===!0&&(Ee*=pt,Ze*=pt,it*=pt),we.set(Ee,Ze,it,pt),Ve.equals(we)===!1&&(e.clearColor(Ee,Ze,it,pt),Ve.copy(we))},reset:function(){I=!1,Me=null,Ve.set(-1,0,0,0)}}}function a(){var I=!1,we=null,Me=null,Ve=null;return{setTest:function(Ee){Ee?Te(2929):ue(2929)},setMask:function(Ee){we!==Ee&&!I&&(e.depthMask(Ee),we=Ee)},setFunc:function(Ee){if(Me!==Ee){if(Ee)switch(Ee){case $f:e.depthFunc(512);break;case ed:e.depthFunc(519);break;case td:e.depthFunc(513);break;case Bs:e.depthFunc(515);break;case nd:e.depthFunc(514);break;case rd:e.depthFunc(518);break;case id:e.depthFunc(516);break;case ad:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);Me=Ee}},setLocked:function(Ee){I=Ee},setClear:function(Ee){Ve!==Ee&&(e.clearDepth(Ee),Ve=Ee)},reset:function(){I=!1,we=null,Me=null,Ve=null}}}function o(){var I=!1,we=null,Me=null,Ve=null,Ee=null,Ze=null,it=null,pt=null,Ht=null;return{setTest:function(at){I||(at?Te(2960):ue(2960))},setMask:function(at){we!==at&&!I&&(e.stencilMask(at),we=at)},setFunc:function(at,Pt,Dt){(Me!==at||Ve!==Pt||Ee!==Dt)&&(e.stencilFunc(at,Pt,Dt),Me=at,Ve=Pt,Ee=Dt)},setOp:function(at,Pt,Dt){(Ze!==at||it!==Pt||pt!==Dt)&&(e.stencilOp(at,Pt,Dt),Ze=at,it=Pt,pt=Dt)},setLocked:function(at){I=at},setClear:function(at){Ht!==at&&(e.clearStencil(at),Ht=at)},reset:function(){I=!1,we=null,Me=null,Ve=null,Ee=null,Ze=null,it=null,pt=null,Ht=null}}}var s=new i,c=new a,l=new o,u=e.getParameter(34921),h=new Uint8Array(u),f=new Uint8Array(u),d=new Uint8Array(u),m={},g=null,y=null,p=null,v=null,_=null,x=null,b=null,T=null,C=null,N=!1,O=null,J=null,F=null,B=null,V=null,Y=e.getParameter(35661),D=!1,z=0,k=e.getParameter(7938);k.indexOf("WebGL")!==-1?(z=parseFloat(/^WebGL\ ([0-9])/.exec(k)[1]),D=z>=1):k.indexOf("OpenGL ES")!==-1&&(z=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(k)[1]),D=z>=2);var q=null,Z={},ee=new et,te=new et;function oe(I,we,Me){var Ve=new Uint8Array(4),Ee=e.createTexture();e.bindTexture(I,Ee),e.texParameteri(I,10241,9728),e.texParameteri(I,10240,9728);for(var Ze=0;Ze<Me;Ze++)e.texImage2D(we+Ze,0,6408,1,1,0,6408,5121,Ve);return Ee}var Pe={};Pe[3553]=oe(3553,3553,1),Pe[34067]=oe(34067,34069,6),s.setClear(0,0,0,1),c.setClear(1),l.setClear(0),Te(2929),c.setFunc(Bs),A(!1),L(Bc),Te(2884),nt(Jn);function be(){for(var I=0,we=h.length;I<we;I++)h[I]=0}function re(I){G(I,0)}function G(I,we){if(h[I]=1,f[I]===0&&(e.enableVertexAttribArray(I),f[I]=1),d[I]!==we){var Me=r?e:t.get("ANGLE_instanced_arrays");Me[r?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](I,we),d[I]=we}}function Be(){for(var I=0,we=f.length;I!==we;++I)f[I]!==h[I]&&(e.disableVertexAttribArray(I),f[I]=0)}function xe(I,we,Me,Ve,Ee,Ze){r===!0&&(Me===5124||Me===5125)?e.vertexAttribIPointer(I,we,Me,Ve,Ee,Ze):e.vertexAttribPointer(I,we,Me,Ve,Ee,Ze)}function Te(I){m[I]!==!0&&(e.enable(I),m[I]=!0)}function ue(I){m[I]!==!1&&(e.disable(I),m[I]=!1)}function $(I){return g!==I?(e.useProgram(I),g=I,!0):!1}var Ce={[Ur]:32774,[Vf]:32778,[kf]:32779};if(r)Ce[kc]=32775,Ce[Wc]=32776;else{var Ye=t.get("EXT_blend_minmax");Ye!==null&&(Ce[kc]=Ye.MIN_EXT,Ce[Wc]=Ye.MAX_EXT)}var Qe={[Wf]:0,[Xf]:1,[jf]:768,[Xc]:770,[Kf]:776,[Jf]:774,[Yf]:772,[qf]:769,[jc]:771,[Qf]:775,[Zf]:773};function nt(I,we,Me,Ve,Ee,Ze,it,pt){if(I===Jn){y&&(ue(3042),y=!1);return}if(y||(Te(3042),y=!0),I!==Hf){if(I!==p||pt!==N){if((v!==Ur||b!==Ur)&&(e.blendEquation(32774),v=Ur,b=Ur),pt)switch(I){case Hi:e.blendFuncSeparate(1,771,1,771);break;case Gc:e.blendFunc(1,1);break;case Hc:e.blendFuncSeparate(0,0,769,771);break;case Vc:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",I);break}else switch(I){case Hi:e.blendFuncSeparate(770,771,1,771);break;case Gc:e.blendFunc(770,1);break;case Hc:e.blendFunc(0,769);break;case Vc:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",I);break}_=null,x=null,T=null,C=null,p=I,N=pt}return}Ee=Ee||we,Ze=Ze||Me,it=it||Ve,(we!==v||Ee!==b)&&(e.blendEquationSeparate(Ce[we],Ce[Ee]),v=we,b=Ee),(Me!==_||Ve!==x||Ze!==T||it!==C)&&(e.blendFuncSeparate(Qe[Me],Qe[Ve],Qe[Ze],Qe[it]),_=Me,x=Ve,T=Ze,C=it),p=I,N=null}function $e(I,we){I.side===$a?ue(2884):Te(2884);var Me=I.side===At;we&&(Me=!Me),A(Me),I.blending===Hi&&I.transparent===!1?nt(Jn):nt(I.blending,I.blendEquation,I.blendSrc,I.blendDst,I.blendEquationAlpha,I.blendSrcAlpha,I.blendDstAlpha,I.premultipliedAlpha),c.setFunc(I.depthFunc),c.setTest(I.depthTest),c.setMask(I.depthWrite),s.setMask(I.colorWrite);var Ve=I.stencilWrite;l.setTest(Ve),Ve&&(l.setMask(I.stencilWriteMask),l.setFunc(I.stencilFunc,I.stencilRef,I.stencilFuncMask),l.setOp(I.stencilFail,I.stencilZFail,I.stencilZPass)),K(I.polygonOffset,I.polygonOffsetFactor,I.polygonOffsetUnits)}function A(I){O!==I&&(I?e.frontFace(2304):e.frontFace(2305),O=I)}function L(I){I!==Uf?(Te(2884),I!==J&&(I===Bc?e.cullFace(1029):I===zf?e.cullFace(1028):e.cullFace(1032))):ue(2884),J=I}function ne(I){I!==F&&(D&&e.lineWidth(I),F=I)}function K(I,we,Me){I?(Te(32823),(B!==we||V!==Me)&&(e.polygonOffset(we,Me),B=we,V=Me)):ue(32823)}function Fe(I){I?Te(3089):ue(3089)}function ye(I){I===void 0&&(I=33984+Y-1),q!==I&&(e.activeTexture(I),q=I)}function R(I,we){q===null&&ye();var Me=Z[q];Me===void 0&&(Me={type:void 0,texture:void 0},Z[q]=Me),(Me.type!==I||Me.texture!==we)&&(e.bindTexture(I,we||Pe[I]),Me.type=I,Me.texture=we)}function he(){var I=Z[q];I!==void 0&&I.type!==void 0&&(e.bindTexture(I.type,null),I.type=void 0,I.texture=void 0)}function fe(){try{e.compressedTexImage2D.apply(e,arguments)}catch(I){console.error("THREE.WebGLState:",I)}}function me(){try{e.texImage2D.apply(e,arguments)}catch(I){console.error("THREE.WebGLState:",I)}}function ie(){try{e.texImage3D.apply(e,arguments)}catch(I){console.error("THREE.WebGLState:",I)}}function Se(I){ee.equals(I)===!1&&(e.scissor(I.x,I.y,I.z,I.w),ee.copy(I))}function pe(I){te.equals(I)===!1&&(e.viewport(I.x,I.y,I.z,I.w),te.copy(I))}function Re(){for(var I=0;I<f.length;I++)f[I]===1&&(e.disableVertexAttribArray(I),f[I]=0);m={},q=null,Z={},g=null,p=null,O=null,J=null,s.reset(),c.reset(),l.reset()}return{buffers:{color:s,depth:c,stencil:l},initAttributes:be,enableAttribute:re,enableAttributeAndDivisor:G,disableUnusedAttributes:Be,vertexAttribPointer:xe,enable:Te,disable:ue,useProgram:$,setBlending:nt,setMaterial:$e,setFlipSided:A,setCullFace:L,setLineWidth:ne,setPolygonOffset:K,setScissorTest:Fe,activeTexture:ye,bindTexture:R,unbindTexture:he,compressedTexImage2D:fe,texImage2D:me,texImage3D:ie,scissor:Se,viewport:pe,reset:Re}}function _y(e,t,n,r,i,a,o){var s=i.isWebGL2,c=i.maxTextures,l=i.maxCubemapSize,u=i.maxTextureSize,h=i.maxSamples,f=new WeakMap,d,m=!1;try{m=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(A){}function g(A,L){return m?new OffscreenCanvas(A,L):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function y(A,L,ne,K){var Fe=1;if((A.width>K||A.height>K)&&(Fe=K/Math.max(A.width,A.height)),Fe<1||L===!0)if(typeof HTMLImageElement!="undefined"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&A instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&A instanceof ImageBitmap){var ye=L?ke.floorPowerOfTwo:Math.floor,R=ye(Fe*A.width),he=ye(Fe*A.height);d===void 0&&(d=g(R,he));var fe=ne?g(R,he):d;fe.width=R,fe.height=he;var me=fe.getContext("2d");return me.drawImage(A,0,0,R,he),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+A.width+"x"+A.height+") to ("+R+"x"+he+")."),fe}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+A.width+"x"+A.height+")."),A;return A}function p(A){return ke.isPowerOfTwo(A.width)&&ke.isPowerOfTwo(A.height)}function v(A){return s?!1:A.wrapS!==Vt||A.wrapT!==Vt||A.minFilter!==_t&&A.minFilter!==It}function _(A,L){return A.generateMipmaps&&L&&A.minFilter!==_t&&A.minFilter!==It}function x(A,L,ne,K){e.generateMipmap(A);var Fe=r.get(L);Fe.__maxMipLevel=Math.log(Math.max(ne,K))*Math.LOG2E}function b(A,L,ne){if(s===!1)return L;if(A!==null){if(e[A]!==void 0)return e[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}var K=L;return L===6403&&(ne===5126&&(K=33326),ne===5131&&(K=33325),ne===5121&&(K=33321)),L===6407&&(ne===5126&&(K=34837),ne===5131&&(K=34843),ne===5121&&(K=32849)),L===6408&&(ne===5126&&(K=34836),ne===5131&&(K=34842),ne===5121&&(K=32856)),(K===33325||K===33326||K===34842||K===34836)&&t.get("EXT_color_buffer_float"),K}function T(A){return A===_t||A===ks||A===Ws?9728:9729}function C(A){var L=A.target;L.removeEventListener("dispose",C),O(L),L.isVideoTexture&&f.delete(L),o.memory.textures--}function N(A){var L=A.target;L.removeEventListener("dispose",N),J(L),o.memory.textures--}function O(A){var L=r.get(A);L.__webglInit!==void 0&&(e.deleteTexture(L.__webglTexture),r.remove(A))}function J(A){var L=r.get(A),ne=r.get(A.texture);if(A){if(ne.__webglTexture!==void 0&&e.deleteTexture(ne.__webglTexture),A.depthTexture&&A.depthTexture.dispose(),A.isWebGLCubeRenderTarget)for(var K=0;K<6;K++)e.deleteFramebuffer(L.__webglFramebuffer[K]),L.__webglDepthbuffer&&e.deleteRenderbuffer(L.__webglDepthbuffer[K]);else e.deleteFramebuffer(L.__webglFramebuffer),L.__webglDepthbuffer&&e.deleteRenderbuffer(L.__webglDepthbuffer),L.__webglMultisampledFramebuffer&&e.deleteFramebuffer(L.__webglMultisampledFramebuffer),L.__webglColorRenderbuffer&&e.deleteRenderbuffer(L.__webglColorRenderbuffer),L.__webglDepthRenderbuffer&&e.deleteRenderbuffer(L.__webglDepthRenderbuffer);r.remove(A.texture),r.remove(A)}}var F=0;function B(){F=0}function V(){var A=F;return A>=c&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+c),F+=1,A}function Y(A,L){var ne=r.get(A);if(A.isVideoTexture&&Ce(A),A.version>0&&ne.__version!==A.version){var K=A.image;if(K===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(K.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Pe(ne,A,L);return}}n.activeTexture(33984+L),n.bindTexture(3553,ne.__webglTexture)}function D(A,L){var ne=r.get(A);if(A.version>0&&ne.__version!==A.version){Pe(ne,A,L);return}n.activeTexture(33984+L),n.bindTexture(35866,ne.__webglTexture)}function z(A,L){var ne=r.get(A);if(A.version>0&&ne.__version!==A.version){Pe(ne,A,L);return}n.activeTexture(33984+L),n.bindTexture(32879,ne.__webglTexture)}function k(A,L){if(A.image.length===6){var ne=r.get(A);if(A.version>0&&ne.__version!==A.version){oe(ne,A),n.activeTexture(33984+L),n.bindTexture(34067,ne.__webglTexture),e.pixelStorei(37440,A.flipY);for(var K=A&&(A.isCompressedTexture||A.image[0].isCompressedTexture),Fe=A.image[0]&&A.image[0].isDataTexture,ye=[],R=0;R<6;R++)!K&&!Fe?ye[R]=y(A.image[R],!1,!0,l):ye[R]=Fe?A.image[R].image:A.image[R];var he=ye[0],fe=p(he)||s,me=a.convert(A.format),ie=a.convert(A.type),Se=b(A.internalFormat,me,ie);te(34067,A,fe);var pe;if(K){for(var R=0;R<6;R++){pe=ye[R].mipmaps;for(var Re=0;Re<pe.length;Re++){var I=pe[Re];A.format!==on&&A.format!==xr?me!==null?n.compressedTexImage2D(34069+R,Re,Se,I.width,I.height,0,I.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+R,Re,Se,I.width,I.height,0,me,ie,I.data)}}ne.__maxMipLevel=pe.length-1}else{pe=A.mipmaps;for(var R=0;R<6;R++)if(Fe){n.texImage2D(34069+R,0,Se,ye[R].width,ye[R].height,0,me,ie,ye[R].data);for(var Re=0;Re<pe.length;Re++){var I=pe[Re],we=I.image[R].image;n.texImage2D(34069+R,Re+1,Se,we.width,we.height,0,me,ie,we.data)}}else{n.texImage2D(34069+R,0,Se,me,ie,ye[R]);for(var Re=0;Re<pe.length;Re++){var I=pe[Re];n.texImage2D(34069+R,Re+1,Se,me,ie,I.image[R])}}ne.__maxMipLevel=pe.length}_(A,fe)&&x(34067,A,he.width,he.height),ne.__version=A.version,A.onUpdate&&A.onUpdate(A)}else n.activeTexture(33984+L),n.bindTexture(34067,ne.__webglTexture)}}function q(A,L){n.activeTexture(33984+L),n.bindTexture(34067,r.get(A).__webglTexture)}var Z={[to]:10497,[Vt]:33071,[no]:33648},ee={[_t]:9728,[ks]:9984,[Ws]:9986,[It]:9729,[Jc]:9985,[ro]:9987};function te(A,L,ne){ne?(e.texParameteri(A,10242,Z[L.wrapS]),e.texParameteri(A,10243,Z[L.wrapT]),(A===32879||A===35866)&&e.texParameteri(A,32882,Z[L.wrapR]),e.texParameteri(A,10240,ee[L.magFilter]),e.texParameteri(A,10241,ee[L.minFilter])):(e.texParameteri(A,10242,33071),e.texParameteri(A,10243,33071),(A===32879||A===35866)&&e.texParameteri(A,32882,33071),(L.wrapS!==Vt||L.wrapT!==Vt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(A,10240,T(L.magFilter)),e.texParameteri(A,10241,T(L.minFilter)),L.minFilter!==_t&&L.minFilter!==It&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var K=t.get("EXT_texture_filter_anisotropic");if(K){if(L.type===Qn&&t.get("OES_texture_float_linear")===null||L.type===oo&&(s||t.get("OES_texture_half_float_linear"))===null)return;(L.anisotropy>1||r.get(L).__currentAnisotropy)&&(e.texParameterf(A,K.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,i.getMaxAnisotropy())),r.get(L).__currentAnisotropy=L.anisotropy)}}function oe(A,L){A.__webglInit===void 0&&(A.__webglInit=!0,L.addEventListener("dispose",C),A.__webglTexture=e.createTexture(),o.memory.textures++)}function Pe(A,L,ne){var K=3553;L.isDataTexture2DArray&&(K=35866),L.isDataTexture3D&&(K=32879),oe(A,L),n.activeTexture(33984+ne),n.bindTexture(K,A.__webglTexture),e.pixelStorei(37440,L.flipY),e.pixelStorei(37441,L.premultiplyAlpha),e.pixelStorei(3317,L.unpackAlignment);var Fe=v(L)&&p(L.image)===!1,ye=y(L.image,Fe,!1,u),R=p(ye)||s,he=a.convert(L.format),fe=a.convert(L.type),me=b(L.internalFormat,he,fe);te(K,L,R);var ie,Se=L.mipmaps;if(L.isDepthTexture)me=6402,s?L.type===Qn?me=36012:L.type===ao?me=33190:L.type===Xi?me=35056:me=33189:L.type===Qn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),L.format===zr&&me===6402&&L.type!==io&&L.type!==ao&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),L.type=io,fe=a.convert(L.type)),L.format===ji&&me===6402&&(me=34041,L.type!==Xi&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),L.type=Xi,fe=a.convert(L.type))),n.texImage2D(3553,0,me,ye.width,ye.height,0,he,fe,null);else if(L.isDataTexture)if(Se.length>0&&R){for(var pe=0,Re=Se.length;pe<Re;pe++)ie=Se[pe],n.texImage2D(3553,pe,me,ie.width,ie.height,0,he,fe,ie.data);L.generateMipmaps=!1,A.__maxMipLevel=Se.length-1}else n.texImage2D(3553,0,me,ye.width,ye.height,0,he,fe,ye.data),A.__maxMipLevel=0;else if(L.isCompressedTexture){for(var pe=0,Re=Se.length;pe<Re;pe++)ie=Se[pe],L.format!==on&&L.format!==xr?he!==null?n.compressedTexImage2D(3553,pe,me,ie.width,ie.height,0,ie.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,pe,me,ie.width,ie.height,0,he,fe,ie.data);A.__maxMipLevel=Se.length-1}else if(L.isDataTexture2DArray)n.texImage3D(35866,0,me,ye.width,ye.height,ye.depth,0,he,fe,ye.data),A.__maxMipLevel=0;else if(L.isDataTexture3D)n.texImage3D(32879,0,me,ye.width,ye.height,ye.depth,0,he,fe,ye.data),A.__maxMipLevel=0;else if(Se.length>0&&R){for(var pe=0,Re=Se.length;pe<Re;pe++)ie=Se[pe],n.texImage2D(3553,pe,me,he,fe,ie);L.generateMipmaps=!1,A.__maxMipLevel=Se.length-1}else n.texImage2D(3553,0,me,he,fe,ye),A.__maxMipLevel=0;_(L,R)&&x(K,L,ye.width,ye.height),A.__version=L.version,L.onUpdate&&L.onUpdate(L)}function be(A,L,ne,K){var Fe=a.convert(L.texture.format),ye=a.convert(L.texture.type),R=b(L.texture.internalFormat,Fe,ye);n.texImage2D(K,0,R,L.width,L.height,0,Fe,ye,null),e.bindFramebuffer(36160,A),e.framebufferTexture2D(36160,ne,K,r.get(L.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function re(A,L,ne){if(e.bindRenderbuffer(36161,A),L.depthBuffer&&!L.stencilBuffer){var K=33189;if(ne){var Fe=L.depthTexture;Fe&&Fe.isDepthTexture&&(Fe.type===Qn?K=36012:Fe.type===ao&&(K=33190));var ye=$(L);e.renderbufferStorageMultisample(36161,ye,K,L.width,L.height)}else e.renderbufferStorage(36161,K,L.width,L.height);e.framebufferRenderbuffer(36160,36096,36161,A)}else if(L.depthBuffer&&L.stencilBuffer){if(ne){var ye=$(L);e.renderbufferStorageMultisample(36161,ye,35056,L.width,L.height)}else e.renderbufferStorage(36161,34041,L.width,L.height);e.framebufferRenderbuffer(36160,33306,36161,A)}else{var R=a.convert(L.texture.format),he=a.convert(L.texture.type),K=b(L.texture.internalFormat,R,he);if(ne){var ye=$(L);e.renderbufferStorageMultisample(36161,ye,K,L.width,L.height)}else e.renderbufferStorage(36161,K,L.width,L.height)}e.bindRenderbuffer(36161,null)}function G(A,L){var ne=L&&L.isWebGLCubeRenderTarget;if(ne)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,A),!(L.depthTexture&&L.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(L.depthTexture).__webglTexture||L.depthTexture.image.width!==L.width||L.depthTexture.image.height!==L.height)&&(L.depthTexture.image.width=L.width,L.depthTexture.image.height=L.height,L.depthTexture.needsUpdate=!0),Y(L.depthTexture,0);var K=r.get(L.depthTexture).__webglTexture;if(L.depthTexture.format===zr)e.framebufferTexture2D(36160,36096,3553,K,0);else if(L.depthTexture.format===ji)e.framebufferTexture2D(36160,33306,3553,K,0);else throw new Error("Unknown depthTexture format")}function Be(A){var L=r.get(A),ne=A.isWebGLCubeRenderTarget===!0;if(A.depthTexture){if(ne)throw new Error("target.depthTexture not supported in Cube render targets");G(L.__webglFramebuffer,A)}else if(ne){L.__webglDepthbuffer=[];for(var K=0;K<6;K++)e.bindFramebuffer(36160,L.__webglFramebuffer[K]),L.__webglDepthbuffer[K]=e.createRenderbuffer(),re(L.__webglDepthbuffer[K],A,!1)}else e.bindFramebuffer(36160,L.__webglFramebuffer),L.__webglDepthbuffer=e.createRenderbuffer(),re(L.__webglDepthbuffer,A,!1);e.bindFramebuffer(36160,null)}function xe(A){var L=r.get(A),ne=r.get(A.texture);A.addEventListener("dispose",N),ne.__webglTexture=e.createTexture(),o.memory.textures++;var K=A.isWebGLCubeRenderTarget===!0,Fe=A.isWebGLMultisampleRenderTarget===!0,ye=p(A)||s;if(s&&A.texture.format===xr&&(A.texture.type===Qn||A.texture.type===oo)&&(A.texture.format=on,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),K){L.__webglFramebuffer=[];for(var R=0;R<6;R++)L.__webglFramebuffer[R]=e.createFramebuffer()}else if(L.__webglFramebuffer=e.createFramebuffer(),Fe)if(s){L.__webglMultisampledFramebuffer=e.createFramebuffer(),L.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,L.__webglColorRenderbuffer);var he=a.convert(A.texture.format),fe=a.convert(A.texture.type),me=b(A.texture.internalFormat,he,fe),ie=$(A);e.renderbufferStorageMultisample(36161,ie,me,A.width,A.height),e.bindFramebuffer(36160,L.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,L.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),A.depthBuffer&&(L.__webglDepthRenderbuffer=e.createRenderbuffer(),re(L.__webglDepthRenderbuffer,A,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(K){n.bindTexture(34067,ne.__webglTexture),te(34067,A.texture,ye);for(var R=0;R<6;R++)be(L.__webglFramebuffer[R],A,36064,34069+R);_(A.texture,ye)&&x(34067,A.texture,A.width,A.height),n.bindTexture(34067,null)}else n.bindTexture(3553,ne.__webglTexture),te(3553,A.texture,ye),be(L.__webglFramebuffer,A,36064,3553),_(A.texture,ye)&&x(3553,A.texture,A.width,A.height),n.bindTexture(3553,null);A.depthBuffer&&Be(A)}function Te(A){var L=A.texture,ne=p(A)||s;if(_(L,ne)){var K=A.isWebGLCubeRenderTarget?34067:3553,Fe=r.get(L).__webglTexture;n.bindTexture(K,Fe),x(K,L,A.width,A.height),n.bindTexture(K,null)}}function ue(A){if(A.isWebGLMultisampleRenderTarget)if(s){var L=r.get(A);e.bindFramebuffer(36008,L.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,L.__webglFramebuffer);var ne=A.width,K=A.height,Fe=16384;A.depthBuffer&&(Fe|=256),A.stencilBuffer&&(Fe|=1024),e.blitFramebuffer(0,0,ne,K,0,0,ne,K,Fe,9728),e.bindFramebuffer(36160,L.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function $(A){return s&&A.isWebGLMultisampleRenderTarget?Math.min(h,A.samples):0}function Ce(A){var L=o.render.frame;f.get(A)!==L&&(f.set(A,L),A.update())}var Ye=!1,Qe=!1;function nt(A,L){A&&A.isWebGLRenderTarget&&(Ye===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Ye=!0),A=A.texture),Y(A,L)}function $e(A,L){A&&A.isWebGLCubeRenderTarget&&(Qe===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Qe=!0),A=A.texture),A&&A.isCubeTexture||Array.isArray(A.image)&&A.image.length===6?k(A,L):q(A,L)}this.allocateTextureUnit=V,this.resetTextureUnits=B,this.setTexture2D=Y,this.setTexture2DArray=D,this.setTexture3D=z,this.setTextureCube=k,this.setTextureCubeDynamic=q,this.setupRenderTarget=xe,this.updateRenderTargetMipmap=Te,this.updateMultisampleRenderTarget=ue,this.safeSetTexture2D=nt,this.safeSetTextureCube=$e}function by(e,t,n){var r=n.isWebGL2;function i(a){var o;if(a===Wi)return 5121;if(a===vd)return 32819;if(a===md)return 32820;if(a===gd)return 33635;if(a===fd)return 5120;if(a===dd)return 5122;if(a===io)return 5123;if(a===pd)return 5124;if(a===ao)return 5125;if(a===Qn)return 5126;if(a===oo)return r?5131:(o=t.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(a===yd)return 6406;if(a===xr)return 6407;if(a===on)return 6408;if(a===xd)return 6409;if(a===_d)return 6410;if(a===zr)return 6402;if(a===ji)return 34041;if(a===wd)return 6403;if(a===Md)return 36244;if(a===Ed)return 33319;if(a===Td)return 33320;if(a===Sd)return 36248;if(a===Ad)return 36249;if(a===Qc||a===Kc||a===$c||a===eu)if(o=t.get("WEBGL_compressed_texture_s3tc"),o!==null){if(a===Qc)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===Kc)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===$c)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===eu)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===tu||a===nu||a===ru||a===iu)if(o=t.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(a===tu)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===nu)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===ru)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===iu)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===Ld)return o=t.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((a===au||a===ou)&&(o=t.get("WEBGL_compressed_texture_etc"),o!==null)){if(a===au)return o.COMPRESSED_RGB8_ETC2;if(a===ou)return o.COMPRESSED_RGBA8_ETC2_EAC}if(a===Pd||a===Cd||a===Rd||a===Od||a===Dd||a===Id||a===Nd||a===Fd||a===Bd||a===Ud||a===zd||a===Gd||a===Hd||a===Vd||a===Wd||a===Xd||a===jd||a===qd||a===Yd||a===Zd||a===Jd||a===Qd||a===Kd||a===$d||a===ep||a===tp||a===np||a===rp)return o=t.get("WEBGL_compressed_texture_astc"),o!==null?a:null;if(a===kd)return o=t.get("EXT_texture_compression_bptc"),o!==null?a:null;if(a===Xi)return r?34042:(o=t.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:i}}function Tl(e){Et.call(this),this.cameras=e||[]}Tl.prototype=Object.assign(Object.create(Et.prototype),{constructor:Tl,isArrayCamera:!0});function ua(){ae.call(this),this.type="Group"}ua.prototype=Object.assign(Object.create(ae.prototype),{constructor:ua,isGroup:!0});function Co(){this._targetRay=null,this._grip=null}Object.assign(Co.prototype,{constructor:Co,getTargetRaySpace:function(){return this._targetRay===null&&(this._targetRay=new ua,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return this._grip===null&&(this._grip=new ua,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this},update:function(e,t,n){var r=null,i=null,a=this._targetRay,o=this._grip;return e&&(a!==null&&(r=t.getPose(e.targetRaySpace,n),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),o!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)))),a!==null&&(a.visible=r!==null),o!==null&&(o.visible=i!==null),this}});function Yu(e,t){var n=this,r=null,i=1,a=null,o="local-floor",s=null,c=[],l=new Map,u=new Et;u.layers.enable(1),u.viewport=new et;var h=new Et;h.layers.enable(2),h.viewport=new et;var f=[u,h],d=new Tl;d.layers.enable(1),d.layers.enable(2);var m=null,g=null;this.enabled=!1,this.isPresenting=!1,this.getController=function(F){var B=c[F];return B===void 0&&(B=new Co,c[F]=B),B.getTargetRaySpace()},this.getControllerGrip=function(F){var B=c[F];return B===void 0&&(B=new Co,c[F]=B),B.getGripSpace()};function y(F){var B=l.get(F.inputSource);B&&B.dispatchEvent({type:F.type})}function p(){l.forEach(function(F,B){F.disconnect(B)}),l.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),J.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function v(F){a=F,J.setContext(r),J.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}this.setFramebufferScaleFactor=function(F){i=F,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(F){o=F,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return r},this.setSession=function(F){if(r=F,r!==null){r.addEventListener("select",y),r.addEventListener("selectstart",y),r.addEventListener("selectend",y),r.addEventListener("squeeze",y),r.addEventListener("squeezestart",y),r.addEventListener("squeezeend",y),r.addEventListener("end",p);var B=t.getContextAttributes();B.xrCompatible!==!0&&t.makeXRCompatible();var V={antialias:B.antialias,alpha:B.alpha,depth:B.depth,stencil:B.stencil,framebufferScaleFactor:i},Y=new XRWebGLLayer(r,t,V);r.updateRenderState({baseLayer:Y}),r.requestReferenceSpace(o).then(v),r.addEventListener("inputsourceschange",_)}};function _(F){for(var B=r.inputSources,V=0;V<c.length;V++)l.set(B[V],c[V]);for(var V=0;V<F.removed.length;V++){var Y=F.removed[V],D=l.get(Y);D&&(D.dispatchEvent({type:"disconnected",data:Y}),l.delete(Y))}for(var V=0;V<F.added.length;V++){var Y=F.added[V],D=l.get(Y);D&&D.dispatchEvent({type:"connected",data:Y})}}var x=new E,b=new E;function T(F,B,V){x.setFromMatrixPosition(B.matrixWorld),b.setFromMatrixPosition(V.matrixWorld);var Y=x.distanceTo(b),D=B.projectionMatrix.elements,z=V.projectionMatrix.elements,k=D[14]/(D[10]-1),q=D[14]/(D[10]+1),Z=(D[9]+1)/D[5],ee=(D[9]-1)/D[5],te=(D[8]-1)/D[0],oe=(z[8]+1)/z[0],Pe=k*te,be=k*oe,re=Y/(-te+oe),G=re*-te;B.matrixWorld.decompose(F.position,F.quaternion,F.scale),F.translateX(G),F.translateZ(re),F.matrixWorld.compose(F.position,F.quaternion,F.scale),F.matrixWorldInverse.getInverse(F.matrixWorld);var Be=k+re,xe=q+re,Te=Pe-G,ue=be+(Y-G),$=Z*q/xe*Be,Ce=ee*q/xe*Be;F.projectionMatrix.makePerspective(Te,ue,$,Ce,Be,xe)}function C(F,B){B===null?F.matrixWorld.copy(F.matrix):F.matrixWorld.multiplyMatrices(B.matrixWorld,F.matrix),F.matrixWorldInverse.getInverse(F.matrixWorld)}this.getCamera=function(F){d.near=h.near=u.near=F.near,d.far=h.far=u.far=F.far,(m!==d.near||g!==d.far)&&(r.updateRenderState({depthNear:d.near,depthFar:d.far}),m=d.near,g=d.far);var B=F.parent,V=d.cameras;C(d,B);for(var Y=0;Y<V.length;Y++)C(V[Y],B);F.matrixWorld.copy(d.matrixWorld);for(var D=F.children,Y=0,z=D.length;Y<z;Y++)D[Y].updateMatrixWorld(!0);return V.length===2?T(d,u,h):d.projectionMatrix.copy(u.projectionMatrix),d};var N=null;function O(F,B){if(s=B.getViewerPose(a),s!==null){var V=s.views,Y=r.renderState.baseLayer;e.setFramebuffer(Y.framebuffer);var D=!1;V.length!==d.cameras.length&&(d.cameras.length=0,D=!0);for(var z=0;z<V.length;z++){var k=V[z],q=Y.getViewport(k),Z=f[z];Z.matrix.fromArray(k.transform.matrix),Z.projectionMatrix.fromArray(k.projectionMatrix),Z.viewport.set(q.x,q.y,q.width,q.height),z===0&&d.matrix.copy(Z.matrix),D===!0&&d.cameras.push(Z)}}for(var ee=r.inputSources,z=0;z<c.length;z++){var te=c[z],oe=ee[z];te.update(oe,B,a)}N&&N(F,B)}var J=new Tu;J.setAnimationLoop(O),this.setAnimationLoop=function(F){N=F},this.dispose=function(){}}Object.assign(Yu.prototype,sn.prototype);function wy(e){function t(p,v){p.fogColor.value.copy(v.color),v.isFog?(p.fogNear.value=v.near,p.fogFar.value=v.far):v.isFogExp2&&(p.fogDensity.value=v.density)}function n(p,v,_,x,b){v.isMeshBasicMaterial?r(p,v):v.isMeshLambertMaterial?(r(p,v),c(p,v)):v.isMeshToonMaterial?(r(p,v),u(p,v)):v.isMeshPhongMaterial?(r(p,v),l(p,v)):v.isMeshStandardMaterial?(r(p,v,_),v.isMeshPhysicalMaterial?f(p,v,_):h(p,v,_)):v.isMeshMatcapMaterial?(r(p,v),d(p,v)):v.isMeshDepthMaterial?(r(p,v),m(p,v)):v.isMeshDistanceMaterial?(r(p,v),g(p,v)):v.isMeshNormalMaterial?(r(p,v),y(p,v)):v.isLineBasicMaterial?(i(p,v),v.isLineDashedMaterial&&a(p,v)):v.isPointsMaterial?o(p,v,x,b):v.isSpriteMaterial?s(p,v):v.isShadowMaterial?(p.color.value.copy(v.color),p.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function r(p,v,_){p.opacity.value=v.opacity,v.color&&p.diffuse.value.copy(v.color),v.emissive&&p.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(p.map.value=v.map),v.alphaMap&&(p.alphaMap.value=v.alphaMap),v.specularMap&&(p.specularMap.value=v.specularMap);var x=v.envMap||_;x&&(p.envMap.value=x,p.flipEnvMap.value=x.isCubeTexture?-1:1,p.reflectivity.value=v.reflectivity,p.refractionRatio.value=v.refractionRatio,p.maxMipLevel.value=e.get(x).__maxMipLevel),v.lightMap&&(p.lightMap.value=v.lightMap,p.lightMapIntensity.value=v.lightMapIntensity),v.aoMap&&(p.aoMap.value=v.aoMap,p.aoMapIntensity.value=v.aoMapIntensity);var b;v.map?b=v.map:v.specularMap?b=v.specularMap:v.displacementMap?b=v.displacementMap:v.normalMap?b=v.normalMap:v.bumpMap?b=v.bumpMap:v.roughnessMap?b=v.roughnessMap:v.metalnessMap?b=v.metalnessMap:v.alphaMap?b=v.alphaMap:v.emissiveMap&&(b=v.emissiveMap),b!==void 0&&(b.isWebGLRenderTarget&&(b=b.texture),b.matrixAutoUpdate===!0&&b.updateMatrix(),p.uvTransform.value.copy(b.matrix));var T;v.aoMap?T=v.aoMap:v.lightMap&&(T=v.lightMap),T!==void 0&&(T.isWebGLRenderTarget&&(T=T.texture),T.matrixAutoUpdate===!0&&T.updateMatrix(),p.uv2Transform.value.copy(T.matrix))}function i(p,v){p.diffuse.value.copy(v.color),p.opacity.value=v.opacity}function a(p,v){p.dashSize.value=v.dashSize,p.totalSize.value=v.dashSize+v.gapSize,p.scale.value=v.scale}function o(p,v,_,x){p.diffuse.value.copy(v.color),p.opacity.value=v.opacity,p.size.value=v.size*_,p.scale.value=x*.5,v.map&&(p.map.value=v.map),v.alphaMap&&(p.alphaMap.value=v.alphaMap);var b;v.map?b=v.map:v.alphaMap&&(b=v.alphaMap),b!==void 0&&(b.matrixAutoUpdate===!0&&b.updateMatrix(),p.uvTransform.value.copy(b.matrix))}function s(p,v){p.diffuse.value.copy(v.color),p.opacity.value=v.opacity,p.rotation.value=v.rotation,v.map&&(p.map.value=v.map),v.alphaMap&&(p.alphaMap.value=v.alphaMap);var _;v.map?_=v.map:v.alphaMap&&(_=v.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),p.uvTransform.value.copy(_.matrix))}function c(p,v){v.emissiveMap&&(p.emissiveMap.value=v.emissiveMap)}function l(p,v){p.specular.value.copy(v.specular),p.shininess.value=Math.max(v.shininess,1e-4),v.emissiveMap&&(p.emissiveMap.value=v.emissiveMap),v.bumpMap&&(p.bumpMap.value=v.bumpMap,p.bumpScale.value=v.bumpScale,v.side===At&&(p.bumpScale.value*=-1)),v.normalMap&&(p.normalMap.value=v.normalMap,p.normalScale.value.copy(v.normalScale),v.side===At&&p.normalScale.value.negate()),v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias)}function u(p,v){p.specular.value.copy(v.specular),p.shininess.value=Math.max(v.shininess,1e-4),v.gradientMap&&(p.gradientMap.value=v.gradientMap),v.emissiveMap&&(p.emissiveMap.value=v.emissiveMap),v.bumpMap&&(p.bumpMap.value=v.bumpMap,p.bumpScale.value=v.bumpScale,v.side===At&&(p.bumpScale.value*=-1)),v.normalMap&&(p.normalMap.value=v.normalMap,p.normalScale.value.copy(v.normalScale),v.side===At&&p.normalScale.value.negate()),v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias)}function h(p,v,_){p.roughness.value=v.roughness,p.metalness.value=v.metalness,v.roughnessMap&&(p.roughnessMap.value=v.roughnessMap),v.metalnessMap&&(p.metalnessMap.value=v.metalnessMap),v.emissiveMap&&(p.emissiveMap.value=v.emissiveMap),v.bumpMap&&(p.bumpMap.value=v.bumpMap,p.bumpScale.value=v.bumpScale,v.side===At&&(p.bumpScale.value*=-1)),v.normalMap&&(p.normalMap.value=v.normalMap,p.normalScale.value.copy(v.normalScale),v.side===At&&p.normalScale.value.negate()),v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias),(v.envMap||_)&&(p.envMapIntensity.value=v.envMapIntensity)}function f(p,v,_){h(p,v,_),p.reflectivity.value=v.reflectivity,p.clearcoat.value=v.clearcoat,p.clearcoatRoughness.value=v.clearcoatRoughness,v.sheen&&p.sheen.value.copy(v.sheen),v.clearcoatMap&&(p.clearcoatMap.value=v.clearcoatMap),v.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap),v.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),p.clearcoatNormalMap.value=v.clearcoatNormalMap,v.side===At&&p.clearcoatNormalScale.value.negate()),p.transparency.value=v.transparency}function d(p,v){v.matcap&&(p.matcap.value=v.matcap),v.bumpMap&&(p.bumpMap.value=v.bumpMap,p.bumpScale.value=v.bumpScale,v.side===At&&(p.bumpScale.value*=-1)),v.normalMap&&(p.normalMap.value=v.normalMap,p.normalScale.value.copy(v.normalScale),v.side===At&&p.normalScale.value.negate()),v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias)}function m(p,v){v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias)}function g(p,v){v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias),p.referencePosition.value.copy(v.referencePosition),p.nearDistance.value=v.nearDistance,p.farDistance.value=v.farDistance}function y(p,v){v.bumpMap&&(p.bumpMap.value=v.bumpMap,p.bumpScale.value=v.bumpScale,v.side===At&&(p.bumpScale.value*=-1)),v.normalMap&&(p.normalMap.value=v.normalMap,p.normalScale.value.copy(v.normalScale),v.side===At&&p.normalScale.value.negate()),v.displacementMap&&(p.displacementMap.value=v.displacementMap,p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias)}return{refreshFogUniforms:t,refreshMaterialUniforms:n}}function Zu(e){e=e||{};var t=e.canvas!==void 0?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=e.context!==void 0?e.context:null,r=e.alpha!==void 0?e.alpha:!1,i=e.depth!==void 0?e.depth:!0,a=e.stencil!==void 0?e.stencil:!0,o=e.antialias!==void 0?e.antialias:!1,s=e.premultipliedAlpha!==void 0?e.premultipliedAlpha:!0,c=e.preserveDrawingBuffer!==void 0?e.preserveDrawingBuffer:!1,l=e.powerPreference!==void 0?e.powerPreference:"default",u=e.failIfMajorPerformanceCaveat!==void 0?e.failIfMajorPerformanceCaveat:!1,h=null,f=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.outputEncoding=kt,this.physicallyCorrectLights=!1,this.toneMapping=Vi,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d=this,m=!1,g=null,y=0,p=0,v=null,_=null,x=-1,b={geometry:null,program:null,wireframe:!1},T=null,C=null,N=new et,O=new et,J=null,F=t.width,B=t.height,V=1,Y=null,D=null,z=new et(0,0,F,B),k=new et(0,0,F,B),q=!1,Z=new aa,ee=new eg,te=!1,oe=!1,Pe=new We,be=new E;function re(){return v===null?V:1}var G;try{var Be={alpha:r,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",Re,!1),G=n||t.getContext("webgl",Be)||t.getContext("experimental-webgl",Be),G===null)throw t.getContext("webgl")!==null?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");G.getShaderPrecisionFormat===void 0&&(G.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(S){throw console.error("THREE.WebGLRenderer: "+S.message),S}var xe,Te,ue,$,Ce,Ye,Qe,nt,$e,A,L,ne,K,Fe,ye,R,he,fe;function me(){xe=new tg(G),Te=new $m(G,xe,e),Te.isWebGL2===!1&&(xe.get("WEBGL_depth_texture"),xe.get("OES_texture_float"),xe.get("OES_texture_half_float"),xe.get("OES_texture_half_float_linear"),xe.get("OES_standard_derivatives"),xe.get("OES_element_index_uint"),xe.get("ANGLE_instanced_arrays")),xe.get("OES_texture_float_linear"),fe=new by(G,xe,Te),ue=new xy(G,xe,Te),ue.scissor(O.copy(k).multiplyScalar(V).floor()),ue.viewport(N.copy(z).multiplyScalar(V).floor()),$=new ig,Ce=new sy,Ye=new _y(G,xe,ue,Ce,Te,fe,$),Qe=new Rp(G,Te),nt=new ng(G,Qe,$),$e=new sg(G,nt,Qe,$),ye=new og(G),A=new oy(d,xe,Te),L=new wy(Ce),ne=new uy,K=new my,Fe=new Qm(d,ue,$e,s),R=new Km(G,xe,$,Te),he=new rg(G,xe,$,Te),$.programs=A.programs,d.capabilities=Te,d.extensions=xe,d.properties=Ce,d.renderLists=ne,d.state=ue,d.info=$}me();var ie=new Yu(d,G);this.xr=ie;var Se=new qu(d,$e,Te.maxTextureSize);this.shadowMap=Se,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){var S=xe.get("WEBGL_lose_context");S&&S.loseContext()},this.forceContextRestore=function(){var S=xe.get("WEBGL_lose_context");S&&S.restoreContext()},this.getPixelRatio=function(){return V},this.setPixelRatio=function(S){S!==void 0&&(V=S,this.setSize(F,B,!1))},this.getSize=function(S){return S===void 0&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),S=new X),S.set(F,B)},this.setSize=function(S,W,H){if(ie.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}F=S,B=W,t.width=Math.floor(S*V),t.height=Math.floor(W*V),H!==!1&&(t.style.width=S+"px",t.style.height=W+"px"),this.setViewport(0,0,S,W)},this.getDrawingBufferSize=function(S){return S===void 0&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),S=new X),S.set(F*V,B*V).floor()},this.setDrawingBufferSize=function(S,W,H){F=S,B=W,V=H,t.width=Math.floor(S*H),t.height=Math.floor(W*H),this.setViewport(0,0,S,W)},this.getCurrentViewport=function(S){return S===void 0&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),S=new et),S.copy(N)},this.getViewport=function(S){return S.copy(z)},this.setViewport=function(S,W,H,j){S.isVector4?z.set(S.x,S.y,S.z,S.w):z.set(S,W,H,j),ue.viewport(N.copy(z).multiplyScalar(V).floor())},this.getScissor=function(S){return S.copy(k)},this.setScissor=function(S,W,H,j){S.isVector4?k.set(S.x,S.y,S.z,S.w):k.set(S,W,H,j),ue.scissor(O.copy(k).multiplyScalar(V).floor())},this.getScissorTest=function(){return q},this.setScissorTest=function(S){ue.setScissorTest(q=S)},this.setOpaqueSort=function(S){Y=S},this.setTransparentSort=function(S){D=S},this.getClearColor=function(){return Fe.getClearColor()},this.setClearColor=function(){Fe.setClearColor.apply(Fe,arguments)},this.getClearAlpha=function(){return Fe.getClearAlpha()},this.setClearAlpha=function(){Fe.setClearAlpha.apply(Fe,arguments)},this.clear=function(S,W,H){var j=0;(S===void 0||S)&&(j|=16384),(W===void 0||W)&&(j|=256),(H===void 0||H)&&(j|=1024),G.clear(j)},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",pe,!1),t.removeEventListener("webglcontextrestored",Re,!1),ne.dispose(),K.dispose(),Ce.dispose(),$e.dispose(),ie.dispose(),Ht.stop()};function pe(S){S.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),m=!0}function Re(){console.log("THREE.WebGLRenderer: Context Restored."),m=!1,me()}function I(S){var W=S.target;W.removeEventListener("dispose",I),we(W)}function we(S){Me(S),Ce.remove(S)}function Me(S){var W=Ce.get(S).program;S.program=void 0,W!==void 0&&A.releaseProgram(W)}function Ve(S,W){S.render(function(H){d.renderBufferImmediate(H,W)})}this.renderBufferImmediate=function(S,W){ue.initAttributes();var H=Ce.get(S);S.hasPositions&&!H.position&&(H.position=G.createBuffer()),S.hasNormals&&!H.normal&&(H.normal=G.createBuffer()),S.hasUvs&&!H.uv&&(H.uv=G.createBuffer()),S.hasColors&&!H.color&&(H.color=G.createBuffer());var j=W.getAttributes();S.hasPositions&&(G.bindBuffer(34962,H.position),G.bufferData(34962,S.positionArray,35048),ue.enableAttribute(j.position),G.vertexAttribPointer(j.position,3,5126,!1,0,0)),S.hasNormals&&(G.bindBuffer(34962,H.normal),G.bufferData(34962,S.normalArray,35048),ue.enableAttribute(j.normal),G.vertexAttribPointer(j.normal,3,5126,!1,0,0)),S.hasUvs&&(G.bindBuffer(34962,H.uv),G.bufferData(34962,S.uvArray,35048),ue.enableAttribute(j.uv),G.vertexAttribPointer(j.uv,2,5126,!1,0,0)),S.hasColors&&(G.bindBuffer(34962,H.color),G.bufferData(34962,S.colorArray,35048),ue.enableAttribute(j.color),G.vertexAttribPointer(j.color,3,5126,!1,0,0)),ue.disableUnusedAttributes(),G.drawArrays(4,0,S.count),S.count=0};var Ee=new Ji;this.renderBufferDirect=function(S,W,H,j,se,Ge){W===null&&(W=Ee);var Ie=se.isMesh&&se.matrixWorld.determinant()<0,Ae=Ii(S,W,j,se);ue.setMaterial(j,Ie);var Ue=!1;(b.geometry!==H.id||b.program!==Ae.id||b.wireframe!==(j.wireframe===!0))&&(b.geometry=H.id,b.program=Ae.id,b.wireframe=j.wireframe===!0,Ue=!0),(j.morphTargets||j.morphNormals)&&(ye.update(se,H,j,Ae),Ue=!0),se.isInstancedMesh===!0&&(Ue=!0);var He=H.index,ct=H.attributes.position;if(He===null){if(ct===void 0||ct.count===0)return}else if(He.count===0)return;var Ke=1;j.wireframe===!0&&(He=nt.getWireframeAttribute(H),Ke=2);var Je,ze=R;He!==null&&(Je=Qe.get(He),ze=he,ze.setIndex(Je)),Ue&&(Ze(se,H,j,Ae),He!==null&&G.bindBuffer(34963,Je.buffer));var qe=He!==null?He.count:ct.count,yt=H.drawRange.start*Ke,Tt=H.drawRange.count*Ke,xt=Ge!==null?Ge.start*Ke:0,vn=Ge!==null?Ge.count*Ke:1/0,st=Math.max(yt,xt),Xn=Math.min(qe,yt+Tt,xt+vn)-1,mr=Math.max(0,Xn-st+1);if(mr!==0){if(se.isMesh)j.wireframe===!0?(ue.setLineWidth(j.wireframeLinewidth*re()),ze.setMode(1)):ze.setMode(4);else if(se.isLine){var ja=j.linewidth;ja===void 0&&(ja=1),ue.setLineWidth(ja*re()),se.isLineSegments?ze.setMode(1):se.isLineLoop?ze.setMode(2):ze.setMode(3)}else se.isPoints?ze.setMode(0):se.isSprite&&ze.setMode(4);if(se.isInstancedMesh)ze.renderInstances(H,st,mr,se.count);else if(H.isInstancedBufferGeometry){var Fi=Math.min(H.instanceCount,H._maxInstanceCount);ze.renderInstances(H,st,mr,Fi)}else ze.render(st,mr)}};function Ze(S,W,H,j){if(!(Te.isWebGL2===!1&&(S.isInstancedMesh||W.isInstancedBufferGeometry)&&xe.get("ANGLE_instanced_arrays")===null)){ue.initAttributes();var se=W.attributes,Ge=j.getAttributes(),Ie=H.defaultAttributeValues;for(var Ae in Ge){var Ue=Ge[Ae];if(Ue>=0){var He=se[Ae];if(He!==void 0){var ct=He.normalized,Ke=He.itemSize,Je=Qe.get(He);if(Je===void 0)continue;var ze=Je.buffer,qe=Je.type,yt=Je.bytesPerElement;if(He.isInterleavedBufferAttribute){var Tt=He.data,xt=Tt.stride,vn=He.offset;Tt&&Tt.isInstancedInterleavedBuffer?(ue.enableAttributeAndDivisor(Ue,Tt.meshPerAttribute),W._maxInstanceCount===void 0&&(W._maxInstanceCount=Tt.meshPerAttribute*Tt.count)):ue.enableAttribute(Ue),G.bindBuffer(34962,ze),ue.vertexAttribPointer(Ue,Ke,qe,ct,xt*yt,vn*yt)}else He.isInstancedBufferAttribute?(ue.enableAttributeAndDivisor(Ue,He.meshPerAttribute),W._maxInstanceCount===void 0&&(W._maxInstanceCount=He.meshPerAttribute*He.count)):ue.enableAttribute(Ue),G.bindBuffer(34962,ze),ue.vertexAttribPointer(Ue,Ke,qe,ct,0,0)}else if(Ae==="instanceMatrix"){var Je=Qe.get(S.instanceMatrix);if(Je===void 0)continue;var ze=Je.buffer,qe=Je.type;ue.enableAttributeAndDivisor(Ue+0,1),ue.enableAttributeAndDivisor(Ue+1,1),ue.enableAttributeAndDivisor(Ue+2,1),ue.enableAttributeAndDivisor(Ue+3,1),G.bindBuffer(34962,ze),G.vertexAttribPointer(Ue+0,4,qe,!1,64,0),G.vertexAttribPointer(Ue+1,4,qe,!1,64,16),G.vertexAttribPointer(Ue+2,4,qe,!1,64,32),G.vertexAttribPointer(Ue+3,4,qe,!1,64,48)}else if(Ie!==void 0){var st=Ie[Ae];if(st!==void 0)switch(st.length){case 2:G.vertexAttrib2fv(Ue,st);break;case 3:G.vertexAttrib3fv(Ue,st);break;case 4:G.vertexAttrib4fv(Ue,st);break;default:G.vertexAttrib1fv(Ue,st)}}}}ue.disableUnusedAttributes()}}this.compile=function(S,W){f=K.get(S,W),f.init(),S.traverse(function(j){j.isLight&&(f.pushLight(j),j.castShadow&&f.pushShadow(j))}),f.setupLights(W);const H={};S.traverse(function(j){let se=j.material;if(se)if(Array.isArray(se))for(let Ge=0;Ge<se.length;Ge++){let Ie=se[Ge];Ie.uuid in H||(Kt(Ie,S,j),H[Ie.uuid]=!0)}else se.uuid in H||(Kt(se,S,j),H[se.uuid]=!0)})};var it=null;function pt(S){ie.isPresenting||it&&it(S)}var Ht=new Tu;Ht.setAnimationLoop(pt),typeof window!="undefined"&&Ht.setContext(window),this.setAnimationLoop=function(S){it=S,ie.setAnimationLoop(S),Ht.start()},this.render=function(S,W){var H,j;if(arguments[2]!==void 0&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),H=arguments[2]),arguments[3]!==void 0&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),j=arguments[3]),!(W&&W.isCamera)){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(!m){b.geometry=null,b.program=null,b.wireframe=!1,x=-1,T=null,S.autoUpdate===!0&&S.updateMatrixWorld(),W.parent===null&&W.updateMatrixWorld(),ie.enabled&&ie.isPresenting&&(W=ie.getCamera(W)),S.onBeforeRender(d,S,W,H||v),f=K.get(S,W),f.init(),Pe.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Z.setFromProjectionMatrix(Pe),oe=this.localClippingEnabled,te=ee.init(this.clippingPlanes,oe,W),h=ne.get(S,W),h.init(),at(S,W,0,d.sortObjects),h.finish(),d.sortObjects===!0&&h.sort(Y,D),te&&ee.beginShadows();var se=f.state.shadowsArray;Se.render(se,S,W),f.setupLights(W),te&&ee.endShadows(),this.info.autoReset&&this.info.reset(),H!==void 0&&this.setRenderTarget(H),Fe.render(h,S,W,j);var Ge=h.opaque,Ie=h.transparent;if(S.overrideMaterial){var Ae=S.overrideMaterial;Ge.length&&Pt(Ge,S,W,Ae),Ie.length&&Pt(Ie,S,W,Ae)}else Ge.length&&Pt(Ge,S,W),Ie.length&&Pt(Ie,S,W);S.onAfterRender(d,S,W),v!==null&&(Ye.updateRenderTargetMipmap(v),Ye.updateMultisampleRenderTarget(v)),ue.buffers.depth.setTest(!0),ue.buffers.depth.setMask(!0),ue.buffers.color.setMask(!0),ue.setPolygonOffset(!1),h=null,f=null}};function at(S,W,H,j){if(S.visible!==!1){var se=S.layers.test(W.layers);if(se){if(S.isGroup)H=S.renderOrder;else if(S.isLOD)S.autoUpdate===!0&&S.update(W);else if(S.isLight)f.pushLight(S),S.castShadow&&f.pushShadow(S);else if(S.isSprite){if(!S.frustumCulled||Z.intersectsSprite(S)){j&&be.setFromMatrixPosition(S.matrixWorld).applyMatrix4(Pe);var Ge=$e.update(S),Ie=S.material;Ie.visible&&h.push(S,Ge,Ie,H,be.z,null)}}else if(S.isImmediateRenderObject)j&&be.setFromMatrixPosition(S.matrixWorld).applyMatrix4(Pe),h.push(S,null,S.material,H,be.z,null);else if((S.isMesh||S.isLine||S.isPoints)&&(S.isSkinnedMesh&&S.skeleton.frame!==$.render.frame&&(S.skeleton.update(),S.skeleton.frame=$.render.frame),!S.frustumCulled||Z.intersectsObject(S))){j&&be.setFromMatrixPosition(S.matrixWorld).applyMatrix4(Pe);var Ge=$e.update(S),Ie=S.material;if(Array.isArray(Ie))for(var Ae=Ge.groups,Ue=0,He=Ae.length;Ue<He;Ue++){var ct=Ae[Ue],Ke=Ie[ct.materialIndex];Ke&&Ke.visible&&h.push(S,Ge,Ke,H,be.z,ct)}else Ie.visible&&h.push(S,Ge,Ie,H,be.z,null)}}for(var Je=S.children,Ue=0,He=Je.length;Ue<He;Ue++)at(Je[Ue],W,H,j)}}function Pt(S,W,H,j){for(var se=0,Ge=S.length;se<Ge;se++){var Ie=S[se],Ae=Ie.object,Ue=Ie.geometry,He=j===void 0?Ie.material:j,ct=Ie.group;if(H.isArrayCamera){C=H;for(var Ke=H.cameras,Je=0,ze=Ke.length;Je<ze;Je++){var qe=Ke[Je];Ae.layers.test(qe.layers)&&(ue.viewport(N.copy(qe.viewport)),f.setupLights(qe),Dt(Ae,W,qe,Ue,He,ct))}}else C=null,Dt(Ae,W,H,Ue,He,ct)}}function Dt(S,W,H,j,se,Ge){if(S.onBeforeRender(d,W,H,j,se,Ge),f=K.get(W,C||H),S.modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,S.matrixWorld),S.normalMatrix.getNormalMatrix(S.modelViewMatrix),S.isImmediateRenderObject){var Ie=Ii(H,W,se,S);ue.setMaterial(se),b.geometry=null,b.program=null,b.wireframe=!1,Ve(S,Ie)}else d.renderBufferDirect(H,W,j,se,S,Ge);S.onAfterRender(d,W,H,j,se,Ge),f=K.get(W,C||H)}function Kt(S,W,H){var j=Ce.get(S),se=f.state.lights,Ge=f.state.shadowsArray,Ie=se.state.version,Ae=A.getParameters(S,se.state,Ge,W,ee.numPlanes,ee.numIntersection,H),Ue=A.getProgramCacheKey(Ae),He=j.program,ct=!0;if(He===void 0)S.addEventListener("dispose",I);else if(He.cacheKey!==Ue)Me(S);else if(j.lightsStateVersion!==Ie)j.lightsStateVersion=Ie,ct=!1;else{if(Ae.shaderID!==void 0)return;ct=!1}ct&&(He=A.acquireProgram(Ae,Ue),j.program=He,j.uniforms=Ae.uniforms,j.outputEncoding=Ae.outputEncoding,S.program=He);var Ke=He.getAttributes();if(S.morphTargets){S.numSupportedMorphTargets=0;for(var Je=0;Je<d.maxMorphTargets;Je++)Ke["morphTarget"+Je]>=0&&S.numSupportedMorphTargets++}if(S.morphNormals){S.numSupportedMorphNormals=0;for(var Je=0;Je<d.maxMorphNormals;Je++)Ke["morphNormal"+Je]>=0&&S.numSupportedMorphNormals++}var ze=j.uniforms;(!S.isShaderMaterial&&!S.isRawShaderMaterial||S.clipping===!0)&&(j.numClippingPlanes=ee.numPlanes,j.numIntersection=ee.numIntersection,ze.clippingPlanes=ee.uniform),j.environment=S.isMeshStandardMaterial?W.environment:null,j.fog=W.fog,j.needsLights=Br(S),j.lightsStateVersion=Ie,j.needsLights&&(ze.ambientLightColor.value=se.state.ambient,ze.lightProbe.value=se.state.probe,ze.directionalLights.value=se.state.directional,ze.directionalLightShadows.value=se.state.directionalShadow,ze.spotLights.value=se.state.spot,ze.spotLightShadows.value=se.state.spotShadow,ze.rectAreaLights.value=se.state.rectArea,ze.pointLights.value=se.state.point,ze.pointLightShadows.value=se.state.pointShadow,ze.hemisphereLights.value=se.state.hemi,ze.directionalShadowMap.value=se.state.directionalShadowMap,ze.directionalShadowMatrix.value=se.state.directionalShadowMatrix,ze.spotShadowMap.value=se.state.spotShadowMap,ze.spotShadowMatrix.value=se.state.spotShadowMatrix,ze.pointShadowMap.value=se.state.pointShadowMap,ze.pointShadowMatrix.value=se.state.pointShadowMatrix);var qe=j.program.getUniforms(),yt=or.seqWithValue(qe.seq,ze);j.uniformsList=yt}function Ii(S,W,H,j){Ye.resetTextureUnits();var se=W.fog,Ge=H.isMeshStandardMaterial?W.environment:null,Ie=v===null?d.outputEncoding:v.texture.encoding,Ae=Ce.get(H),Ue=f.state.lights;if(te&&(oe||S!==T)){var He=S===T&&H.id===x;ee.setState(H.clippingPlanes,H.clipIntersection,H.clipShadows,S,Ae,He)}H.version===Ae.__version?(Ae.program===void 0||H.fog&&Ae.fog!==se||Ae.environment!==Ge||Ae.needsLights&&Ae.lightsStateVersion!==Ue.state.version||Ae.numClippingPlanes!==void 0&&(Ae.numClippingPlanes!==ee.numPlanes||Ae.numIntersection!==ee.numIntersection)||Ae.outputEncoding!==Ie)&&Kt(H,W,j):(Kt(H,W,j),Ae.__version=H.version);var ct=!1,Ke=!1,Je=!1,ze=Ae.program,qe=ze.getUniforms(),yt=Ae.uniforms;if(ue.useProgram(ze.program)&&(ct=!0,Ke=!0,Je=!0),H.id!==x&&(x=H.id,Ke=!0),ct||T!==S){if(qe.setValue(G,"projectionMatrix",S.projectionMatrix),Te.logarithmicDepthBuffer&&qe.setValue(G,"logDepthBufFC",2/(Math.log(S.far+1)/Math.LN2)),T!==S&&(T=S,Ke=!0,Je=!0),H.isShaderMaterial||H.isMeshPhongMaterial||H.isMeshToonMaterial||H.isMeshStandardMaterial||H.envMap){var Tt=qe.map.cameraPosition;Tt!==void 0&&Tt.setValue(G,be.setFromMatrixPosition(S.matrixWorld))}(H.isMeshPhongMaterial||H.isMeshToonMaterial||H.isMeshLambertMaterial||H.isMeshBasicMaterial||H.isMeshStandardMaterial||H.isShaderMaterial)&&qe.setValue(G,"isOrthographic",S.isOrthographicCamera===!0),(H.isMeshPhongMaterial||H.isMeshToonMaterial||H.isMeshLambertMaterial||H.isMeshBasicMaterial||H.isMeshStandardMaterial||H.isShaderMaterial||H.skinning)&&qe.setValue(G,"viewMatrix",S.matrixWorldInverse)}if(H.skinning){qe.setOptional(G,j,"bindMatrix"),qe.setOptional(G,j,"bindMatrixInverse");var xt=j.skeleton;if(xt){var vn=xt.bones;if(Te.floatVertexTextures){if(xt.boneTexture===void 0){var st=Math.sqrt(vn.length*4);st=ke.ceilPowerOfTwo(st),st=Math.max(st,4);var Xn=new Float32Array(st*st*4);Xn.set(xt.boneMatrices);var mr=new oi(Xn,st,st,on,Qn);xt.boneMatrices=Xn,xt.boneTexture=mr,xt.boneTextureSize=st}qe.setValue(G,"boneTexture",xt.boneTexture,Ye),qe.setValue(G,"boneTextureSize",xt.boneTextureSize)}else qe.setOptional(G,xt,"boneMatrices")}}return(Ke||Ae.receiveShadow!==j.receiveShadow)&&(Ae.receiveShadow=j.receiveShadow,qe.setValue(G,"receiveShadow",j.receiveShadow)),Ke&&(qe.setValue(G,"toneMappingExposure",d.toneMappingExposure),qe.setValue(G,"toneMappingWhitePoint",d.toneMappingWhitePoint),Ae.needsLights&&Ni(yt,Je),se&&H.fog&&L.refreshFogUniforms(yt,se),L.refreshMaterialUniforms(yt,H,Ge,V,B),yt.ltc_1!==void 0&&(yt.ltc_1.value=le.LTC_1),yt.ltc_2!==void 0&&(yt.ltc_2.value=le.LTC_2),or.upload(G,Ae.uniformsList,yt,Ye)),H.isShaderMaterial&&H.uniformsNeedUpdate===!0&&(or.upload(G,Ae.uniformsList,yt,Ye),H.uniformsNeedUpdate=!1),H.isSpriteMaterial&&qe.setValue(G,"center",j.center),qe.setValue(G,"modelViewMatrix",j.modelViewMatrix),qe.setValue(G,"normalMatrix",j.normalMatrix),qe.setValue(G,"modelMatrix",j.matrixWorld),ze}function Ni(S,W){S.ambientLightColor.needsUpdate=W,S.lightProbe.needsUpdate=W,S.directionalLights.needsUpdate=W,S.directionalLightShadows.needsUpdate=W,S.pointLights.needsUpdate=W,S.pointLightShadows.needsUpdate=W,S.spotLights.needsUpdate=W,S.spotLightShadows.needsUpdate=W,S.rectAreaLights.needsUpdate=W,S.hemisphereLights.needsUpdate=W}function Br(S){return S.isMeshLambertMaterial||S.isMeshToonMaterial||S.isMeshPhongMaterial||S.isMeshStandardMaterial||S.isShadowMaterial||S.isShaderMaterial&&S.lights===!0}this.setFramebuffer=function(S){g!==S&&v===null&&G.bindFramebuffer(36160,S),g=S},this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return p},this.getRenderTarget=function(){return v},this.setRenderTarget=function(S,W,H){v=S,y=W,p=H,S&&Ce.get(S).__webglFramebuffer===void 0&&Ye.setupRenderTarget(S);var j=g,se=!1;if(S){var Ge=Ce.get(S).__webglFramebuffer;S.isWebGLCubeRenderTarget?(j=Ge[W||0],se=!0):S.isWebGLMultisampleRenderTarget?j=Ce.get(S).__webglMultisampledFramebuffer:j=Ge,N.copy(S.viewport),O.copy(S.scissor),J=S.scissorTest}else N.copy(z).multiplyScalar(V).floor(),O.copy(k).multiplyScalar(V).floor(),J=q;if(_!==j&&(G.bindFramebuffer(36160,j),_=j),ue.viewport(N),ue.scissor(O),ue.setScissorTest(J),se){var Ie=Ce.get(S.texture);G.framebufferTexture2D(36160,36064,34069+(W||0),Ie.__webglTexture,H||0)}},this.readRenderTargetPixels=function(S,W,H,j,se,Ge,Ie){if(!(S&&S.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}var Ae=Ce.get(S).__webglFramebuffer;if(S.isWebGLCubeRenderTarget&&Ie!==void 0&&(Ae=Ae[Ie]),Ae){var Ue=!1;Ae!==_&&(G.bindFramebuffer(36160,Ae),Ue=!0);try{var He=S.texture,ct=He.format,Ke=He.type;if(ct!==on&&fe.convert(ct)!==G.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(Ke!==Wi&&fe.convert(Ke)!==G.getParameter(35738)&&!(Ke===Qn&&(Te.isWebGL2||xe.get("OES_texture_float")||xe.get("WEBGL_color_buffer_float")))&&!(Ke===oo&&(Te.isWebGL2?xe.get("EXT_color_buffer_float"):xe.get("EXT_color_buffer_half_float")))){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}G.checkFramebufferStatus(36160)===36053?W>=0&&W<=S.width-j&&H>=0&&H<=S.height-se&&G.readPixels(W,H,j,se,fe.convert(ct),fe.convert(Ke),Ge):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{Ue&&G.bindFramebuffer(36160,_)}}},this.copyFramebufferToTexture=function(S,W,H){H===void 0&&(H=0);var j=Math.pow(2,-H),se=Math.floor(W.image.width*j),Ge=Math.floor(W.image.height*j),Ie=fe.convert(W.format);Ye.setTexture2D(W,0),G.copyTexImage2D(3553,H,Ie,S.x,S.y,se,Ge,0),ue.unbindTexture()},this.copyTextureToTexture=function(S,W,H,j){j===void 0&&(j=0);var se=W.image.width,Ge=W.image.height,Ie=fe.convert(H.format),Ae=fe.convert(H.type);Ye.setTexture2D(H,0),W.isDataTexture?G.texSubImage2D(3553,j,S.x,S.y,se,Ge,Ie,Ae,W.image.data):W.isCompressedTexture?G.compressedTexSubImage2D(3553,j,S.x,S.y,W.mipmaps[0].width,W.mipmaps[0].height,Ie,W.mipmaps[0].data):G.texSubImage2D(3553,j,S.x,S.y,Ie,Ae,W.image),j===0&&H.generateMipmaps&&G.generateMipmap(3553),ue.unbindTexture()},this.initTexture=function(S){Ye.setTexture2D(S,0),ue.unbindTexture()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Sl(e,t){this.name="",this.color=new de(e),this.density=t!==void 0?t:25e-5}Object.assign(Sl.prototype,{isFogExp2:!0,clone:function(){return new Sl(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}});function Al(e,t,n){this.name="",this.color=new de(e),this.near=t!==void 0?t:1,this.far=n!==void 0?n:1e3}Object.assign(Al.prototype,{isFog:!0,clone:function(){return new Al(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}});function sr(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ho,this.updateRange={offset:0,count:-1},this.version=0}Object.defineProperty(sr.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),Object.assign(sr.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 r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this},set:function(e,t){return t===void 0&&(t=0),this.array.set(e,t),this},clone:function(){return new this.constructor().copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}});var Sr=new E;function Ro(e,t,n,r){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r===!0}Object.defineProperties(Ro.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Ro.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)Sr.x=this.getX(t),Sr.y=this.getY(t),Sr.z=this.getZ(t),Sr.applyMatrix4(e),this.setXYZ(t,Sr.x,Sr.y,Sr.z);return this},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,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,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]=r,this.data.array[e+3]=i,this},clone:function(){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");for(var e=[],t=0;t<this.count;t++)for(var n=t*this.data.stride+this.offset,r=0;r<this.itemSize;r++)e.push(this.data.array[n+r]);return new De(new this.array.constructor(e),this.itemSize,this.normalized)},toJSON:function(){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");for(var e=[],t=0;t<this.count;t++)for(var n=t*this.data.stride+this.offset,r=0;r<this.itemSize;r++)e.push(this.data.array[n+r]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}});function Ar(e){Oe.call(this),this.type="SpriteMaterial",this.color=new de(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}Ar.prototype=Object.create(Oe.prototype),Ar.prototype.constructor=Ar,Ar.prototype.isSpriteMaterial=!0,Ar.prototype.copy=function(e){return Oe.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 ui,ha=new E,hi=new E,fi=new E,di=new X,fa=new X,Ju=new We,Oo=new E,da=new E,Do=new E,Qu=new X,Ll=new X,Ku=new X;function Pl(e){if(ae.call(this),this.type="Sprite",ui===void 0){ui=new ve;var t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new sr(t,5);ui.setIndex([0,1,2,0,2,3]),ui.setAttribute("position",new Ro(n,3,0,!1)),ui.setAttribute("uv",new Ro(n,2,3,!1))}this.geometry=ui,this.material=e!==void 0?e:new Ar,this.center=new X(.5,.5)}Pl.prototype=Object.assign(Object.create(ae.prototype),{constructor:Pl,isSprite:!0,raycast:function(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),hi.setFromMatrixScale(this.matrixWorld),Ju.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),fi.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&hi.multiplyScalar(-fi.z);var n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));var a=this.center;Io(Oo.set(-.5,-.5,0),fi,a,hi,r,i),Io(da.set(.5,-.5,0),fi,a,hi,r,i),Io(Do.set(.5,.5,0),fi,a,hi,r,i),Qu.set(0,0),Ll.set(1,0),Ku.set(1,1);var o=e.ray.intersectTriangle(Oo,da,Do,!1,ha);if(!(o===null&&(Io(da.set(-.5,.5,0),fi,a,hi,r,i),Ll.set(0,1),o=e.ray.intersectTriangle(Oo,Do,da,!1,ha),o===null))){var s=e.ray.origin.distanceTo(ha);s<e.near||s>e.far||t.push({distance:s,point:ha.clone(),uv:Ot.getUV(ha,Oo,da,Do,Qu,Ll,Ku,new X),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return ae.prototype.copy.call(this,e),e.center!==void 0&&this.center.copy(e.center),this}});function Io(e,t,n,r,i,a){di.subVectors(e,n).addScalar(.5).multiply(r),i!==void 0?(fa.x=a*di.x-i*di.y,fa.y=i*di.x+a*di.y):fa.copy(di),e.copy(t),e.x+=fa.x,e.y+=fa.y,e.applyMatrix4(Ju)}var No=new E,$u=new E;function Fo(){ae.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}Fo.prototype=Object.assign(Object.create(ae.prototype),{constructor:Fo,isLOD:!0,copy:function(e){ae.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){t===void 0&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,object:e}),this.add(e),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(e){var t=this.levels;if(t.length>0){for(var n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){var n=this.levels;if(n.length>0){No.setFromMatrixPosition(this.matrixWorld);var r=e.ray.origin.distanceTo(No);this.getObjectForDistance(r).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){No.setFromMatrixPosition(e.matrixWorld),$u.setFromMatrixPosition(this.matrixWorld);var n=No.distanceTo($u)/e.zoom;t[0].object.visible=!0;for(var r=1,i=t.length;r<i&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}},toJSON:function(e){var t=ae.prototype.toJSON.call(this,e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}});function Cl(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),ut.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new We,this.bindMatrixInverse=new We}Cl.prototype=Object.assign(Object.create(ut.prototype),{constructor:Cl,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,t===void 0&&(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 et,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var i=1/e.manhattanLength();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){ut.prototype.updateMatrixWorld.call(this,e),this.bindMode==="attached"?this.bindMatrixInverse.getInverse(this.matrixWorld):this.bindMode==="detached"?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)},boneTransform:function(){var e=new E,t=new et,n=new et,r=new E,i=new We;return function(a,o){var s=this.skeleton,c=this.geometry;t.fromBufferAttribute(c.attributes.skinIndex,a),n.fromBufferAttribute(c.attributes.skinWeight,a),e.fromBufferAttribute(c.attributes.position,a).applyMatrix4(this.bindMatrix),o.set(0,0,0);for(var l=0;l<4;l++){var u=n.getComponent(l);if(u!==0){var h=t.getComponent(l);i.multiplyMatrices(s.bones[h].matrixWorld,s.boneInverses[h]),o.addScaledVector(r.copy(e).applyMatrix4(i),u)}}return o.applyMatrix4(this.bindMatrixInverse)}}()});var eh=new We,My=new We;function Rl(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(this.bones.length*16),this.frame=-1,t===void 0)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,r=this.bones.length;n<r;n++)this.boneInverses.push(new We)}}Object.assign(Rl.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new We;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&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)e=this.bones[t],e&&(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,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:My;eh.multiplyMatrices(o,t[i]),eh.toArray(n,i*16)}r!==void 0&&(r.needsUpdate=!0)},clone:function(){return new Rl(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}});function th(){ae.call(this),this.type="Bone"}th.prototype=Object.assign(Object.create(ae.prototype),{constructor:th,isBone:!0});var nh=new We,rh=new We,Bo=[],pa=new ut;function Ol(e,t,n){ut.call(this,e,t),this.instanceMatrix=new De(new Float32Array(n*16),16),this.count=n,this.frustumCulled=!1}Ol.prototype=Object.assign(Object.create(ut.prototype),{constructor:Ol,isInstancedMesh:!0,getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,e*16)},raycast:function(e,t){var n=this.matrixWorld,r=this.count;if(pa.geometry=this.geometry,pa.material=this.material,pa.material!==void 0)for(var i=0;i<r;i++){this.getMatrixAt(i,nh),rh.multiplyMatrices(n,nh),pa.matrixWorld=rh,pa.raycast(e,Bo);for(var a=0,o=Bo.length;a<o;a++){var s=Bo[a];s.instanceId=i,s.object=this,t.push(s)}Bo.length=0}},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,e*16)},updateMorphTargets:function(){}});function mt(e){Oe.call(this),this.type="LineBasicMaterial",this.color=new de(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}mt.prototype=Object.create(Oe.prototype),mt.prototype.constructor=mt,mt.prototype.isLineBasicMaterial=!0,mt.prototype.copy=function(e){return Oe.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this};var ih=new E,ah=new E,oh=new We,Uo=new Jr,zo=new Dn;function tn(e,t,n){n===1&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),ae.call(this),this.type="Line",this.geometry=e!==void 0?e:new ve,this.material=t!==void 0?t:new mt,this.updateMorphTargets()}tn.prototype=Object.assign(Object.create(ae.prototype),{constructor:tn,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(e.index===null){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)ih.fromBufferAttribute(t,r-1),ah.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=ih.distanceTo(ah);e.setAttribute("lineDistance",new ce(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices,n=e.lineDistances;n[0]=0;for(var r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold;if(n.boundingSphere===null&&n.computeBoundingSphere(),zo.copy(n.boundingSphere),zo.applyMatrix4(r),zo.radius+=i,e.ray.intersectsSphere(zo)!==!1){oh.getInverse(r),Uo.copy(e.ray).applyMatrix4(oh);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new E,c=new E,l=new E,u=new E,h=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var f=n.index,d=n.attributes,m=d.position.array;if(f!==null)for(var g=f.array,y=0,p=g.length-1;y<p;y+=h){var v=g[y],_=g[y+1];s.fromArray(m,v*3),c.fromArray(m,_*3);var x=Uo.distanceSqToSegment(s,c,u,l);if(!(x>o)){u.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(u);b<e.near||b>e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else for(var y=0,p=m.length/3-1;y<p;y+=h){s.fromArray(m,3*y),c.fromArray(m,3*y+3);var x=Uo.distanceSqToSegment(s,c,u,l);if(!(x>o)){u.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(u);b<e.near||b>e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}else if(n.isGeometry)for(var T=n.vertices,C=T.length,y=0;y<C-1;y+=h){var x=Uo.distanceSqToSegment(T[y],T[y+1],u,l);if(!(x>o)){u.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(u);b<e.near||b>e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}},updateMorphTargets:function(){var e=this.geometry,t,n,r;if(e.isBufferGeometry){var i=e.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(o!==void 0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=o.length;t<n;t++)r=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}}else{var s=e.morphTargets;s!==void 0&&s.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Go=new E,Ho=new E;function Mt(e,t){tn.call(this,e,t),this.type="LineSegments"}Mt.prototype=Object.assign(Object.create(tn.prototype),{constructor:Mt,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(e.index===null){for(var t=e.attributes.position,n=[],r=0,i=t.count;r<i;r+=2)Go.fromBufferAttribute(t,r),Ho.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Go.distanceTo(Ho);e.setAttribute("lineDistance",new ce(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry)for(var a=e.vertices,n=e.lineDistances,r=0,i=a.length;r<i;r+=2)Go.copy(a[r]),Ho.copy(a[r+1]),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Go.distanceTo(Ho);return this}});function Dl(e,t){tn.call(this,e,t),this.type="LineLoop"}Dl.prototype=Object.assign(Object.create(tn.prototype),{constructor:Dl,isLineLoop:!0});function Lr(e){Oe.call(this),this.type="PointsMaterial",this.color=new de(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}Lr.prototype=Object.create(Oe.prototype),Lr.prototype.constructor=Lr,Lr.prototype.isPointsMaterial=!0,Lr.prototype.copy=function(e){return Oe.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 sh=new We,Il=new Jr,Vo=new Dn,ko=new E;function Nl(e,t){ae.call(this),this.type="Points",this.geometry=e!==void 0?e:new ve,this.material=t!==void 0?t:new Lr,this.updateMorphTargets()}Nl.prototype=Object.assign(Object.create(ae.prototype),{constructor:Nl,isPoints:!0,raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(n.boundingSphere===null&&n.computeBoundingSphere(),Vo.copy(n.boundingSphere),Vo.applyMatrix4(r),Vo.radius+=i,e.ray.intersectsSphere(Vo)!==!1){sh.getInverse(r),Il.copy(e.ray).applyMatrix4(sh);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,c=n.attributes,l=c.position.array;if(s!==null)for(var u=s.array,h=0,f=u.length;h<f;h++){var d=u[h];ko.fromArray(l,d*3),Fl(ko,d,o,r,e,t,this)}else for(var h=0,m=l.length/3;h<m;h++)ko.fromArray(l,h*3),Fl(ko,h,o,r,e,t,this)}else for(var g=n.vertices,h=0,m=g.length;h<m;h++)Fl(g[h],h,o,r,e,t,this)}},updateMorphTargets:function(){var e=this.geometry,t,n,r;if(e.isBufferGeometry){var i=e.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(o!==void 0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=o.length;t<n;t++)r=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}}else{var s=e.morphTargets;s!==void 0&&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)}});function Fl(e,t,n,r,i,a,o){var s=Il.distanceSqToPoint(e);if(s<n){var c=new E;Il.closestPointToPoint(e,c),c.applyMatrix4(r);var l=i.ray.origin.distanceTo(c);if(l<i.near||l>i.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:c,index:t,face:null,object:o})}}function lh(e,t,n,r,i,a,o,s,c){ot.call(this,e,t,n,r,i,a,o,s,c),this.format=o!==void 0?o:xr,this.minFilter=a!==void 0?a:It,this.magFilter=i!==void 0?i:It,this.generateMipmaps=!1}lh.prototype=Object.assign(Object.create(ot.prototype),{constructor:lh,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});function va(e,t,n,r,i,a,o,s,c,l,u,h){ot.call(this,null,a,o,s,c,l,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}va.prototype=Object.create(ot.prototype),va.prototype.constructor=va,va.prototype.isCompressedTexture=!0;function Wo(e,t,n,r,i,a,o,s,c){ot.call(this,e,t,n,r,i,a,o,s,c),this.needsUpdate=!0}Wo.prototype=Object.create(ot.prototype),Wo.prototype.constructor=Wo,Wo.prototype.isCanvasTexture=!0;function Xo(e,t,n,r,i,a,o,s,c,l){if(l=l!==void 0?l:zr,l!==zr&&l!==ji)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&l===zr&&(n=io),n===void 0&&l===ji&&(n=Xi),ot.call(this,null,r,i,a,o,s,l,n,c),this.image={width:e,height:t},this.magFilter=o!==void 0?o:_t,this.minFilter=s!==void 0?s:_t,this.flipY=!1,this.generateMipmaps=!1}Xo.prototype=Object.create(ot.prototype),Xo.prototype.constructor=Xo,Xo.prototype.isDepthTexture=!0;function jo(e){ve.call(this),this.type="WireframeGeometry";var t=[],n,r,i,a,o,s=[0,0],c={},l,u,h,f,d=["a","b","c"],m;if(e&&e.isGeometry){var g=e.faces;for(n=0,i=g.length;n<i;n++){var y=g[n];for(r=0;r<3;r++)u=y[d[r]],h=y[d[(r+1)%3]],s[0]=Math.min(u,h),s[1]=Math.max(u,h),f=s[0]+","+s[1],c[f]===void 0&&(c[f]={index1:s[0],index2:s[1]})}for(f in c)l=c[f],m=e.vertices[l.index1],t.push(m.x,m.y,m.z),m=e.vertices[l.index2],t.push(m.x,m.y,m.z)}else if(e&&e.isBufferGeometry){var p,v,_,x,b,T,C,N;if(m=new E,e.index!==null){for(p=e.attributes.position,v=e.index,_=e.groups,_.length===0&&(_=[{start:0,count:v.count,materialIndex:0}]),a=0,o=_.length;a<o;++a)for(x=_[a],b=x.start,T=x.count,n=b,i=b+T;n<i;n+=3)for(r=0;r<3;r++)u=v.getX(n+r),h=v.getX(n+(r+1)%3),s[0]=Math.min(u,h),s[1]=Math.max(u,h),f=s[0]+","+s[1],c[f]===void 0&&(c[f]={index1:s[0],index2:s[1]});for(f in c)l=c[f],m.fromBufferAttribute(p,l.index1),t.push(m.x,m.y,m.z),m.fromBufferAttribute(p,l.index2),t.push(m.x,m.y,m.z)}else for(p=e.attributes.position,n=0,i=p.count/3;n<i;n++)for(r=0;r<3;r++)C=3*n+r,m.fromBufferAttribute(p,C),t.push(m.x,m.y,m.z),N=3*n+(r+1)%3,m.fromBufferAttribute(p,N),t.push(m.x,m.y,m.z)}this.setAttribute("position",new ce(t,3))}jo.prototype=Object.create(ve.prototype),jo.prototype.constructor=jo;function qo(e,t,n){Ne.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new ma(e,t,n)),this.mergeVertices()}qo.prototype=Object.create(Ne.prototype),qo.prototype.constructor=qo;function ma(e,t,n){ve.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r=[],i=[],a=[],o=[],s=1e-5,c=new E,l=new E,u=new E,h=new E,f=new E,d,m;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var g=t+1;for(d=0;d<=n;d++){var y=d/n;for(m=0;m<=t;m++){var p=m/t;e(p,y,l),i.push(l.x,l.y,l.z),p-s>=0?(e(p-s,y,u),h.subVectors(l,u)):(e(p+s,y,u),h.subVectors(u,l)),y-s>=0?(e(p,y-s,u),f.subVectors(l,u)):(e(p,y+s,u),f.subVectors(u,l)),c.crossVectors(h,f).normalize(),a.push(c.x,c.y,c.z),o.push(p,y)}}for(d=0;d<n;d++)for(m=0;m<t;m++){var v=d*g+m,_=d*g+m+1,x=(d+1)*g+m+1,b=(d+1)*g+m;r.push(v,_,b),r.push(_,x,b)}this.setIndex(r),this.setAttribute("position",new ce(i,3)),this.setAttribute("normal",new ce(a,3)),this.setAttribute("uv",new ce(o,2))}ma.prototype=Object.create(ve.prototype),ma.prototype.constructor=ma;function Yo(e,t,n,r){Ne.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new Zt(e,t,n,r)),this.mergeVertices()}Yo.prototype=Object.create(Ne.prototype),Yo.prototype.constructor=Yo;function Zt(e,t,n,r){ve.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},n=n||1,r=r||0;var i=[],a=[];o(r),c(n),l(),this.setAttribute("position",new ce(i,3)),this.setAttribute("normal",new ce(i.slice(),3)),this.setAttribute("uv",new ce(a,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(p){for(var v=new E,_=new E,x=new E,b=0;b<t.length;b+=3)f(t[b+0],v),f(t[b+1],_),f(t[b+2],x),s(v,_,x,p)}function s(p,v,_,x){var b=Math.pow(2,x),T=[],C,N;for(C=0;C<=b;C++){T[C]=[];var O=p.clone().lerp(_,C/b),J=v.clone().lerp(_,C/b),F=b-C;for(N=0;N<=F;N++)N===0&&C===b?T[C][N]=O:T[C][N]=O.clone().lerp(J,N/F)}for(C=0;C<b;C++)for(N=0;N<2*(b-C)-1;N++){var B=Math.floor(N/2);N%2===0?(h(T[C][B+1]),h(T[C+1][B]),h(T[C][B])):(h(T[C][B+1]),h(T[C+1][B+1]),h(T[C+1][B]))}}function c(p){for(var v=new E,_=0;_<i.length;_+=3)v.x=i[_+0],v.y=i[_+1],v.z=i[_+2],v.normalize().multiplyScalar(p),i[_+0]=v.x,i[_+1]=v.y,i[_+2]=v.z}function l(){for(var p=new E,v=0;v<i.length;v+=3){p.x=i[v+0],p.y=i[v+1],p.z=i[v+2];var _=g(p)/2/Math.PI+.5,x=y(p)/Math.PI+.5;a.push(_,1-x)}d(),u()}function u(){for(var p=0;p<a.length;p+=6){var v=a[p+0],_=a[p+2],x=a[p+4],b=Math.max(v,_,x),T=Math.min(v,_,x);b>.9&&T<.1&&(v<.2&&(a[p+0]+=1),_<.2&&(a[p+2]+=1),x<.2&&(a[p+4]+=1))}}function h(p){i.push(p.x,p.y,p.z)}function f(p,v){var _=p*3;v.x=e[_+0],v.y=e[_+1],v.z=e[_+2]}function d(){for(var p=new E,v=new E,_=new E,x=new E,b=new X,T=new X,C=new X,N=0,O=0;N<i.length;N+=9,O+=6){p.set(i[N+0],i[N+1],i[N+2]),v.set(i[N+3],i[N+4],i[N+5]),_.set(i[N+6],i[N+7],i[N+8]),b.set(a[O+0],a[O+1]),T.set(a[O+2],a[O+3]),C.set(a[O+4],a[O+5]),x.copy(p).add(v).add(_).divideScalar(3);var J=g(x);m(b,O+0,p,J),m(T,O+2,v,J),m(C,O+4,_,J)}}function m(p,v,_,x){x<0&&p.x===1&&(a[v]=p.x-1),_.x===0&&_.z===0&&(a[v]=x/2/Math.PI+.5)}function g(p){return Math.atan2(p.z,-p.x)}function y(p){return Math.atan2(-p.y,Math.sqrt(p.x*p.x+p.z*p.z))}}Zt.prototype=Object.create(ve.prototype),Zt.prototype.constructor=Zt;function Zo(e,t){Ne.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ga(e,t)),this.mergeVertices()}Zo.prototype=Object.create(Ne.prototype),Zo.prototype.constructor=Zo;function ga(e,t){var n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];Zt.call(this,n,r,e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}ga.prototype=Object.create(Zt.prototype),ga.prototype.constructor=ga;function Jo(e,t){Ne.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new pi(e,t)),this.mergeVertices()}Jo.prototype=Object.create(Ne.prototype),Jo.prototype.constructor=Jo;function pi(e,t){var n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];Zt.call(this,n,r,e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}pi.prototype=Object.create(Zt.prototype),pi.prototype.constructor=pi;function Qo(e,t){Ne.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ya(e,t)),this.mergeVertices()}Qo.prototype=Object.create(Ne.prototype),Qo.prototype.constructor=Qo;function ya(e,t){var n=(1+Math.sqrt(5))/2,r=[-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],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];Zt.call(this,r,i,e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}ya.prototype=Object.create(Zt.prototype),ya.prototype.constructor=ya;function Ko(e,t){Ne.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new xa(e,t)),this.mergeVertices()}Ko.prototype=Object.create(Ne.prototype),Ko.prototype.constructor=Ko;function xa(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],a=[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];Zt.call(this,i,a,e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}xa.prototype=Object.create(Zt.prototype),xa.prototype.constructor=xa;function $o(e,t,n,r,i,a){Ne.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},a!==void 0&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new vi(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}$o.prototype=Object.create(Ne.prototype),$o.prototype.constructor=$o;function vi(e,t,n,r,i){ve.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},t=t||64,n=n||1,r=r||8,i=i||!1;var a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o=new E,s=new E,c=new X,l=new E,u,h,f=[],d=[],m=[],g=[];y(),this.setIndex(g),this.setAttribute("position",new ce(f,3)),this.setAttribute("normal",new ce(d,3)),this.setAttribute("uv",new ce(m,2));function y(){for(u=0;u<t;u++)p(u);p(i===!1?t:0),_(),v()}function p(x){l=e.getPointAt(x/t,l);var b=a.normals[x],T=a.binormals[x];for(h=0;h<=r;h++){var C=h/r*Math.PI*2,N=Math.sin(C),O=-Math.cos(C);s.x=O*b.x+N*T.x,s.y=O*b.y+N*T.y,s.z=O*b.z+N*T.z,s.normalize(),d.push(s.x,s.y,s.z),o.x=l.x+n*s.x,o.y=l.y+n*s.y,o.z=l.z+n*s.z,f.push(o.x,o.y,o.z)}}function v(){for(h=1;h<=t;h++)for(u=1;u<=r;u++){var x=(r+1)*(h-1)+(u-1),b=(r+1)*h+(u-1),T=(r+1)*h+u,C=(r+1)*(h-1)+u;g.push(x,b,C),g.push(b,T,C)}}function _(){for(u=0;u<=t;u++)for(h=0;h<=r;h++)c.x=u/t,c.y=h/r,m.push(c.x,c.y)}}vi.prototype=Object.create(ve.prototype),vi.prototype.constructor=vi,vi.prototype.toJSON=function(){var e=ve.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e};function es(e,t,n,r,i,a,o){Ne.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},o!==void 0&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new _a(e,t,n,r,i,a)),this.mergeVertices()}es.prototype=Object.create(Ne.prototype),es.prototype.constructor=es;function _a(e,t,n,r,i,a){ve.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var o=[],s=[],c=[],l=[],u,h,f=new E,d=new E,m=new E,g=new E,y=new E,p=new E,v=new E;for(u=0;u<=n;++u){var _=u/n*i*Math.PI*2;for(F(_,i,a,e,m),F(_+.01,i,a,e,g),p.subVectors(g,m),v.addVectors(g,m),y.crossVectors(p,v),v.crossVectors(y,p),y.normalize(),v.normalize(),h=0;h<=r;++h){var x=h/r*Math.PI*2,b=-t*Math.cos(x),T=t*Math.sin(x);f.x=m.x+(b*v.x+T*y.x),f.y=m.y+(b*v.y+T*y.y),f.z=m.z+(b*v.z+T*y.z),s.push(f.x,f.y,f.z),d.subVectors(f,m).normalize(),c.push(d.x,d.y,d.z),l.push(u/n),l.push(h/r)}}for(h=1;h<=n;h++)for(u=1;u<=r;u++){var C=(r+1)*(h-1)+(u-1),N=(r+1)*h+(u-1),O=(r+1)*h+u,J=(r+1)*(h-1)+u;o.push(C,N,J),o.push(N,O,J)}this.setIndex(o),this.setAttribute("position",new ce(s,3)),this.setAttribute("normal",new ce(c,3)),this.setAttribute("uv",new ce(l,2));function F(B,V,Y,D,z){var k=Math.cos(B),q=Math.sin(B),Z=Y/V*B,ee=Math.cos(Z);z.x=D*(2+ee)*.5*k,z.y=D*(2+ee)*q*.5,z.z=D*Math.sin(Z)*.5}}_a.prototype=Object.create(ve.prototype),_a.prototype.constructor=_a;function ts(e,t,n,r,i){Ne.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new ba(e,t,n,r,i)),this.mergeVertices()}ts.prototype=Object.create(Ne.prototype),ts.prototype.constructor=ts;function ba(e,t,n,r,i){ve.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||Math.PI*2;var a=[],o=[],s=[],c=[],l=new E,u=new E,h=new E,f,d;for(f=0;f<=n;f++)for(d=0;d<=r;d++){var m=d/r*i,g=f/n*Math.PI*2;u.x=(e+t*Math.cos(g))*Math.cos(m),u.y=(e+t*Math.cos(g))*Math.sin(m),u.z=t*Math.sin(g),o.push(u.x,u.y,u.z),l.x=e*Math.cos(m),l.y=e*Math.sin(m),h.subVectors(u,l).normalize(),s.push(h.x,h.y,h.z),c.push(d/r),c.push(f/n)}for(f=1;f<=n;f++)for(d=1;d<=r;d++){var y=(r+1)*f+d-1,p=(r+1)*(f-1)+d-1,v=(r+1)*(f-1)+d,_=(r+1)*f+d;a.push(y,p,_),a.push(p,v,_)}this.setIndex(a),this.setAttribute("position",new ce(o,3)),this.setAttribute("normal",new ce(s,3)),this.setAttribute("uv",new ce(c,2))}ba.prototype=Object.create(ve.prototype),ba.prototype.constructor=ba;var Ey={triangulate:function(e,t,n){n=n||2;var r=t&&t.length,i=r?t[0]*n:e.length,a=ch(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;var s,c,l,u,h,f,d;if(r&&(a=Py(e,t,a,n)),e.length>80*n){s=l=e[0],c=u=e[1];for(var m=n;m<i;m+=n)h=e[m],f=e[m+1],h<s&&(s=h),f<c&&(c=f),h>l&&(l=h),f>u&&(u=f);d=Math.max(l-s,u-c),d=d!==0?1/d:0}return wa(a,o,n,s,c,d),o}};function ch(e,t,n,r,i){var a,o;if(i===Gy(e,t,n,r)>0)for(a=t;a<n;a+=r)o=fh(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=fh(a,e[a],e[a+1],o);return o&&ns(o,o.next)&&(Ea(o),o=o.next),o}function lr(e,t){if(!e)return e;t||(t=e);var n=e,r;do if(r=!1,!n.steiner&&(ns(n,n.next)||ht(n.prev,n,n.next)===0)){if(Ea(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function wa(e,t,n,r,i,a,o){if(e){!o&&a&&Iy(e,r,i,a);for(var s=e,c,l;e.prev!==e.next;){if(c=e.prev,l=e.next,a?Sy(e,r,i,a):Ty(e)){t.push(c.i/n),t.push(e.i/n),t.push(l.i/n),Ea(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=Ay(lr(e),t,n),wa(e,t,n,r,i,a,2)):o===2&&Ly(e,t,n,r,i,a):wa(lr(e),t,n,r,i,a,1);break}}}}function Ty(e){var t=e.prev,n=e,r=e.next;if(ht(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(mi(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&ht(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Sy(e,t,n,r){var i=e.prev,a=e,o=e.next;if(ht(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,c=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,l=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=Bl(s,c,t,n,r),f=Bl(l,u,t,n,r),d=e.prevZ,m=e.nextZ;d&&d.z>=h&&m&&m.z<=f;){if(d!==e.prev&&d!==e.next&&mi(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ht(d.prev,d,d.next)>=0||(d=d.prevZ,m!==e.prev&&m!==e.next&&mi(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&ht(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&&mi(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ht(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;m&&m.z<=f;){if(m!==e.prev&&m!==e.next&&mi(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&ht(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Ay(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!ns(i,a)&&uh(i,r,r.next,a)&&Ma(i,a)&&Ma(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),Ea(r),Ea(r.next),r=e=a),r=r.next}while(r!==e);return lr(r)}function Ly(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&By(o,s)){var c=hh(o,s);o=lr(o,o.next),c=lr(c,c.next),wa(o,t,n,r,i,a),wa(c,t,n,r,i,a);return}s=s.next}o=o.next}while(o!==e)}function Py(e,t,n,r){var i=[],a,o,s,c,l;for(a=0,o=t.length;a<o;a++)s=t[a]*r,c=a<o-1?t[a+1]*r:e.length,l=ch(e,s,c,r,!1),l===l.next&&(l.steiner=!0),i.push(Fy(l));for(i.sort(Cy),a=0;a<i.length;a++)Ry(i[a],n),n=lr(n,n.next);return n}function Cy(e,t){return e.x-t.x}function Ry(e,t){if(t=Oy(e,t),t){var n=hh(t,e);lr(t,t.next),lr(n,n.next)}}function Oy(e,t){var n=t,r=e.x,i=e.y,a=-1/0,o;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a){if(a=s,s===r){if(i===n.y)return n;if(i===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!o)return null;if(r===a)return o;var c=o,l=o.x,u=o.y,h=1/0,f;n=o;do r>=n.x&&n.x>=l&&r!==n.x&&mi(i<u?r:a,i,l,u,i<u?a:r,i,n.x,n.y)&&(f=Math.abs(i-n.y)/(r-n.x),Ma(n,e)&&(f<h||f===h&&(n.x>o.x||n.x===o.x&&Dy(o,n)))&&(o=n,h=f)),n=n.next;while(n!==c);return o}function Dy(e,t){return ht(e.prev,e,t.prev)<0&&ht(t.next,e,e.next)<0}function Iy(e,t,n,r){var i=e;do i.z===null&&(i.z=Bl(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,Ny(i)}function Ny(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ,!!r);t++);for(c=l;s>0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function Bl(e,t,n,r,i){return e=32767*(e-n)*i,t=32767*(t-r)*i,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Fy(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 mi(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function By(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Uy(e,t)&&(Ma(e,t)&&Ma(t,e)&&zy(e,t)&&(ht(e.prev,e,t.prev)||ht(e,t.prev,t))||ns(e,t)&&ht(e.prev,e,e.next)>0&&ht(t.prev,t,t.next)>0)}function ht(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ns(e,t){return e.x===t.x&&e.y===t.y}function uh(e,t,n,r){var i=is(ht(e,t,n)),a=is(ht(e,t,r)),o=is(ht(n,r,e)),s=is(ht(n,r,t));return!!(i!==a&&o!==s||i===0&&rs(e,n,t)||a===0&&rs(e,r,t)||o===0&&rs(n,e,r)||s===0&&rs(n,t,r))}function rs(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function is(e){return e>0?1:e<0?-1:0}function Uy(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&&uh(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Ma(e,t){return ht(e.prev,e,e.next)<0?ht(e,t,e.next)>=0&&ht(e,e.prev,t)>=0:ht(e,t,e.prev)<0||ht(e,e.next,t)<0}function zy(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function hh(e,t){var n=new Ul(e.i,e.x,e.y),r=new Ul(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function fh(e,t,n,r){var i=new Ul(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ea(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 Ul(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}function Gy(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}var cr={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return n*.5},isClockWise:function(e){return cr.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];dh(e),ph(n,e);var a=e.length;t.forEach(dh);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,ph(n,t[o]);for(var s=Ey.triangulate(n,r),o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};function dh(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function ph(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function gi(e,t){Ne.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new zn(e,t)),this.mergeVertices()}gi.prototype=Object.create(Ne.prototype),gi.prototype.constructor=gi,gi.prototype.toJSON=function(){var e=Ne.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return vh(t,n,e)};function zn(e,t){ve.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];for(var n=this,r=[],i=[],a=0,o=e.length;a<o;a++){var s=e[a];c(s)}this.setAttribute("position",new ce(r,3)),this.setAttribute("uv",new ce(i,2)),this.computeVertexNormals();function c(l){var u=[],h=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1,d=t.depth!==void 0?t.depth:100,m=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:6,y=t.bevelSize!==void 0?t.bevelSize:g-2,p=t.bevelOffset!==void 0?t.bevelOffset:0,v=t.bevelSegments!==void 0?t.bevelSegments:3,_=t.extrudePath,x=t.UVGenerator!==void 0?t.UVGenerator:Hy;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),d=t.amount);var b,T=!1,C,N,O,J;_&&(b=_.getSpacedPoints(f),T=!0,m=!1,C=_.computeFrenetFrames(f,!1),N=new E,O=new E,J=new E),m||(v=0,g=0,y=0,p=0);var F,B,V,Y=l.extractPoints(h),D=Y.shape,z=Y.holes,k=!cr.isClockWise(D);if(k)for(D=D.reverse(),B=0,V=z.length;B<V;B++)F=z[B],cr.isClockWise(F)&&(z[B]=F.reverse());var q=cr.triangulateShape(D,z),Z=D;for(B=0,V=z.length;B<V;B++)F=z[B],D=D.concat(F);function ee(ie,Se,pe){return Se||console.error("THREE.ExtrudeGeometry: vec does not exist"),Se.clone().multiplyScalar(pe).add(ie)}var te,oe,Pe,be,re,G=D.length,Be,xe=q.length;function Te(ie,Se,pe){var Re,I,we,Me=ie.x-Se.x,Ve=ie.y-Se.y,Ee=pe.x-ie.x,Ze=pe.y-ie.y,it=Me*Me+Ve*Ve,pt=Me*Ze-Ve*Ee;if(Math.abs(pt)>Number.EPSILON){var Ht=Math.sqrt(it),at=Math.sqrt(Ee*Ee+Ze*Ze),Pt=Se.x-Ve/Ht,Dt=Se.y+Me/Ht,Kt=pe.x-Ze/at,Ii=pe.y+Ee/at,Ni=((Kt-Pt)*Ze-(Ii-Dt)*Ee)/(Me*Ze-Ve*Ee);Re=Pt+Me*Ni-ie.x,I=Dt+Ve*Ni-ie.y;var Br=Re*Re+I*I;if(Br<=2)return new X(Re,I);we=Math.sqrt(Br/2)}else{var S=!1;Me>Number.EPSILON?Ee>Number.EPSILON&&(S=!0):Me<-Number.EPSILON?Ee<-Number.EPSILON&&(S=!0):Math.sign(Ve)===Math.sign(Ze)&&(S=!0),S?(Re=-Ve,I=Me,we=Math.sqrt(it)):(Re=Me,I=Ve,we=Math.sqrt(it/2))}return new X(Re/we,I/we)}for(var ue=[],$=0,Ce=Z.length,Ye=Ce-1,Qe=$+1;$<Ce;$++,Ye++,Qe++)Ye===Ce&&(Ye=0),Qe===Ce&&(Qe=0),ue[$]=Te(Z[$],Z[Ye],Z[Qe]);var nt=[],$e,A=ue.concat();for(B=0,V=z.length;B<V;B++){for(F=z[B],$e=[],$=0,Ce=F.length,Ye=Ce-1,Qe=$+1;$<Ce;$++,Ye++,Qe++)Ye===Ce&&(Ye=0),Qe===Ce&&(Qe=0),$e[$]=Te(F[$],F[Ye],F[Qe]);nt.push($e),A=A.concat($e)}for(te=0;te<v;te++){for(Pe=te/v,be=g*Math.cos(Pe*Math.PI/2),oe=y*Math.sin(Pe*Math.PI/2)+p,$=0,Ce=Z.length;$<Ce;$++)re=ee(Z[$],ue[$],oe),ye(re.x,re.y,-be);for(B=0,V=z.length;B<V;B++)for(F=z[B],$e=nt[B],$=0,Ce=F.length;$<Ce;$++)re=ee(F[$],$e[$],oe),ye(re.x,re.y,-be)}for(oe=y+p,$=0;$<G;$++)re=m?ee(D[$],A[$],oe):D[$],T?(O.copy(C.normals[0]).multiplyScalar(re.x),N.copy(C.binormals[0]).multiplyScalar(re.y),J.copy(b[0]).add(O).add(N),ye(J.x,J.y,J.z)):ye(re.x,re.y,0);var L;for(L=1;L<=f;L++)for($=0;$<G;$++)re=m?ee(D[$],A[$],oe):D[$],T?(O.copy(C.normals[L]).multiplyScalar(re.x),N.copy(C.binormals[L]).multiplyScalar(re.y),J.copy(b[L]).add(O).add(N),ye(J.x,J.y,J.z)):ye(re.x,re.y,d/f*L);for(te=v-1;te>=0;te--){for(Pe=te/v,be=g*Math.cos(Pe*Math.PI/2),oe=y*Math.sin(Pe*Math.PI/2)+p,$=0,Ce=Z.length;$<Ce;$++)re=ee(Z[$],ue[$],oe),ye(re.x,re.y,d+be);for(B=0,V=z.length;B<V;B++)for(F=z[B],$e=nt[B],$=0,Ce=F.length;$<Ce;$++)re=ee(F[$],$e[$],oe),T?ye(re.x,re.y+b[f-1].y,b[f-1].x+be):ye(re.x,re.y,d+be)}ne(),K();function ne(){var ie=r.length/3;if(m){var Se=0,pe=G*Se;for($=0;$<xe;$++)Be=q[$],R(Be[2]+pe,Be[1]+pe,Be[0]+pe);for(Se=f+v*2,pe=G*Se,$=0;$<xe;$++)Be=q[$],R(Be[0]+pe,Be[1]+pe,Be[2]+pe)}else{for($=0;$<xe;$++)Be=q[$],R(Be[2],Be[1],Be[0]);for($=0;$<xe;$++)Be=q[$],R(Be[0]+G*f,Be[1]+G*f,Be[2]+G*f)}n.addGroup(ie,r.length/3-ie,0)}function K(){var ie=r.length/3,Se=0;for(Fe(Z,Se),Se+=Z.length,B=0,V=z.length;B<V;B++)F=z[B],Fe(F,Se),Se+=F.length;n.addGroup(ie,r.length/3-ie,1)}function Fe(ie,Se){var pe,Re;for($=ie.length;--$>=0;){pe=$,Re=$-1,Re<0&&(Re=ie.length-1);var I=0,we=f+v*2;for(I=0;I<we;I++){var Me=G*I,Ve=G*(I+1),Ee=Se+pe+Me,Ze=Se+Re+Me,it=Se+Re+Ve,pt=Se+pe+Ve;he(Ee,Ze,it,pt)}}}function ye(ie,Se,pe){u.push(ie),u.push(Se),u.push(pe)}function R(ie,Se,pe){fe(ie),fe(Se),fe(pe);var Re=r.length/3,I=x.generateTopUV(n,r,Re-3,Re-2,Re-1);me(I[0]),me(I[1]),me(I[2])}function he(ie,Se,pe,Re){fe(ie),fe(Se),fe(Re),fe(Se),fe(pe),fe(Re);var I=r.length/3,we=x.generateSideWallUV(n,r,I-6,I-3,I-2,I-1);me(we[0]),me(we[1]),me(we[3]),me(we[1]),me(we[2]),me(we[3])}function fe(ie){r.push(u[ie*3+0]),r.push(u[ie*3+1]),r.push(u[ie*3+2])}function me(ie){i.push(ie.x),i.push(ie.y)}}}zn.prototype=Object.create(ve.prototype),zn.prototype.constructor=zn,zn.prototype.toJSON=function(){var e=ve.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return vh(t,n,e)};var Hy={generateTopUV:function(e,t,n,r,i){var a=t[n*3],o=t[n*3+1],s=t[r*3],c=t[r*3+1],l=t[i*3],u=t[i*3+1];return[new X(a,o),new X(s,c),new X(l,u)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[n*3],s=t[n*3+1],c=t[n*3+2],l=t[r*3],u=t[r*3+1],h=t[r*3+2],f=t[i*3],d=t[i*3+1],m=t[i*3+2],g=t[a*3],y=t[a*3+1],p=t[a*3+2];return Math.abs(s-u)<.01?[new X(o,1-c),new X(l,1-h),new X(f,1-m),new X(g,1-p)]:[new X(s,1-c),new X(u,1-h),new X(d,1-m),new X(y,1-p)]}};function vh(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,i=e.length;r<i;r++){var a=e[r];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return t.extrudePath!==void 0&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function as(e,t){Ne.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new Ta(e,t)),this.mergeVertices()}as.prototype=Object.create(Ne.prototype),as.prototype.constructor=as;function Ta(e,t){t=t||{};var n=t.font;if(!(n&&n.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Ne;var r=n.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),zn.call(this,r,t),this.type="TextBufferGeometry"}Ta.prototype=Object.create(zn.prototype),Ta.prototype.constructor=Ta;function os(e,t,n,r,i,a,o){Ne.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new yi(e,t,n,r,i,a,o)),this.mergeVertices()}os.prototype=Object.create(Ne.prototype),os.prototype.constructor=os;function yi(e,t,n,r,i,a,o){ve.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=r!==void 0?r:0,i=i!==void 0?i:Math.PI*2,a=a!==void 0?a:0,o=o!==void 0?o:Math.PI;var s=Math.min(a+o,Math.PI),c,l,u=0,h=[],f=new E,d=new E,m=[],g=[],y=[],p=[];for(l=0;l<=n;l++){var v=[],_=l/n,x=0;for(l==0&&a==0?x=.5/t:l==n&&s==Math.PI&&(x=-.5/t),c=0;c<=t;c++){var b=c/t;f.x=-e*Math.cos(r+b*i)*Math.sin(a+_*o),f.y=e*Math.cos(a+_*o),f.z=e*Math.sin(r+b*i)*Math.sin(a+_*o),g.push(f.x,f.y,f.z),d.copy(f).normalize(),y.push(d.x,d.y,d.z),p.push(b+x,1-_),v.push(u++)}h.push(v)}for(l=0;l<n;l++)for(c=0;c<t;c++){var T=h[l][c+1],C=h[l][c],N=h[l+1][c],O=h[l+1][c+1];(l!==0||a>0)&&m.push(T,C,O),(l!==n-1||s<Math.PI)&&m.push(C,N,O)}this.setIndex(m),this.setAttribute("position",new ce(g,3)),this.setAttribute("normal",new ce(y,3)),this.setAttribute("uv",new ce(p,2))}yi.prototype=Object.create(ve.prototype),yi.prototype.constructor=yi;function ss(e,t,n,r,i,a){Ne.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new Sa(e,t,n,r,i,a)),this.mergeVertices()}ss.prototype=Object.create(Ne.prototype),ss.prototype.constructor=ss;function Sa(e,t,n,r,i,a){ve.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},e=e||.5,t=t||1,i=i!==void 0?i:0,a=a!==void 0?a:Math.PI*2,n=n!==void 0?Math.max(3,n):8,r=r!==void 0?Math.max(1,r):1;var o=[],s=[],c=[],l=[],u,h=e,f=(t-e)/r,d=new E,m=new X,g,y;for(g=0;g<=r;g++){for(y=0;y<=n;y++)u=i+y/n*a,d.x=h*Math.cos(u),d.y=h*Math.sin(u),s.push(d.x,d.y,d.z),c.push(0,0,1),m.x=(d.x/t+1)/2,m.y=(d.y/t+1)/2,l.push(m.x,m.y);h+=f}for(g=0;g<r;g++){var p=g*(n+1);for(y=0;y<n;y++){u=y+p;var v=u,_=u+n+1,x=u+n+2,b=u+1;o.push(v,_,b),o.push(_,x,b)}}this.setIndex(o),this.setAttribute("position",new ce(s,3)),this.setAttribute("normal",new ce(c,3)),this.setAttribute("uv",new ce(l,2))}Sa.prototype=Object.create(ve.prototype),Sa.prototype.constructor=Sa;function ls(e,t,n,r){Ne.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new Aa(e,t,n,r)),this.mergeVertices()}ls.prototype=Object.create(Ne.prototype),ls.prototype.constructor=ls;function Aa(e,t,n,r){ve.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||Math.PI*2,r=ke.clamp(r,0,Math.PI*2);var i=[],a=[],o=[],s,c=1/t,l=new E,u=new X,h,f;for(h=0;h<=t;h++){var d=n+h*c*r,m=Math.sin(d),g=Math.cos(d);for(f=0;f<=e.length-1;f++)l.x=e[f].x*m,l.y=e[f].y,l.z=e[f].x*g,a.push(l.x,l.y,l.z),u.x=h/t,u.y=f/(e.length-1),o.push(u.x,u.y)}for(h=0;h<t;h++)for(f=0;f<e.length-1;f++){s=f+h*e.length;var y=s,p=s+e.length,v=s+e.length+1,_=s+1;i.push(y,p,_),i.push(p,v,_)}if(this.setIndex(i),this.setAttribute("position",new ce(a,3)),this.setAttribute("uv",new ce(o,2)),this.computeVertexNormals(),r===Math.PI*2){var x=this.attributes.normal.array,b=new E,T=new E,C=new E;for(s=t*e.length*3,h=0,f=0;h<e.length;h++,f+=3)b.x=x[f+0],b.y=x[f+1],b.z=x[f+2],T.x=x[s+f+0],T.y=x[s+f+1],T.z=x[s+f+2],C.addVectors(b,T).normalize(),x[f+0]=x[s+f+0]=C.x,x[f+1]=x[s+f+1]=C.y,x[f+2]=x[s+f+2]=C.z}}Aa.prototype=Object.create(ve.prototype),Aa.prototype.constructor=Aa;function xi(e,t){Ne.call(this),this.type="ShapeGeometry",typeof t=="object"&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new _i(e,t)),this.mergeVertices()}xi.prototype=Object.create(Ne.prototype),xi.prototype.constructor=xi,xi.prototype.toJSON=function(){var e=Ne.prototype.toJSON.call(this),t=this.parameters.shapes;return mh(t,e)};function _i(e,t){ve.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],r=[],i=[],a=[],o=0,s=0;if(Array.isArray(e)===!1)l(e);else for(var c=0;c<e.length;c++)l(e[c]),this.addGroup(o,s,c),o+=s,s=0;this.setIndex(n),this.setAttribute("position",new ce(r,3)),this.setAttribute("normal",new ce(i,3)),this.setAttribute("uv",new ce(a,2));function l(u){var h,f,d,m=r.length/3,g=u.extractPoints(t),y=g.shape,p=g.holes;for(cr.isClockWise(y)===!1&&(y=y.reverse()),h=0,f=p.length;h<f;h++)d=p[h],cr.isClockWise(d)===!0&&(p[h]=d.reverse());var v=cr.triangulateShape(y,p);for(h=0,f=p.length;h<f;h++)d=p[h],y=y.concat(d);for(h=0,f=y.length;h<f;h++){var _=y[h];r.push(_.x,_.y,0),i.push(0,0,1),a.push(_.x,_.y)}for(h=0,f=v.length;h<f;h++){var x=v[h],b=x[0]+m,T=x[1]+m,C=x[2]+m;n.push(b,T,C),s+=3}}}_i.prototype=Object.create(ve.prototype),_i.prototype.constructor=_i,_i.prototype.toJSON=function(){var e=ve.prototype.toJSON.call(this),t=this.parameters.shapes;return mh(t,e)};function mh(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function cs(e,t){ve.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1;var n=[],r=Math.cos(ke.DEG2RAD*t),i=[0,0],a={},o,s,c,l=["a","b","c"],u;e.isBufferGeometry?(u=new Ne,u.fromBufferGeometry(e)):u=e.clone(),u.mergeVertices(),u.computeFaceNormals();for(var h=u.vertices,f=u.faces,d=0,m=f.length;d<m;d++)for(var g=f[d],y=0;y<3;y++)o=g[l[y]],s=g[l[(y+1)%3]],i[0]=Math.min(o,s),i[1]=Math.max(o,s),c=i[0]+","+i[1],a[c]===void 0?a[c]={index1:i[0],index2:i[1],face1:d,face2:void 0}:a[c].face2=d;for(c in a){var p=a[c];if(p.face2===void 0||f[p.face1].normal.dot(f[p.face2].normal)<=r){var v=h[p.index1];n.push(v.x,v.y,v.z),v=h[p.index2],n.push(v.x,v.y,v.z)}}this.setAttribute("position",new ce(n,3))}cs.prototype=Object.create(ve.prototype),cs.prototype.constructor=cs;function bi(e,t,n,r,i,a,o,s){Ne.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new ur(e,t,n,r,i,a,o,s)),this.mergeVertices()}bi.prototype=Object.create(Ne.prototype),bi.prototype.constructor=bi;function ur(e,t,n,r,i,a,o,s){ve.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};var c=this;e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,a=a!==void 0?a:!1,o=o!==void 0?o:0,s=s!==void 0?s:Math.PI*2;var l=[],u=[],h=[],f=[],d=0,m=[],g=n/2,y=0;p(),a===!1&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute("position",new ce(u,3)),this.setAttribute("normal",new ce(h,3)),this.setAttribute("uv",new ce(f,2));function p(){var _,x,b=new E,T=new E,C=0,N=(t-e)/n;for(x=0;x<=i;x++){var O=[],J=x/i,F=J*(t-e)+e;for(_=0;_<=r;_++){var B=_/r,V=B*s+o,Y=Math.sin(V),D=Math.cos(V);T.x=F*Y,T.y=-J*n+g,T.z=F*D,u.push(T.x,T.y,T.z),b.set(Y,N,D).normalize(),h.push(b.x,b.y,b.z),f.push(B,1-J),O.push(d++)}m.push(O)}for(_=0;_<r;_++)for(x=0;x<i;x++){var z=m[x][_],k=m[x+1][_],q=m[x+1][_+1],Z=m[x][_+1];l.push(z,k,Z),l.push(k,q,Z),C+=6}c.addGroup(y,C,0),y+=C}function v(_){var x,b,T,C=new X,N=new E,O=0,J=_===!0?e:t,F=_===!0?1:-1;for(b=d,x=1;x<=r;x++)u.push(0,g*F,0),h.push(0,F,0),f.push(.5,.5),d++;for(T=d,x=0;x<=r;x++){var B=x/r,V=B*s+o,Y=Math.cos(V),D=Math.sin(V);N.x=J*D,N.y=g*F,N.z=J*Y,u.push(N.x,N.y,N.z),h.push(0,F,0),C.x=Y*.5+.5,C.y=D*.5*F+.5,f.push(C.x,C.y),d++}for(x=0;x<r;x++){var z=b+x,k=T+x;_===!0?l.push(k,k+1,z):l.push(k+1,k,z),O+=3}c.addGroup(y,O,_===!0?1:2),y+=O}}ur.prototype=Object.create(ve.prototype),ur.prototype.constructor=ur;function us(e,t,n,r,i,a,o){bi.call(this,0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}us.prototype=Object.create(bi.prototype),us.prototype.constructor=us;function hs(e,t,n,r,i,a,o){ur.call(this,0,e,t,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}hs.prototype=Object.create(ur.prototype),hs.prototype.constructor=hs;function fs(e,t,n,r){Ne.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new La(e,t,n,r)),this.mergeVertices()}fs.prototype=Object.create(Ne.prototype),fs.prototype.constructor=fs;function La(e,t,n,r){ve.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=t!==void 0?Math.max(3,t):8,n=n!==void 0?n:0,r=r!==void 0?r:Math.PI*2;var i=[],a=[],o=[],s=[],c,l,u=new E,h=new X;for(a.push(0,0,0),o.push(0,0,1),s.push(.5,.5),l=0,c=3;l<=t;l++,c+=3){var f=n+l/t*r;u.x=e*Math.cos(f),u.y=e*Math.sin(f),a.push(u.x,u.y,u.z),o.push(0,0,1),h.x=(a[c]/e+1)/2,h.y=(a[c+1]/e+1)/2,s.push(h.x,h.y)}for(c=1;c<=t;c++)i.push(c,c+1,0);this.setIndex(i),this.setAttribute("position",new ce(a,3)),this.setAttribute("normal",new ce(o,3)),this.setAttribute("uv",new ce(s,2))}La.prototype=Object.create(ve.prototype),La.prototype.constructor=La;var zt=Object.freeze({__proto__:null,WireframeGeometry:jo,ParametricGeometry:qo,ParametricBufferGeometry:ma,TetrahedronGeometry:Zo,TetrahedronBufferGeometry:ga,OctahedronGeometry:Jo,OctahedronBufferGeometry:pi,IcosahedronGeometry:Qo,IcosahedronBufferGeometry:ya,DodecahedronGeometry:Ko,DodecahedronBufferGeometry:xa,PolyhedronGeometry:Yo,PolyhedronBufferGeometry:Zt,TubeGeometry:$o,TubeBufferGeometry:vi,TorusKnotGeometry:es,TorusKnotBufferGeometry:_a,TorusGeometry:ts,TorusBufferGeometry:ba,TextGeometry:as,TextBufferGeometry:Ta,SphereGeometry:os,SphereBufferGeometry:yi,RingGeometry:ss,RingBufferGeometry:Sa,PlaneGeometry:Po,PlaneBufferGeometry:li,LatheGeometry:ls,LatheBufferGeometry:Aa,ShapeGeometry:xi,ShapeBufferGeometry:_i,ExtrudeGeometry:gi,ExtrudeBufferGeometry:zn,EdgesGeometry:cs,ConeGeometry:us,ConeBufferGeometry:hs,CylinderGeometry:bi,CylinderBufferGeometry:ur,CircleGeometry:fs,CircleBufferGeometry:La,BoxGeometry:Ap,BoxBufferGeometry:Ao});function wi(e){Oe.call(this),this.type="ShadowMaterial",this.color=new de(0),this.transparent=!0,this.setValues(e)}wi.prototype=Object.create(Oe.prototype),wi.prototype.constructor=wi,wi.prototype.isShadowMaterial=!0,wi.prototype.copy=function(e){return Oe.prototype.copy.call(this,e),this.color.copy(e.color),this};function hr(e){Wt.call(this,e),this.type="RawShaderMaterial"}hr.prototype=Object.create(Wt.prototype),hr.prototype.constructor=hr,hr.prototype.isRawShaderMaterial=!0;function Gn(e){Oe.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new de(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vr,this.normalScale=new X(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.vertexTangents=!1,this.setValues(e)}Gn.prototype=Object.create(Oe.prototype),Gn.prototype.constructor=Gn,Gn.prototype.isMeshStandardMaterial=!0,Gn.prototype.copy=function(e){return Oe.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.vertexTangents=e.vertexTangents,this};function Mi(e){Gn.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new X(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(e)}Mi.prototype=Object.create(Gn.prototype),Mi.prototype.constructor=Mi,Mi.prototype.isMeshPhysicalMaterial=!0,Mi.prototype.copy=function(e){return Gn.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new de).copy(e.sheen):this.sheen=null,this.transparency=e.transparency,this};function Pr(e){Oe.call(this),this.type="MeshPhongMaterial",this.color=new de(16777215),this.specular=new de(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vr,this.normalScale=new X(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=eo,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)}Pr.prototype=Object.create(Oe.prototype),Pr.prototype.constructor=Pr,Pr.prototype.isMeshPhongMaterial=!0,Pr.prototype.copy=function(e){return Oe.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};function Ei(e){Oe.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new de(16777215),this.specular=new de(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vr,this.normalScale=new X(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}Ei.prototype=Object.create(Oe.prototype),Ei.prototype.constructor=Ei,Ei.prototype.isMeshToonMaterial=!0,Ei.prototype.copy=function(e){return Oe.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,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};function Ti(e){Oe.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vr,this.normalScale=new X(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)}Ti.prototype=Object.create(Oe.prototype),Ti.prototype.constructor=Ti,Ti.prototype.isMeshNormalMaterial=!0,Ti.prototype.copy=function(e){return Oe.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};function Si(e){Oe.call(this),this.type="MeshLambertMaterial",this.color=new de(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=eo,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)}Si.prototype=Object.create(Oe.prototype),Si.prototype.constructor=Si,Si.prototype.isMeshLambertMaterial=!0,Si.prototype.copy=function(e){return Oe.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};function Ai(e){Oe.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new de(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vr,this.normalScale=new X(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)}Ai.prototype=Object.create(Oe.prototype),Ai.prototype.constructor=Ai,Ai.prototype.isMeshMatcapMaterial=!0,Ai.prototype.copy=function(e){return Oe.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};function Li(e){mt.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Li.prototype=Object.create(mt.prototype),Li.prototype.constructor=Li,Li.prototype.isLineDashedMaterial=!0,Li.prototype.copy=function(e){return mt.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Vy=Object.freeze({__proto__:null,ShadowMaterial:wi,SpriteMaterial:Ar,RawShaderMaterial:hr,ShaderMaterial:Wt,PointsMaterial:Lr,MeshPhysicalMaterial:Mi,MeshStandardMaterial:Gn,MeshPhongMaterial:Pr,MeshToonMaterial:Ei,MeshNormalMaterial:Ti,MeshLambertMaterial:Si,MeshDepthMaterial:Er,MeshDistanceMaterial:Tr,MeshBasicMaterial:hn,MeshMatcapMaterial:Ai,LineDashedMaterial:Li,LineBasicMaterial:mt,Material:Oe}),ft={arraySlice:function(e,t,n){return ft.isTypedArray(e)?new e.constructor(e.subarray(t,n!==void 0?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:typeof t.BYTES_PER_ELEMENT=="number"?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){function t(a,o){return e[a]-e[o]}for(var n=e.length,r=new Array(n),i=0;i!==n;++i)r[i]=i;return r.sort(t),r},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,c=0;c!==t;++c)i[o++]=e[s+c];return i},flattenJSON:function(e,t,n,r){for(var i=1,a=e[0];a!==void 0&&a[r]===void 0;)a=e[i++];if(a!==void 0){var o=a[r];if(o!==void 0)if(Array.isArray(o))do o=a[r],o!==void 0&&(t.push(a.time),n.push.apply(n,o)),a=e[i++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[r],o!==void 0&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++];while(a!==void 0);else do o=a[r],o!==void 0&&(t.push(a.time),n.push(o)),a=e[i++];while(a!==void 0)}},subclip:function(e,t,n,r,i){i=i||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(),u=[],h=[],f=0;f<c.times.length;++f){var d=c.times[f]*i;if(!(d<n||d>=r)){u.push(c.times[f]);for(var m=0;m<l;++m)h.push(c.values[f*l+m])}}u.length!==0&&(c.times=ft.convertArray(u,c.times.constructor),c.values=ft.convertArray(h,c.values.constructor),o.push(c))}a.tracks=o;for(var g=1/0,s=0;s<a.tracks.length;++s)g>a.tracks[s].times[0]&&(g=a.tracks[s].times[0]);for(var s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*g);return a.resetDuration(),a},makeClipAdditive:function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=e),(r===void 0||r<=0)&&(r=30);for(var i=e.tracks.length,a=t/r,o=0;o<i;++o){var s=n.tracks[o],c=s.ValueTypeName;if(!(c==="bool"||c==="string")){var l=e.tracks.find(function(x){return x.name===s.name&&x.ValueTypeName===c});if(l!==void 0){var u=s.getValueSize(),h=s.times.length-1,f;if(a<=s.times[0])f=ft.arraySlice(s.values,0,s.valueSize);else if(a>=s.times[h]){var d=h*u;f=ft.arraySlice(s.values,d)}else{var m=s.createInterpolant();m.evaluate(a),f=m.resultBuffer}if(c==="quaternion"){var g=new bt(f[0],f[1],f[2],f[3]).normalize().conjugate();g.toArray(f)}for(var y=l.times.length,p=0;p<y;++p){var v=p*u;if(c==="quaternion")bt.multiplyQuaternionsFlat(l.values,v,f,0,l.values,v);else for(var _=0;_<u;++_)l.values[v+_]-=f[_]}}}}return e.blendMode=su,e}};function nn(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}Object.assign(nn.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(r===void 0){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,r=t[++n],e<r)break t}a=t.length;break n}if(!(e>=i)){var s=t[1];e<s&&(n=2,i=s);for(var o=n-2;;){if(i===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===o)break;if(r=i,i=t[--n-1],e>=i)break t}a=n,n=0;break n}break e}for(;n<a;){var c=n+a>>>1;e<t[c]?a=c:n=c+1}if(r=t[n],i=t[n-1],i===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(nn.prototype,{beforeStart_:nn.prototype.copySampleValue_,afterEnd_:nn.prototype.copySampleValue_});function zl(e,t,n,r){nn.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}zl.prototype=Object.assign(Object.create(nn.prototype),{constructor:zl,DefaultSettings_:{endingStart:Gr,endingEnd:Gr},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(o===void 0)switch(this.getSettings_().endingStart){case Hr:i=e,o=2*t-n;break;case co:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(s===void 0)switch(this.getSettings_().endingEnd){case Hr:a=e,s=2*n-t;break;case co:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}var c=(n-t)*.5,l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,f=this._weightNext,d=(n-t)/(r-t),m=d*d,g=m*d,y=-h*g+2*h*m-h*d,p=(1+h)*g+(-1.5-2*h)*m+(-.5+h)*d+1,v=(-1-f)*g+(1.5+f)*m+.5*d,_=f*g-f*m,x=0;x!==o;++x)i[x]=y*a[l+x]+p*a[c+x]+v*a[s+x]+_*a[u+x];return i}});function ds(e,t,n,r){nn.call(this,e,t,n,r)}ds.prototype=Object.assign(Object.create(nn.prototype),{constructor:ds,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(r-t),u=1-l,h=0;h!==o;++h)i[h]=a[c+h]*u+a[s+h]*l;return i}});function Gl(e,t,n,r){nn.call(this,e,t,n,r)}Gl.prototype=Object.assign(Object.create(nn.prototype),{constructor:Gl,interpolate_:function(e){return this.copySampleValue_(e-1)}});function Ft(e,t,n,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ft.convertArray(t,this.TimeBufferType),this.values=ft.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}Object.assign(Ft,{toJSON:function(e){var t=e.constructor,n;if(t.toJSON!==void 0)n=t.toJSON(e);else{n={name:e.name,times:ft.convertArray(e.times,Array),values:ft.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(n.interpolation=r)}return n.type=e.ValueTypeName,n}}),Object.assign(Ft.prototype,{constructor:Ft,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:lo,InterpolantFactoryMethodDiscrete:function(e){return new Gl(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new ds(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new zl(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case so:t=this.InterpolantFactoryMethodDiscrete;break;case lo:t=this.InterpolantFactoryMethodLinear;break;case Xs:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return so;case this.InterpolantFactoryMethodLinear:return lo;case this.InterpolantFactoryMethodSmooth:return Xs}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(e!==0)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(e!==1)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;a!==-1&&n[a]>t;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);var o=this.getValueSize();this.times=ft.arraySlice(n,i,a),this.values=ft.arraySlice(this.values,i*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,r=this.values,i=n.length;i===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if(typeof s=="number"&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(a!==null&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(r!==void 0&&ft.isTypedArray(r))for(var o=0,c=r.length;o!==c;++o){var l=r[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=ft.arraySlice(this.times),t=ft.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===Xs,i=1,a=e.length-1,o=1;o<a;++o){var s=!1,c=e[o],l=e[o+1];if(c!==l&&(o!==1||c!==c[0]))if(r)s=!0;else for(var u=o*n,h=u-n,f=u+n,d=0;d!==n;++d){var m=t[u+d];if(m!==t[h+d]||m!==t[f+d]){s=!0;break}}if(s){if(o!==i){e[i]=e[o];for(var g=o*n,y=i*n,d=0;d!==n;++d)t[y+d]=t[g+d]}++i}}if(a>0){e[i]=e[a];for(var g=a*n,y=i*n,d=0;d!==n;++d)t[y+d]=t[g+d];++i}return i!==e.length?(this.times=ft.arraySlice(e,0,i),this.values=ft.arraySlice(t,0,i*n)):(this.times=e,this.values=t),this},clone:function(){var e=ft.arraySlice(this.times,0),t=ft.arraySlice(this.values,0),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}});function Hl(e,t,n){Ft.call(this,e,t,n)}Hl.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Hl,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:so,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});function Vl(e,t,n,r){Ft.call(this,e,t,n,r)}Vl.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Vl,ValueTypeName:"color"});function Pa(e,t,n,r){Ft.call(this,e,t,n,r)}Pa.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Pa,ValueTypeName:"number"});function kl(e,t,n,r){nn.call(this,e,t,n,r)}kl.prototype=Object.assign(Object.create(nn.prototype),{constructor:kl,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=(n-t)/(r-t),l=s+o;s!==l;s+=4)bt.slerpFlat(i,0,a,s-o,a,s,c);return i}});function ps(e,t,n,r){Ft.call(this,e,t,n,r)}ps.prototype=Object.assign(Object.create(Ft.prototype),{constructor:ps,ValueTypeName:"quaternion",DefaultInterpolation:lo,InterpolantFactoryMethodLinear:function(e){return new kl(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0});function Wl(e,t,n,r){Ft.call(this,e,t,n,r)}Wl.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Wl,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:so,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});function Ca(e,t,n,r){Ft.call(this,e,t,n,r)}Ca.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Ca,ValueTypeName:"vector"});function fn(e,t,n,r){this.name=e,this.tracks=n,this.duration=t!==void 0?t:-1,this.blendMode=r!==void 0?r:js,this.uuid=ke.generateUUID(),this.duration<0&&this.resetDuration()}function ky(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Pa;case"vector":case"vector2":case"vector3":case"vector4":return Ca;case"color":return Vl;case"quaternion":return ps;case"bool":case"boolean":return Hl;case"string":return Wl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function Wy(e){if(e.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=ky(e.type);if(e.times===void 0){var n=[],r=[];ft.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return t.parse!==void 0?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(fn,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(Wy(n[i]).scale(r));return new fn(e.name,e.duration,t,e.blendMode)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode},i=0,a=n.length;i!==a;++i)t.push(Ft.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],c=[];s.push((o+i-1)%i,o,(o+1)%i),c.push(0,1,0);var l=ft.getKeyframeOrder(s);s=ft.sortedArray(s,1,l),c=ft.sortedArray(c,1,l),!r&&s[0]===0&&(s.push(i),c.push(c[0])),a.push(new Pa(".morphTargetInfluences["+t[o].name+"]",s,c).scale(1/n))}return new fn(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],c=s.name.match(i);if(c&&c.length>1){var l=c[1],u=r[l];u||(r[l]=u=[]),u.push(s)}}var h=[];for(var l in r)h.push(fn.CreateFromMorphTargetSequence(l,r[l],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(x,b,T,C,N){if(T.length!==0){var O=[],J=[];ft.flattenJSON(T,O,J,C),O.length!==0&&N.push(new x(b,O,J))}},r=[],i=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.blendMode,c=e.hierarchy||[],l=0;l<c.length;l++){var u=c[l].keys;if(!(!u||u.length===0))if(u[0].morphTargets){for(var h={},f=0;f<u.length;f++)if(u[f].morphTargets)for(var d=0;d<u[f].morphTargets.length;d++)h[u[f].morphTargets[d]]=-1;for(var m in h){for(var g=[],y=[],d=0;d!==u[f].morphTargets.length;++d){var p=u[f];g.push(p.time),y.push(p.morphTarget===m?1:0)}r.push(new Pa(".morphTargetInfluence["+m+"]",g,y))}a=h.length*(o||1)}else{var v=".bones["+t[l].name+"]";n(Ca,v+".position",u,"pos",r),n(ps,v+".quaternion",u,"rot",r),n(Ca,v+".scale",u,"scl",r)}}if(r.length===0)return null;var _=new fn(i,a,r,s);return _}}),Object.assign(fn.prototype,{resetDuration:function(){for(var e=this.tracks,t=0,n=0,r=e.length;n!==r;++n){var i=this.tracks[n];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,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 fn(this.name,this.duration,e,this.blendMode)}});var Pi={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function gh(e,t,n){var r=this,i=!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(l){o++,i===!1&&r.onStart!==void 0&&r.onStart(l,a,o),i=!0},this.itemEnd=function(l){a++,r.onProgress!==void 0&&r.onProgress(l,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(l){r.onError!==void 0&&r.onError(l)},this.resolveURL=function(l){return s?s(l):l},this.setURLModifier=function(l){return s=l,this},this.addHandler=function(l,u){return c.push(l,u),this},this.removeHandler=function(l){var u=c.indexOf(l);return u!==-1&&c.splice(u,2),this},this.getHandler=function(l){for(var u=0,h=c.length;u<h;u+=2){var f=c[u],d=c[u+1];if(f.global&&(f.lastIndex=0),f.test(l))return d}return null}}var Xy=new gh;function tt(e){this.manager=e!==void 0?e:Xy,this.crossOrigin="anonymous",this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(tt.prototype,{load:function(){},loadAsync:function(e,t){var n=this;return new Promise(function(r,i){n.load(e,r,t,i)})},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},setRequestHeader:function(e){return this.requestHeader=e,this}});var dn={};function bn(e){tt.call(this,e)}bn.prototype=Object.assign(Object.create(tt.prototype),{constructor:bn,load:function(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Pi.get(e);if(a!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;if(dn[e]!==void 0){dn[e].push({onLoad:t,onProgress:n,onError:r});return}var o=/^data:(.*?)(;base64)?,(.*)$/,s=e.match(o);if(s){var c=s[1],l=!!s[2],u=s[3];u=decodeURIComponent(u),l&&(u=atob(u));try{var h,f=(this.responseType||"").toLowerCase();switch(f){case"arraybuffer":case"blob":for(var d=new Uint8Array(u.length),m=0;m<u.length;m++)d[m]=u.charCodeAt(m);f==="blob"?h=new Blob([d.buffer],{type:c}):h=d.buffer;break;case"document":var g=new DOMParser;h=g.parseFromString(u,c);break;case"json":h=JSON.parse(u);break;default:h=u;break}setTimeout(function(){t&&t(h),i.manager.itemEnd(e)},0)}catch(v){setTimeout(function(){r&&r(v),i.manager.itemError(e),i.manager.itemEnd(e)},0)}}else{dn[e]=[],dn[e].push({onLoad:t,onProgress:n,onError:r});var y=new XMLHttpRequest;y.open("GET",e,!0),y.addEventListener("load",function(v){var _=this.response,x=dn[e];if(delete dn[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Pi.add(e,_);for(var b=0,T=x.length;b<T;b++){var C=x[b];C.onLoad&&C.onLoad(_)}i.manager.itemEnd(e)}else{for(var b=0,T=x.length;b<T;b++){var C=x[b];C.onError&&C.onError(v)}i.manager.itemError(e),i.manager.itemEnd(e)}},!1),y.addEventListener("progress",function(v){for(var _=dn[e],x=0,b=_.length;x<b;x++){var T=_[x];T.onProgress&&T.onProgress(v)}},!1),y.addEventListener("error",function(v){var _=dn[e];delete dn[e];for(var x=0,b=_.length;x<b;x++){var T=_[x];T.onError&&T.onError(v)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),y.addEventListener("abort",function(v){var _=dn[e];delete dn[e];for(var x=0,b=_.length;x<b;x++){var T=_[x];T.onError&&T.onError(v)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),this.responseType!==void 0&&(y.responseType=this.responseType),this.withCredentials!==void 0&&(y.withCredentials=this.withCredentials),y.overrideMimeType&&y.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(var p in this.requestHeader)y.setRequestHeader(p,this.requestHeader[p]);y.send(null)}return i.manager.itemStart(e),y},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this}});function yh(e){tt.call(this,e)}yh.prototype=Object.assign(Object.create(tt.prototype),{constructor:yh,load:function(e,t,n,r){var i=this,a=new bn(i.manager);a.setPath(i.path),a.load(e,function(o){try{t(i.parse(JSON.parse(o)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}},n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=fn.parse(e[n]);t.push(r)}return t}});function xh(e){tt.call(this,e)}xh.prototype=Object.assign(Object.create(tt.prototype),{constructor:xh,load:function(e,t,n,r){var i=this,a=[],o=new va;o.image=a;var s=new bn(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer");function c(f){s.load(e[f],function(d){var m=i.parse(d,!0);a[f]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},l+=1,l===6&&(m.mipmapCount===1&&(o.minFilter=It),o.format=m.format,o.needsUpdate=!0,t&&t(o))},n,r)}if(Array.isArray(e))for(var l=0,u=0,h=e.length;u<h;++u)c(u);else s.load(e,function(f){var d=i.parse(f,!0);if(d.isCubemap)for(var m=d.mipmaps.length/d.mipmapCount,g=0;g<m;g++){a[g]={mipmaps:[]};for(var y=0;y<d.mipmapCount;y++)a[g].mipmaps.push(d.mipmaps[g*d.mipmapCount+y]),a[g].format=d.format,a[g].width=d.width,a[g].height=d.height}else o.image.width=d.width,o.image.height=d.height,o.mipmaps=d.mipmaps;d.mipmapCount===1&&(o.minFilter=It),o.format=d.format,o.needsUpdate=!0,t&&t(o)},n,r);return o}});function _h(e){tt.call(this,e)}_h.prototype=Object.assign(Object.create(tt.prototype),{constructor:_h,load:function(e,t,n,r){var i=this,a=new oi,o=new bn(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,function(s){var c=i.parse(s);c&&(c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Vt,a.wrapT=c.wrapT!==void 0?c.wrapT:Vt,a.magFilter=c.magFilter!==void 0?c.magFilter:It,a.minFilter=c.minFilter!==void 0?c.minFilter:It,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=ro),c.mipmapCount===1&&(a.minFilter=It),a.needsUpdate=!0,t&&t(a,c))},n,r),a}});function Ra(e){tt.call(this,e)}Ra.prototype=Object.assign(Object.create(tt.prototype),{constructor:Ra,load:function(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Pi.get(e);if(a!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.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),Pi.add(e,this),t&&t(this),i.manager.itemEnd(e)}function c(l){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),r&&r(l),i.manager.itemError(e),i.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}});function Xl(e){tt.call(this,e)}Xl.prototype=Object.assign(Object.create(tt.prototype),{constructor:Xl,load:function(e,t,n,r){var i=new ar,a=new Ra(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(l){a.load(e[l],function(u){i.images[l]=u,o++,o===6&&(i.needsUpdate=!0,t&&t(i))},void 0,r)}for(var c=0;c<e.length;++c)s(c);return i}});function jl(e){tt.call(this,e)}jl.prototype=Object.assign(Object.create(tt.prototype),{constructor:jl,load:function(e,t,n,r){var i=new ot,a=new Ra(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){i.image=o;var s=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;i.format=s?xr:on,i.needsUpdate=!0,t!==void 0&&t(i)},n,r),i}});function Le(){this.type="Curve",this.arcLengthDivisions=200}Object.assign(Le.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){e===void 0&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){e===void 0&&(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(e===void 0&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t=[],n,r=this.getPoint(0),i,a=0;for(t.push(0),i=1;i<=e;i++)n=this.getPoint(i/e),a+=n.distanceTo(r),t.push(a),r=n;return this.cacheArcLengths=t,t},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n=this.getLengths(),r=0,i=n.length,a;t?a=t:a=e*n[i-1];for(var o=0,s=i-1,c;o<=s;)if(r=Math.floor(o+(s-o)/2),c=n[r]-a,c<0)o=r+1;else if(c>0)s=r-1;else{s=r;break}if(r=s,n[r]===a)return r/(i-1);var l=n[r],u=n[r+1],h=u-l,f=(a-l)/h,d=(r+f)/(i-1);return d},getTangent:function(e,t){var n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);var a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new X:new E);return s.copy(o).sub(a).normalize(),s},getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){var n=new E,r=[],i=[],a=[],o=new E,s=new We,c,l,u;for(c=0;c<=e;c++)l=c/e,r[c]=this.getTangentAt(l,new E),r[c].normalize();i[0]=new E,a[0]=new E;var h=Number.MAX_VALUE,f=Math.abs(r[0].x),d=Math.abs(r[0].y),m=Math.abs(r[0].z);for(f<=h&&(h=f,n.set(1,0,0)),d<=h&&(h=d,n.set(0,1,0)),m<=h&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]),c=1;c<=e;c++)i[c]=i[c-1].clone(),a[c]=a[c-1].clone(),o.crossVectors(r[c-1],r[c]),o.length()>Number.EPSILON&&(o.normalize(),u=Math.acos(ke.clamp(r[c-1].dot(r[c]),-1,1)),i[c].applyMatrix4(s.makeRotationAxis(o,u))),a[c].crossVectors(r[c],i[c]);if(t===!0)for(u=Math.acos(ke.clamp(i[0].dot(i[e]),-1,1)),u/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(u=-u),c=1;c<=e;c++)i[c].applyMatrix4(s.makeRotationAxis(r[c],u*c)),a[c].crossVectors(r[c],i[c]);return{tangents:r,normals:i,binormals:a}},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}});function rn(e,t,n,r,i,a,o,s){Le.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}rn.prototype=Object.create(Le.prototype),rn.prototype.constructor=rn,rn.prototype.isEllipseCurve=!0,rn.prototype.getPoint=function(e,t){for(var n=t||new X,r=Math.PI*2,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(a?i=0:i=r),this.aClockwise===!0&&!a&&(i===r?i=-r:i=i-r);var o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){var l=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,f=c-this.aY;s=h*l-f*u+this.aX,c=h*u+f*l+this.aY}return n.set(s,c)},rn.prototype.copy=function(e){return Le.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},rn.prototype.toJSON=function(){var e=Le.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},rn.prototype.fromJSON=function(e){return Le.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};function Oa(e,t,n,r,i,a){rn.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}Oa.prototype=Object.create(rn.prototype),Oa.prototype.constructor=Oa,Oa.prototype.isArcCurve=!0;function ql(){var e=0,t=0,n=0,r=0;function i(a,o,s,c){e=a,t=s,n=-3*a+3*o-2*s-c,r=2*a-2*o+s+c}return{initCatmullRom:function(a,o,s,c,l){i(o,s,l*(s-a),l*(c-o))},initNonuniformCatmullRom:function(a,o,s,c,l,u,h){var f=(o-a)/l-(s-a)/(l+u)+(s-o)/u,d=(s-o)/u-(c-o)/(u+h)+(c-s)/h;f*=u,d*=u,i(o,s,f,d)},calc:function(a){var o=a*a,s=o*a;return e+t*a+n*o+r*s}}}var vs=new E,Yl=new ql,Zl=new ql,Jl=new ql;function Jt(e,t,n,r){Le.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}Jt.prototype=Object.create(Le.prototype),Jt.prototype.constructor=Jt,Jt.prototype.isCatmullRomCurve3=!0,Jt.prototype.getPoint=function(e,t){var n=t||new E,r=this.points,i=r.length,a=(i-(this.closed?0:1))*e,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:s===0&&o===i-1&&(o=i-2,s=1);var c,l,u,h;if(this.closed||o>0?c=r[(o-1)%i]:(vs.subVectors(r[0],r[1]).add(r[0]),c=vs),l=r[o%i],u=r[(o+1)%i],this.closed||o+2<i?h=r[(o+2)%i]:(vs.subVectors(r[i-1],r[i-2]).add(r[i-1]),h=vs),this.curveType==="centripetal"||this.curveType==="chordal"){var f=this.curveType==="chordal"?.5:.25,d=Math.pow(c.distanceToSquared(l),f),m=Math.pow(l.distanceToSquared(u),f),g=Math.pow(u.distanceToSquared(h),f);m<1e-4&&(m=1),d<1e-4&&(d=m),g<1e-4&&(g=m),Yl.initNonuniformCatmullRom(c.x,l.x,u.x,h.x,d,m,g),Zl.initNonuniformCatmullRom(c.y,l.y,u.y,h.y,d,m,g),Jl.initNonuniformCatmullRom(c.z,l.z,u.z,h.z,d,m,g)}else this.curveType==="catmullrom"&&(Yl.initCatmullRom(c.x,l.x,u.x,h.x,this.tension),Zl.initCatmullRom(c.y,l.y,u.y,h.y,this.tension),Jl.initCatmullRom(c.z,l.z,u.z,h.z,this.tension));return n.set(Yl.calc(s),Zl.calc(s),Jl.calc(s)),n},Jt.prototype.copy=function(e){Le.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Jt.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Jt.prototype.fromJSON=function(e){Le.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(new E().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this};function bh(e,t,n,r,i){var a=(r-t)*.5,o=(i-n)*.5,s=e*e,c=e*s;return(2*n-2*r+a+o)*c+(-3*n+3*r-2*a-o)*s+a*e+n}function jy(e,t){var n=1-e;return n*n*t}function qy(e,t){return 2*(1-e)*e*t}function Yy(e,t){return e*e*t}function Da(e,t,n,r){return jy(e,t)+qy(e,n)+Yy(e,r)}function Zy(e,t){var n=1-e;return n*n*n*t}function Jy(e,t){var n=1-e;return 3*n*n*e*t}function Qy(e,t){return 3*(1-e)*e*e*t}function Ky(e,t){return e*e*e*t}function Ia(e,t,n,r,i){return Zy(e,t)+Jy(e,n)+Qy(e,r)+Ky(e,i)}function wn(e,t,n,r){Le.call(this),this.type="CubicBezierCurve",this.v0=e||new X,this.v1=t||new X,this.v2=n||new X,this.v3=r||new X}wn.prototype=Object.create(Le.prototype),wn.prototype.constructor=wn,wn.prototype.isCubicBezierCurve=!0,wn.prototype.getPoint=function(e,t){var n=t||new X,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Ia(e,r.x,i.x,a.x,o.x),Ia(e,r.y,i.y,a.y,o.y)),n},wn.prototype.copy=function(e){return Le.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},wn.prototype.toJSON=function(){var e=Le.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},wn.prototype.fromJSON=function(e){return Le.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};function Hn(e,t,n,r){Le.call(this),this.type="CubicBezierCurve3",this.v0=e||new E,this.v1=t||new E,this.v2=n||new E,this.v3=r||new E}Hn.prototype=Object.create(Le.prototype),Hn.prototype.constructor=Hn,Hn.prototype.isCubicBezierCurve3=!0,Hn.prototype.getPoint=function(e,t){var n=t||new E,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Ia(e,r.x,i.x,a.x,o.x),Ia(e,r.y,i.y,a.y,o.y),Ia(e,r.z,i.z,a.z,o.z)),n},Hn.prototype.copy=function(e){return Le.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},Hn.prototype.toJSON=function(){var e=Le.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},Hn.prototype.fromJSON=function(e){return Le.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};function Qt(e,t){Le.call(this),this.type="LineCurve",this.v1=e||new X,this.v2=t||new X}Qt.prototype=Object.create(Le.prototype),Qt.prototype.constructor=Qt,Qt.prototype.isLineCurve=!0,Qt.prototype.getPoint=function(e,t){var n=t||new X;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Qt.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Qt.prototype.getTangent=function(e,t){var n=t||new X,n=n.copy(this.v2).sub(this.v1).normalize();return n},Qt.prototype.copy=function(e){return Le.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Qt.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Qt.prototype.fromJSON=function(e){return Le.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this};function Mn(e,t){Le.call(this),this.type="LineCurve3",this.v1=e||new E,this.v2=t||new E}Mn.prototype=Object.create(Le.prototype),Mn.prototype.constructor=Mn,Mn.prototype.isLineCurve3=!0,Mn.prototype.getPoint=function(e,t){var n=t||new E;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Mn.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Mn.prototype.copy=function(e){return Le.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Mn.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Mn.prototype.fromJSON=function(e){return Le.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this};function En(e,t,n){Le.call(this),this.type="QuadraticBezierCurve",this.v0=e||new X,this.v1=t||new X,this.v2=n||new X}En.prototype=Object.create(Le.prototype),En.prototype.constructor=En,En.prototype.isQuadraticBezierCurve=!0,En.prototype.getPoint=function(e,t){var n=t||new X,r=this.v0,i=this.v1,a=this.v2;return n.set(Da(e,r.x,i.x,a.x),Da(e,r.y,i.y,a.y)),n},En.prototype.copy=function(e){return Le.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},En.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},En.prototype.fromJSON=function(e){return Le.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this};function Vn(e,t,n){Le.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new E,this.v1=t||new E,this.v2=n||new E}Vn.prototype=Object.create(Le.prototype),Vn.prototype.constructor=Vn,Vn.prototype.isQuadraticBezierCurve3=!0,Vn.prototype.getPoint=function(e,t){var n=t||new E,r=this.v0,i=this.v1,a=this.v2;return n.set(Da(e,r.x,i.x,a.x),Da(e,r.y,i.y,a.y),Da(e,r.z,i.z,a.z)),n},Vn.prototype.copy=function(e){return Le.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Vn.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Vn.prototype.fromJSON=function(e){return Le.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this};function Tn(e){Le.call(this),this.type="SplineCurve",this.points=e||[]}Tn.prototype=Object.create(Le.prototype),Tn.prototype.constructor=Tn,Tn.prototype.isSplineCurve=!0,Tn.prototype.getPoint=function(e,t){var n=t||new X,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[a===0?a:a-1],c=r[a],l=r[a>r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(bh(o,s.x,c.x,l.x,u.x),bh(o,s.y,c.y,l.y,u.y)),n},Tn.prototype.copy=function(e){Le.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},Tn.prototype.toJSON=function(){var e=Le.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},Tn.prototype.fromJSON=function(e){Le.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(new X().fromArray(r))}return this};var Ql=Object.freeze({__proto__:null,ArcCurve:Oa,CatmullRomCurve3:Jt,CubicBezierCurve:wn,CubicBezierCurve3:Hn,EllipseCurve:rn,LineCurve:Qt,LineCurve3:Mn,QuadraticBezierCurve:En,QuadraticBezierCurve3:Vn,SplineCurve:Tn});function fr(){Le.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}fr.prototype=Object.assign(Object.create(Le.prototype),{constructor:fr,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 Qt(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=o===0?0:1-i/o;return a.getPointAt(s)}r++}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,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){e===void 0&&(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,r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?e*2: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];n&&n.equals(l)||(t.push(l),n=l)}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t},copy:function(e){Le.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=Le.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){Le.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(new Ql[r.type]().fromJSON(r))}return this}});function Sn(e){fr.call(this),this.type="Path",this.currentPoint=new X,e&&this.setFromPoints(e)}Sn.prototype=Object.assign(Object.create(fr.prototype),{constructor:Sn,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 Qt(this.currentPoint.clone(),new X(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,r){var i=new En(this.currentPoint.clone(),new X(e,t),new X(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(e,t,n,r,i,a){var o=new wn(this.currentPoint.clone(),new X(e,t),new X(n,r),new X(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this},splineThru:function(e){var t=[this.currentPoint.clone()].concat(e),n=new Tn(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this},absarc:function(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this},ellipse:function(e,t,n,r,i,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(e+c,t+l,n,r,i,a,o,s),this},absellipse:function(e,t,n,r,i,a,o,s){var c=new rn(e,t,n,r,i,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 u=c.getPoint(1);return this.currentPoint.copy(u),this},copy:function(e){return fr.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=fr.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return fr.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}});function Cr(e){Sn.call(this,e),this.uuid=ke.generateUUID(),this.type="Shape",this.holes=[]}Cr.prototype=Object.assign(Object.create(Sn.prototype),{constructor:Cr,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;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){Sn.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Sn.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Sn.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(new Sn().fromJSON(r))}return this}});function lt(e,t){ae.call(this),this.type="Light",this.color=new de(e),this.intensity=t!==void 0?t:1,this.receiveShadow=void 0}lt.prototype=Object.assign(Object.create(ae.prototype),{constructor:lt,isLight:!0,copy:function(e){return ae.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=ae.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}});function Kl(e,t,n){lt.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(ae.DefaultUp),this.updateMatrix(),this.groundColor=new de(t)}Kl.prototype=Object.assign(Object.create(lt.prototype),{constructor:Kl,isHemisphereLight:!0,copy:function(e){return lt.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}});function kn(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new X(512,512),this.map=null,this.mapPass=null,this.matrix=new We,this._frustum=new aa,this._frameExtents=new X(1,1),this._viewportCount=1,this._viewports=[new et(0,0,1,1)]}Object.assign(kn.prototype,{_projScreenMatrix:new We,_lightPositionWorld:new E,_lookTarget:new E,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),i.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(i),t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),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 this.bias!==0&&(e.bias=this.bias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}});function $l(){kn.call(this,new Et(50,1,.5,500))}$l.prototype=Object.assign(Object.create(kn.prototype),{constructor:$l,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=ke.RAD2DEG*2*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;(n!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),kn.prototype.updateMatrices.call(this,e)}});function ec(e,t,n,r,i,a){lt.call(this,e,t),this.type="SpotLight",this.position.copy(ae.DefaultUp),this.updateMatrix(),this.target=new ae,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(o){this.intensity=o/Math.PI}}),this.distance=n!==void 0?n:0,this.angle=r!==void 0?r:Math.PI/3,this.penumbra=i!==void 0?i:0,this.decay=a!==void 0?a:1,this.shadow=new $l}ec.prototype=Object.assign(Object.create(lt.prototype),{constructor:ec,isSpotLight:!0,copy:function(e){return lt.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}});function tc(){kn.call(this,new Et(90,1,.5,500)),this._frameExtents=new X(4,2),this._viewportCount=6,this._viewports=[new et(2,1,1,1),new et(0,1,1,1),new et(3,1,1,1),new et(1,1,1,1),new et(3,0,1,1),new et(1,0,1,1)],this._cubeDirections=[new E(1,0,0),new E(-1,0,0),new E(0,0,1),new E(0,0,-1),new E(0,1,0),new E(0,-1,0)],this._cubeUps=[new E(0,1,0),new E(0,1,0),new E(0,1,0),new E(0,1,0),new E(0,0,1),new E(0,0,-1)]}tc.prototype=Object.assign(Object.create(kn.prototype),{constructor:tc,isPointLightShadow:!0,updateMatrices:function(e,t){t===void 0&&(t=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;i.setFromMatrixPosition(e.matrixWorld),n.position.copy(i),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}});function nc(e,t,n,r){lt.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return this.intensity*4*Math.PI},set:function(i){this.intensity=i/(4*Math.PI)}}),this.distance=n!==void 0?n:0,this.decay=r!==void 0?r:1,this.shadow=new tc}nc.prototype=Object.assign(Object.create(lt.prototype),{constructor:nc,isPointLight:!0,copy:function(e){return lt.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}});function Na(e,t,n,r,i,a){Bn.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e!==void 0?e:-1,this.right=t!==void 0?t:1,this.top=n!==void 0?n:1,this.bottom=r!==void 0?r:-1,this.near=i!==void 0?i:.1,this.far=a!==void 0?a:2e3,this.updateProjectionMatrix()}Na.prototype=Object.assign(Object.create(Bn.prototype),{constructor:Na,isOrthographicCamera:!0,copy:function(e,t){return Bn.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=e.view===null?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){this.view!==null&&(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,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(this.view!==null&&this.view.enabled){var c=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=c*this.view.offsetX,a=i+c*this.view.width,o-=l*this.view.offsetY,s=o-l*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=ae.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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}});function rc(){kn.call(this,new Na(-5,5,5,-5,.5,500))}rc.prototype=Object.assign(Object.create(kn.prototype),{constructor:rc,isDirectionalLightShadow:!0,updateMatrices:function(e){kn.prototype.updateMatrices.call(this,e)}});function ic(e,t){lt.call(this,e,t),this.type="DirectionalLight",this.position.copy(ae.DefaultUp),this.updateMatrix(),this.target=new ae,this.shadow=new rc}ic.prototype=Object.assign(Object.create(lt.prototype),{constructor:ic,isDirectionalLight:!0,copy:function(e){return lt.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}});function ac(e,t){lt.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}ac.prototype=Object.assign(Object.create(lt.prototype),{constructor:ac,isAmbientLight:!0});function oc(e,t,n,r){lt.call(this,e,t),this.type="RectAreaLight",this.width=n!==void 0?n:10,this.height=r!==void 0?r:10}oc.prototype=Object.assign(Object.create(lt.prototype),{constructor:oc,isRectAreaLight:!0,copy:function(e){return lt.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=lt.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}});function sc(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new E)}Object.assign(sc.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,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],1.092548*(n*r)),t.addScaledVector(a[5],1.092548*(r*i)),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],1.092548*(n*i)),t.addScaledVector(a[8],.546274*(n*n-r*r)),t},getIrradianceAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],2*.511664*r),t.addScaledVector(a[2],2*.511664*i),t.addScaledVector(a[3],2*.511664*n),t.addScaledVector(a[4],2*.429043*n*r),t.addScaledVector(a[5],2*.429043*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],2*.429043*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},addScaledSH:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],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){t===void 0&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+r*3);return this},toArray:function(e,t){e===void 0&&(e=[]),t===void 0&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+r*3);return e}}),Object.assign(sc,{getBasisAt:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}});function pn(e,t){lt.call(this,void 0,t),this.type="LightProbe",this.sh=e!==void 0?e:new sc}pn.prototype=Object.assign(Object.create(lt.prototype),{constructor:pn,isLightProbe:!0,copy:function(e){return lt.prototype.copy.call(this,e),this.sh.copy(e.sh),this},fromJSON:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this},toJSON:function(e){var t=lt.prototype.toJSON.call(this,e);return t.object.sh=this.sh.toArray(),t}});function lc(e){tt.call(this,e),this.textures={}}lc.prototype=Object.assign(Object.create(tt.prototype),{constructor:lc,load:function(e,t,n,r){var i=this,a=new bn(i.manager);a.setPath(i.path),a.load(e,function(o){try{t(i.parse(JSON.parse(o)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}},n,r)},parse:function(e){var t=this.textures;function n(c){return t[c]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",c),t[c]}var r=new Vy[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new de().setHex(e.sheen)),e.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.skinning!==void 0&&(r.skinning=e.skinning),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(var i in e.uniforms){var a=e.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=new de().setHex(a.value);break;case"v2":r.uniforms[i].value=new X().fromArray(a.value);break;case"v3":r.uniforms[i].value=new E().fromArray(a.value);break;case"v4":r.uniforms[i].value=new et().fromArray(a.value);break;case"m3":r.uniforms[i].value=new Ut().fromArray(a.value);case"m4":r.uniforms[i].value=new We().fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(var o in e.extensions)r.extensions[o]=e.extensions[o];if(e.shading!==void 0&&(r.flatShading=e.shading===1),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=n(e.map)),e.matcap!==void 0&&(r.matcap=n(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){var s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new X().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=n(e.specularMap)),e.envMap!==void 0&&(r.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new X().fromArray(e.clearcoatNormalScale)),r},setTextures:function(e){return this.textures=e,this}});var wh={decodeText:function(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(i){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}};function ms(){ve.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}ms.prototype=Object.assign(Object.create(ve.prototype),{constructor:ms,isInstancedBufferGeometry:!0,copy:function(e){return ve.prototype.copy.call(this,e),this.instanceCount=e.instanceCount,this},clone:function(){return new this.constructor().copy(this)},toJSON:function(){var e=ve.prototype.toJSON.call(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}});function cc(e,t,n,r){typeof n=="number"&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),De.call(this,e,t,n),this.meshPerAttribute=r||1}cc.prototype=Object.assign(Object.create(De.prototype),{constructor:cc,isInstancedBufferAttribute:!0,copy:function(e){return De.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=De.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}});function uc(e){tt.call(this,e)}uc.prototype=Object.assign(Object.create(tt.prototype),{constructor:uc,load:function(e,t,n,r){var i=this,a=new bn(i.manager);a.setPath(i.path),a.load(e,function(o){try{t(i.parse(JSON.parse(o)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}},n,r)},parse:function(e){var t=e.isInstancedBufferGeometry?new ms:new ve,n=e.data.index;if(n!==void 0){var r=new hc[n.type](n.array);t.setIndex(new De(r,1))}var i=e.data.attributes;for(var a in i){var o=i[a],r=new hc[o.type](o.array),s=o.isInstancedBufferAttribute?cc:De,c=new s(r,o.itemSize,o.normalized);o.name!==void 0&&(c.name=o.name),t.setAttribute(a,c)}var l=e.data.morphAttributes;if(l)for(var a in l){for(var u=l[a],h=[],f=0,d=u.length;f<d;f++){var o=u[f],r=new hc[o.type](o.array),c=new De(r,o.itemSize,o.normalized);o.name!==void 0&&(c.name=o.name),h.push(c)}t.morphAttributes[a]=h}var m=e.data.morphTargetsRelative;m&&(t.morphTargetsRelative=!0);var g=e.data.groups||e.data.drawcalls||e.data.offsets;if(g!==void 0)for(var f=0,y=g.length;f!==y;++f){var p=g[f];t.addGroup(p.start,p.count,p.materialIndex)}var v=e.data.boundingSphere;if(v!==void 0){var _=new E;v.center!==void 0&&_.fromArray(v.center),t.boundingSphere=new Dn(_,v.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var hc={Int8Array,Uint8Array,Uint8ClampedArray:typeof Uint8ClampedArray!="undefined"?Uint8ClampedArray:Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function fc(e){tt.call(this,e)}fc.prototype=Object.assign(Object.create(tt.prototype),{constructor:fc,load:function(e,t,n,r){var i=this,a=this.path===""?wh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new bn(i.manager);o.setPath(this.path),o.load(e,function(s){var c=null;try{c=JSON.parse(s)}catch(u){r!==void 0&&r(u),console.error("THREE:ObjectLoader: Can't parse "+e+".",u.message);return}var l=c.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}i.parse(c,t)},n,r)},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,function(){t!==void 0&&t(s)}),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(s),s},parseShape:function(e){var t={};if(e!==void 0)for(var n=0,r=e.length;n<r;n++){var i=new Cr().fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(e!==void 0)for(var r=new uc,i=0,a=e.length;i<a;i++){var o,s=e[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new zt[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new zt[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new zt[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new zt[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 zt[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new zt[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 zt[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new zt[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new zt[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new zt[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new zt[s.type](new Ql[s.path.type]().fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new zt[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new zt[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var h=[],c=0,l=s.shapes.length;c<l;c++){var u=t[s.shapes[c]];h.push(u)}o=new zt[s.type](h,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(var h=[],c=0,l=s.shapes.length;c<l;c++){var u=t[s.shapes[c]];h.push(u)}var f=s.options.extrudePath;f!==void 0&&(s.options.extrudePath=new Ql[f.type]().fromJSON(f)),o=new zt[s.type](h,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,s.name!==void 0&&(o.name=s.name),o.isBufferGeometry===!0&&s.userData!==void 0&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},r={};if(e!==void 0){var i=new lc;i.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if(s.type==="MultiMaterial"){for(var c=[],l=0;l<s.materials.length;l++){var u=s.materials[l];n[u.uuid]===void 0&&(n[u.uuid]=i.parse(u)),c.push(n[u.uuid])}r[s.uuid]=c}else n[s.uuid]===void 0&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=fn.parse(r);r.uuid!==void 0&&(i.uuid=r.uuid),t.push(i)}return t},parseImages:function(e,t){var n=this,r={};function i(g){return n.manager.itemStart(g),o.load(g,function(){n.manager.itemEnd(g)},void 0,function(){n.manager.itemError(g),n.manager.itemEnd(g)})}if(e!==void 0&&e.length>0){var a=new gh(t),o=new Ra(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,c=e.length;s<c;s++){var l=e[s],u=l.url;if(Array.isArray(u)){r[l.uuid]=[];for(var h=0,f=u.length;h<f;h++){var d=u[h],m=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;r[l.uuid].push(i(m))}}else{var m=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url;r[l.uuid]=i(m)}}}return r},parseTextures:function(e,t){function n(c,l){return typeof c=="number"?c:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",c),l[c])}var r={};if(e!==void 0)for(var i=0,a=e.length;i<a;i++){var o=e[i];o.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),t[o.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var s;Array.isArray(t[o.image])?s=new ar(t[o.image]):s=new ot(t[o.image]),s.needsUpdate=!0,s.uuid=o.uuid,o.name!==void 0&&(s.name=o.name),o.mapping!==void 0&&(s.mapping=n(o.mapping,$y)),o.offset!==void 0&&s.offset.fromArray(o.offset),o.repeat!==void 0&&s.repeat.fromArray(o.repeat),o.center!==void 0&&s.center.fromArray(o.center),o.rotation!==void 0&&(s.rotation=o.rotation),o.wrap!==void 0&&(s.wrapS=n(o.wrap[0],Mh),s.wrapT=n(o.wrap[1],Mh)),o.format!==void 0&&(s.format=o.format),o.type!==void 0&&(s.type=o.type),o.encoding!==void 0&&(s.encoding=o.encoding),o.minFilter!==void 0&&(s.minFilter=n(o.minFilter,Eh)),o.magFilter!==void 0&&(s.magFilter=n(o.magFilter,Eh)),o.anisotropy!==void 0&&(s.anisotropy=o.anisotropy),o.flipY!==void 0&&(s.flipY=o.flipY),o.premultiplyAlpha!==void 0&&(s.premultiplyAlpha=o.premultiplyAlpha),o.unpackAlignment!==void 0&&(s.unpackAlignment=o.unpackAlignment),r[o.uuid]=s}return r},parseObject:function(e,t,n){var r;function i(y){return t[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",y),t[y]}function a(y){if(y!==void 0){if(Array.isArray(y)){for(var p=[],v=0,_=y.length;v<_;v++){var x=y[v];n[x]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",x),p.push(n[x])}return p}return n[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",y),n[y]}}switch(e.type){case"Scene":r=new Ji,e.background!==void 0&&Number.isInteger(e.background)&&(r.background=new de(e.background)),e.fog!==void 0&&(e.fog.type==="Fog"?r.fog=new Al(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(r.fog=new Sl(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new Et(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(r.focus=e.focus),e.zoom!==void 0&&(r.zoom=e.zoom),e.filmGauge!==void 0&&(r.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(r.filmOffset=e.filmOffset),e.view!==void 0&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new Na(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(r.zoom=e.zoom),e.view!==void 0&&(r.view=Object.assign({},e.view));break;case"AmbientLight":r=new ac(e.color,e.intensity);break;case"DirectionalLight":r=new ic(e.color,e.intensity);break;case"PointLight":r=new nc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new oc(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new ec(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new Kl(e.color,e.groundColor,e.intensity);break;case"LightProbe":r=new pn().fromJSON(e);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=i(e.geometry),s=a(e.material);r=new ut(o,s);break;case"InstancedMesh":var o=i(e.geometry),s=a(e.material),c=e.count,l=e.instanceMatrix;r=new Ol(o,s,c),r.instanceMatrix=new De(new Float32Array(l.array),16);break;case"LOD":r=new Fo;break;case"Line":r=new tn(i(e.geometry),a(e.material),e.mode);break;case"LineLoop":r=new Dl(i(e.geometry),a(e.material));break;case"LineSegments":r=new Mt(i(e.geometry),a(e.material));break;case"PointCloud":case"Points":r=new Nl(i(e.geometry),a(e.material));break;case"Sprite":r=new Pl(a(e.material));break;case"Group":r=new ua;break;default:r=new ae}if(r.uuid=e.uuid,e.name!==void 0&&(r.name=e.name),e.matrix!==void 0?(r.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(e.position!==void 0&&r.position.fromArray(e.position),e.rotation!==void 0&&r.rotation.fromArray(e.rotation),e.quaternion!==void 0&&r.quaternion.fromArray(e.quaternion),e.scale!==void 0&&r.scale.fromArray(e.scale)),e.castShadow!==void 0&&(r.castShadow=e.castShadow),e.receiveShadow!==void 0&&(r.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(r.shadow.bias=e.shadow.bias),e.shadow.radius!==void 0&&(r.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&r.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(r.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(r.visible=e.visible),e.frustumCulled!==void 0&&(r.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(r.renderOrder=e.renderOrder),e.userData!==void 0&&(r.userData=e.userData),e.layers!==void 0&&(r.layers.mask=e.layers),e.children!==void 0)for(var u=e.children,h=0;h<u.length;h++)r.add(this.parseObject(u[h],t,n));if(e.type==="LOD"){e.autoUpdate!==void 0&&(r.autoUpdate=e.autoUpdate);for(var f=e.levels,d=0;d<f.length;d++){var m=f[d],g=r.getObjectByProperty("uuid",m.object);g!==void 0&&r.addLevel(g,m.distance)}}return r}});var $y={UVMapping:Us,CubeReflectionMapping:zs,CubeRefractionMapping:Gs,EquirectangularReflectionMapping:Yc,EquirectangularRefractionMapping:Hs,SphericalReflectionMapping:Zc,CubeUVReflectionMapping:ki,CubeUVRefractionMapping:Vs},Mh={RepeatWrapping:to,ClampToEdgeWrapping:Vt,MirroredRepeatWrapping:no},Eh={NearestFilter:_t,NearestMipmapNearestFilter:ks,NearestMipmapLinearFilter:Ws,LinearFilter:It,LinearMipmapNearestFilter:Jc,LinearMipmapLinearFilter:ro};function Th(e){typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),tt.call(this,e),this.options=void 0}Th.prototype=Object.assign(Object.create(tt.prototype),{constructor:Th,setOptions:function(t){return this.options=t,this},load:function(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Pi.get(e);if(a!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;fetch(e).then(function(o){return o.blob()}).then(function(o){return i.options===void 0?createImageBitmap(o):createImageBitmap(o,i.options)}).then(function(o){Pi.add(e,o),t&&t(o),i.manager.itemEnd(e)}).catch(function(o){r&&r(o),i.manager.itemError(e),i.manager.itemEnd(e)}),i.manager.itemStart(e)}});function Sh(){this.type="ShapePath",this.color=new de,this.subPaths=[],this.currentPath=null}Object.assign(Sh.prototype,{moveTo:function(e,t){return this.currentPath=new Sn,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,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this},bezierCurveTo:function(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(D){for(var z=[],k=0,q=D.length;k<q;k++){var Z=D[k],ee=new Cr;ee.curves=Z.curves,z.push(ee)}return z}function r(D,z){for(var k=z.length,q=!1,Z=k-1,ee=0;ee<k;Z=ee++){var te=z[Z],oe=z[ee],Pe=oe.x-te.x,be=oe.y-te.y;if(Math.abs(be)>Number.EPSILON){if(be<0&&(te=z[ee],Pe=-Pe,oe=z[Z],be=-be),D.y<te.y||D.y>oe.y)continue;if(D.y===te.y){if(D.x===te.x)return!0}else{var re=be*(D.x-te.x)-Pe*(D.y-te.y);if(re===0)return!0;if(re<0)continue;q=!q}}else{if(D.y!==te.y)continue;if(oe.x<=D.x&&D.x<=te.x||te.x<=D.x&&D.x<=oe.x)return!0}}return q}var i=cr.isClockWise,a=this.subPaths;if(a.length===0)return[];if(t===!0)return n(a);var o,s,c,l=[];if(a.length===1)return s=a[0],c=new Cr,c.curves=s.curves,l.push(c),l;var u=!i(a[0].getPoints());u=e?!u:u;var h=[],f=[],d=[],m=0,g;f[m]=void 0,d[m]=[];for(var y=0,p=a.length;y<p;y++)s=a[y],g=s.getPoints(),o=i(g),o=e?!o:o,o?(!u&&f[m]&&m++,f[m]={s:new Cr,p:g},f[m].s.curves=s.curves,u&&m++,d[m]=[]):d[m].push({h:s,p:g[0]});if(!f[0])return n(a);if(f.length>1){for(var v=!1,_=[],x=0,b=f.length;x<b;x++)h[x]=[];for(var x=0,b=f.length;x<b;x++)for(var T=d[x],C=0;C<T.length;C++){for(var N=T[C],O=!0,J=0;J<f.length;J++)r(N.p,f[J].p)&&(x!==J&&_.push({froms:x,tos:J,hole:C}),O?(O=!1,h[J].push(N)):v=!0);O&&h[x].push(N)}_.length>0&&(v||(d=h))}for(var F,y=0,B=f.length;y<B;y++){c=f[y].s,l.push(c),F=d[y];for(var V=0,Y=F.length;V<Y;V++)c.holes.push(F[V].h)}return l}});function Ah(e){this.type="Font",this.data=e}Object.assign(Ah.prototype,{isFont:!0,generateShapes:function(e,t){t===void 0&&(t=100);for(var n=[],r=e0(e,t,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}});function e0(e,t,n){for(var r=Array.from?Array.from(e):String(e).split(""),i=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,c=0,l=0;l<r.length;l++){var u=r[l];if(u===`
3113
+ `)s=0,c-=a;else{var h=t0(u,i,s,c,n);s+=h.offsetX,o.push(h.path)}}return o}function t0(e,t,n,r,i){var a=i.glyphs[e]||i.glyphs["?"];if(!a){console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".");return}var o=new Sh,s,c,l,u,h,f,d,m;if(a.o)for(var g=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),y=0,p=g.length;y<p;){var v=g[y++];switch(v){case"m":s=g[y++]*t+n,c=g[y++]*t+r,o.moveTo(s,c);break;case"l":s=g[y++]*t+n,c=g[y++]*t+r,o.lineTo(s,c);break;case"q":l=g[y++]*t+n,u=g[y++]*t+r,h=g[y++]*t+n,f=g[y++]*t+r,o.quadraticCurveTo(h,f,l,u);break;case"b":l=g[y++]*t+n,u=g[y++]*t+r,h=g[y++]*t+n,f=g[y++]*t+r,d=g[y++]*t+n,m=g[y++]*t+r,o.bezierCurveTo(h,f,d,m,l,u);break}}return{offsetX:a.ha*t,path:o}}function Lh(e){tt.call(this,e)}Lh.prototype=Object.assign(Object.create(tt.prototype),{constructor:Lh,load:function(e,t,n,r){var i=this,a=new bn(this.manager);a.setPath(this.path),a.load(e,function(o){var s;try{s=JSON.parse(o)}catch(l){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),s=JSON.parse(o.substring(65,o.length-2))}var c=i.parse(s);t&&t(c)},n,r)},parse:function(e){return new Ah(e)}});var gs,Ph={getContext:function(){return gs===void 0&&(gs=new(window.AudioContext||window.webkitAudioContext)),gs},setContext:function(e){gs=e}};function dc(e){tt.call(this,e)}dc.prototype=Object.assign(Object.create(tt.prototype),{constructor:dc,load:function(e,t,n,r){var i=this,a=new bn(i.manager);a.setResponseType("arraybuffer"),a.setPath(i.path),a.load(e,function(o){try{var s=o.slice(0),c=Ph.getContext();c.decodeAudioData(s,function(l){t(l)})}catch(l){r?r(l):console.error(l),i.manager.itemError(e)}},n,r)}});function Ch(e,t,n){pn.call(this,void 0,n);var r=new de().set(e),i=new de().set(t),a=new E(r.r,r.g,r.b),o=new E(i.r,i.g,i.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)}Ch.prototype=Object.assign(Object.create(pn.prototype),{constructor:Ch,isHemisphereLightProbe:!0,copy:function(e){return pn.prototype.copy.call(this,e),this},toJSON:function(e){var t=pn.prototype.toJSON.call(this,e);return t}});function Rh(e,t){pn.call(this,void 0,t);var n=new de().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}Rh.prototype=Object.assign(Object.create(pn.prototype),{constructor:Rh,isAmbientLightProbe:!0,copy:function(e){return pn.prototype.copy.call(this,e),this},toJSON:function(e){var t=pn.prototype.toJSON.call(this,e);return t}});var Oh=new We,Dh=new We;function n0(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Et,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Et,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}}Object.assign(n0.prototype,{update:function(e){var t=this._cache,n=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;if(n){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 r=e.projectionMatrix.clone(),i=t.eyeSep/2,a=i*t.near/t.focus,o=t.near*Math.tan(ke.DEG2RAD*t.fov*.5)/t.zoom,s,c;Dh.elements[12]=-i,Oh.elements[12]=i,s=-o*t.aspect+a,c=o*t.aspect+a,r.elements[0]=2*t.near/(c-s),r.elements[8]=(c+s)/(c-s),this.cameraL.projectionMatrix.copy(r),s=-o*t.aspect-a,c=o*t.aspect-a,r.elements[0]=2*t.near/(c-s),r.elements[8]=(c+s)/(c-s),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Dh),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Oh)}});function Ih(e){this.autoStart=e!==void 0?e:!0,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(Ih.prototype,{start:function(){this.startTime=(typeof performance=="undefined"?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=(typeof performance=="undefined"?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var Rr=new E,Nh=new bt,r0=new E,Or=new E;function Fh(){ae.call(this),this.type="AudioListener",this.context=Ph.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ih}Fh.prototype=Object.assign(Object.create(ae.prototype),{constructor:Fh,getInput:function(){return this.gain},removeFilter:function(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){ae.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Rr,Nh,r0),Or.set(0,0,-1).applyQuaternion(Nh),t.positionX){var r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Rr.x,r),t.positionY.linearRampToValueAtTime(Rr.y,r),t.positionZ.linearRampToValueAtTime(Rr.z,r),t.forwardX.linearRampToValueAtTime(Or.x,r),t.forwardY.linearRampToValueAtTime(Or.y,r),t.forwardZ.linearRampToValueAtTime(Or.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(Rr.x,Rr.y,Rr.z),t.setOrientation(Or.x,Or.y,Or.z,n.x,n.y,n.z)}});function Fa(e){ae.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._progress=0,this.filters=[]}Fa.prototype=Object.assign(Object.create(ae.prototype),{constructor:Fa,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(e===void 0&&(e=0),this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}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._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()},pause:function(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this},stop:function(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this},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=[]),this.isPlaying===!0?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this},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 Dr=new E,Bh=new bt,i0=new E,Ir=new E;function Uh(e){Fa.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}Uh.prototype=Object.assign(Object.create(Fa.prototype),{constructor:Uh,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(ae.prototype.updateMatrixWorld.call(this,e),!(this.hasPlaybackControl===!0&&this.isPlaying===!1)){this.matrixWorld.decompose(Dr,Bh,i0),Ir.set(0,0,1).applyQuaternion(Bh);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Dr.x,n),t.positionY.linearRampToValueAtTime(Dr.y,n),t.positionZ.linearRampToValueAtTime(Dr.z,n),t.orientationX.linearRampToValueAtTime(Ir.x,n),t.orientationY.linearRampToValueAtTime(Ir.y,n),t.orientationZ.linearRampToValueAtTime(Ir.z,n)}else t.setPosition(Dr.x,Dr.y,Dr.z),t.setOrientation(Ir.x,Ir.y,Ir.z)}}});function zh(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t!==void 0?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}Object.assign(zh.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}});function Gh(e,t,n){this.binding=e,this.valueSize=n;var r,i,a;switch(t){case"quaternion":r=this._slerp,i=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:r=this._lerp,i=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}Object.assign(Gh.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(a===0){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{a+=t;var s=t/a;this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},accumulateAdditive:function(e){var t=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){var s=t*this._origIndex;this._mixBufferRegion(n,r,s,1-i,t)}a>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(var c=t,l=t+t;c!==l;++c)if(n[c]!==n[c+t]){o.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var e=this.valueSize*3;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,n=e;n<t;n++)this.buffer[n]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*4+3]=1},_setAdditiveIdentityOther:function(){for(var e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]},_select:function(e,t,n,r,i){if(r>=.5)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){bt.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){var a=this._workIndex*i;bt.multiplyQuaternionsFlat(e,a,e,t,e,n),bt.slerpFlat(e,t,e,t,e,a,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}},_lerpAdditive:function(e,t,n,r,i){for(var a=0;a!==i;++a){var o=t+a;e[o]=e[o]+e[n+a]*r}}});var pc="\\[\\]\\.:\\/",a0=new RegExp("["+pc+"]","g"),vc="[^"+pc+"]",o0="[^"+pc.replace("\\.","")+"]",s0=/((?:WC+[\/:])*)/.source.replace("WC",vc),l0=/(WCOD+)?/.source.replace("WCOD",o0),c0=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",vc),u0=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",vc),h0=new RegExp("^"+s0+l0+c0+u0+"$"),f0=["material","materials","bones"];function Hh(e,t,n){var r=n||Gt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}Object.assign(Hh.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].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()}});function Gt(e,t,n){this.path=t,this.parsedPath=n||Gt.parseTrackName(t),this.node=Gt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}Object.assign(Gt,{Composite:Hh,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Gt.Composite(e,t,n):new Gt(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(a0,"")},parseTrackName:function(e){var t=h0.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]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){var i=n.nodeName.substring(r+1);f0.indexOf(i)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){var r=function(a){for(var o=0;o<a.length;o++){var s=a[o];if(s.name===t||s.uuid===t)return s;var c=r(s.children);if(c)return c}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(Gt.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(t,n){t[n]=this.node[this.propertyName]},function(t,n){for(var r=this.resolvedProperty,i=0,a=r.length;i!==a;++i)t[n++]=r[i]},function(t,n){t[n]=this.resolvedProperty[this.propertyIndex]},function(t,n){this.resolvedProperty.toArray(t,n)}],SetterByBindingTypeAndVersioning:[[function(t,n){this.targetObject[this.propertyName]=t[n]},function(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.needsUpdate=!0},function(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){for(var r=this.resolvedProperty,i=0,a=r.length;i!==a;++i)r[i]=t[n++]},function(t,n){for(var r=this.resolvedProperty,i=0,a=r.length;i!==a;++i)r[i]=t[n++];this.targetObject.needsUpdate=!0},function(t,n){for(var r=this.resolvedProperty,i=0,a=r.length;i!==a;++i)r[i]=t[n++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){this.resolvedProperty[this.propertyIndex]=t[n]},function(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.needsUpdate=!0},function(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){this.resolvedProperty.fromArray(t,n)},function(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.needsUpdate=!0},function(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,n){this.bind(),this.getValue(t,n)},setValue:function(t,n){this.bind(),this.setValue(t,n)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=Gt.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(a!==void 0){if(e[a]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[a]}}var s=e[r];if(s===void 0){var c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}var l=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(i!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[i]!==void 0&&(i=e.morphTargetDictionary[i])}else{console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);return}}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else s.fromArray!==void 0&&s.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Gt.prototype,{_getValue_unbound:Gt.prototype.getValue,_setValue_unbound:Gt.prototype.setValue});function d0(){this.uuid=ke.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 r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}Object.assign(d0.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,c=void 0,l=0,u=arguments.length;l!==u;++l){var h=arguments[l],f=h.uuid,d=r[f];if(d===void 0){d=t++,r[f]=d,e.push(h);for(var m=0,g=s;m!==g;++m)o[m].push(new Gt(h,i[m],a[m]))}else if(d<n){c=e[d];var y=--n,p=e[y];r[p.uuid]=d,e[d]=p,r[f]=y,e[y]=h;for(var m=0,g=s;m!==g;++m){var v=o[m],_=v[y],x=v[d];v[d]=_,x===void 0&&(x=new Gt(h,i[m],a[m])),v[y]=x}}else e[d]!==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,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,l=n[c];if(l!==void 0&&l>=t){var u=t++,h=e[u];n[h.uuid]=l,e[l]=h,n[c]=u,e[u]=s;for(var f=0,d=i;f!==d;++f){var m=r[f],g=m[u],y=m[l];m[l]=g,m[u]=y}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],l=c.uuid,u=r[l];if(u!==void 0)if(delete r[l],u<n){var h=--n,f=e[h],d=--t,m=e[d];r[f.uuid]=u,e[u]=f,r[m.uuid]=h,e[h]=m,e.pop();for(var g=0,y=a;g!==y;++g){var p=i[g],v=p[h],_=p[d];p[u]=v,p[h]=_,p.pop()}}else{var d=--t,m=e[d];r[m.uuid]=u,e[u]=m,e.pop();for(var g=0,y=a;g!==y;++g){var p=i[g];p[u]=p[d],p.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(r!==void 0)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=new Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(var h=l,f=s.length;h!==f;++h){var d=s[h];u[h]=new Gt(d,e,t)}return u},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],c=e[o];t[c]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}});function Vh(e,t,n,r){this._mixer=e,this._clip=t,this._localRoot=n||null,this.blendMode=r||t.blendMode;for(var i=t.tracks,a=i.length,o=new Array(a),s={endingStart:Gr,endingEnd:Gr},c=0;c!==a;++c){var l=i[c].createInterpolant(null);o[c]=l,l.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ap,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}Object.assign(Vh.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&&this.timeScale!==0&&this._startTime===null&&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 r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;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 e!==null&&(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 r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/o,c[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return e!==null&&(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,r){if(!this.enabled){this._updateWeight(e);return}var i=this._startTime;if(i!==null){var a=(e-i)*n;if(a<0||n===0)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0){var c=this._interpolants,l=this._propertyBindings;switch(this.blendMode){case su:for(var u=0,h=c.length;u!==h;++u)c[u].evaluate(o),l[u].accumulateAdditive(s);break;case js:default:for(var u=0,h=c.length;u!==h;++u)c[u].evaluate(o),l[u].accumulate(r,s)}}},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(n!==null){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(n!==null){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,r=this.loop,i=this._loopCount,a=r===op;if(e===0)return i===-1?t:a&&(i&1)===1?n-t:t;if(r===ip){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else if(t<0)t=0;else{this.time=t;break e}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(i===-1&&(e>=0?(i=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,i+=Math.abs(o);var s=this.repetitions-i;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(s===1){var c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&(i&1)===1)return n-t}return t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=Hr,r.endingEnd=Hr):(e?r.endingStart=this.zeroSlopeAtStart?Hr:Gr:r.endingStart=co,t?r.endingEnd=this.zeroSlopeAtEnd?Hr:Gr:r.endingEnd=co)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}});function kh(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}kh.prototype=Object.assign(Object.create(sn.prototype),{constructor:kh,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];l===void 0&&(l={},c[s]=l);for(var u=0;u!==i;++u){var h=r[u],f=h.name,d=l[f];if(d!==void 0)a[u]=d;else{if(d=a[u],d!==void 0){d._cacheIndex===null&&(++d.referenceCount,this._addInactiveBinding(d,s,f));continue}var m=t&&t._propertyBindings[u].binding.parsedPath;d=new Gh(Gt.create(n,f,m),h.ValueTypeName,h.getValueSize()),++d.referenceCount,this._addInactiveBinding(d,s,f),a[u]=d}o[u].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];--i.useCount===0&&(i.restoreOriginalState(),this._takeBackBinding(i))}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 t!==null&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,a=i[t];if(a===void 0)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,c=s[s.length-1],l=e._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),e._byClipCacheIndex=null;var u=o.actionByRoot,h=(e._localRoot||this._root).uuid;delete u[h],s.length===0&&delete a[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];--i.referenceCount===0&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=r[t],a=this._bindings;i===void 0&&(i={},r[t]=i),i[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete o[i],Object.keys(o).length===0&&delete a[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return n===void 0&&(n=new ds(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t,n){var r=t||this._root,i=r.uuid,a=typeof e=="string"?fn.findByName(r,e):e,o=a!==null?a.uuid:e,s=this._actionsByClip[o],c=null;if(n===void 0&&(a!==null?n=a.blendMode:n=js),s!==void 0){var l=s.actionByRoot[i];if(l!==void 0&&l.blendMode===n)return l;c=s.knownActions[0],a===null&&(a=c._clip)}if(a===null)return null;var u=new Vh(this,a,t,n);return this._bindAction(u,c),this._addInactiveAction(u,o,i),u},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i=typeof e=="string"?fn.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return o!==void 0&&o.actionByRoot[r]||null},stopAllAction:function(){for(var e=this._actions,t=this._nActiveActions,n=t-1;n>=0;--n)e[n].stop();return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){var s=t[o];s._update(r,e,i,a)}for(var c=this._bindings,l=this._nActiveBindings,o=0;o!==l;++o)c[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,r=this._actionsByClip,i=r[n];if(i!==void 0){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var l=c._cacheIndex,u=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=l,t[l]=u,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot,a=i[t];a!==void 0&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[t];if(s!==void 0)for(var c in s){var l=s[c];l.restoreOriginalState(),this._removeInactiveBinding(l)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}});function mc(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}mc.prototype.clone=function(){return new mc(this.value.clone===void 0?this.value:this.value.clone())};function Wh(e,t,n){sr.call(this,e,t),this.meshPerAttribute=n||1}Wh.prototype=Object.assign(Object.create(sr.prototype),{constructor:Wh,isInstancedInterleavedBuffer:!0,copy:function(e){return sr.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}});function Xh(e,t,n,r){this.ray=new Jr(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new Qs,this.params={Mesh:{},Line:{threshold:1},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 jh(e,t){return e.distance-t.distance}function gc(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),r===!0)for(var i=e.children,a=0,o=i.length;a<o;a++)gc(i[a],t,n,!0)}Object.assign(Xh.prototype,{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 r=n||[];return gc(e,this,r,t),r.sort(jh),r},intersectObjects:function(e,t,n){var r=n||[];if(Array.isArray(e)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=e.length;i<a;i++)gc(e[i],this,r,t);return r.sort(jh),r}});function yc(e,t,n){return this.radius=e!==void 0?e:1,this.phi=t!==void 0?t:0,this.theta=n!==void 0?n:0,this}Object.assign(yc.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),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(ke.clamp(t/this.radius,-1,1))),this}});function p0(e,t,n){return this.radius=e!==void 0?e:1,this.theta=t!==void 0?t:0,this.y=n!==void 0?n:0,this}Object.assign(p0.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 qh=new X;function Yh(e,t){this.min=e!==void 0?e:new X(1/0,1/0),this.max=t!==void 0?t:new X(-1/0,-1/0)}Object.assign(Yh.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=qh.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 e===void 0&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new X),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return e===void 0&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new X),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 t===void 0&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new X),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 t===void 0&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new X),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){var t=qh.copy(e).clamp(this.min,this.max);return t.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 Zh=new E,ys=new E;function Jh(e,t){this.start=e!==void 0?e:new E,this.end=t!==void 0?t:new E}Object.assign(Jh.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 e===void 0&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new E),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return e===void 0&&(console.warn("THREE.Line3: .delta() target is now required"),e=new E),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 t===void 0&&(console.warn("THREE.Line3: .at() target is now required"),t=new E),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){Zh.subVectors(e,this.start),ys.subVectors(this.end,this.start);var n=ys.dot(ys),r=ys.dot(Zh),i=r/n;return t&&(i=ke.clamp(i,0,1)),i},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return n===void 0&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new E),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)}});function xs(e){ae.call(this),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}xs.prototype=Object.create(ae.prototype),xs.prototype.constructor=xs,xs.prototype.isImmediateRenderObject=!0;var Qh=new E;function Ba(e,t){ae.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new ve,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1,o=32;i<o;i++,a++){var s=i/o*Math.PI*2,c=a/o*Math.PI*2;r.push(Math.cos(s),Math.sin(s),1,Math.cos(c),Math.sin(c),1)}n.setAttribute("position",new ce(r,3));var l=new mt({fog:!1,toneMapped:!1});this.cone=new Mt(n,l),this.add(this.cone),this.update()}Ba.prototype=Object.create(ae.prototype),Ba.prototype.constructor=Ba,Ba.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Ba.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),Qh.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Qh),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var dr=new E,_s=new We,xc=new We;function Kh(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,Kh(e.children[n]));return t}function Ci(e){for(var t=Kh(e),n=new ve,r=[],i=[],a=new de(0,0,1),o=new de(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new ce(r,3)),n.setAttribute("color",new ce(i,3));var l=new mt({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});Mt.call(this,n,l),this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}Ci.prototype=Object.create(Mt.prototype),Ci.prototype.constructor=Ci,Ci.prototype.isSkeletonHelper=!0,Ci.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,r=n.getAttribute("position");xc.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<t.length;i++){var o=t[i];o.parent&&o.parent.isBone&&(_s.multiplyMatrices(xc,o.matrixWorld),dr.setFromMatrixPosition(_s),r.setXYZ(a,dr.x,dr.y,dr.z),_s.multiplyMatrices(xc,o.parent.matrixWorld),dr.setFromMatrixPosition(_s),r.setXYZ(a+1,dr.x,dr.y,dr.z),a+=2)}n.getAttribute("position").needsUpdate=!0,ae.prototype.updateMatrixWorld.call(this,e)};function Ua(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new yi(t,4,2),i=new hn({wireframe:!0,fog:!1,toneMapped:!1});ut.call(this,r,i),this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}Ua.prototype=Object.create(ut.prototype),Ua.prototype.constructor=Ua,Ua.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Ua.prototype.update=function(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var v0=new E,$h=new de,ef=new de;function za(e,t,n){ae.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new pi(t);r.rotateY(Math.PI*.5),this.material=new hn({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);var i=r.getAttribute("position"),a=new Float32Array(i.count*3);r.setAttribute("color",new De(a,3)),this.add(new ut(r,this.material)),this.update()}za.prototype=Object.create(ae.prototype),za.prototype.constructor=za,za.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},za.prototype.update=function(){var e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");$h.copy(this.light.color),ef.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?$h:ef;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(v0.setFromMatrixPosition(this.light.matrixWorld).negate())};function _c(e,t,n,r){e=e||10,t=t||10,n=new de(n!==void 0?n:4473924),r=new de(r!==void 0?r:8947848);for(var i=t/2,a=e/t,o=e/2,s=[],c=[],l=0,u=0,h=-o;l<=t;l++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var f=l===i?n:r;f.toArray(c,u),u+=3,f.toArray(c,u),u+=3,f.toArray(c,u),u+=3,f.toArray(c,u),u+=3}var d=new ve;d.setAttribute("position",new ce(s,3)),d.setAttribute("color",new ce(c,3));var m=new mt({vertexColors:!0,toneMapped:!1});Mt.call(this,d,m),this.type="GridHelper"}_c.prototype=Object.assign(Object.create(Mt.prototype),{constructor:_c,copy:function(e){return Mt.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return new this.constructor().copy(this)}});function bc(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new de(i!==void 0?i:4473924),a=new de(a!==void 0?a:8947848);var o=[],s=[],c,l,u,h,f,d,m;for(h=0;h<=t;h++)u=h/t*(Math.PI*2),c=Math.sin(u)*e,l=Math.cos(u)*e,o.push(0,0,0),o.push(c,0,l),m=h&1?i:a,s.push(m.r,m.g,m.b),s.push(m.r,m.g,m.b);for(h=0;h<=n;h++)for(m=h&1?i:a,d=e-e/n*h,f=0;f<r;f++)u=f/r*(Math.PI*2),c=Math.sin(u)*d,l=Math.cos(u)*d,o.push(c,0,l),s.push(m.r,m.g,m.b),u=(f+1)/r*(Math.PI*2),c=Math.sin(u)*d,l=Math.cos(u)*d,o.push(c,0,l),s.push(m.r,m.g,m.b);var g=new ve;g.setAttribute("position",new ce(o,3)),g.setAttribute("color",new ce(s,3));var y=new mt({vertexColors:!0,toneMapped:!1});Mt.call(this,g,y),this.type="PolarGridHelper"}bc.prototype=Object.create(Mt.prototype),bc.prototype.constructor=bc;var tf=new E,bs=new E,nf=new E;function Ga(e,t,n){ae.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,t===void 0&&(t=1);var r=new ve;r.setAttribute("position",new ce([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new mt({fog:!1,toneMapped:!1});this.lightPlane=new tn(r,i),this.add(this.lightPlane),r=new ve,r.setAttribute("position",new ce([0,0,0,0,0,1],3)),this.targetLine=new tn(r,i),this.add(this.targetLine),this.update()}Ga.prototype=Object.create(ae.prototype),Ga.prototype.constructor=Ga,Ga.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Ga.prototype.update=function(){tf.setFromMatrixPosition(this.light.matrixWorld),bs.setFromMatrixPosition(this.light.target.matrixWorld),nf.subVectors(bs,tf),this.lightPlane.lookAt(bs),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(bs),this.targetLine.scale.z=nf.length()};var ws=new E,dt=new Bn;function Ms(e){var t=new ve,n=new mt({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],a={},o=new de(16755200),s=new de(16711680),c=new de(43775),l=new de(16777215),u=new de(3355443);h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c),h("c","t",l),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u);function h(d,m,g){f(d,g),f(m,g)}function f(d,m){r.push(0,0,0),i.push(m.r,m.g,m.b),a[d]===void 0&&(a[d]=[]),a[d].push(r.length/3-1)}t.setAttribute("position",new ce(r,3)),t.setAttribute("color",new ce(i,3)),Mt.call(this,t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}Ms.prototype=Object.create(Mt.prototype),Ms.prototype.constructor=Ms,Ms.prototype.update=function(){var e=this.geometry,t=this.pointMap,n=1,r=1;dt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),gt("c",t,e,dt,0,0,-1),gt("t",t,e,dt,0,0,1),gt("n1",t,e,dt,-n,-r,-1),gt("n2",t,e,dt,n,-r,-1),gt("n3",t,e,dt,-n,r,-1),gt("n4",t,e,dt,n,r,-1),gt("f1",t,e,dt,-n,-r,1),gt("f2",t,e,dt,n,-r,1),gt("f3",t,e,dt,-n,r,1),gt("f4",t,e,dt,n,r,1),gt("u1",t,e,dt,n*.7,r*1.1,-1),gt("u2",t,e,dt,-n*.7,r*1.1,-1),gt("u3",t,e,dt,0,r*2,-1),gt("cf1",t,e,dt,-n,0,1),gt("cf2",t,e,dt,n,0,1),gt("cf3",t,e,dt,0,-r,1),gt("cf4",t,e,dt,0,r,1),gt("cn1",t,e,dt,-n,0,-1),gt("cn2",t,e,dt,n,0,-1),gt("cn3",t,e,dt,0,-r,-1),gt("cn4",t,e,dt,0,r,-1),e.getAttribute("position").needsUpdate=!0};function gt(e,t,n,r,i,a,o){ws.set(i,a,o).unproject(r);var s=t[e];if(s!==void 0)for(var c=n.getAttribute("position"),l=0,u=s.length;l<u;l++)c.setXYZ(s[l],ws.x,ws.y,ws.z)}var Es=new gn;function Nr(e,t){this.object=e,t===void 0&&(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]),r=new Float32Array(8*3),i=new ve;i.setIndex(new De(n,1)),i.setAttribute("position",new De(r,3)),Mt.call(this,i,new mt({color:t,toneMapped:!1})),this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}Nr.prototype=Object.create(Mt.prototype),Nr.prototype.constructor=Nr,Nr.prototype.update=function(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&Es.setFromObject(this.object),!Es.isEmpty()){var t=Es.min,n=Es.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Nr.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Nr.prototype.copy=function(e){return Mt.prototype.copy.call(this,e),this.object=e.object,this},Nr.prototype.clone=function(){return new this.constructor().copy(this)};function Ts(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]),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],i=new ve;i.setIndex(new De(n,1)),i.setAttribute("position",new ce(r,3)),Mt.call(this,i,new mt({color:t,toneMapped:!1})),this.type="Box3Helper",this.geometry.computeBoundingSphere()}Ts.prototype=Object.create(Mt.prototype),Ts.prototype.constructor=Ts,Ts.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),ae.prototype.updateMatrixWorld.call(this,e))};function Ss(e,t,n){this.plane=e,this.size=t===void 0?1:t;var r=n!==void 0?n:16776960,i=[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],a=new ve;a.setAttribute("position",new ce(i,3)),a.computeBoundingSphere(),tn.call(this,a,new mt({color:r,toneMapped:!1})),this.type="PlaneHelper";var o=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],s=new ve;s.setAttribute("position",new ce(o,3)),s.computeBoundingSphere(),this.add(new ut(s,new hn({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}Ss.prototype=Object.create(tn.prototype),Ss.prototype.constructor=Ss,Ss.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?At:Gi,this.lookAt(this.plane.normal),ae.prototype.updateMatrixWorld.call(this,e)};var rf=new E,As,wc;function pr(e,t,n,r,i,a){ae.call(this),this.type="ArrowHelper",e===void 0&&(e=new E(0,0,1)),t===void 0&&(t=new E(0,0,0)),n===void 0&&(n=1),r===void 0&&(r=16776960),i===void 0&&(i=.2*n),a===void 0&&(a=.2*i),As===void 0&&(As=new ve,As.setAttribute("position",new ce([0,0,0,0,1,0],3)),wc=new ur(0,.5,1,5,1),wc.translate(0,-.5,0)),this.position.copy(t),this.line=new tn(As,new mt({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ut(wc,new hn({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}pr.prototype=Object.create(ae.prototype),pr.prototype.constructor=pr,pr.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{rf.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(rf,t)}},pr.prototype.setLength=function(e,t,n){t===void 0&&(t=.2*e),n===void 0&&(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()},pr.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},pr.prototype.copy=function(e){return ae.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},pr.prototype.clone=function(){return new this.constructor().copy(this)};function Mc(e){e=e||1;var t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new ve;r.setAttribute("position",new ce(t,3)),r.setAttribute("color",new ce(n,3));var i=new mt({vertexColors:!0,toneMapped:!1});Mt.call(this,r,i),this.type="AxesHelper"}Mc.prototype=Object.create(Mt.prototype),Mc.prototype.constructor=Mc;var Ri=4,vr=8,An=Math.pow(2,vr),af=[.125,.215,.35,.446,.526,.582],of=vr-Ri+1+af.length,Oi=20,Ln={[kt]:0,[uo]:1,[Ys]:2,[lu]:3,[cu]:4,[uu]:5,[qs]:6},Ec=new Na,{_lodPlanes:Ha,_sizeLods:sf,_sigmas:Ls}=g0(),Tc=null,Fr=(1+Math.sqrt(5))/2,Di=1/Fr,lf=[new E(1,1,1),new E(-1,1,1),new E(1,1,-1),new E(-1,1,-1),new E(0,Fr,Di),new E(0,Fr,-Di),new E(Di,0,Fr),new E(-Di,0,Fr),new E(Fr,Di,0),new E(-Fr,Di,0)];function cf(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=y0(Oi),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}cf.prototype={constructor:cf,fromScene:function(e,t=0,n=.1,r=100){Tc=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i},fromEquirectangular:function(e){return e.magFilter=_t,e.minFilter=_t,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){Tc=this._renderer.getRenderTarget();var t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t},compileCubemapShader:function(){this._cubemapShader===null&&(this._cubemapShader=ff(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){this._equirectShader===null&&(this._equirectShader=hf(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(var e=0;e<Ha.length;e++)Ha[e].dispose()},_cleanup:function(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Tc),e.scissorTest=!1,e.setSize(e.width,e.height)},_allocateTargets:function(e){var t={magFilter:_t,minFilter:_t,generateMipmaps:!1,type:Wi,format:bd,encoding:m0(e)?e.encoding:Ys,depthBuffer:!1,stencilBuffer:!1},n=uf(t);return n.depthBuffer=!e,this._pingPongRenderTarget=uf(t),n},_compileMaterial:function(e){var t=new ut(Ha[0],e);this._renderer.compile(t,Ec)},_sceneToCubeUV:function(e,t,n,r){var i=90,a=1,o=new Et(i,a,t,n),s=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],l=this._renderer,u=l.outputEncoding,h=l.toneMapping,f=l.toneMappingExposure,d=l.getClearColor(),m=l.getClearAlpha();l.toneMapping=qc,l.toneMappingExposure=1,l.outputEncoding=kt;var g=e.background;if(g&&g.isColor){g.convertSRGBToLinear();var y=Math.max(g.r,g.g,g.b),p=Math.min(Math.max(Math.ceil(Math.log2(y)),-128),127);g=g.multiplyScalar(Math.pow(2,-p));var v=(p+128)/255;l.setClearColor(g,v),e.background=null}for(var _=0;_<6;_++){var x=_%3;x==0?(o.up.set(0,s[_],0),o.lookAt(c[_],0,0)):x==1?(o.up.set(0,0,s[_]),o.lookAt(0,c[_],0)):(o.up.set(0,s[_],0),o.lookAt(0,0,c[_])),Sc(r,x*An,_>2?An:0,An,An),l.setRenderTarget(r),l.render(e,o)}l.toneMapping=h,l.toneMappingExposure=f,l.outputEncoding=u,l.setClearColor(d,m)},_textureToCubeUV:function(e,t){var n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=ff()):this._equirectShader==null&&(this._equirectShader=hf());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new ut(Ha[0],r),a=r.uniforms;a.envMap.value=e,e.isCubeTexture||a.texelSize.value.set(1/e.image.width,1/e.image.height),a.inputEncoding.value=Ln[e.encoding],a.outputEncoding.value=Ln[t.texture.encoding],Sc(t,0,0,3*An,2*An),n.setRenderTarget(t),n.render(i,Ec)},_applyPMREM:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;r<of;r++){var i=Math.sqrt(Ls[r]*Ls[r]-Ls[r-1]*Ls[r-1]),a=lf[(r-1)%lf.length];this._blur(e,r-1,r,i,a)}t.autoClear=n},_blur:function(e,t,n,r,i){var a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,"latitudinal",i),this._halfBlur(a,e,n,n,r,"longitudinal",i)},_halfBlur:function(e,t,n,r,i,a,o){var s=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");var l=3,u=new ut(Ha[r],c),h=c.uniforms,f=sf[n]-1,d=isFinite(i)?Math.PI/(2*f):2*Math.PI/(2*Oi-1),m=i/d,g=isFinite(i)?1+Math.floor(l*m):Oi;g>Oi&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Oi}`);for(var y=[],p=0,v=0;v<Oi;++v){var b=v/m,_=Math.exp(-b*b/2);y.push(_),v==0?p+=_:v<g&&(p+=2*_)}for(var v=0;v<y.length;v++)y[v]=y[v]/p;h.envMap.value=e.texture,h.samples.value=g,h.weights.value=y,h.latitudinal.value=a==="latitudinal",o&&(h.poleAxis.value=o),h.dTheta.value=d,h.mipInt.value=vr-n,h.inputEncoding.value=Ln[e.texture.encoding],h.outputEncoding.value=Ln[e.texture.encoding];var x=sf[r],b=3*Math.max(0,An-2*x),T=(r===0?0:2*An)+2*x*(r>vr-Ri?r-vr+Ri:0);Sc(t,b,T,3*x,2*x),s.setRenderTarget(t),s.render(u,Ec)}};function m0(e){return e===void 0||e.type!==Wi?!1:e.encoding===kt||e.encoding===uo||e.encoding===qs}function g0(){for(var e=[],t=[],n=[],r=vr,i=0;i<of;i++){var a=Math.pow(2,r);t.push(a);var o=1/a;i>vr-Ri?o=af[i-vr+Ri-1]:i==0&&(o=0),n.push(o);for(var s=1/(a-1),c=-s/2,l=1+s/2,u=[c,c,l,c,l,l,c,c,l,l,c,l],h=6,f=6,d=3,m=2,g=1,y=new Float32Array(d*f*h),p=new Float32Array(m*f*h),v=new Float32Array(g*f*h),_=0;_<h;_++){var x=_%3*2/3-1,b=_>2?0:-1,T=[x,b,0,x+2/3,b,0,x+2/3,b+1,0,x,b,0,x+2/3,b+1,0,x,b+1,0];y.set(T,d*f*_),p.set(u,m*f*_);var C=[_,_,_,_,_,_];v.set(C,g*f*_)}var N=new ve;N.setAttribute("position",new De(y,d)),N.setAttribute("uv",new De(p,m)),N.setAttribute("faceIndex",new De(v,g)),e.push(N),r>Ri&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function uf(e){var t=new $t(3*An,3*An,e);return t.texture.mapping=ki,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Sc(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function y0(e){var t=new Float32Array(e),n=new E(0,1,0),r=new hr({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:Ln[kt]},outputEncoding:{value:Ln[kt]}},vertexShader:Ac(),fragmentShader:`
3114
3114
  precision mediump float;
3115
3115
  precision mediump int;
3116
3116
  varying vec3 vOutputDirection;
@@ -3122,7 +3122,7 @@ uniform float dTheta;
3122
3122
  uniform float mipInt;
3123
3123
  uniform vec3 poleAxis;
3124
3124
 
3125
- ${Ac()}
3125
+ ${Lc()}
3126
3126
 
3127
3127
  #define ENVMAP_TYPE_CUBE_UV
3128
3128
  #include <cube_uv_reflection_fragment>
@@ -3152,14 +3152,14 @@ void main() {
3152
3152
  }
3153
3153
  gl_FragColor = linearToOutputTexel(gl_FragColor);
3154
3154
  }
3155
- `,blending:Jn,depthTest:!1,depthWrite:!1});return r.type="SphericalGaussianBlur",r}function uf(){var e=new X(1,1),t=new hr({uniforms:{envMap:{value:null},texelSize:{value:e},inputEncoding:{value:Ln[kt]},outputEncoding:{value:Ln[kt]}},vertexShader:Sc(),fragmentShader:`
3155
+ `,blending:Jn,depthTest:!1,depthWrite:!1});return r.type="SphericalGaussianBlur",r}function hf(){var e=new X(1,1),t=new hr({uniforms:{envMap:{value:null},texelSize:{value:e},inputEncoding:{value:Ln[kt]},outputEncoding:{value:Ln[kt]}},vertexShader:Ac(),fragmentShader:`
3156
3156
  precision mediump float;
3157
3157
  precision mediump int;
3158
3158
  varying vec3 vOutputDirection;
3159
3159
  uniform sampler2D envMap;
3160
3160
  uniform vec2 texelSize;
3161
3161
 
3162
- ${Ac()}
3162
+ ${Lc()}
3163
3163
 
3164
3164
  #include <common>
3165
3165
 
@@ -3181,20 +3181,20 @@ void main() {
3181
3181
  gl_FragColor.rgb = mix(tm, bm, f.y);
3182
3182
  gl_FragColor = linearToOutputTexel(gl_FragColor);
3183
3183
  }
3184
- `,blending:Jn,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function hf(){var e=new hr({uniforms:{envMap:{value:null},inputEncoding:{value:Ln[kt]},outputEncoding:{value:Ln[kt]}},vertexShader:Sc(),fragmentShader:`
3184
+ `,blending:Jn,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function ff(){var e=new hr({uniforms:{envMap:{value:null},inputEncoding:{value:Ln[kt]},outputEncoding:{value:Ln[kt]}},vertexShader:Ac(),fragmentShader:`
3185
3185
  precision mediump float;
3186
3186
  precision mediump int;
3187
3187
  varying vec3 vOutputDirection;
3188
3188
  uniform samplerCube envMap;
3189
3189
 
3190
- ${Ac()}
3190
+ ${Lc()}
3191
3191
 
3192
3192
  void main() {
3193
3193
  gl_FragColor = vec4(0.0);
3194
3194
  gl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;
3195
3195
  gl_FragColor = linearToOutputTexel(gl_FragColor);
3196
3196
  }
3197
- `,blending:Jn,depthTest:!1,depthWrite:!1});return e.type="CubemapToCubeUV",e}function Sc(){return`
3197
+ `,blending:Jn,depthTest:!1,depthWrite:!1});return e.type="CubemapToCubeUV",e}function Ac(){return`
3198
3198
  precision mediump float;
3199
3199
  precision mediump int;
3200
3200
  attribute vec3 position;
@@ -3229,7 +3229,7 @@ void main() {
3229
3229
  vOutputDirection = getDirection(uv, faceIndex);
3230
3230
  gl_Position = vec4( position, 1.0 );
3231
3231
  }
3232
- `}function Ac(){return`
3232
+ `}function Lc(){return`
3233
3233
  uniform int inputEncoding;
3234
3234
  uniform int outputEncoding;
3235
3235
 
@@ -3274,7 +3274,7 @@ vec4 linearToOutputTexel(vec4 value){
3274
3274
  vec4 envMapTexelToLinear(vec4 color) {
3275
3275
  return inputTexelToLinear(color);
3276
3276
  }
3277
- `}Le.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Le.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(fr.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 Ne,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new E(i.x,i.y,i.z||0))}return t}}),Object.assign(Sn.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Object.create(Jt.prototype),Object.create(Jt.prototype);function ff(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Jt.call(this,e),this.type="catmullrom"}ff.prototype=Object.create(Jt.prototype),Object.assign(ff.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.")}}),xc.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Ci.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(tt.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),bh.extractUrlBase(e)}}),tt.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(hc.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(qh.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(gn.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)}}),Object.assign(Dn.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),aa.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},Zh.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(ke,{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()."),ke.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),ke.ceilPowerOfTwo(e)}}),Object.assign(Ut.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.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(We.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 E().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.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)}}),yn.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},bt.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(Jr.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(Rt.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(Rt,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Rt.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Rt.getNormal(e,t,n,r)}}),Object.assign(Cr.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 gi(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new xi(this,e)}}),Object.assign(X.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(E.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(et.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(Ne.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.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(ae.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.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(ae.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.assign(ut.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(ut.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),op},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Oo.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Cl.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Pl.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Le.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}}),Et.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),t!==void 0&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(lt.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(De.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===qi},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(qi)}}}),Object.assign(De.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(e===!0?qi:so),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(ve.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)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new De(arguments[1],arguments[2]))):e==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t)},addDrawCall:function(e,t,n){n!==void 0&&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)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(ve.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(fs.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(Wh.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(sr.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===qi},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(sr.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(e===!0?qi:so),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(zn.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(vc.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(Oe.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 de}},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=e===Uc}},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(Pr.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(Wt.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(Yu.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},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(Yu.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=e===!0?oo:kt}}}),Object.defineProperties(ju.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($t.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(Fa.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this,n=new fc;return n.load(e,function(r){t.setBuffer(r)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Uh.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},ra.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},_r.crossOrigin=void 0,_r.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new Xl;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},_r.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new Wl;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},_r.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},_r.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ff}}));var Va=function(e,t){t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.target=new E,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:Yn.ROTATE,MIDDLE:Yn.DOLLY,RIGHT:Yn.PAN},this.touches={ONE:Zn.ROTATE,TWO:Zn.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),s=o.NONE},this.update=function(){var R=new E,he=new bt().setFromUnitVectors(e.up,new E(0,1,0)),fe=he.clone().inverse(),me=new E,ie=new bt;return function(){var pe=n.object.position;return R.copy(pe).sub(n.target),R.applyQuaternion(he),l.setFromVector3(R),n.autoRotate&&s===o.NONE&&O(C()),n.enableDamping?(l.theta+=u.theta*n.dampingFactor,l.phi+=u.phi*n.dampingFactor):(l.theta+=u.theta,l.phi+=u.phi),l.theta=Math.max(n.minAzimuthAngle,Math.min(n.maxAzimuthAngle,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),l.radius*=h,l.radius=Math.max(n.minDistance,Math.min(n.maxDistance,l.radius)),n.enableDamping===!0?n.target.addScaledVector(f,n.dampingFactor):n.target.add(f),R.setFromSpherical(l),R.applyQuaternion(fe),pe.copy(n.target).add(R),n.object.lookAt(n.target),n.enableDamping===!0?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,f.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),f.set(0,0,0)),h=1,d||me.distanceToSquared(n.object.position)>c||8*(1-ie.dot(n.object.quaternion))>c?(n.dispatchEvent(r),me.copy(n.object.position),ie.copy(n.object.quaternion),d=!1,!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",ye,!1),n.domElement.removeEventListener("mousedown",Qe,!1),n.domElement.removeEventListener("wheel",A,!1),n.domElement.removeEventListener("touchstart",ne,!1),n.domElement.removeEventListener("touchend",Fe,!1),n.domElement.removeEventListener("touchmove",K,!1),document.removeEventListener("mousemove",nt,!1),document.removeEventListener("mouseup",$e,!1),n.domElement.removeEventListener("keydown",L,!1)};var n=this,r={type:"change"},i={type:"start"},a={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},s=o.NONE,c=1e-6,l=new gc,u=new gc,h=1,f=new E,d=!1,m=new X,g=new X,y=new X,p=new X,v=new X,_=new X,x=new X,b=new X,T=new X;function C(){return 2*Math.PI/60/60*n.autoRotateSpeed}function N(){return Math.pow(.95,n.zoomSpeed)}function O(R){u.theta-=R}function J(R){u.phi-=R}var F=function(){var R=new E;return function(fe,me){R.setFromMatrixColumn(me,0),R.multiplyScalar(-fe),f.add(R)}}(),B=function(){var R=new E;return function(fe,me){n.screenSpacePanning===!0?R.setFromMatrixColumn(me,1):(R.setFromMatrixColumn(me,0),R.crossVectors(n.object.up,R)),R.multiplyScalar(fe),f.add(R)}}(),V=function(){var R=new E;return function(fe,me){var ie=n.domElement;if(n.object.isPerspectiveCamera){var Se=n.object.position;R.copy(Se).sub(n.target);var pe=R.length();pe*=Math.tan(n.object.fov/2*Math.PI/180),F(2*fe*pe/ie.clientHeight,n.object.matrix),B(2*me*pe/ie.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(F(fe*(n.object.right-n.object.left)/n.object.zoom/ie.clientWidth,n.object.matrix),B(me*(n.object.top-n.object.bottom)/n.object.zoom/ie.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function Y(R){n.object.isPerspectiveCamera?h/=R:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*R)),n.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function D(R){n.object.isPerspectiveCamera?h*=R:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/R)),n.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function z(R){m.set(R.clientX,R.clientY)}function k(R){x.set(R.clientX,R.clientY)}function q(R){p.set(R.clientX,R.clientY)}function Z(R){g.set(R.clientX,R.clientY),y.subVectors(g,m).multiplyScalar(n.rotateSpeed);var he=n.domElement;O(2*Math.PI*y.x/he.clientHeight),J(2*Math.PI*y.y/he.clientHeight),m.copy(g),n.update()}function ee(R){b.set(R.clientX,R.clientY),T.subVectors(b,x),T.y>0?Y(N()):T.y<0&&D(N()),x.copy(b),n.update()}function te(R){v.set(R.clientX,R.clientY),_.subVectors(v,p).multiplyScalar(n.panSpeed),V(_.x,_.y),p.copy(v),n.update()}function oe(R){R.deltaY<0?D(N()):R.deltaY>0&&Y(N()),n.update()}function Pe(R){var he=!1;switch(R.keyCode){case n.keys.UP:V(0,n.keyPanSpeed),he=!0;break;case n.keys.BOTTOM:V(0,-n.keyPanSpeed),he=!0;break;case n.keys.LEFT:V(n.keyPanSpeed,0),he=!0;break;case n.keys.RIGHT:V(-n.keyPanSpeed,0),he=!0;break}he&&(R.preventDefault(),n.update())}function be(R){if(R.touches.length==1)m.set(R.touches[0].pageX,R.touches[0].pageY);else{var he=.5*(R.touches[0].pageX+R.touches[1].pageX),fe=.5*(R.touches[0].pageY+R.touches[1].pageY);m.set(he,fe)}}function re(R){if(R.touches.length==1)p.set(R.touches[0].pageX,R.touches[0].pageY);else{var he=.5*(R.touches[0].pageX+R.touches[1].pageX),fe=.5*(R.touches[0].pageY+R.touches[1].pageY);p.set(he,fe)}}function G(R){var he=R.touches[0].pageX-R.touches[1].pageX,fe=R.touches[0].pageY-R.touches[1].pageY,me=Math.sqrt(he*he+fe*fe);x.set(0,me)}function Be(R){n.enableZoom&&G(R),n.enablePan&&re(R)}function xe(R){n.enableZoom&&G(R),n.enableRotate&&be(R)}function Te(R){if(R.touches.length==1)g.set(R.touches[0].pageX,R.touches[0].pageY);else{var he=.5*(R.touches[0].pageX+R.touches[1].pageX),fe=.5*(R.touches[0].pageY+R.touches[1].pageY);g.set(he,fe)}y.subVectors(g,m).multiplyScalar(n.rotateSpeed);var me=n.domElement;O(2*Math.PI*y.x/me.clientHeight),J(2*Math.PI*y.y/me.clientHeight),m.copy(g)}function ue(R){if(R.touches.length==1)v.set(R.touches[0].pageX,R.touches[0].pageY);else{var he=.5*(R.touches[0].pageX+R.touches[1].pageX),fe=.5*(R.touches[0].pageY+R.touches[1].pageY);v.set(he,fe)}_.subVectors(v,p).multiplyScalar(n.panSpeed),V(_.x,_.y),p.copy(v)}function $(R){var he=R.touches[0].pageX-R.touches[1].pageX,fe=R.touches[0].pageY-R.touches[1].pageY,me=Math.sqrt(he*he+fe*fe);b.set(0,me),T.set(0,Math.pow(b.y/x.y,n.zoomSpeed)),Y(T.y),x.copy(b)}function Ce(R){n.enableZoom&&$(R),n.enablePan&&ue(R)}function Ye(R){n.enableZoom&&$(R),n.enableRotate&&Te(R)}function Qe(R){if(n.enabled!==!1){R.preventDefault(),n.domElement.focus?n.domElement.focus():window.focus();var he;switch(R.button){case 0:he=n.mouseButtons.LEFT;break;case 1:he=n.mouseButtons.MIDDLE;break;case 2:he=n.mouseButtons.RIGHT;break;default:he=-1}switch(he){case Yn.DOLLY:if(n.enableZoom===!1)return;k(R),s=o.DOLLY;break;case Yn.ROTATE:if(R.ctrlKey||R.metaKey||R.shiftKey){if(n.enablePan===!1)return;q(R),s=o.PAN}else{if(n.enableRotate===!1)return;z(R),s=o.ROTATE}break;case Yn.PAN:if(R.ctrlKey||R.metaKey||R.shiftKey){if(n.enableRotate===!1)return;z(R),s=o.ROTATE}else{if(n.enablePan===!1)return;q(R),s=o.PAN}break;default:s=o.NONE}s!==o.NONE&&(document.addEventListener("mousemove",nt,!1),document.addEventListener("mouseup",$e,!1),n.dispatchEvent(i))}}function nt(R){if(n.enabled!==!1)switch(R.preventDefault(),s){case o.ROTATE:if(n.enableRotate===!1)return;Z(R);break;case o.DOLLY:if(n.enableZoom===!1)return;ee(R);break;case o.PAN:if(n.enablePan===!1)return;te(R);break}}function $e(R){n.enabled!==!1&&(document.removeEventListener("mousemove",nt,!1),document.removeEventListener("mouseup",$e,!1),n.dispatchEvent(a),s=o.NONE)}function A(R){n.enabled===!1||n.enableZoom===!1||s!==o.NONE&&s!==o.ROTATE||(R.preventDefault(),R.stopPropagation(),n.dispatchEvent(i),oe(R),n.dispatchEvent(a))}function L(R){n.enabled===!1||n.enableKeys===!1||n.enablePan===!1||Pe(R)}function ne(R){if(n.enabled!==!1){switch(R.preventDefault(),R.touches.length){case 1:switch(n.touches.ONE){case Zn.ROTATE:if(n.enableRotate===!1)return;be(R),s=o.TOUCH_ROTATE;break;case Zn.PAN:if(n.enablePan===!1)return;re(R),s=o.TOUCH_PAN;break;default:s=o.NONE}break;case 2:switch(n.touches.TWO){case Zn.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Be(R),s=o.TOUCH_DOLLY_PAN;break;case Zn.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;xe(R),s=o.TOUCH_DOLLY_ROTATE;break;default:s=o.NONE}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}}function K(R){if(n.enabled!==!1)switch(R.preventDefault(),R.stopPropagation(),s){case o.TOUCH_ROTATE:if(n.enableRotate===!1)return;Te(R),n.update();break;case o.TOUCH_PAN:if(n.enablePan===!1)return;ue(R),n.update();break;case o.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ce(R),n.update();break;case o.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Ye(R),n.update();break;default:s=o.NONE}}function Fe(R){n.enabled!==!1&&(n.dispatchEvent(a),s=o.NONE)}function ye(R){n.enabled!==!1&&R.preventDefault()}n.domElement.addEventListener("contextmenu",ye,!1),n.domElement.addEventListener("mousedown",Qe,!1),n.domElement.addEventListener("wheel",A,!1),n.domElement.addEventListener("touchstart",ne,!1),n.domElement.addEventListener("touchend",Fe,!1),n.domElement.addEventListener("touchmove",K,!1),n.domElement.addEventListener("keydown",L,!1),n.domElement.tabIndex===-1&&(n.domElement.tabIndex=0),this.update()};Va.prototype=Object.create(sn.prototype),Va.prototype.constructor=Va;var Lc=function(e,t){Va.call(this,e,t),this.mouseButtons.LEFT=Yn.PAN,this.mouseButtons.RIGHT=Yn.ROTATE,this.touches.ONE=Zn.PAN,this.touches.TWO=Zn.DOLLY_ROTATE};Lc.prototype=Object.create(sn.prototype),Lc.prototype.constructor=Lc;var Wn=function(e){ae.call(this),this.element=e,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})};Wn.prototype=Object.create(ae.prototype),Wn.prototype.constructor=Wn;var Ts=function(e){Wn.call(this,e)};Ts.prototype=Object.create(Wn.prototype),Ts.prototype.constructor=Ts;var y0=function(){var e=this,t,n,r,i,a=new We,o={camera:{fov:0,style:""},objects:new WeakMap},s=document.createElement("div");s.style.overflow="hidden",this.domElement=s;var c=document.createElement("div");c.style.WebkitTransformStyle="preserve-3d",c.style.transformStyle="preserve-3d",c.style.pointerEvents="none",s.appendChild(c);var l=/Trident/i.test(navigator.userAgent);this.getSize=function(){return{width:t,height:n}},this.setSize=function(p,v){t=p,n=v,r=t/2,i=n/2,s.style.width=p+"px",s.style.height=v+"px",c.style.width=p+"px",c.style.height=v+"px"};function u(p){return Math.abs(p)<1e-10?0:p}function h(p){var v=p.elements;return"matrix3d("+u(v[0])+","+u(-v[1])+","+u(v[2])+","+u(v[3])+","+u(v[4])+","+u(-v[5])+","+u(v[6])+","+u(v[7])+","+u(v[8])+","+u(-v[9])+","+u(v[10])+","+u(v[11])+","+u(v[12])+","+u(-v[13])+","+u(v[14])+","+u(v[15])+")"}function f(p,v){var _=p.elements,x="matrix3d("+u(_[0])+","+u(_[1])+","+u(_[2])+","+u(_[3])+","+u(-_[4])+","+u(-_[5])+","+u(-_[6])+","+u(-_[7])+","+u(_[8])+","+u(_[9])+","+u(_[10])+","+u(_[11])+","+u(_[12])+","+u(_[13])+","+u(_[14])+","+u(_[15])+")";return l?"translate(-50%,-50%)translate("+r+"px,"+i+"px)"+v+x:"translate(-50%,-50%)"+x}function d(p,v,_,x){if(p instanceof Wn){p.onBeforeRender(e,v,_);var b;p instanceof Ts?(a.copy(_.matrixWorldInverse),a.transpose(),a.copyPosition(p.matrixWorld),a.scale(p.scale),a.elements[3]=0,a.elements[7]=0,a.elements[11]=0,a.elements[15]=1,b=f(a,x)):b=f(p.matrixWorld,x);var T=p.element,C=o.objects.get(p);if(C===void 0||C.style!==b){T.style.WebkitTransform=b,T.style.transform=b;var N={style:b};l&&(N.distanceToCameraSquared=m(_,p)),o.objects.set(p,N)}T.style.display=p.visible?"":"none",T.parentNode!==c&&c.appendChild(T),p.onAfterRender(e,v,_)}for(var O=0,J=p.children.length;O<J;O++)d(p.children[O],v,_,x)}var m=function(){var p=new E,v=new E;return function(_,x){return p.setFromMatrixPosition(_.matrixWorld),v.setFromMatrixPosition(x.matrixWorld),p.distanceToSquared(v)}}();function g(p){var v=[];return p.traverse(function(_){_ instanceof Wn&&v.push(_)}),v}function y(p){for(var v=g(p).sort(function(T,C){var N=o.objects.get(T).distanceToCameraSquared,O=o.objects.get(C).distanceToCameraSquared;return N-O}),_=v.length,x=0,b=v.length;x<b;x++)v[x].element.style.zIndex=_-x}this.render=function(p,v){var _=v.projectionMatrix.elements[5]*i;if(o.camera.fov!==_&&(v.isPerspectiveCamera?(s.style.WebkitPerspective=_+"px",s.style.perspective=_+"px"):(s.style.WebkitPerspective="",s.style.perspective=""),o.camera.fov=_),p.autoUpdate===!0&&p.updateMatrixWorld(),v.parent===null&&v.updateMatrixWorld(),v.isOrthographicCamera)var x=-(v.right+v.left)/2,b=(v.top+v.bottom)/2;var T=v.isOrthographicCamera?"scale("+_+")translate("+u(x)+"px,"+u(b)+"px)"+h(v.matrixWorldInverse):"translateZ("+_+"px)"+h(v.matrixWorldInverse),C=T+"translate("+r+"px,"+i+"px)";o.camera.style!==C&&!l&&(c.style.WebkitTransform=C,c.style.transform=C,o.camera.style=C),d(p,p,v,T),l&&y(p)}};function df(e,t,n){var r=t.getBoundingClientRect(),i=r.top,a=r.left,o=r.width,s=r.height;return new _e.Vector2((e.x-a)/o*2-1,-(e.y-i)/s*2+1)}var pf=function(e){Rs(t,e);function t(n,r,i,a,o){var s=e.call(this)||this;s.type="RoundedBoxGeometry",o=isNaN(o)?1:Math.max(1,Math.floor(o)),n=isNaN(n)?1:n,r=isNaN(r)?1:r,i=isNaN(i)?1:i,a=isNaN(a)?.15:a,a=Math.min(a,Math.min(n,Math.min(r,Math.min(i)))/2);var c=n/2-a,l=r/2-a,u=i/2-a;s.parameters={width:n,height:r,depth:i,radius:a,radiusSegments:o};var h=o+1,f=h*o+1<<3,d=new _e.BufferAttribute(new Float32Array(f*3),3),m=new _e.BufferAttribute(new Float32Array(f*3),3),g=[],y=[];new _e.Vector3;var p=new _e.Vector3,v=[],_=[],x=[],b=h*o,T=h*o+1;C(),O(),N(),J(),B(),F();function C(){for(var D=[new _e.Vector3(1,1,1),new _e.Vector3(1,1,-1),new _e.Vector3(-1,1,-1),new _e.Vector3(-1,1,1),new _e.Vector3(1,-1,1),new _e.Vector3(1,-1,-1),new _e.Vector3(-1,-1,-1),new _e.Vector3(-1,-1,1)],z=0;z<8;z++)g.push([]),y.push([]);for(var k=Math.PI/2,q=new _e.Vector3(c,l,u),Z=0;Z<=o;Z++){var ee=Z/o,te=ee*k,oe=Math.cos(te),Pe=Math.sin(te);if(Z==o){p.set(0,1,0);var be=p.clone().multiplyScalar(a).add(q);g[0].push(be),v.push(be);var re=p.clone();y[0].push(re),_.push(re);continue}for(var G=0;G<=o;G++){var Be=G/o,xe=Be*k;p.x=oe*Math.cos(xe),p.y=Pe,p.z=oe*Math.sin(xe);var be=p.clone().multiplyScalar(a).add(q);g[0].push(be),v.push(be);var re=p.clone().normalize();y[0].push(re),_.push(re)}}for(var Te=1;Te<8;Te++)for(var z=0;z<g[0].length;z++){var be=g[0][z].clone().multiply(D[Te]);g[Te].push(be),v.push(be);var re=y[0][z].clone().multiply(D[Te]);y[Te].push(re),_.push(re)}}function N(){for(var D=[!0,!1,!0,!1,!1,!0,!1,!0],z=h*(o-1),k=0;k<8;k++){for(var q=T*k,Z=0;Z<o-1;Z++)for(var ee=Z*h,te=(Z+1)*h,oe=0;oe<o;oe++){var Pe=oe+1,be=q+ee+oe,re=q+ee+Pe,G=q+te+oe,Be=q+te+Pe;D[k]?(x.push(be),x.push(G),x.push(re),x.push(re),x.push(G),x.push(Be)):(x.push(be),x.push(re),x.push(G),x.push(re),x.push(Be),x.push(G))}for(var oe=0;oe<o;oe++){var be=q+z+oe,re=q+z+oe+1,G=q+b;D[k]?(x.push(be),x.push(G),x.push(re)):(x.push(be),x.push(re),x.push(G))}}}function O(){var D=b,z=b+T,k=b+T*2,q=b+T*3;x.push(D),x.push(z),x.push(k),x.push(D),x.push(k),x.push(q),D=b+T*4,z=b+T*5,k=b+T*6,q=b+T*7,x.push(D),x.push(k),x.push(z),x.push(D),x.push(q),x.push(k),D=0,z=T,k=T*4,q=T*5,x.push(D),x.push(k),x.push(z),x.push(z),x.push(k),x.push(q),D=T*2,z=T*3,k=T*6,q=T*7,x.push(D),x.push(k),x.push(z),x.push(z),x.push(k),x.push(q),D=o,z=o+T*3,k=o+T*4,q=o+T*7,x.push(D),x.push(z),x.push(k),x.push(z),x.push(q),x.push(k),D=o+T,z=o+T*2,k=o+T*5,q=o+T*6,x.push(D),x.push(k),x.push(z),x.push(z),x.push(k),x.push(q)}function J(){for(var D=0;D<4;D++)for(var z=D*T,k=4*T+z,q=(D&1)===1,Z=0;Z<o;Z++){var ee=Z+1,te=z+Z,oe=z+ee,Pe=k+Z,be=k+ee;q?(x.push(te),x.push(Pe),x.push(oe),x.push(oe),x.push(Pe),x.push(be)):(x.push(te),x.push(oe),x.push(Pe),x.push(oe),x.push(be),x.push(Pe))}}function F(){for(var D=[0,2,4,6],z=[1,3,5,7],k=0;k<4;k++)for(var q=T*D[k],Z=T*z[k],ee=1>=k,te=0;te<o;te++){var oe=te*h,Pe=(te+1)*h,be=q+oe,re=q+Pe,G=Z+oe,Be=Z+Pe;ee?(x.push(be),x.push(G),x.push(re),x.push(re),x.push(G),x.push(Be)):(x.push(be),x.push(re),x.push(G),x.push(re),x.push(Be),x.push(G))}}function B(){for(var D=o-1,z=[0,1,4,5],k=[3,2,7,6],q=[0,1,1,0],Z=0;Z<4;Z++)for(var ee=z[Z]*T,te=k[Z]*T,oe=0;oe<=D;oe++){var Pe=ee+o+oe*h,be=ee+(oe!=D?o+(oe+1)*h:T-1),re=te+o+oe*h,G=te+(oe!=D?o+(oe+1)*h:T-1);q[Z]?(x.push(Pe),x.push(re),x.push(be),x.push(be),x.push(re),x.push(G)):(x.push(Pe),x.push(be),x.push(re),x.push(be),x.push(G),x.push(re))}}for(var V=0,Y=0;Y<v.length;Y++)d.setXYZ(V,v[Y].x,v[Y].y,v[Y].z),m.setXYZ(V,_[Y].x,_[Y].y,_[Y].z),V++;return s.setIndex(new _e.BufferAttribute(new Uint16Array(x),1)),s.setAttribute("position",d),s.setAttribute("normal",m),s}return t}(_e.BufferGeometry);function vf(e,t){return typeof e!="number"||typeof t!="number"?!1:Math.abs(e-t)<.001}function ka(e,t,n,r){r===void 0&&(r=function(a){return a});var i=r(n);return e*(1-i)+t*i}var Lt=Number((Math.PI/2).toFixed(5));function x0(e,t,n){var r=new _e.Shape;return r.moveTo(n,0),r.lineTo(e-n,0),r.absarc(e-n,n,n,-Lt,0,!1),r.lineTo(e,t-n),r.absarc(e-n,t-n,n,0,Lt,!1),r.lineTo(n,t),r.absarc(n,t-n,n,Lt,Math.PI,!1),r.lineTo(0,n),r.absarc(n,n,n,Math.PI,Math.PI*1.5,!1),r}var Wa=function(e){var t=document.createElement("div");t.innerText=e;var n=new Wn(t);return n.name=e,n.scale.set(.3,.3,.3),t.style.pointerEvents="none",t.style.backfaceVisibility="hidden",n},Ss=function(e){var t=new _e.PlaneGeometry(5,5),n=new _e.MeshBasicMaterial({transparent:!0,opacity:0}),r=new _e.Mesh(t,n),i=document.createElement("div");i.innerText=e;var a=new Wn(i);return a.name=e,a.scale.set(.3,.3,.3),i.style.color="#ffffff",i.style.opacity="0.5",i.style.pointerEvents="none",i.style.backfaceVisibility="hidden",r.rotateX(-Lt),r.add(a),r},_0=function(e){Rs(t,e);function t(n,r){var i=e.call(this,n)||this;i.camera=new yr.Camera(90),i.scene=new _e.Scene,i.renderer=new _e.WebGLRenderer({antialias:!0,alpha:!0}),i.css3drenderer=new y0,i.ambientLight=new _e.AmbientLight(16777215,.7),i.wrapper=document.createElement("div"),i.arrows=document.createElement("div"),i.arrowLeft=document.createElement("div"),i.arrowRight=document.createElement("div"),i.arrowFront=document.createElement("div"),i.arrowBack=document.createElement("div"),i.arrowTop=document.createElement("div"),i.arrowBottom=document.createElement("div"),i.spherical=null,i.dragging=!1,i.style=document.createElement("style"),i.directionalLight=new _e.DirectionalLight(16777215,.2),i.box=new _e.Mesh(new pf(8,8,8,.5,20),new _e.MeshPhongMaterial({color:16777215})),i.faces=new _e.Group,i.orient=function(s){var c=s.longitude,l=s.latitude;i.dragging=!1,i.spherical=null,i.controls.enableDamping=!1,i.five.setState({longitude:c,latitude:l}),i.five.ready().then(function(){i.controls.enableDamping=!0,i.setState({arrowsVisible:!0})})},i.onRenderFrame=function(){var s,c,l,u,h;if(i.renderer.render(i.scene,i.camera),i.css3drenderer.render(i.scene,i.camera),i.directionalLight.position.copy(i.camera.position),(s=i.controls)===null||s===void 0||s.update(),i.dragging){i.camera.computePose(),i.updateByCamera();var f=i.camera.pose,d=f.longitude,m=f.latitude;i.five.setState({longitude:d,latitude:m},!0),i.updateArrows({longitude:d,latitude:m})}else if(i.spherical&&(!vf(i.spherical.pi,(c=i.controls)===null||c===void 0?void 0:c.getPolarAngle())||!vf(i.spherical.theta,(l=i.controls)===null||l===void 0?void 0:l.getAzimuthalAngle()))){i.spherical={pi:(u=i.controls)===null||u===void 0?void 0:u.getPolarAngle(),theta:(h=i.controls)===null||h===void 0?void 0:h.getAzimuthalAngle()},i.camera.computePose(),i.updateByCamera();var g=i.camera.pose,d=g.longitude,m=g.latitude;i.five.setState({longitude:d,latitude:m},!0),i.updateArrows({longitude:d,latitude:m})}else i.spherical=null},i.onTapGesture=function(s){var c=s.pointers[0].clientX,l=s.pointers[0].clientY,u=df({x:c,y:l},i.wrapper),h=new _e.Raycaster;h.setFromCamera(u,i.camera);var f=h.intersectObjects(i.faces.children,!1)[0];if(f){var d=f.object.userData,m=d.longitude,g=d.latitude;i.orient({longitude:m,latitude:g})}},i.onFiveWantsGesture=function(){if(i.spherical)return!1},i.onFiveModeChange=function(s){i.controls&&(i.controls.maxPolarAngle=s==="Topview"?0:Lt)},i.onCameraUpdate=function(s){var c=s.state;if(!i.dragging&&!i.spherical){var l=c.longitude,u=c.latitude;i.camera.pose.longitude===l&&i.camera.pose.latitude===u||(i.camera.setFromPose({longitude:l,latitude:u,distance:20,offset:new _e.Vector3(0,0,0)}),i.updateByCamera(),i.updateArrows({longitude:l,latitude:u}))}},i.onPanStart=function(s){i.dragging=!0,i.spherical={}},i.onMouseMove=function(s){if(!i.dragging){var c=df({x:s.clientX,y:s.clientY},i.wrapper),l=new _e.Raycaster;l.setFromCamera(c,i.camera);var u=l.intersectObjects(i.faces.children,!1)[0];i.faces.children.forEach(function(h){h.material.opacity=0,h.children[0].element.style.color=""}),u&&(u.object.material.opacity=.3,u.object.children[0].element.style.color="#336dff")}},i.onPanEnd=function(s){i.dragging=!1,i.spherical={pi:i.controls.getPolarAngle(),theta:i.controls.getAzimuthalAngle()}},i.dispose=function(){i.disable()},i.five=n;var a={enabled:!1,visible:!0,arrowsVisible:!1};i.state=Object.assign(a,r==null?void 0:r.initialState);var o=Bt({orthoView:!0},r==null?void 0:r.config);return i._config=o,i.state.enabled&&i._enable({userAction:!1}),i.mc=new Ns.Manager(i.wrapper),i.mc.add(new Ns.Tap({interval:410})),i.mc.add(new Ns.Pan({threshold:10,pointers:0})),i.camera.setFromPose({distance:20,offset:new _e.Vector3(0,0,0),longitude:n.camera.pose.latitude,latitude:n.camera.pose.latitude}),i.cylinder=new _e.Mesh(new _e.CylinderGeometry(13.2,14,.01,50,1,!0),new _e.ShaderMaterial({uniforms:{radiusTop:{value:13.2},radiusBottom:{value:14},opacity:{value:1}},vertexShader:`
3277
+ `}Le.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Le.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(fr.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 Ne,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new E(i.x,i.y,i.z||0))}return t}}),Object.assign(Sn.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Object.create(Jt.prototype),Object.create(Jt.prototype);function df(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Jt.call(this,e),this.type="catmullrom"}df.prototype=Object.create(Jt.prototype),Object.assign(df.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.")}}),_c.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Ci.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(tt.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),wh.extractUrlBase(e)}}),tt.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(Yh.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(gn.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)}}),Object.assign(Dn.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),aa.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},Jh.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(ke,{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()."),ke.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),ke.ceilPowerOfTwo(e)}}),Object.assign(Ut.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.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(We.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 E().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.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)}}),yn.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},bt.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(Jr.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(Ot.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(Ot,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Ot.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Ot.getNormal(e,t,n,r)}}),Object.assign(Cr.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 gi(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new xi(this,e)}}),Object.assign(X.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(E.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(et.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(Ne.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.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(ae.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.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(ae.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.assign(ut.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(ut.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),sp},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Fo.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Rl.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Cl.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Le.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}}),Et.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),t!==void 0&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(lt.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(De.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===qi},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(qi)}}}),Object.assign(De.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(e===!0?qi:ho),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(ve.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)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new De(arguments[1],arguments[2]))):e==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t)},addDrawCall:function(e,t,n){n!==void 0&&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)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(ve.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(ms.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(Xh.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(sr.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===qi},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(sr.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(e===!0?qi:ho),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(zn.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(mc.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(Oe.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 de}},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=e===zc}},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(Pr.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(Wt.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(Zu.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},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(Zu.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=e===!0?uo:kt}}}),Object.defineProperties(qu.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($t.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(Fa.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this,n=new dc;return n.load(e,function(r){t.setBuffer(r)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),zh.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},ra.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},_r.crossOrigin=void 0,_r.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new jl;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},_r.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new Xl;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},_r.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},_r.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Bf}}));var Va=function(e,t){t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.target=new E,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:Yn.ROTATE,MIDDLE:Yn.DOLLY,RIGHT:Yn.PAN},this.touches={ONE:Zn.ROTATE,TWO:Zn.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),s=o.NONE},this.update=function(){var R=new E,he=new bt().setFromUnitVectors(e.up,new E(0,1,0)),fe=he.clone().inverse(),me=new E,ie=new bt;return function(){var pe=n.object.position;return R.copy(pe).sub(n.target),R.applyQuaternion(he),l.setFromVector3(R),n.autoRotate&&s===o.NONE&&O(C()),n.enableDamping?(l.theta+=u.theta*n.dampingFactor,l.phi+=u.phi*n.dampingFactor):(l.theta+=u.theta,l.phi+=u.phi),l.theta=Math.max(n.minAzimuthAngle,Math.min(n.maxAzimuthAngle,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),l.radius*=h,l.radius=Math.max(n.minDistance,Math.min(n.maxDistance,l.radius)),n.enableDamping===!0?n.target.addScaledVector(f,n.dampingFactor):n.target.add(f),R.setFromSpherical(l),R.applyQuaternion(fe),pe.copy(n.target).add(R),n.object.lookAt(n.target),n.enableDamping===!0?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,f.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),f.set(0,0,0)),h=1,d||me.distanceToSquared(n.object.position)>c||8*(1-ie.dot(n.object.quaternion))>c?(n.dispatchEvent(r),me.copy(n.object.position),ie.copy(n.object.quaternion),d=!1,!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",ye,!1),n.domElement.removeEventListener("mousedown",Qe,!1),n.domElement.removeEventListener("wheel",A,!1),n.domElement.removeEventListener("touchstart",ne,!1),n.domElement.removeEventListener("touchend",Fe,!1),n.domElement.removeEventListener("touchmove",K,!1),document.removeEventListener("mousemove",nt,!1),document.removeEventListener("mouseup",$e,!1),n.domElement.removeEventListener("keydown",L,!1)};var n=this,r={type:"change"},i={type:"start"},a={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},s=o.NONE,c=1e-6,l=new yc,u=new yc,h=1,f=new E,d=!1,m=new X,g=new X,y=new X,p=new X,v=new X,_=new X,x=new X,b=new X,T=new X;function C(){return 2*Math.PI/60/60*n.autoRotateSpeed}function N(){return Math.pow(.95,n.zoomSpeed)}function O(R){u.theta-=R}function J(R){u.phi-=R}var F=function(){var R=new E;return function(fe,me){R.setFromMatrixColumn(me,0),R.multiplyScalar(-fe),f.add(R)}}(),B=function(){var R=new E;return function(fe,me){n.screenSpacePanning===!0?R.setFromMatrixColumn(me,1):(R.setFromMatrixColumn(me,0),R.crossVectors(n.object.up,R)),R.multiplyScalar(fe),f.add(R)}}(),V=function(){var R=new E;return function(fe,me){var ie=n.domElement;if(n.object.isPerspectiveCamera){var Se=n.object.position;R.copy(Se).sub(n.target);var pe=R.length();pe*=Math.tan(n.object.fov/2*Math.PI/180),F(2*fe*pe/ie.clientHeight,n.object.matrix),B(2*me*pe/ie.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(F(fe*(n.object.right-n.object.left)/n.object.zoom/ie.clientWidth,n.object.matrix),B(me*(n.object.top-n.object.bottom)/n.object.zoom/ie.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function Y(R){n.object.isPerspectiveCamera?h/=R:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*R)),n.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function D(R){n.object.isPerspectiveCamera?h*=R:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/R)),n.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function z(R){m.set(R.clientX,R.clientY)}function k(R){x.set(R.clientX,R.clientY)}function q(R){p.set(R.clientX,R.clientY)}function Z(R){g.set(R.clientX,R.clientY),y.subVectors(g,m).multiplyScalar(n.rotateSpeed);var he=n.domElement;O(2*Math.PI*y.x/he.clientHeight),J(2*Math.PI*y.y/he.clientHeight),m.copy(g),n.update()}function ee(R){b.set(R.clientX,R.clientY),T.subVectors(b,x),T.y>0?Y(N()):T.y<0&&D(N()),x.copy(b),n.update()}function te(R){v.set(R.clientX,R.clientY),_.subVectors(v,p).multiplyScalar(n.panSpeed),V(_.x,_.y),p.copy(v),n.update()}function oe(R){R.deltaY<0?D(N()):R.deltaY>0&&Y(N()),n.update()}function Pe(R){var he=!1;switch(R.keyCode){case n.keys.UP:V(0,n.keyPanSpeed),he=!0;break;case n.keys.BOTTOM:V(0,-n.keyPanSpeed),he=!0;break;case n.keys.LEFT:V(n.keyPanSpeed,0),he=!0;break;case n.keys.RIGHT:V(-n.keyPanSpeed,0),he=!0;break}he&&(R.preventDefault(),n.update())}function be(R){if(R.touches.length==1)m.set(R.touches[0].pageX,R.touches[0].pageY);else{var he=.5*(R.touches[0].pageX+R.touches[1].pageX),fe=.5*(R.touches[0].pageY+R.touches[1].pageY);m.set(he,fe)}}function re(R){if(R.touches.length==1)p.set(R.touches[0].pageX,R.touches[0].pageY);else{var he=.5*(R.touches[0].pageX+R.touches[1].pageX),fe=.5*(R.touches[0].pageY+R.touches[1].pageY);p.set(he,fe)}}function G(R){var he=R.touches[0].pageX-R.touches[1].pageX,fe=R.touches[0].pageY-R.touches[1].pageY,me=Math.sqrt(he*he+fe*fe);x.set(0,me)}function Be(R){n.enableZoom&&G(R),n.enablePan&&re(R)}function xe(R){n.enableZoom&&G(R),n.enableRotate&&be(R)}function Te(R){if(R.touches.length==1)g.set(R.touches[0].pageX,R.touches[0].pageY);else{var he=.5*(R.touches[0].pageX+R.touches[1].pageX),fe=.5*(R.touches[0].pageY+R.touches[1].pageY);g.set(he,fe)}y.subVectors(g,m).multiplyScalar(n.rotateSpeed);var me=n.domElement;O(2*Math.PI*y.x/me.clientHeight),J(2*Math.PI*y.y/me.clientHeight),m.copy(g)}function ue(R){if(R.touches.length==1)v.set(R.touches[0].pageX,R.touches[0].pageY);else{var he=.5*(R.touches[0].pageX+R.touches[1].pageX),fe=.5*(R.touches[0].pageY+R.touches[1].pageY);v.set(he,fe)}_.subVectors(v,p).multiplyScalar(n.panSpeed),V(_.x,_.y),p.copy(v)}function $(R){var he=R.touches[0].pageX-R.touches[1].pageX,fe=R.touches[0].pageY-R.touches[1].pageY,me=Math.sqrt(he*he+fe*fe);b.set(0,me),T.set(0,Math.pow(b.y/x.y,n.zoomSpeed)),Y(T.y),x.copy(b)}function Ce(R){n.enableZoom&&$(R),n.enablePan&&ue(R)}function Ye(R){n.enableZoom&&$(R),n.enableRotate&&Te(R)}function Qe(R){if(n.enabled!==!1){R.preventDefault(),n.domElement.focus?n.domElement.focus():window.focus();var he;switch(R.button){case 0:he=n.mouseButtons.LEFT;break;case 1:he=n.mouseButtons.MIDDLE;break;case 2:he=n.mouseButtons.RIGHT;break;default:he=-1}switch(he){case Yn.DOLLY:if(n.enableZoom===!1)return;k(R),s=o.DOLLY;break;case Yn.ROTATE:if(R.ctrlKey||R.metaKey||R.shiftKey){if(n.enablePan===!1)return;q(R),s=o.PAN}else{if(n.enableRotate===!1)return;z(R),s=o.ROTATE}break;case Yn.PAN:if(R.ctrlKey||R.metaKey||R.shiftKey){if(n.enableRotate===!1)return;z(R),s=o.ROTATE}else{if(n.enablePan===!1)return;q(R),s=o.PAN}break;default:s=o.NONE}s!==o.NONE&&(document.addEventListener("mousemove",nt,!1),document.addEventListener("mouseup",$e,!1),n.dispatchEvent(i))}}function nt(R){if(n.enabled!==!1)switch(R.preventDefault(),s){case o.ROTATE:if(n.enableRotate===!1)return;Z(R);break;case o.DOLLY:if(n.enableZoom===!1)return;ee(R);break;case o.PAN:if(n.enablePan===!1)return;te(R);break}}function $e(R){n.enabled!==!1&&(document.removeEventListener("mousemove",nt,!1),document.removeEventListener("mouseup",$e,!1),n.dispatchEvent(a),s=o.NONE)}function A(R){n.enabled===!1||n.enableZoom===!1||s!==o.NONE&&s!==o.ROTATE||(R.preventDefault(),R.stopPropagation(),n.dispatchEvent(i),oe(R),n.dispatchEvent(a))}function L(R){n.enabled===!1||n.enableKeys===!1||n.enablePan===!1||Pe(R)}function ne(R){if(n.enabled!==!1){switch(R.preventDefault(),R.touches.length){case 1:switch(n.touches.ONE){case Zn.ROTATE:if(n.enableRotate===!1)return;be(R),s=o.TOUCH_ROTATE;break;case Zn.PAN:if(n.enablePan===!1)return;re(R),s=o.TOUCH_PAN;break;default:s=o.NONE}break;case 2:switch(n.touches.TWO){case Zn.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Be(R),s=o.TOUCH_DOLLY_PAN;break;case Zn.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;xe(R),s=o.TOUCH_DOLLY_ROTATE;break;default:s=o.NONE}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}}function K(R){if(n.enabled!==!1)switch(R.preventDefault(),R.stopPropagation(),s){case o.TOUCH_ROTATE:if(n.enableRotate===!1)return;Te(R),n.update();break;case o.TOUCH_PAN:if(n.enablePan===!1)return;ue(R),n.update();break;case o.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ce(R),n.update();break;case o.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Ye(R),n.update();break;default:s=o.NONE}}function Fe(R){n.enabled!==!1&&(n.dispatchEvent(a),s=o.NONE)}function ye(R){n.enabled!==!1&&R.preventDefault()}n.domElement.addEventListener("contextmenu",ye,!1),n.domElement.addEventListener("mousedown",Qe,!1),n.domElement.addEventListener("wheel",A,!1),n.domElement.addEventListener("touchstart",ne,!1),n.domElement.addEventListener("touchend",Fe,!1),n.domElement.addEventListener("touchmove",K,!1),n.domElement.addEventListener("keydown",L,!1),n.domElement.tabIndex===-1&&(n.domElement.tabIndex=0),this.update()};Va.prototype=Object.create(sn.prototype),Va.prototype.constructor=Va;var Pc=function(e,t){Va.call(this,e,t),this.mouseButtons.LEFT=Yn.PAN,this.mouseButtons.RIGHT=Yn.ROTATE,this.touches.ONE=Zn.PAN,this.touches.TWO=Zn.DOLLY_ROTATE};Pc.prototype=Object.create(sn.prototype),Pc.prototype.constructor=Pc;var Wn=function(e){ae.call(this),this.element=e,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})};Wn.prototype=Object.create(ae.prototype),Wn.prototype.constructor=Wn;var Ps=function(e){Wn.call(this,e)};Ps.prototype=Object.create(Wn.prototype),Ps.prototype.constructor=Ps;var x0=function(){var e=this,t,n,r,i,a=new We,o={camera:{fov:0,style:""},objects:new WeakMap},s=document.createElement("div");s.style.overflow="hidden",this.domElement=s;var c=document.createElement("div");c.style.WebkitTransformStyle="preserve-3d",c.style.transformStyle="preserve-3d",c.style.pointerEvents="none",s.appendChild(c);var l=/Trident/i.test(navigator.userAgent);this.getSize=function(){return{width:t,height:n}},this.setSize=function(p,v){t=p,n=v,r=t/2,i=n/2,s.style.width=p+"px",s.style.height=v+"px",c.style.width=p+"px",c.style.height=v+"px"};function u(p){return Math.abs(p)<1e-10?0:p}function h(p){var v=p.elements;return"matrix3d("+u(v[0])+","+u(-v[1])+","+u(v[2])+","+u(v[3])+","+u(v[4])+","+u(-v[5])+","+u(v[6])+","+u(v[7])+","+u(v[8])+","+u(-v[9])+","+u(v[10])+","+u(v[11])+","+u(v[12])+","+u(-v[13])+","+u(v[14])+","+u(v[15])+")"}function f(p,v){var _=p.elements,x="matrix3d("+u(_[0])+","+u(_[1])+","+u(_[2])+","+u(_[3])+","+u(-_[4])+","+u(-_[5])+","+u(-_[6])+","+u(-_[7])+","+u(_[8])+","+u(_[9])+","+u(_[10])+","+u(_[11])+","+u(_[12])+","+u(_[13])+","+u(_[14])+","+u(_[15])+")";return l?"translate(-50%,-50%)translate("+r+"px,"+i+"px)"+v+x:"translate(-50%,-50%)"+x}function d(p,v,_,x){if(p instanceof Wn){p.onBeforeRender(e,v,_);var b;p instanceof Ps?(a.copy(_.matrixWorldInverse),a.transpose(),a.copyPosition(p.matrixWorld),a.scale(p.scale),a.elements[3]=0,a.elements[7]=0,a.elements[11]=0,a.elements[15]=1,b=f(a,x)):b=f(p.matrixWorld,x);var T=p.element,C=o.objects.get(p);if(C===void 0||C.style!==b){T.style.WebkitTransform=b,T.style.transform=b;var N={style:b};l&&(N.distanceToCameraSquared=m(_,p)),o.objects.set(p,N)}T.style.display=p.visible?"":"none",T.parentNode!==c&&c.appendChild(T),p.onAfterRender(e,v,_)}for(var O=0,J=p.children.length;O<J;O++)d(p.children[O],v,_,x)}var m=function(){var p=new E,v=new E;return function(_,x){return p.setFromMatrixPosition(_.matrixWorld),v.setFromMatrixPosition(x.matrixWorld),p.distanceToSquared(v)}}();function g(p){var v=[];return p.traverse(function(_){_ instanceof Wn&&v.push(_)}),v}function y(p){for(var v=g(p).sort(function(T,C){var N=o.objects.get(T).distanceToCameraSquared,O=o.objects.get(C).distanceToCameraSquared;return N-O}),_=v.length,x=0,b=v.length;x<b;x++)v[x].element.style.zIndex=_-x}this.render=function(p,v){var _=v.projectionMatrix.elements[5]*i;if(o.camera.fov!==_&&(v.isPerspectiveCamera?(s.style.WebkitPerspective=_+"px",s.style.perspective=_+"px"):(s.style.WebkitPerspective="",s.style.perspective=""),o.camera.fov=_),p.autoUpdate===!0&&p.updateMatrixWorld(),v.parent===null&&v.updateMatrixWorld(),v.isOrthographicCamera)var x=-(v.right+v.left)/2,b=(v.top+v.bottom)/2;var T=v.isOrthographicCamera?"scale("+_+")translate("+u(x)+"px,"+u(b)+"px)"+h(v.matrixWorldInverse):"translateZ("+_+"px)"+h(v.matrixWorldInverse),C=T+"translate("+r+"px,"+i+"px)";o.camera.style!==C&&!l&&(c.style.WebkitTransform=C,c.style.transform=C,o.camera.style=C),d(p,p,v,T),l&&y(p)}};function pf(e,t,n){var r=t.getBoundingClientRect(),i=r.top,a=r.left,o=r.width,s=r.height;return new _e.Vector2((e.x-a)/o*2-1,-(e.y-i)/s*2+1)}var vf=function(e){Ya(t,e);function t(n,r,i,a,o){var s=e.call(this)||this;s.type="RoundedBoxGeometry",o=isNaN(o)?1:Math.max(1,Math.floor(o)),n=isNaN(n)?1:n,r=isNaN(r)?1:r,i=isNaN(i)?1:i,a=isNaN(a)?.15:a,a=Math.min(a,Math.min(n,Math.min(r,Math.min(i)))/2);var c=n/2-a,l=r/2-a,u=i/2-a;s.parameters={width:n,height:r,depth:i,radius:a,radiusSegments:o};var h=o+1,f=h*o+1<<3,d=new _e.BufferAttribute(new Float32Array(f*3),3),m=new _e.BufferAttribute(new Float32Array(f*3),3),g=[],y=[];new _e.Vector3;var p=new _e.Vector3,v=[],_=[],x=[],b=h*o,T=h*o+1;C(),O(),N(),J(),B(),F();function C(){for(var D=[new _e.Vector3(1,1,1),new _e.Vector3(1,1,-1),new _e.Vector3(-1,1,-1),new _e.Vector3(-1,1,1),new _e.Vector3(1,-1,1),new _e.Vector3(1,-1,-1),new _e.Vector3(-1,-1,-1),new _e.Vector3(-1,-1,1)],z=0;z<8;z++)g.push([]),y.push([]);for(var k=Math.PI/2,q=new _e.Vector3(c,l,u),Z=0;Z<=o;Z++){var ee=Z/o,te=ee*k,oe=Math.cos(te),Pe=Math.sin(te);if(Z==o){p.set(0,1,0);var be=p.clone().multiplyScalar(a).add(q);g[0].push(be),v.push(be);var re=p.clone();y[0].push(re),_.push(re);continue}for(var G=0;G<=o;G++){var Be=G/o,xe=Be*k;p.x=oe*Math.cos(xe),p.y=Pe,p.z=oe*Math.sin(xe);var be=p.clone().multiplyScalar(a).add(q);g[0].push(be),v.push(be);var re=p.clone().normalize();y[0].push(re),_.push(re)}}for(var Te=1;Te<8;Te++)for(var z=0;z<g[0].length;z++){var be=g[0][z].clone().multiply(D[Te]);g[Te].push(be),v.push(be);var re=y[0][z].clone().multiply(D[Te]);y[Te].push(re),_.push(re)}}function N(){for(var D=[!0,!1,!0,!1,!1,!0,!1,!0],z=h*(o-1),k=0;k<8;k++){for(var q=T*k,Z=0;Z<o-1;Z++)for(var ee=Z*h,te=(Z+1)*h,oe=0;oe<o;oe++){var Pe=oe+1,be=q+ee+oe,re=q+ee+Pe,G=q+te+oe,Be=q+te+Pe;D[k]?(x.push(be),x.push(G),x.push(re),x.push(re),x.push(G),x.push(Be)):(x.push(be),x.push(re),x.push(G),x.push(re),x.push(Be),x.push(G))}for(var oe=0;oe<o;oe++){var be=q+z+oe,re=q+z+oe+1,G=q+b;D[k]?(x.push(be),x.push(G),x.push(re)):(x.push(be),x.push(re),x.push(G))}}}function O(){var D=b,z=b+T,k=b+T*2,q=b+T*3;x.push(D),x.push(z),x.push(k),x.push(D),x.push(k),x.push(q),D=b+T*4,z=b+T*5,k=b+T*6,q=b+T*7,x.push(D),x.push(k),x.push(z),x.push(D),x.push(q),x.push(k),D=0,z=T,k=T*4,q=T*5,x.push(D),x.push(k),x.push(z),x.push(z),x.push(k),x.push(q),D=T*2,z=T*3,k=T*6,q=T*7,x.push(D),x.push(k),x.push(z),x.push(z),x.push(k),x.push(q),D=o,z=o+T*3,k=o+T*4,q=o+T*7,x.push(D),x.push(z),x.push(k),x.push(z),x.push(q),x.push(k),D=o+T,z=o+T*2,k=o+T*5,q=o+T*6,x.push(D),x.push(k),x.push(z),x.push(z),x.push(k),x.push(q)}function J(){for(var D=0;D<4;D++)for(var z=D*T,k=4*T+z,q=(D&1)===1,Z=0;Z<o;Z++){var ee=Z+1,te=z+Z,oe=z+ee,Pe=k+Z,be=k+ee;q?(x.push(te),x.push(Pe),x.push(oe),x.push(oe),x.push(Pe),x.push(be)):(x.push(te),x.push(oe),x.push(Pe),x.push(oe),x.push(be),x.push(Pe))}}function F(){for(var D=[0,2,4,6],z=[1,3,5,7],k=0;k<4;k++)for(var q=T*D[k],Z=T*z[k],ee=1>=k,te=0;te<o;te++){var oe=te*h,Pe=(te+1)*h,be=q+oe,re=q+Pe,G=Z+oe,Be=Z+Pe;ee?(x.push(be),x.push(G),x.push(re),x.push(re),x.push(G),x.push(Be)):(x.push(be),x.push(re),x.push(G),x.push(re),x.push(Be),x.push(G))}}function B(){for(var D=o-1,z=[0,1,4,5],k=[3,2,7,6],q=[0,1,1,0],Z=0;Z<4;Z++)for(var ee=z[Z]*T,te=k[Z]*T,oe=0;oe<=D;oe++){var Pe=ee+o+oe*h,be=ee+(oe!=D?o+(oe+1)*h:T-1),re=te+o+oe*h,G=te+(oe!=D?o+(oe+1)*h:T-1);q[Z]?(x.push(Pe),x.push(re),x.push(be),x.push(be),x.push(re),x.push(G)):(x.push(Pe),x.push(be),x.push(re),x.push(be),x.push(G),x.push(re))}}for(var V=0,Y=0;Y<v.length;Y++)d.setXYZ(V,v[Y].x,v[Y].y,v[Y].z),m.setXYZ(V,_[Y].x,_[Y].y,_[Y].z),V++;return s.setIndex(new _e.BufferAttribute(new Uint16Array(x),1)),s.setAttribute("position",d),s.setAttribute("normal",m),s}return t}(_e.BufferGeometry);function ka(e,t){return typeof e!="number"||typeof t!="number"?!1:Math.abs(e-t)<.001}function Wa(e,t,n,r){r===void 0&&(r=function(a){return a});var i=r(n);return e*(1-i)+t*i}var Lt=Number((Math.PI/2).toFixed(5));function _0(e,t,n){var r=new _e.Shape;return r.moveTo(n,0),r.lineTo(e-n,0),r.absarc(e-n,n,n,-Lt,0,!1),r.lineTo(e,t-n),r.absarc(e-n,t-n,n,0,Lt,!1),r.lineTo(n,t),r.absarc(n,t-n,n,Lt,Math.PI,!1),r.lineTo(0,n),r.absarc(n,n,n,Math.PI,Math.PI*1.5,!1),r}var Xa=function(e){var t=document.createElement("div");t.innerText=e;var n=new Wn(t);return n.name=e,n.scale.set(.3,.3,.3),t.style.pointerEvents="none",t.style.backfaceVisibility="hidden",n},Cs=function(e){var t=new _e.PlaneGeometry(5,5),n=new _e.MeshBasicMaterial({transparent:!0,opacity:0}),r=new _e.Mesh(t,n),i=document.createElement("div");i.innerText=e;var a=new Wn(i);return a.name=e,a.scale.set(.3,.3,.3),i.style.color="#ffffff",i.style.opacity="0.5",i.style.pointerEvents="none",i.style.backfaceVisibility="hidden",r.rotateX(-Lt),r.add(a),r},b0=function(e){Ya(t,e);function t(n,r){var i=e.call(this,n)||this;i.camera=new yr.Camera(90),i.scene=new _e.Scene,i.renderer=new _e.WebGLRenderer({antialias:!0,alpha:!0}),i.css3drenderer=new x0,i.ambientLight=new _e.AmbientLight(16777215,.7),i.wrapper=document.createElement("div"),i.arrows=document.createElement("div"),i.arrowLeft=document.createElement("div"),i.arrowRight=document.createElement("div"),i.arrowFront=document.createElement("div"),i.arrowBack=document.createElement("div"),i.arrowTop=document.createElement("div"),i.arrowBottom=document.createElement("div"),i.spherical=null,i.dragging=!1,i.style=document.createElement("style"),i.directionalLight=new _e.DirectionalLight(16777215,.2),i.box=new _e.Mesh(new vf(8,8,8,.5,20),new _e.MeshPhongMaterial({color:16777215})),i.faces=new _e.Group,i.orient=function(s){var c=s.longitude,l=s.latitude;i.dragging=!1,i.spherical=null,i.controls.enableDamping=!1,i.five.setState(Object.assign({latitude:l},c!==void 0?{longitude:c+i.config.fixedLongitude}:{})),i.five.ready().then(function(){i.controls.enableDamping=!0,i.setState({arrowsVisible:!0})})},i.onRenderFrame=function(){var s,c,l,u,h;if(i.renderer.render(i.scene,i.camera),i.css3drenderer.render(i.scene,i.camera),i.directionalLight.position.copy(i.camera.position),(s=i.controls)===null||s===void 0||s.update(),i.dragging){i.camera.computePose(),i.updateByCamera();var f=i.camera.pose,d=f.longitude,m=f.latitude;i.five.setState({longitude:d,latitude:m},!0),i.updateArrows({longitude:d,latitude:m})}else if(i.spherical&&(!ka(i.spherical.pi,(c=i.controls)===null||c===void 0?void 0:c.getPolarAngle())||!ka(i.spherical.theta,(l=i.controls)===null||l===void 0?void 0:l.getAzimuthalAngle()))){i.spherical={pi:(u=i.controls)===null||u===void 0?void 0:u.getPolarAngle(),theta:(h=i.controls)===null||h===void 0?void 0:h.getAzimuthalAngle()},i.camera.computePose(),i.updateByCamera();var g=i.camera.pose,d=g.longitude,m=g.latitude;i.five.setState({longitude:d,latitude:m},!0),i.updateArrows({longitude:d,latitude:m})}else i.spherical=null},i.onTapGesture=function(s){var c=s.pointers[0].clientX,l=s.pointers[0].clientY,u=pf({x:c,y:l},i.wrapper),h=new _e.Raycaster;h.setFromCamera(u,i.camera);var f=h.intersectObjects(i.faces.children,!1)[0];if(f){var d=f.object.userData,m=d.longitude,g=d.latitude;i.orient({longitude:m,latitude:g})}},i.onFiveWantsGesture=function(){if(i.spherical)return!1},i.onFiveModeChange=function(s){i.controls&&(i.controls.maxPolarAngle=s==="Topview"?0:Lt)},i.onCameraUpdate=function(s){var c=s.state;if(!i.dragging&&!i.spherical){var l=c.longitude,u=c.latitude;i.camera.pose.longitude===l&&i.camera.pose.latitude===u||(i.camera.setFromPose({longitude:l,latitude:u,distance:20,offset:new _e.Vector3(0,0,0)}),i.updateByCamera(),i.updateArrows({longitude:l,latitude:u}))}},i.onPanStart=function(s){i.dragging=!0,i.spherical={}},i.onMouseMove=function(s){if(!i.dragging){var c=pf({x:s.clientX,y:s.clientY},i.wrapper),l=new _e.Raycaster;l.setFromCamera(c,i.camera);var u=l.intersectObjects(i.faces.children,!1)[0];i.faces.children.forEach(function(h){h.material.opacity=0,h.children[0].element.style.color=""}),u&&(u.object.material.opacity=.3,u.object.children[0].element.style.color="#336dff")}},i.onPanEnd=function(s){i.dragging=!1,i.spherical={pi:i.controls.getPolarAngle(),theta:i.controls.getAzimuthalAngle()}},i.dispose=function(){i.disable()},i.five=n;var a={enabled:!1,visible:!0,arrowsVisible:!1};i.state=Object.assign(a,r==null?void 0:r.initialState);var o=Bt({fixedLongitude:0,orthoView:!0},r==null?void 0:r.config);return i._config=o,i.state.enabled&&i._enable({userAction:!1}),i.mc=new Fs.Manager(i.wrapper),i.mc.add(new Fs.Tap({interval:410})),i.mc.add(new Fs.Pan({threshold:10,pointers:0})),i.camera.setFromPose({distance:20,offset:new _e.Vector3(0,0,0),longitude:n.camera.pose.latitude,latitude:n.camera.pose.latitude}),i.cylinder=new _e.Mesh(new _e.CylinderGeometry(13.2,14,.01,50,1,!0),new _e.ShaderMaterial({uniforms:{radiusTop:{value:13.2},radiusBottom:{value:14},opacity:{value:1}},vertexShader:`
3278
3278
  varying vec3 pos;
3279
3279
  varying mat4 vViewMatrix;
3280
3280
  void main() {
@@ -3304,7 +3304,7 @@ vec4 envMapTexelToLinear(vec4 color) {
3304
3304
  vec4 color = mix(color1, color2, z);
3305
3305
  gl_FragColor = color;
3306
3306
  }
3307
- `,transparent:!0})),i.init(),i}return Object.defineProperty(t.prototype,"config",{get:function(){return Bt({},this._config)},enumerable:!1,configurable:!0}),t.prototype.updateState=function(n,r){var i=this.state;this.state=Bt(Bt({},this.state),n),typeof n.arrowsVisible=="boolean"&&this.handleArrowsVisible(n.arrowsVisible),this.hooks.emit("stateChange",{state:this.state,prevState:i,userAction:r})},t.prototype.appendTo=function(n){if(n){n.appendChild(this.wrapper);var r=this.wrapper.getBoundingClientRect(),i=r.width,a=r.height;this.renderer.setSize(i,a),this.css3drenderer.setSize(i,a)}},t.prototype.init=function(){this.renderer.setClearAlpha(0),this.renderer.domElement.style.outline="none",this.initDom(),this.initFaces(),this.initControls(),this.initLights();var n=this.cylinder;n.position.y=-3;var r=Ss("西");r.position.set(-19,0,0),n.add(r);var i=Ss("东");i.position.set(19,0,0),n.add(i);var a=Ss("北");a.position.set(0,0,-19),n.add(a);var o=Ss("南");o.position.set(0,0,19),n.add(o),this.updateByCamera(),this.scene.add(n,this.box,this.faces)},t.prototype.initDom=function(){this.style.innerHTML=`
3307
+ `,transparent:!0})),i.init(),i}return Object.defineProperty(t.prototype,"config",{get:function(){return Bt({},this._config)},enumerable:!1,configurable:!0}),t.prototype.updateState=function(n,r){var i=this.state;this.state=Bt(Bt({},this.state),n),typeof n.arrowsVisible=="boolean"&&this.handleArrowsVisible(n.arrowsVisible),this.hooks.emit("stateChange",{state:this.state,prevState:i,userAction:r})},t.prototype.appendTo=function(n){if(n){n.appendChild(this.wrapper);var r=this.wrapper.getBoundingClientRect(),i=r.width,a=r.height;this.renderer.setSize(i,a),this.css3drenderer.setSize(i,a)}},t.prototype.init=function(){this.renderer.setClearAlpha(0),this.renderer.domElement.style.outline="none",this.initDom(),this.initFaces(),this.initControls(),this.initLights();var n=this.cylinder;n.position.y=-3;var r=Cs("西");r.position.set(-19,0,0),n.add(r);var i=Cs("东");i.position.set(19,0,0),n.add(i);var a=Cs("北");a.position.set(0,0,-19),n.add(a);var o=Cs("南");o.position.set(0,0,19),n.add(o),this.updateByCamera(),this.scene.add(n,this.box,this.faces),this.scene.rotation.y=this.config.fixedLongitude},t.prototype.initDom=function(){this.style.innerHTML=`
3308
3308
  .OrientationPlugin .OrientationArrows {
3309
3309
  position: absolute;
3310
3310
  top: 0;
@@ -3404,4 +3404,25 @@ vec4 envMapTexelToLinear(vec4 color) {
3404
3404
  border-color: transparent transparent var(--color) transparent;
3405
3405
  transform: translate(0, -15px);
3406
3406
  }
3407
- `,this.wrapper.className="OrientationPlugin",this.arrows.className="OrientationArrows",this.wrapper.style.cssText="position: relative; width: 100%; height: 100%",this.wrapper.appendChild(this.arrows),this.arrowLeft.className=this.arrowRight.className=this.arrowTop.className=this.arrowBack.className=this.arrowFront.className="OrientationArrow",this.arrowBottom.className="OrientationArrow disabled",this.arrowBack.innerText="后",this.arrowFront.innerText="前",this.arrowLeft.innerText="左",this.arrowRight.innerText="右",this.arrowTop.innerText="上",this.arrowBottom.innerText="下",this.css3drenderer.domElement.style.cssText="position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; color: #00000090;"},t.prototype.bindEvents=function(){var n=this;this.five.on("renderFrame",this.onRenderFrame),this.five.on("camera.update",this.onCameraUpdate),this.five.on("wantsGesture",this.onFiveWantsGesture),this.five.on("modeChange",this.onFiveModeChange),this.mc.on("tap",this.onTapGesture),this.mc.on("panstart",this.onPanStart),this.mc.on("panend",this.onPanEnd),this.wrapper.addEventListener("mousemove",this.onMouseMove),this.arrowTop.onclick=function(){return n.orient({longitude:0,latitude:Lt})},this.arrowLeft.onclick=function(){return n.orient({longitude:-Lt,latitude:0})},this.arrowRight.onclick=function(){return n.orient({longitude:Lt,latitude:0})},this.arrowFront.onclick=function(){return n.orient({longitude:0,latitude:0})},this.arrowBack.onclick=function(){return n.orient({longitude:Math.PI,latitude:0})}},t.prototype.unbindEvents=function(){this.five.off("renderFrame",this.onRenderFrame),this.five.off("camera.update",this.onCameraUpdate),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("modeChange",this.onFiveModeChange),this.mc.off("tap",this.onTapGesture),this.mc.off("panstart",this.onPanStart),this.mc.off("panend",this.onPanEnd),this.wrapper.removeEventListener("mousemove",this.onMouseMove),this.arrowTop.onclick=null,this.arrowLeft.onclick=null,this.arrowRight.onclick=null,this.arrowFront.onclick=null,this.arrowBack.onclick=null},t.prototype.updateByCamera=function(){var n=ka(.2,1,this.camera.pose.latitude/Math.PI*2,function(s){return s*s}),r=ka(11,13,this.camera.pose.latitude/Math.PI*2,function(s){return s*s}),i=ka(12,15,this.camera.pose.latitude/Math.PI*2,function(s){return s*s}),a=ka(13,19,this.camera.pose.latitude/Math.PI*2,function(s){return s*s}),o=ka(-.2,.5,this.camera.pose.latitude/Math.PI*2,function(s){return s*s});this.cylinder.geometry=new _e.CylinderGeometry(r,i,.01,50,1,!0),this.cylinder.material.uniforms.radiusTop.value=r,this.cylinder.material.uniforms.radiusBottom.value=i,this.cylinder.material.needsUpdate=!0,this.cylinder.children.forEach(function(s){s.position.normalize().multiplyScalar(a),s.scale.set(n,n,n);var c=s.children[0];c&&(c.element.style.opacity=o.toString())})},t.prototype.updateArrows=function(n){n.longitude;var r=n.latitude,i=Lt-r<.02;this.setState({arrowsVisible:i})},t.prototype.handleArrowsVisible=function(n){var r=this;if(this.state.enabled)if(this.cylinder.material.uniforms.opacity.value=n?.4:1,this.cylinder.material.needsUpdate=!0,n){var i=this.five.getCurrentState(),a=i.longitude,o=i.latitude;if(Lt-o<.03)this.five.state.mode==="Topview"||this.five.state.mode==="Mapview"?(this.faces.getObjectByName("上").element.className="active",this.arrows.innerHTML="",this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowFront),this.arrows.style.transform="rotate(".concat(a/Math.PI*180,"deg)")):(this.arrows.innerHTML="",this.faces.getObjectByName("上").element.className="");else{switch(this.arrows.innerHTML="",this.arrows.appendChild(this.arrowTop),this.config.orthoView&&this.five.ready().then(function(){r.five.controller.cameraType="orthographic",r.five.ready().then(function(){return r.five.controller.cameraMotion.ended=!1})}),a){case 0:this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("前").element.className="active";break;case Lt:this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("右").element.className="active";break;case Math.PI:this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("后").element.className="active";break;default:this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("左").element.className="active";break}this.arrows.style.transform=""}this.arrows.style.display="block"}else this.config.orthoView&&(this.five.controller.cameraType="auto",this.five.ready().then(function(){return r.five.controller.cameraMotion.ended=!1})),this.arrows.style.display="none",this.faces.children.forEach(function(s){s.children[0].element.className=""})},t.prototype.setState=function(n,r){r===void 0&&(r={});var i=this.state,a=r.userAction!==void 0?r.userAction:!0;if(this.updateState(n,a),n.enabled!==void 0&&i.enabled!==n.enabled){var o={userAction:a};n.enabled?this._enable(o):this._disable(o)}},t.prototype.initLights=function(){this.directionalLight.target=this.box,this.scene.add(this.ambientLight,this.directionalLight)},t.prototype.initFaces=function(){var n=x0(7,7,.5),r=new _e.ShapeGeometry(n);r.translate(-3.5,-3.5,0);var i=new _e.Mesh(r,new _e.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));i.userData={longitude:0,latitude:0},i.position.z=4.1,i.add(Wa("前"));var a=new _e.Mesh(r,new _e.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));a.rotateY(Math.PI),a.position.z=-4.1,a.add(Wa("后")),a.userData={longitude:Math.PI,latitude:0};var o=new _e.Mesh(r,new _e.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));o.rotateY(Lt),o.position.x=4.1,o.add(Wa("右")),o.userData={longitude:Lt,latitude:0};var s=new _e.Mesh(r,new _e.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));s.rotateY(-Lt),s.position.x=-4.1,s.add(Wa("左")),s.userData={longitude:-Lt,latitude:0};var c=new _e.Mesh(r,new _e.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));c.rotateX(-Lt),c.position.y=4.1,c.add(Wa("上")),c.userData={longitude:0,latitude:Lt},this.faces.add(i,a,s,o,c)},t.prototype.initControls=function(){var n=this.controls=new Va(this.camera,this.renderer.domElement);n.enableZoom=!1,n.enableDamping=!0,n.enablePan=!1,n.maxPolarAngle=Lt,n.dampingFactor=.15,n.rotateSpeed=.25},t.prototype.load=function(n){return Os(this,void 0,void 0,function(){return Ds(this,function(r){return[2]})})},t.prototype._enable=function(n){var r=this.five.getCurrentState(),i=r.longitude,a=r.latitude;this.camera.setFromPose({longitude:i,latitude:a,distance:20,offset:new _e.Vector3(0,0,0)}),this.updateByCamera(),this.wrapper.appendChild(this.renderer.domElement),this.wrapper.appendChild(this.css3drenderer.domElement),this.bindEvents()},t.prototype._disable=function(n){this.wrapper.removeChild(this.renderer.domElement),this.wrapper.removeChild(this.css3drenderer.domElement),this.unbindEvents()},t.prototype.enable=function(n){var r;if(!this.state.enabled){var i=(r=n==null?void 0:n.userAction)!==null&&r!==void 0?r:!0;this.updateState({enabled:!0},i),this._enable({userAction:i}),document.head.appendChild(this.style)}},t.prototype.disable=function(n){var r;if(this.state.enabled!==!1){var i=(r=n==null?void 0:n.userAction)!==null&&r!==void 0?r:!0;this.updateState({enabled:!1},i),this._disable({userAction:i}),document.head.removeChild(this.style)}},t}(Ft.BasePlugin.Controller),b0=function(e,t){return new _0(e,t)};Ft.ItemMaskPlugin=Nf,Ft.OrientationPlugin=b0,Ft.RoundedBoxGeometry=pf,Object.defineProperty(Ft,Symbol.toStringTag,{value:"Module"})});
3407
+ `,this.wrapper.className="OrientationPlugin",this.arrows.className="OrientationArrows",this.wrapper.style.cssText="position: relative; width: 100%; height: 100%",this.wrapper.appendChild(this.arrows),this.arrowLeft.className=this.arrowRight.className=this.arrowTop.className=this.arrowBack.className=this.arrowFront.className="OrientationArrow",this.arrowBottom.className="OrientationArrow disabled",this.arrowBack.innerText="后",this.arrowFront.innerText="前",this.arrowLeft.innerText="左",this.arrowRight.innerText="右",this.arrowTop.innerText="上",this.arrowBottom.innerText="下",this.css3drenderer.domElement.style.cssText="position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; color: #00000090;"},t.prototype.bindEvents=function(){var n=this;this.five.on("renderFrame",this.onRenderFrame),this.five.on("camera.update",this.onCameraUpdate),this.five.on("wantsGesture",this.onFiveWantsGesture),this.five.on("modeChange",this.onFiveModeChange),this.mc.on("tap",this.onTapGesture),this.mc.on("panstart",this.onPanStart),this.mc.on("panend",this.onPanEnd),this.wrapper.addEventListener("mousemove",this.onMouseMove),this.arrowTop.onclick=function(){return n.orient({longitude:0,latitude:Lt})},this.arrowLeft.onclick=function(){return n.orient({longitude:-Lt,latitude:0})},this.arrowRight.onclick=function(){return n.orient({longitude:Lt,latitude:0})},this.arrowFront.onclick=function(){return n.orient({longitude:0,latitude:0})},this.arrowBack.onclick=function(){return n.orient({longitude:Math.PI,latitude:0})}},t.prototype.unbindEvents=function(){this.five.off("renderFrame",this.onRenderFrame),this.five.off("camera.update",this.onCameraUpdate),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("modeChange",this.onFiveModeChange),this.mc.off("tap",this.onTapGesture),this.mc.off("panstart",this.onPanStart),this.mc.off("panend",this.onPanEnd),this.wrapper.removeEventListener("mousemove",this.onMouseMove),this.arrowTop.onclick=null,this.arrowLeft.onclick=null,this.arrowRight.onclick=null,this.arrowFront.onclick=null,this.arrowBack.onclick=null},t.prototype.updateByCamera=function(){var n=Wa(.2,1,this.camera.pose.latitude/Math.PI*2,function(s){return s*s}),r=Wa(11,13,this.camera.pose.latitude/Math.PI*2,function(s){return s*s}),i=Wa(12,15,this.camera.pose.latitude/Math.PI*2,function(s){return s*s}),a=Wa(13,19,this.camera.pose.latitude/Math.PI*2,function(s){return s*s}),o=Wa(-.2,.5,this.camera.pose.latitude/Math.PI*2,function(s){return s*s});this.cylinder.geometry=new _e.CylinderGeometry(r,i,.01,50,1,!0),this.cylinder.material.uniforms.radiusTop.value=r,this.cylinder.material.uniforms.radiusBottom.value=i,this.cylinder.material.needsUpdate=!0,this.cylinder.children.forEach(function(s){s.position.normalize().multiplyScalar(a),s.scale.set(n,n,n);var c=s.children[0];c&&(c.element.style.opacity=o.toString())})},t.prototype.updateArrows=function(n){n.longitude;var r=n.latitude,i=Lt-r<.02;this.setState({arrowsVisible:i})},t.prototype.handleArrowsVisible=function(n){var r=this;if(this.state.enabled)if(this.cylinder.material.uniforms.opacity.value=n?.4:1,this.cylinder.material.needsUpdate=!0,n){var i=this.five.getCurrentState(),a=i.longitude,o=i.latitude;if(Lt-o<.03)this.five.state.mode==="Topview"||this.five.state.mode==="Mapview"?(this.faces.getObjectByName("上").element.className="active",this.arrows.innerHTML="",this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowFront),this.arrows.style.transform="rotate(".concat((a-this.config.fixedLongitude)/Math.PI*180,"deg)")):(this.arrows.innerHTML="",this.faces.getObjectByName("上").element.className="");else{switch(this.arrows.innerHTML="",this.arrows.appendChild(this.arrowTop),this.config.orthoView&&this.five.ready().then(function(){r.five.controller.cameraType="orthographic",r.five.ready().then(function(){return r.five.controller.cameraMotion.ended=!1})}),!0){case ka(0,a-this.config.fixedLongitude):this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("前").element.className="active";break;case ka(Lt,a-this.config.fixedLongitude):this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("右").element.className="active";break;case ka(Math.PI,a-this.config.fixedLongitude):this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("后").element.className="active";break;default:this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("左").element.className="active";break}this.arrows.style.transform=""}this.arrows.style.display="block"}else this.config.orthoView&&(this.five.controller.cameraType="auto",this.five.ready().then(function(){return r.five.controller.cameraMotion.ended=!1})),this.arrows.style.display="none",this.faces.children.forEach(function(s){s.children[0].element.className=""})},t.prototype.setState=function(n,r){r===void 0&&(r={});var i=this.state,a=r.userAction!==void 0?r.userAction:!0;if(this.updateState(n,a),n.enabled!==void 0&&i.enabled!==n.enabled){var o={userAction:a};n.enabled?this._enable(o):this._disable(o)}},t.prototype.initLights=function(){this.directionalLight.target=this.box,this.scene.add(this.ambientLight,this.directionalLight)},t.prototype.initFaces=function(){var n=_0(7,7,.5),r=new _e.ShapeGeometry(n);r.translate(-3.5,-3.5,0);var i=new _e.Mesh(r,new _e.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));i.userData={longitude:0,latitude:0},i.position.z=4.1,i.add(Xa("前"));var a=new _e.Mesh(r,new _e.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));a.rotateY(Math.PI),a.position.z=-4.1,a.add(Xa("后")),a.userData={longitude:Math.PI,latitude:0};var o=new _e.Mesh(r,new _e.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));o.rotateY(Lt),o.position.x=4.1,o.add(Xa("右")),o.userData={longitude:Lt,latitude:0};var s=new _e.Mesh(r,new _e.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));s.rotateY(-Lt),s.position.x=-4.1,s.add(Xa("左")),s.userData={longitude:-Lt,latitude:0};var c=new _e.Mesh(r,new _e.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));c.rotateX(-Lt),c.position.y=4.1,c.add(Xa("上")),c.userData={longitude:0,latitude:Lt},this.faces.add(i,a,s,o,c)},t.prototype.initControls=function(){var n=this.controls=new Va(this.camera,this.renderer.domElement);n.enableZoom=!1,n.enableDamping=!0,n.enablePan=!1,n.maxPolarAngle=Lt,n.dampingFactor=.15,n.rotateSpeed=.25},t.prototype.load=function(n){return Za(this,void 0,void 0,function(){return Ja(this,function(r){return[2]})})},t.prototype._enable=function(n){var r=this.five.getCurrentState(),i=r.longitude,a=r.latitude;this.camera.setFromPose({longitude:i,latitude:a,distance:20,offset:new _e.Vector3(0,0,0)}),this.updateByCamera(),this.wrapper.appendChild(this.renderer.domElement),this.wrapper.appendChild(this.css3drenderer.domElement),this.bindEvents()},t.prototype._disable=function(n){this.wrapper.removeChild(this.renderer.domElement),this.wrapper.removeChild(this.css3drenderer.domElement),this.unbindEvents()},t.prototype.enable=function(n){var r;if(!this.state.enabled){var i=(r=n==null?void 0:n.userAction)!==null&&r!==void 0?r:!0;this.updateState({enabled:!0},i),this._enable({userAction:i}),document.head.appendChild(this.style)}},t.prototype.disable=function(n){var r;if(this.state.enabled!==!1){var i=(r=n==null?void 0:n.userAction)!==null&&r!==void 0?r:!0;this.updateState({enabled:!1},i),this._disable({userAction:i}),document.head.removeChild(this.style)}},t}(Ct.BasePlugin.Controller),w0=function(e,t){return new b0(e,t)},M0=function(e){Ya(t,e);function t(n,r){var i=e.call(this,n)||this;return i.data={},i.pluginName="BackgroundPlugin",i._onFiveCameraUpdate=function(a){var o=(Math.PI/2-Math.max(a.latitude,0))/(Math.PI/2),s=Math.max(.2-o,0)*10;i.gradientBg&&(i.gradientBg.style.transform="translateY(-".concat((1-o)*50,"%)")),i.groundBg&&(i.groundBg.style.backgroundImage="radial-gradient(circle, #2E303350 ".concat(s*100,"%, transparent ").concat(s*120,"%)"))},i._addEventListener=function(){i.five.on("cameraUpdate",i._onFiveCameraUpdate)},i._removeEventListener=function(){i.five.off("cameraUpdate",i._onFiveCameraUpdate)},i.load=function(){return Za(i,void 0,void 0,function(){return Ja(this,function(a){return[2]})})},i.setState=function(a,o){},i.enable=function(){var a,o=(a=i.five.getElement())===null||a===void 0?void 0:a.parentNode;if(!o){i.five.ready().then(function(){return i.enable()});return}i.state.enabled||(i._onFiveCameraUpdate(i.five.getPose(),!1),i.gradientBg&&o.appendChild(i.gradientBg),i.groundBg&&o.appendChild(i.groundBg),i.style&&document.head.appendChild(i.style),i._addEventListener(),i.hooks.emit("enable",{userAction:!0}),i.state.enabled=!0)},i.disable=function(a){var o,s,c,l;i.state.enabled&&((s=(o=i.gradientBg)===null||o===void 0?void 0:o.parentNode)===null||s===void 0||s.removeChild(i.gradientBg),(l=(c=i.groundBg)===null||c===void 0?void 0:c.parentNode)===null||l===void 0||l.removeChild(i.groundBg),i.style&&document.head.removeChild(i.style),i._removeEventListener(),i.hooks.emit("disable",{userAction:!0}),i.state.enabled=!1)},i.dispose=function(){i._removeEventListener(),i.hooks.emit("disable",{userAction:!0}),i.state.enabled=!1},i.state={enabled:!1},typeof document=="undefined"||(i.gradientBg=document.createElement("div"),i.groundBg=document.createElement("div"),i.style=document.createElement("style"),i.gradientBg.className="BackgroundPluginBg",i.groundBg.className="BackgroundPluginGroundBg",i.style.innerHTML=`
3408
+ .BackgroundPluginBg {
3409
+ position: absolute;
3410
+ top: 0;
3411
+ right: 0;
3412
+ left: 0;
3413
+ height: 200%;
3414
+ background: linear-gradient(#0A0B0D, #2E3033);
3415
+ z-index: -1;
3416
+ pointerEvents: none;
3417
+ }
3418
+ .BackgroundPluginGroundBg {
3419
+ position: absolute;
3420
+ top: 0;
3421
+ right: 0;
3422
+ left: 0;
3423
+ bottom: 0;
3424
+ background-image: radial-gradient(circle, #2E303350 0, transparent 0);
3425
+ z-index: -1;
3426
+ pointerEvents: none;
3427
+ }
3428
+ `,i.enable()),i}return t}(bf.BasePlugin.Controller),E0=function(e,t){return new M0(e,t)};Ct.BackgroundPlugin=E0,Ct.ItemMaskPlugin=Ff,Ct.OrientationPlugin=w0,Ct.RoundedBoxGeometry=vf,Object.defineProperty(Ct,Symbol.toStringTag,{value:"Module"})});