@realsee/five 6.9.0-alpha.2 → 6.9.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/docs/assets/hierarchy.js +1 -1
  2. package/docs/assets/search.js +1 -1
  3. package/docs/classes/five.AdaptiveLuminancePass.html +1 -1
  4. package/docs/classes/five.EyeDomeLightingPass.html +1 -1
  5. package/docs/classes/five.FivePass.html +1 -1
  6. package/docs/classes/five.FlowingFireworks3DPass.html +1 -1
  7. package/docs/classes/five.FlowingLight2DPass.html +1 -1
  8. package/docs/classes/five.FlowingLight3DPass.html +1 -1
  9. package/docs/classes/five.GaussianBlurPass.html +1 -1
  10. package/docs/classes/five.Model.html +1 -1
  11. package/docs/classes/five.ModelScene.html +1 -1
  12. package/docs/classes/five.PBMCustomShader.html +1 -1
  13. package/docs/classes/five.PBMGSObject.html +26 -6
  14. package/docs/classes/five.PBMMeshMaterial.html +1 -1
  15. package/docs/classes/five.PBMPanoFilter.html +1 -1
  16. package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
  17. package/docs/classes/five.PBMUpdateable.html +1 -1
  18. package/docs/classes/five.Parameter.html +1 -1
  19. package/docs/classes/five.Tile3D.html +1 -1
  20. package/docs/classes/five.TileNode.html +1 -1
  21. package/docs/classes/five.TrajectoryNode.html +1 -1
  22. package/docs/classes/five.WorkResolvedObserver.html +1 -1
  23. package/docs/classes/gltf-loader.DDSLoader.html +1 -1
  24. package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
  25. package/docs/classes/gltf-loader.GLTFObject.html +1 -1
  26. package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
  27. package/docs/classes/line.LineGeometry.html +1 -1
  28. package/docs/classes/line.LineMaterial.html +1 -1
  29. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  30. package/docs/classes/line.THREE_Line2.html +1 -1
  31. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  32. package/docs/classes/plugins.CSS2DObject.html +1 -1
  33. package/docs/classes/plugins.CSS3DObject.html +1 -1
  34. package/docs/classes/plugins.CSS3DSprite.html +1 -1
  35. package/docs/classes/plugins.InstancedPrefabBufferGeometry.html +1 -1
  36. package/docs/classes/plugins.Object3DHelperController.html +1 -1
  37. package/docs/classes/plugins.PointBufferGeometry.html +1 -1
  38. package/docs/classes/plugins.PrefabBufferGeometry.html +1 -1
  39. package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
  40. package/docs/classes/vfx.Airflow.html +1 -1
  41. package/docs/classes/vfx.Flame.html +1 -1
  42. package/docs/classes/vfx.Particle.html +1 -1
  43. package/docs/classes/vfx.ParticleGPU.html +1 -1
  44. package/docs/classes/vfx.SpotLight.html +1 -1
  45. package/docs/functions/five.loadSpz.html +1 -1
  46. package/docs/hierarchy.html +1 -1
  47. package/docs/interfaces/five.LooseWorkWithExtrinsics.html +1 -1
  48. package/docs/interfaces/five.PBMMaterial.html +1 -1
  49. package/docs/interfaces/five.PBMMeshMaterialParameters.html +1 -1
  50. package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
  51. package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
  52. package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
  53. package/docs/interfaces/five.ParameterValue.html +1 -1
  54. package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
  55. package/docs/interfaces/five.SplatData.html +4 -2
  56. package/docs/interfaces/five.ViewLayer.html +1 -1
  57. package/docs/interfaces/five.WorkCubeImage.html +1 -1
  58. package/docs/interfaces/five.WorkImage.html +1 -1
  59. package/docs/interfaces/five.WorkObserver.html +1 -1
  60. package/docs/interfaces/five.WorkObserverProto.html +1 -1
  61. package/docs/interfaces/five.WorkTile.html +1 -1
  62. package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
  63. package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
  64. package/docs/interfaces/plugins.CSS2DPluginController.html +1 -1
  65. package/docs/interfaces/plugins.CSS2DPluginType.EventMap.html +1 -1
  66. package/docs/interfaces/plugins.CSS2DPluginType.State.html +1 -1
  67. package/docs/interfaces/plugins.CSS3DPluginController.html +1 -1
  68. package/docs/interfaces/plugins.CSS3DPluginType.EventMap.html +1 -1
  69. package/docs/interfaces/plugins.CSS3DPluginType.State.html +1 -1
  70. package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
  71. package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
  72. package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
  73. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationController.html +1 -1
  74. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.EventMap.html +1 -1
  75. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.State.html +1 -1
  76. package/docs/interfaces/plugins.ItemMaskController.html +1 -1
  77. package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
  78. package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
  79. package/docs/interfaces/plugins.Object3DHelperPluginType.BaseController.html +1 -1
  80. package/docs/interfaces/plugins.Object3DHelperPluginType.BaseHelper.html +1 -1
  81. package/docs/interfaces/plugins.Object3DHelperPluginType.BoundingBoxController.html +1 -1
  82. package/docs/interfaces/plugins.Object3DHelperPluginType.MoveController.html +1 -1
  83. package/docs/interfaces/plugins.Object3DHelperPluginType.MoveHelperAbstract.html +1 -1
  84. package/docs/interfaces/plugins.Object3DHelperPluginType.RotateController.html +1 -1
  85. package/docs/interfaces/plugins.Object3DHelperPluginType.RotateHelperAbstract.html +1 -1
  86. package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
  87. package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
  88. package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
  89. package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
  90. package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
  91. package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
  92. package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
  93. package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
  94. package/docs/interfaces/plugins.TrajectoryController.html +1 -1
  95. package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
  96. package/docs/interfaces/react.UseFivePluginOptions.html +1 -1
  97. package/docs/interfaces/react.UseFivePluginOptionsWithCreate.html +1 -1
  98. package/docs/types/five.ParseOptions.html +1 -1
  99. package/five/gaussian-splatting/objectParamsStore.d.ts +35 -0
  100. package/five/index.js +10 -10
  101. package/five/index.mjs +105 -64
  102. package/five/model/loaders/spz.d.ts +9 -0
  103. package/five/model/objects/pbmGaussianSplattingObject.d.ts +34 -0
  104. package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +6 -0
  105. package/gltf-loader/index.js +3 -3
  106. package/gltf-loader/index.mjs +3 -3
  107. package/line/index.js +3 -3
  108. package/line/index.mjs +3 -3
  109. package/package.json +1 -1
  110. package/{pbmGaussianSplattingObject-C6i7CUTu.cjs → pbmGaussianSplattingObject-BDOzNal0.cjs} +3 -3
  111. package/{pbmGaussianSplattingObject-CaE6q4r-.js → pbmGaussianSplattingObject-BwsrwWs6.js} +27 -10
  112. package/plugins/index.js +2 -2
  113. package/plugins/index.mjs +2 -2
  114. package/react/index.js +2 -2
  115. package/react/index.mjs +2 -2
  116. package/shader-lib/index.js +2 -2
  117. package/shader-lib/index.mjs +2 -2
  118. package/sticker/index.js +3 -3
  119. package/sticker/index.mjs +3 -3
  120. package/umd/five-gltf-loader.js +3 -3
  121. package/umd/five-line.js +3 -3
  122. package/umd/five-plugins.js +2 -2
  123. package/umd/five-react.js +2 -2
  124. package/umd/five-shader-lib.js +2 -2
  125. package/umd/five-sticker.js +3 -3
  126. package/umd/five-vfx.js +2 -2
  127. package/umd/five-vue.js +2 -2
  128. package/umd/five.js +8 -8
  129. package/vfx/index.js +2 -2
  130. package/vfx/index.mjs +2 -2
  131. package/vue/index.js +2 -2
  132. package/vue/index.mjs +2 -2
  133. package/work-downloader/index.js +2 -2
  134. package/work-downloader/index.mjs +2 -2
package/five/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 7/31/2026
5
- * Version: 6.9.0-alpha.2
4
+ * Generated: 8/5/2026
5
+ * Version: 6.9.0-alpha.3
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,7 +252,7 @@
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
- */import { t as e } from "../pbmGaussianSplattingObject-CaE6q4r-.js";
255
+ */import { t as e } from "../pbmGaussianSplattingObject-BwsrwWs6.js";
256
256
  import * as t from "three";
257
257
  import { Mesh as n, MeshBasicMaterial as r, Object3D as i, SphereGeometry as a } from "three";
258
258
  import * as o from "protobufjs/minimal";
@@ -8740,7 +8740,7 @@ function os() {
8740
8740
  }
8741
8741
  //#endregion
8742
8742
  //#region build/five/model/loaders/spz.js?worker&inline
8743
- var ss = "(function(){var e=(e,t)=>()=>(e&&(t=e(e=0)),t);function t(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function n(...e){}function r(e){return typeof Symbol>`u`?`$Symbol<${e}>$`:Symbol(e)}r(`$$FIVE_EVENT$$`);let i=Date.now();typeof performance<`u`&&(typeof performance.timeOrigin==`number`?i=performance.timeOrigin:performance.timing!==void 0&&(i=performance.timing.navigationStart));let a=typeof performance<`u`?(()=>i+performance.now()):(()=>Date.now()),o=[/\\.([0-9a-z]+)\\.jsonp([\\?\\#].*)?$/i,/jsonp_([0-9a-z]+)([\\?\\#].*)?$/i],s=typeof location<`u`?location.href:``,c=/^https\\:/.test(s);var l=class extends Error{constructor(e,t,n){super(`[NETWORK]: request proxy error(type: ${t}, reason: ${n}): ${e}`)}},u=class extends Error{constructor(e,t,n){super(`[NETWORK]: response error(type: ${t}, status: ${n}): ${e}`),this.httpStatus=n}},d=class extends Error{constructor(e,t,n){super(`[NETWORK]: request timeout(type: ${t}, timeout: ${n}ms): ${e}`)}};function f(e){if(!e)return{};let t={},n=e.trim().split(`\n`);for(let e=0;e<n.length;e++){let r=n[e],i=r.indexOf(`:`),a=r.slice(0,i).trim().toLowerCase(),o=r.slice(i+1).trim();o&&(t[a]?t[a]+=`, `+o:t[a]=o)}return t}function p(e){for(let t of o){let n=e.match(t);if(n)return`jsonp_`+n[1]}return null}function m(e){return p(e)!==null}function h(e,t={},r=n,i=n,o=n){let m=a(),h=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>c&&/^http\\:/.test(e)?(console.warn(`The page at '${s}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\\:/,`https:`)):e).catch(n=>{var r;p(e);let i=new l(h,`XMLHttpRequest`,n&&n.message?String(n.message):String(n));return(r=t.networkSubscribe)==null||r.emit(`network`,e,`XMLHttpRequest`,`forbidden`,i.message),Promise.reject(i)}).then(e=>new Promise((s,c)=>{let l=p(e);if(l){let n=window,o=null,f=!1,p=document.createElement(`script`);n[l]=d=>{var g,_;let v=a(),y=v-m;if(delete n[l],p.parentNode&&p.parentNode.removeChild(p),o!==null&&(window.clearTimeout(o),o=null),f===!0)return;if(d.indexOf(`data:`)!==0){let n=new u(e,`XMLHttpRequest`,500);i(n),c(n),(g=t.networkSubscribe)==null||g.emit(`network`,e,`XMLHttpRequest`,`error`,n.message);return}let b=d.split(`,`),x=(b[0].match(/:(.*?);/)||[])[1],S=b[1];if(t.responseType===`arraybuffer`||t.responseType===`blob`){let e=atob(b[1]),n=e.length,r=new Uint8Array(n);for(let t=0;t<n;t++)r[t]=e.charCodeAt(t);S=t.responseType===`arraybuffer`?r.buffer:new Blob([r],{type:x})}let C={body:S,meta:{origin:h,source:e,requestTime:m,responseTime:v,costs:y,headers:{}}};r(C),s(C),(_=t.networkSubscribe)==null||_.emit(`network`,e,`XMLHttpRequest`,`ok`,JSON.stringify(C.meta)),f=!0},p.src=e,document.body.appendChild(p),typeof t.timeout==`number`&&(o=window.setTimeout(()=>{var n;if(o=null,f!==!0){f=!0;let r=new d(e,`XMLHttpRequest`,t.timeout||NaN);i(r),c(r),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`timeout`,r.message)}},t.timeout))}else{let l=!1,p=new XMLHttpRequest,g=()=>{p&&(p.removeEventListener(`timeout`,_,!1),p.removeEventListener(`progress`,v,!1),p.removeEventListener(`load`,y,!1),p.removeEventListener(`error`,b,!1)),p=null,g=n},_=function(){var n;if(l===!0)return;l=!0,g();let r=new d(e,`XMLHttpRequest`,t.timeout||NaN);i(r),c(r),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`timeout`,r.message)},v=function(e){l!==!0&&e.lengthComputable&&(e.total<=0||o(e.loaded/e.total,e.loaded,e.total))},y=function(n){var i;if(l===!0)return;let o=this.status;if(o===0||o>=200&&o<400){l=!0,g();let o=a(),c=o-m,u=f(this.getAllResponseHeaders()),d=n.total,p={body:this.response,meta:{origin:h,source:e,requestTime:m,responseTime:o,costs:c,headers:u,size:d}};r(p),s(p),(i=t.networkSubscribe)==null||i.emit(`network`,e,`XMLHttpRequest`,`ok`,JSON.stringify(p.meta))}else b.call(this)},b=function(){var n;if(l===!0)return;l=!0,g();let r=new u(e,`XMLHttpRequest`,this.status);i(r),c(r),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`error`,r.message)};p.addEventListener(`timeout`,_,!1),p.addEventListener(`progress`,v,!1),p.addEventListener(`load`,y,!1),p.addEventListener(`error`,b,!1),t.responseType&&(p.responseType=t.responseType),typeof t.timeout==`number`&&(p.timeout=t.timeout),p.open(`GET`,e,!0),p.send(null)}}))}let g={};function _(e,t={}){let r=a(),i=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>c&&/^http\\:/.test(e)?(console.warn(`The page at '${s}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\\:/,`https:`)):e).catch(n=>{var r;let a=new l(i,`Link`,n&&n.message?String(n.message):String(n));return(r=t.networkSubscribe)==null||r.emit(`network`,e,`Link`,`forbidden`,a.message),Promise.reject(a)}).then(e=>e in g?g[e]:g[e]=new Promise((o,s)=>{let c=document.head||document.getElementsByTagName(`head`)[0],l=document.createElement(`link`),d=!1,f=null;l.onload=s=>{var c;if(f!==null&&(clearTimeout(f),f=null),d===!0)return;d=!0,o(),l.onerror=n,l.onload=n;let u=a(),p={origin:i,source:e,requestTime:r,responseTime:u,costs:u-r,headers:{}};(c=t.networkSubscribe)==null||c.emit(`network`,e,`Link`,`preload`,JSON.stringify(p))},l.onerror=r=>{var i;if(f!==null&&(clearTimeout(f),f=null),d===!0)return;d=!0,delete g[e],c&&l.parentNode===c&&c.removeChild(l);let a=new u(e,`Link`,0);s(a),l.onerror=n,l.onload=n,(i=t.networkSubscribe)==null||i.emit(`network`,e,`Link`,`error`,a.message)},typeof t.timeout==`number`&&(f=window.setTimeout(()=>{var s;if(f=null,d===!0)return;d=!0,o(),l.onerror=n,l.onload=n;let c=a(),u={origin:i,source:e,requestTime:r,responseTime:c,costs:c-r,headers:{}};(s=t.networkSubscribe)==null||s.emit(`network`,e,`Link`,`timeout`,JSON.stringify(u))},t.timeout)),l.rel=l.relList&&l.relList.supports(`prefetch`)?`prefetch`:`preload`,l.as=`fetch`,l.crossOrigin=``,l.fetchPriority=`high`,l.href=e,c&&c.appendChild(l)}))}function v(e,t={},r=n,i=n,o=n,f){let p=a(),g=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>c&&/^http\\:/.test(e)?(console.warn(`The page at '${s}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\\:/,`https:`)):e).catch(n=>{var r;let i=new l(g,`Image`,n&&n.message?String(n.message):String(n));return(r=t.networkSubscribe)==null||r.emit(`network`,e,`Image`,`forbidden`,i.message),Promise.reject(i)}).then(e=>m(e)?h(e,{responseType:`blob`,networkSubscribe:t.networkSubscribe}).then(e=>URL.createObjectURL(e.body)):e).then(e=>new Promise((s,c)=>{let l=f==null?new Image:f,m=!1,h=null;typeof t.timeout==`number`&&(h=window.setTimeout(()=>{var r;if(l.onload=n,l.onerror=n,h=null,m===!0)return;m=!0;let a=new d(e,`Image`,t.timeout);i(a),c(a),(r=t.networkSubscribe)==null||r.emit(`network`,e,`Image`,`timeout`,a.message)},t.timeout)),l.onload=()=>{var i;if(l.onload=n,l.onerror=n,h!==null&&(clearTimeout(h),h=null),m===!0)return;let c=a(),u={headers:{},origin:g,source:e,requestTime:p,responseTime:c,costs:c-p};m=!0;let d={body:l,meta:u};o(1),r(d),s(d),(i=t.networkSubscribe)==null||i.emit(`network`,e,`Image`,`ok`,JSON.stringify(d.meta))},l.onerror=()=>{var r;if(l.onload=n,l.onerror=n,h!==null&&(clearTimeout(h),h=null),m===!0)return;m=!0;let a=new u(e,`Image`,0);i(a),c(a),(r=t.networkSubscribe)==null||r.emit(`network`,e,`Image`,`ok`,a.message)},o(0),l.src=e}))}new class{constructor(e={}){this.options=e}ajax(e,t={},r=n,i=n,a=n){var o;let s=this.options;return h(e,{responseType:t.responseType,timeout:(o=t.timeout)==null?s.timeout:o,get requestProxy(){var e;return(e=t.requestProxy)==null?s.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?s.networkSubscribe:e}},r,i,a)}loadImage(e,t={},r=n,i=n,a=n,o){var s;let c=this.options;return v(e,{timeout:(s=t.timeout)==null?c.timeout:s,get requestProxy(){var e;return(e=t.requestProxy)==null?c.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?c.networkSubscribe:e}},r,i,a,o)}preload(e,t={}){var n;let r=this.options;return _(e,{timeout:(n=t.timeout)==null?r.timeout:n,get requestProxy(){var e;return(e=t.requestProxy)==null?r.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?r.networkSubscribe:e}})}};function y(){}function b(e,t){this.x=e||0,this.y=t||0}function x(){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.`)}function S(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(this,`id`,{value:gc++}),this.uuid=X.generateUUID(),this.name=``,this.image=e===void 0?S.DEFAULT_IMAGE:e,this.mipmaps=[],this.mapping=t===void 0?S.DEFAULT_MAPPING:t,this.wrapS=n===void 0?Vo:n,this.wrapT=r===void 0?Vo:r,this.magFilter=i===void 0?Ko:i,this.minFilter=a===void 0?Jo:a,this.anisotropy=c===void 0?1:c,this.format=o===void 0?es:o,this.internalFormat=null,this.type=s===void 0?Yo:s,this.offset=new b(0,0),this.repeat=new b(1,1),this.center=new b(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new x,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l===void 0?$s:l,this.version=0,this.onUpdate=null}function C(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=r===void 0?1:r}function w(e,t,n){this.width=e,this.height=t,this.scissor=new C(0,0,e,t),this.scissorTest=!1,this.viewport=new C(0,0,e,t),n=n||{},this.texture=new S(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?!1:n.generateMipmaps,this.texture.minFilter=n.minFilter===void 0?Ko:n.minFilter,this.depthBuffer=n.depthBuffer===void 0?!0:n.depthBuffer,this.stencilBuffer=n.stencilBuffer===void 0?!0:n.stencilBuffer,this.depthTexture=n.depthTexture===void 0?null:n.depthTexture}function T(e,t,n){w.call(this,e,t,n),this.samples=4}function E(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=r===void 0?1:r}function D(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function O(){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.`)}function k(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||k.DefaultOrder}function A(){this.mask=1}function j(){Object.defineProperty(this,`id`,{value:Oc++}),this.uuid=X.generateUUID(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=j.DefaultUp.clone();var e=new D,t=new k,n=new E,r=new D(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 O},normalMatrix:{value:new x}}),this.matrix=new O,this.matrixWorld=new O,this.matrixAutoUpdate=j.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new A,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function M(){j.call(this),this.type=`Scene`,this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}function N(e,t){this.min=e===void 0?new D(1/0,1/0,1/0):e,this.max=t===void 0?new D(-1/0,-1/0,-1/0):t}function P(e,t,n,r,i){var a,o;for(a=0,o=e.length-3;a<=o;a+=3){$c.fromArray(e,a);var s=i.x*Math.abs($c.x)+i.y*Math.abs($c.y)+i.z*Math.abs($c.z),c=t.dot($c),l=n.dot($c),u=r.dot($c);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>s)return!1}return!0}function F(e,t){this.center=e===void 0?new D:e,this.radius=t===void 0?-1:t}function I(e,t){this.origin=e===void 0?new D:e,this.direction=t===void 0?new D(0,0,-1):t}function L(e,t){this.normal=e===void 0?new D(1,0,0):e,this.constant=t===void 0?0:t}function R(e,t,n){this.a=e===void 0?new D:e,this.b=t===void 0?new D:t,this.c=n===void 0?new D:n}function z(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}function ee(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}function te(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function ne(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}function B(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new D,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new z,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=a===void 0?0:a}function V(){Object.defineProperty(this,`id`,{value:wl++}),this.uuid=X.generateUUID(),this.name=``,this.type=`Material`,this.fog=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=lc,this.stencilZFail=lc,this.stencilZPass=lc,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function re(e){V.call(this),this.type=`MeshBasicMaterial`,this.color=new z(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=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.skinning=!1,this.morphTargets=!1,this.setValues(e)}function H(e,t,n){if(Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n===!0,this.usage=uc,this.updateRange={offset:0,count:-1},this.version=0}function U(e,t,n){H.call(this,new Int8Array(e),t,n)}function ie(e,t,n){H.call(this,new Uint8Array(e),t,n)}function W(e,t,n){H.call(this,new Uint8ClampedArray(e),t,n)}function ae(e,t,n){H.call(this,new Int16Array(e),t,n)}function G(e,t,n){H.call(this,new Uint16Array(e),t,n)}function oe(e,t,n){H.call(this,new Int32Array(e),t,n)}function se(e,t,n){H.call(this,new Uint32Array(e),t,n)}function K(e,t,n){H.call(this,new Float32Array(e),t,n)}function ce(e,t,n){H.call(this,new Float64Array(e),t,n)}function le(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function ue(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}function q(){Object.defineProperty(this,`id`,{value:El+=2}),this.uuid=X.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={}}function de(e,t){j.call(this),this.type=`Mesh`,this.geometry=e===void 0?new q:e,this.material=t===void 0?new re:t,this.updateMorphTargets()}function fe(e,t,n,r,i,a,o,s){if((t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side!==2,s))===null)return null;Yl.copy(s),Yl.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(Yl);return c<n.near||c>n.far?null:{distance:c,point:Yl.clone(),object:e}}function pe(e,t,n,r,i,a,o,s,c,l,u,d){Il.fromBufferAttribute(i,l),Ll.fromBufferAttribute(i,u),Rl.fromBufferAttribute(i,d);var f=e.morphTargetInfluences;if(t.morphTargets&&a&&f){Hl.set(0,0,0),Ul.set(0,0,0),Wl.set(0,0,0);for(var p=0,m=a.length;p<m;p++){var h=f[p],g=a[p];h!==0&&(zl.fromBufferAttribute(g,l),Bl.fromBufferAttribute(g,u),Vl.fromBufferAttribute(g,d),o?(Hl.addScaledVector(zl,h),Ul.addScaledVector(Bl,h),Wl.addScaledVector(Vl,h)):(Hl.addScaledVector(zl.sub(Il),h),Ul.addScaledVector(Bl.sub(Ll),h),Wl.addScaledVector(Vl.sub(Rl),h)))}Il.add(Hl),Ll.add(Ul),Rl.add(Wl)}e.isSkinnedMesh&&(e.boneTransform(l,Il),e.boneTransform(u,Ll),e.boneTransform(d,Rl));var _=fe(e,t,n,r,Il,Ll,Rl,Jl);if(_){s&&(Gl.fromBufferAttribute(s,l),Kl.fromBufferAttribute(s,u),ql.fromBufferAttribute(s,d),_.uv=R.getUV(Jl,Il,Ll,Rl,Gl,Kl,ql,new b)),c&&(Gl.fromBufferAttribute(c,l),Kl.fromBufferAttribute(c,u),ql.fromBufferAttribute(c,d),_.uv2=R.getUV(Jl,Il,Ll,Rl,Gl,Kl,ql,new b));var v=new B(l,u,d);R.getNormal(Il,Ll,Rl,v.normal),_.face=v}return _}function J(){Object.defineProperty(this,`id`,{value:Xl+=2}),this.uuid=X.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}function me(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}function he(e){for(var t={},n=0;n<e.length;n++){var r=me(e[n]);for(var i in r)t[i]=r[i]}return t}function ge(e){V.call(this),this.type=`ShaderMaterial`,this.defines={},this.uniforms={},this.vertexShader=ru,this.fragmentShader=iu,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))}function _e(){j.call(this),this.type=`Camera`,this.matrixWorldInverse=new O,this.projectionMatrix=new O,this.projectionMatrixInverse=new O}function ve(e,t,n,r){_e.call(this),this.type=`PerspectiveCamera`,this.fov=e===void 0?50:e,this.zoom=1,this.near=n===void 0?.1:n,this.far=r===void 0?2e3:r,this.focus=10,this.aspect=t===void 0?1:t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function ye(e,t,n){if(j.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 ve(au,ou,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new D(1,0,0)),this.add(r);var i=new ve(au,ou,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new D(-1,0,0)),this.add(i);var a=new ve(au,ou,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new D(0,1,0)),this.add(a);var o=new ve(au,ou,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new D(0,-1,0)),this.add(o);var s=new ve(au,ou,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new D(0,0,1)),this.add(s);var c=new ve(au,ou,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new D(0,0,-1)),this.add(c),this.update=function(e,t){this.parent===null&&this.updateMatrixWorld();var l=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;var d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(u),e.xr.enabled=l},this.clear=function(e,t,r,i){for(var a=e.getRenderTarget(),o=0;o<6;o++)e.setRenderTarget(n,o),e.clear(t,r,i);e.setRenderTarget(a)}}function be(e,t,n){Number.isInteger(t)&&(console.warn(`THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )`),t=n),w.call(this,e,e,t)}function xe(e,t,n,r,i,a,o,s,c,l,u,d){S.call(this,null,a,o,s,c,l,r,i,u,d),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=c===void 0?Uo:c,this.minFilter=l===void 0?Uo:l,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}function Se(e,t,n,r,i,a){this.planes=[e===void 0?new L:e,t===void 0?new L:t,n===void 0?new L:n,r===void 0?new L:r,i===void 0?new L:i,a===void 0?new L:a]}function Ce(){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(e){n=e},setContext:function(t){e=t}}}function we(e,t){var n=t.isWebGL2,r=new WeakMap;function i(t,n){var r=t.array,i=t.usage,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,r,i),t.onUploadCallback();var o=5126;return r instanceof Float32Array?o=5126:r instanceof Float64Array?console.warn(`THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.`):r instanceof Uint16Array?o=5123:r instanceof Int16Array?o=5122:r instanceof Uint32Array?o=5125:r instanceof Int32Array?o=5124:r instanceof Int8Array?o=5120:r instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}function a(t,r,i){var a=r.array,o=r.updateRange;e.bindBuffer(i,t),o.count===-1?e.bufferSubData(i,0,a):(n?e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1)}function o(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)}function s(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))}function c(e,t){e.isInterleavedBufferAttribute&&(e=e.data);var n=r.get(e);n===void 0?r.set(e,i(e,t)):n.version<e.version&&(a(n.buffer,e,t),n.version=e.version)}return{get:o,remove:s,update:c}}function Te(e,t,n,r){J.call(this),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Ee(e,t,n,r)),this.mergeVertices()}function Ee(e,t,n,r){q.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,d=t/s,f,p,m=[],h=[],g=[],_=[];for(p=0;p<l;p++){var v=p*d-a;for(f=0;f<c;f++){var y=f*u-i;h.push(y,-v,0),g.push(0,0,1),_.push(f/o),_.push(1-p/s)}}for(p=0;p<s;p++)for(f=0;f<o;f++){var b=f+c*p,x=f+c*(p+1),S=f+1+c*(p+1),C=f+1+c*p;m.push(b,x,C),m.push(x,S,C)}this.setIndex(m),this.setAttribute(`position`,new K(h,3)),this.setAttribute(`normal`,new K(g,3)),this.setAttribute(`uv`,new K(_,2))}function De(e,t,n,r){var i=new z(0),a=0,o,s,c=null,l=0,u=null;function d(t,r,d,p){var m=r.background,h=e.xr,g=h.getSession&&h.getSession();if(g&&g.environmentBlendMode===`additive`&&(m=null),m===null?f(i,a):m&&m.isColor&&(f(m,1),p=!0),(e.autoClear||p)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||m.mapping===306)){s===void 0&&(s=new de(new tu(1,1,1),new ge({type:`BackgroundCubeMaterial`,uniforms:me(lu.cube.uniforms),vertexShader:lu.cube.vertexShader,fragmentShader:lu.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute(`normal`),s.geometry.deleteAttribute(`uv`),s.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(s.material,`envMap`,{get:function(){return this.uniforms.envMap.value}}),n.update(s));var _=m.isWebGLCubeRenderTarget?m.texture:m;s.material.uniforms.envMap.value=_,s.material.uniforms.flipEnvMap.value=_.isCubeTexture?-1:1,(c!==m||l!==_.version||u!==e.toneMapping)&&(s.material.needsUpdate=!0,c=m,l=_.version,u=e.toneMapping),t.unshift(s,s.geometry,s.material,0,0,null)}else m&&m.isTexture&&(o===void 0&&(o=new de(new Ee(2,2),new ge({type:`BackgroundMaterial`,uniforms:me(lu.background.uniforms),vertexShader:lu.background.vertexShader,fragmentShader:lu.background.fragmentShader,side:0,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=m,m.matrixAutoUpdate===!0&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),(c!==m||l!==m.version||u!==e.toneMapping)&&(o.material.needsUpdate=!0,c=m,l=m.version,u=e.toneMapping),t.unshift(o,o.geometry,o.material,0,0,null))}function f(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}return{getClearColor:function(){return i},setClearColor:function(e,t){i.set(e),a=t===void 0?1:t,f(i,a)},getClearAlpha:function(){return a},setClearAlpha:function(e){a=e,f(i,a)},render:d}}function Oe(e,t,n,r){var i=r.isWebGL2,a;function o(e){a=e}function s(t,r){e.drawArrays(a,t,r),n.update(r,a)}function c(r,o,s,c){if(c!==0){var l,u;if(i)l=e,u=`drawArraysInstanced`;else if(l=t.get(`ANGLE_instanced_arrays`),u=`drawArraysInstancedANGLE`,l===null){console.error(`THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.`);return}l[u](a,o,s,c),n.update(s,a,c)}}this.setMode=o,this.render=s,this.renderInstances=c}function ke(e,t,n){var r;function i(){if(r!==void 0)return r;var n=t.get(`EXT_texture_filter_anisotropic`);return r=n===null?0:e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT),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<`u`&&e instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<`u`&&e instanceof WebGL2ComputeRenderingContext,s=n.precision===void 0?`highp`:n.precision,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),d=e.getParameter(35660),f=e.getParameter(3379),p=e.getParameter(34076),m=e.getParameter(34921),h=e.getParameter(36347),g=e.getParameter(36348),_=e.getParameter(36349),v=d>0,y=o||!!t.get(`OES_texture_float`),b=v&&y,x=o?e.getParameter(36183):0;return{isWebGL2:o,getMaxAnisotropy:i,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:h,maxVaryings:g,maxFragmentUniforms:_,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:b,maxSamples:x}}function Ae(){var e=this,t=null,n=0,r=!1,i=!1,a=new L,o=new x,s={value:null,needsUpdate:!1};this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,a){var o=e.length!==0||i||n!==0||r;return r=i,t=l(e,a,0),n=e.length,o},this.beginShadows=function(){i=!0,l(null)},this.endShadows=function(){i=!1,c()},this.setState=function(e,a,o,u,d,f){if(!r||e===null||e.length===0||i&&!o)i?l(null):c();else{var p=i?0:n,m=p*4,h=d.clippingState||null;s.value=h,h=l(e,u,m,f);for(var g=0;g!==m;++g)h[g]=t[g];d.clippingState=h,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=p}};function c(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function l(t,n,r,i){var c=t===null?0:t.length,l=null;if(c!==0){if(l=s.value,i!==!0||l===null){var u=r+c*4,d=n.matrixWorldInverse;o.getNormalMatrix(d),(l===null||l.length<u)&&(l=new Float32Array(u));for(var f=0,p=r;f!==c;++f,p+=4)a.copy(t[f]).applyMatrix4(d,o),a.normal.toArray(l,p),l[p+3]=a.constant}s.value=l,s.needsUpdate=!0}return e.numPlanes=c,e.numIntersection=0,l}}function je(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 Me(e,t,n){var r=new WeakMap,i=new WeakMap;function a(e){var o=e.target,s=r.get(o);for(var c in s.index!==null&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);o.removeEventListener(`dispose`,a),r.delete(o);var l=i.get(s);l&&(t.remove(l),i.delete(s)),n.memory.geometries--}function o(e,t){var i=r.get(t);return i||(t.addEventListener(`dispose`,a),t.isBufferGeometry?i=t:t.isGeometry&&(t._bufferGeometry===void 0&&(t._bufferGeometry=new q().setFromObject(e)),i=t._bufferGeometry),r.set(t,i),n.memory.geometries++,i)}function s(e){var n=e.index,r=e.attributes;for(var i in n!==null&&t.update(n,34963),r)t.update(r[i],34962);var a=e.morphAttributes;for(var i in a)for(var o=a[i],s=0,c=o.length;s<c;s++)t.update(o[s],34962)}function c(e){var n=[],r=e.index,a=e.attributes.position,o=0;if(r!==null){var s=r.array;o=r.version;for(var c=0,l=s.length;c<l;c+=3){var u=s[c+0],d=s[c+1],f=s[c+2];n.push(u,d,d,f,f,u)}}else{var s=a.array;o=a.version;for(var c=0,l=s.length/3-1;c<l;c+=3){var u=c+0,d=c+1,f=c+2;n.push(u,d,d,f,f,u)}}var p=new(ue(n)>65535?se:G)(n,1);p.version=o,t.update(p,34963);var m=i.get(e);m&&t.remove(m),i.set(e,p)}function l(e){var t=i.get(e);if(t){var n=e.index;n!==null&&t.version<n.version&&c(e)}else c(e);return i.get(e)}return{get:o,update:s,getWireframeAttribute:l}}function Ne(e,t,n,r){var i=r.isWebGL2,a;function o(e){a=e}var s,c;function l(e){s=e.type,c=e.bytesPerElement}function u(t,r){e.drawElements(a,r,s,t*c),n.update(r,a)}function d(r,o,l,u){if(u!==0){var d,f;if(i)d=e,f=`drawElementsInstanced`;else if(d=t.get(`ANGLE_instanced_arrays`),f=`drawElementsInstancedANGLE`,d===null){console.error(`THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.`);return}d[f](a,l,s,o*c,u),n.update(l,a,u)}}this.setMode=o,this.setIndex=l,this.render=u,this.renderInstances=d}function Pe(e){var t={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(e,t,r){switch(r=r||1,n.calls++,t){case 4:n.triangles+=e/3*r;break;case 1:n.lines+=e/2*r;break;case 3:n.lines+=r*(e-1);break;case 2:n.lines+=r*e;break;case 0:n.points+=r*e;break;default:console.error(`THREE.WebGLInfo: Unknown draw mode:`,t);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 Fe(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Ie(e){var t={},n=new Float32Array(8);function r(r,i,a,o){var s=r.morphTargetInfluences,c=s===void 0?0:s.length,l=t[i.id];if(l===void 0){l=[];for(var u=0;u<c;u++)l[u]=[u,0];t[i.id]=l}for(var d=a.morphTargets&&i.morphAttributes.position,f=a.morphNormals&&i.morphAttributes.normal,u=0;u<c;u++){var p=l[u];p[1]!==0&&(d&&i.deleteAttribute(`morphTarget`+u),f&&i.deleteAttribute(`morphNormal`+u))}for(var u=0;u<c;u++){var p=l[u];p[0]=u,p[1]=s[u]}l.sort(Fe);for(var m=0,u=0;u<8;u++){var p=l[u];if(p){var h=p[0],g=p[1];if(g){d&&i.setAttribute(`morphTarget`+u,d[h]),f&&i.setAttribute(`morphNormal`+u,f[h]),n[u]=g,m+=g;continue}}n[u]=0}var _=i.morphTargetsRelative?1:1-m;o.getUniforms().setValue(e,`morphTargetBaseInfluence`,_),o.getUniforms().setValue(e,`morphTargetInfluences`,n)}return{update:r}}function Le(e,t,n,r){var i=new WeakMap;function a(e){var a=r.render.frame,o=e.geometry,s=t.get(e,o);return i.get(s)!==a&&(o.isGeometry&&s.updateFromObject(e),t.update(s),i.set(s,a)),e.isInstancedMesh&&n.update(e.instanceMatrix,34962),s}function o(){i=new WeakMap}return{update:a,dispose:o}}function Re(e,t,n,r,i,a,o,s,c,l){e=e===void 0?[]:e,t=t===void 0?301:t,o=o===void 0?$o:o,S.call(this,e,t,n,r,i,a,o,s,c,l),this.flipY=!1}function ze(e,t,n,r){S.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=Uo,this.minFilter=Uo,this.wrapR=Vo,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Be(e,t,n,r){S.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=Uo,this.minFilter=Uo,this.wrapR=Vo,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Ve(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=mu[i];if(a===void 0&&(a=new Float32Array(i),mu[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 He(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 Ue(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function We(e,t){var n=hu[t];n===void 0&&(n=new Int32Array(t),hu[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Ge(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Ke(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(He(n,t))return;e.uniform2fv(this.addr,t),Ue(n,t)}}function qe(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(He(n,t))return;e.uniform3fv(this.addr,t),Ue(n,t)}}function Je(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(He(n,t))return;e.uniform4fv(this.addr,t),Ue(n,t)}}function Ye(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(He(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Ue(n,t)}else{if(He(n,r))return;vu.set(r),e.uniformMatrix2fv(this.addr,!1,vu),Ue(n,r)}}function Xe(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(He(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Ue(n,t)}else{if(He(n,r))return;_u.set(r),e.uniformMatrix3fv(this.addr,!1,_u),Ue(n,r)}}function Ze(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(He(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Ue(n,t)}else{if(He(n,r))return;gu.set(r),e.uniformMatrix4fv(this.addr,!1,gu),Ue(n,r)}}function Qe(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||uu,i)}function $e(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||du,i)}function et(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||fu,i)}function tt(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||pu,i)}function nt(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function rt(e,t){var n=this.cache;He(n,t)||(e.uniform2iv(this.addr,t),Ue(n,t))}function it(e,t){var n=this.cache;He(n,t)||(e.uniform3iv(this.addr,t),Ue(n,t))}function at(e,t){var n=this.cache;He(n,t)||(e.uniform4iv(this.addr,t),Ue(n,t))}function ot(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function st(e){switch(e){case 5126:return Ge;case 35664:return Ke;case 35665:return qe;case 35666:return Je;case 35674:return Ye;case 35675:return Xe;case 35676:return Ze;case 5124:case 35670:return nt;case 35667:case 35671:return rt;case 35668:case 35672:return it;case 35669:case 35673:return at;case 5125:return ot;case 35678:case 36198:case 36298:case 36306:case 35682:return Qe;case 35679:case 36299:case 36307:return et;case 35680:case 36300:case 36308:case 36293:return tt;case 36289:case 36303:case 36311:case 36292:return $e}}function ct(e,t){e.uniform1fv(this.addr,t)}function lt(e,t){e.uniform1iv(this.addr,t)}function ut(e,t){e.uniform2iv(this.addr,t)}function dt(e,t){e.uniform3iv(this.addr,t)}function ft(e,t){e.uniform4iv(this.addr,t)}function pt(e,t){var n=Ve(t,this.size,2);e.uniform2fv(this.addr,n)}function mt(e,t){var n=Ve(t,this.size,3);e.uniform3fv(this.addr,n)}function ht(e,t){var n=Ve(t,this.size,4);e.uniform4fv(this.addr,n)}function gt(e,t){var n=Ve(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function _t(e,t){var n=Ve(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function vt(e,t){var n=Ve(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function yt(e,t,n){var r=t.length,i=We(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(t[a]||uu,i[a])}function bt(e,t,n){var r=t.length,i=We(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(t[a]||pu,i[a])}function xt(e){switch(e){case 5126:return ct;case 35664:return pt;case 35665:return mt;case 35666:return ht;case 35674:return gt;case 35675:return _t;case 35676:return vt;case 5124:case 35670:return lt;case 35667:case 35671:return ut;case 35668:case 35672:return dt;case 35669:case 35673:return ft;case 35678:case 36198:case 36298:case 36306:case 35682:return yt;case 35680:case 36300:case 36308:case 36293:return bt}}function St(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=st(t.type)}function Ct(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=xt(t.type)}function wt(e){this.id=e,this.seq=[],this.map={}}function Tt(e,t){e.seq.push(t),e.map[t.id]=t}function Et(e,t,n){var r=e.name,i=r.length;for(yu.lastIndex=0;;){var a=yu.exec(r),o=yu.lastIndex,s=a[1],c=a[2]===`]`,l=a[3];if(c&&(s|=0),l===void 0||l===`[`&&o+2===i){Tt(n,l===void 0?new St(s,e,t):new Ct(s,e,t));break}else{var u=n.map[s];u===void 0&&(u=new wt(s),Tt(n,u)),n=u}}}function Dt(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r);Et(i,e.getUniformLocation(t,i.name),this)}}function Ot(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}function kt(e){for(var t=e.split(`\n`),n=0;n<t.length;n++)t[n]=n+1+`: `+t[n];return t.join(`\n`)}function At(e){switch(e){case $s:return[`Linear`,`( value )`];case ec:return[`sRGB`,`( value )`];case nc:return[`RGBE`,`( value )`];case ic:return[`RGBM`,`( value, 7.0 )`];case ac:return[`RGBM`,`( value, 16.0 )`];case oc:return[`RGBD`,`( value, 256.0 )`];case tc:return[`Gamma`,`( value, float( GAMMA_FACTOR ) )`];case rc:return[`LogLuv`,`( value )`];default:throw Error(`unsupported encoding: `+e)}}function jt(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+`\n`+i+kt(a)}function Mt(e,t){var n=At(t);return`vec4 `+e+`( vec4 value ) { return `+n[0]+`ToLinear`+n[1]+`; }`}function Nt(e,t){var n=At(t);return`vec4 `+e+`( vec4 value ) { return LinearTo`+n[0]+n[1]+`; }`}function Pt(e,t){var n;switch(t){case 1:n=`Linear`;break;case 2:n=`Reinhard`;break;case 3:n=`Uncharted2`;break;case 4:n=`OptimizedCineon`;break;case 5:n=`ACESFilmic`;break;default:throw Error(`unsupported toneMapping: `+t)}return`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}function Ft(e){return[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`:``].filter(Rt).join(`\n`)}function It(e){var t=[];for(var n in e){var r=e[n];r!==!1&&t.push(`#define `+n+` `+r)}return t.join(`\n`)}function Lt(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var a=e.getActiveAttrib(t,i).name;n[a]=e.getAttribLocation(t,a)}return n}function Rt(e){return e!==``}function zt(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 Bt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function Vt(e){return e.replace(xu,Ht)}function Ht(e,t){var n=Q[t];if(n===void 0)throw Error(`Can not resolve #include <`+t+`>`);return Vt(n)}function Ut(e){return e.replace(Cu,Gt).replace(Su,Wt)}function Wt(e,t,n,r){return console.warn(`WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.`),Gt(e,t,n,r)}function Gt(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 Kt(e){var t=`precision `+e.precision+` float;\nprecision `+e.precision+` int;`;return e.precision===`highp`?t+=`\n#define HIGH_PRECISION`:e.precision===`mediump`?t+=`\n#define MEDIUM_PRECISION`:e.precision===`lowp`&&(t+=`\n#define LOW_PRECISION`),t}function qt(e){var t=`SHADOWMAP_TYPE_BASIC`;return e.shadowMapType===1?t=`SHADOWMAP_TYPE_PCF`:e.shadowMapType===2?t=`SHADOWMAP_TYPE_PCF_SOFT`:e.shadowMapType===3&&(t=`SHADOWMAP_TYPE_VSM`),t}function Jt(e){var t=`ENVMAP_TYPE_CUBE`;if(e.envMap)switch(e.envMapMode){case 301:case 302:t=`ENVMAP_TYPE_CUBE`;break;case 306:case 307:t=`ENVMAP_TYPE_CUBE_UV`;break;case 303:case 304:t=`ENVMAP_TYPE_EQUIREC`;break;case 305:t=`ENVMAP_TYPE_SPHERE`;break}return t}function Yt(e){var t=`ENVMAP_MODE_REFLECTION`;if(e.envMap)switch(e.envMapMode){case 302:case 304:t=`ENVMAP_MODE_REFRACTION`;break}return t}function Xt(e){var t=`ENVMAP_BLENDING_NONE`;if(e.envMap)switch(e.combine){case 0:t=`ENVMAP_BLENDING_MULTIPLY`;break;case 1:t=`ENVMAP_BLENDING_MIX`;break;case 2:t=`ENVMAP_BLENDING_ADD`;break}return t}function Zt(e,t,n){var r=e.getContext(),i=n.defines,a=n.vertexShader,o=n.fragmentShader,s=qt(n),c=Jt(n),l=Yt(n),u=Xt(n),d=e.gammaFactor>0?e.gammaFactor:1,f=n.isWebGL2?``:Ft(n),p=It(i),m=r.createProgram(),h,g;if(n.isRawShaderMaterial?(h=[p].filter(Rt).join(`\n`),h.length>0&&(h+=`\n`),g=[f,p].filter(Rt).join(`\n`),g.length>0&&(g+=`\n`)):(h=[Kt(n),`#define SHADER_NAME `+n.shaderName,p,n.instancing?`#define USE_INSTANCING`:``,n.supportsVertexTextures?`#define VERTEX_TEXTURES`:``,`#define GAMMA_FACTOR `+d,`#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`,`\n`].filter(Rt).join(`\n`),g=[f,Kt(n),`#define SHADER_NAME `+n.shaderName,p,n.alphaTest?`#define ALPHATEST `+n.alphaTest+(n.alphaTest%1?``:`.0`):``,`#define GAMMA_FACTOR `+d,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===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:Q.tonemapping_pars_fragment,n.toneMapping===0?``:Pt(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?Q.encodings_pars_fragment:``,n.mapEncoding?Mt(`mapTexelToLinear`,n.mapEncoding):``,n.matcapEncoding?Mt(`matcapTexelToLinear`,n.matcapEncoding):``,n.envMapEncoding?Mt(`envMapTexelToLinear`,n.envMapEncoding):``,n.emissiveMapEncoding?Mt(`emissiveMapTexelToLinear`,n.emissiveMapEncoding):``,n.lightMapEncoding?Mt(`lightMapTexelToLinear`,n.lightMapEncoding):``,n.outputEncoding?Nt(`linearToOutputTexel`,n.outputEncoding):``,n.depthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,`\n`].filter(Rt).join(`\n`)),a=Vt(a),a=zt(a,n),a=Bt(a,n),o=Vt(o),o=zt(o,n),o=Bt(o,n),a=Ut(a),o=Ut(o),n.isWebGL2&&!n.isRawShaderMaterial){var _=!1,v=/^\\s*#version\\s+300\\s+es\\s*\\n/;n.isShaderMaterial&&a.match(v)!==null&&o.match(v)!==null&&(_=!0,a=a.replace(v,``),o=o.replace(v,``)),h=[`#version 300 es\n`,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(`\n`)+`\n`+h,g=[`#version 300 es\n`,`#define varying in`,_?``:`out highp vec4 pc_fragColor;`,_?``:`#define gl_FragColor pc_fragColor`,`#define gl_FragDepthEXT gl_FragDepth`,`#define texture2D texture`,`#define textureCube texture`,`#define texture2DProj textureProj`,`#define texture2DLodEXT textureLod`,`#define texture2DProjLodEXT textureProjLod`,`#define textureCubeLodEXT textureLod`,`#define texture2DGradEXT textureGrad`,`#define texture2DProjGradEXT textureProjGrad`,`#define textureCubeGradEXT textureGrad`].join(`\n`)+`\n`+g}var y=h+a,b=g+o,x=Ot(r,35633,y),S=Ot(r,35632,b);if(r.attachShader(m,x),r.attachShader(m,S),n.index0AttributeName===void 0?n.morphTargets===!0&&r.bindAttribLocation(m,0,`position`):r.bindAttribLocation(m,0,n.index0AttributeName),r.linkProgram(m),e.debug.checkShaderErrors){var C=r.getProgramInfoLog(m).trim(),w=r.getShaderInfoLog(x).trim(),T=r.getShaderInfoLog(S).trim(),E=!0,D=!0;if(r.getProgramParameter(m,35714)===!1){E=!1;var O=jt(r,x,`vertex`),k=jt(r,S,`fragment`);console.error(`THREE.WebGLProgram: shader error: `,r.getError(),`35715`,r.getProgramParameter(m,35715),`gl.getProgramInfoLog`,C,O,k)}else C===``?(w===``||T===``)&&(D=!1):console.warn(`THREE.WebGLProgram: gl.getProgramInfoLog()`,C);D&&(this.diagnostics={runnable:E,programLog:C,vertexShader:{log:w,prefix:h},fragmentShader:{log:T,prefix:g}})}r.deleteShader(x),r.deleteShader(S);var A;this.getUniforms=function(){return A===void 0&&(A=new Dt(r,m)),A};var j;return this.getAttributes=function(){return j===void 0&&(j=Lt(r,m)),j},this.destroy=function(){r.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=bu++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=x,this.fragmentShader=S,this}function Qt(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`},d=`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`.split(`.`);function f(e,t){var n;if(t){var r=lu[t];n={name:e.type,uniforms:nu.clone(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}}else n={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};return n}function p(e){var t=e.skeleton.bones;if(o)return 1024;var n=Math.floor((c-20)/4),r=Math.min(n,t.length);return r<t.length?(console.warn(`THREE.WebGLRenderer: Skeleton has `+t.length+` bones. This GPU supports `+r+`.`),0):r}function m(e){var t;return e?e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn(`THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead.`),t=e.texture.encoding):t=$s,t}this.getParameters=function(r,c,d,h,g,_,v){var y=h.fog,b=r.isMeshStandardMaterial?h.environment:null,x=r.envMap||b,S=u[r.type],C=v.isSkinnedMesh?p(v):0;r.precision!==null&&(s=n.getMaxPrecision(r.precision),s!==r.precision&&console.warn(`THREE.WebGLProgram.getParameters:`,r.precision,`not supported, using`,s,`instead.`));var w=f(r,S);r.onBeforeCompile(w,e);var T=e.getRenderTarget();return{isWebGL2:i,shaderID:S,shaderName:w.name,uniforms:w.uniforms,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,defines:r.defines,isRawShaderMaterial:r.isRawShaderMaterial,isShaderMaterial:r.isShaderMaterial,precision:s,instancing:v.isInstancedMesh===!0,supportsVertexTextures:l,outputEncoding:T===null?e.outputEncoding:m(T.texture),map:!!r.map,mapEncoding:m(r.map),matcap:!!r.matcap,matcapEncoding:m(r.matcap),envMap:!!x,envMapMode:x&&x.mapping,envMapEncoding:m(x),envMapCubeUV:!!x&&(x.mapping===306||x.mapping===307),lightMap:!!r.lightMap,lightMapEncoding:m(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:m(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:r.normalMapType===1,tangentSpaceNormalMap:r.normalMapType===0,clearcoatMap:!!r.clearcoatMap,clearcoatRoughnessMap:!!r.clearcoatRoughnessMap,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexUvs:!!r.map||!!r.bumpMap||!!r.normalMap||!!r.specularMap||!!r.alphaMap||!!r.emissiveMap||!!r.roughnessMap||!!r.metalnessMap||!!r.clearcoatMap||!!r.clearcoatRoughnessMap||!!r.clearcoatNormalMap||!!r.displacementMap,uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap)&&!!r.displacementMap,fog:!!y,useFog:r.fog,fogExp2:y&&y.isFogExp2,flatShading:r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:a,skinning:r.skinning&&C>0,maxBones:C,useVertexTexture:o,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:c.directional.length,numPointLights:c.point.length,numSpotLights:c.spot.length,numRectAreaLights:c.rectArea.length,numHemiLights:c.hemi.length,numDirLightShadows:c.directionalShadowMap.length,numPointLightShadows:c.pointShadowMap.length,numSpotLightShadows:c.spotShadowMap.length,numClippingPlanes:g,numClipIntersection:_,dithering:r.dithering,shadowMapEnabled:e.shadowMap.enabled&&d.length>0,shadowMapType:e.shadowMap.type,toneMapping:r.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:r.side===2,flipSided:r.side===1,depthPacking:r.depthPacking===void 0?!1:r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.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:r.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),t.defines!==void 0)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(t.isRawShaderMaterial===void 0){for(var i=0;i<d.length;i++)n.push(t[d[i]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(t,n){for(var i,a=0,o=r.length;a<o;a++){var s=r[a];if(s.cacheKey===n){i=s,++i.usedTimes;break}}return i===void 0&&(i=new Zt(e,n,t),r.push(i)),i},this.releaseProgram=function(e){if(--e.usedTimes===0){var t=r.indexOf(e);r[t]=r[r.length-1],r.pop(),e.destroy()}},this.programs=r}function $t(){var e=new WeakMap;function t(t){var n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function n(t){e.delete(t)}function r(t,n,r){e.get(t)[n]=r}function i(){e=new WeakMap}return{get:t,remove:n,update:r,dispose:i}}function en(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.program===t.program?e.material.id===t.material.id?e.z===t.z?e.id-t.id:e.z-t.z:e.material.id-t.material.id:e.program.id-t.program.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function tn(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function nn(){var e=[],t=0,n=[],r=[],i={id:-1};function a(){t=0,n.length=0,r.length=0}function o(n,r,a,o,s,c){var l=e[t];return l===void 0?(l={id:n.id,object:n,geometry:r,material:a,program:a.program||i,groupOrder:o,renderOrder:n.renderOrder,z:s,group:c},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=a,l.program=a.program||i,l.groupOrder=o,l.renderOrder=n.renderOrder,l.z=s,l.group=c),t++,l}function s(e,t,i,a,s,c){var l=o(e,t,i,a,s,c);(i.transparent===!0?r:n).push(l)}function c(e,t,i,a,s,c){var l=o(e,t,i,a,s,c);(i.transparent===!0?r:n).unshift(l)}function l(e,t){n.length>1&&n.sort(e||en),r.length>1&&r.sort(t||tn)}function u(){for(var n=t,r=e.length;n<r;n++){var i=e[n];if(i.id===null)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}}return{opaque:n,transparent:r,init:a,push:s,unshift:c,finish:u,sort:l}}function rn(){var e=new WeakMap;function t(n){var r=n.target;r.removeEventListener(`dispose`,t),e.delete(r)}function n(n,r){var i=e.get(n),a;return i===void 0?(a=new nn,e.set(n,new WeakMap),e.get(n).set(r,a),n.addEventListener(`dispose`,t)):(a=i.get(r),a===void 0&&(a=new nn,i.set(r,a))),a}function r(){e=new WeakMap}return{get:n,dispose:r}}function an(){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 D,color:new z};break;case`SpotLight`:n={position:new D,direction:new D,color:new z,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new D,color:new z,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new D,skyColor:new z,groundColor:new z};break;case`RectAreaLight`:n={color:new z,position:new D,halfWidth:new D,halfHeight:new D};break}return e[t.id]=n,n}}}function on(){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 b};break;case`SpotLight`:n={shadowBias:0,shadowRadius:1,shadowMapSize:new b};break;case`PointLight`:n={shadowBias:0,shadowRadius:1,shadowMapSize:new b,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}function sn(e,t){return!!t.castShadow-+!!e.castShadow}function cn(){for(var e=new an,t=on(),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 D);var i=new D,a=new O,o=new O;function s(r,s,c){for(var l=0,u=0,d=0,f=0;f<9;f++)n.probe[f].set(0,0,0);var p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=c.matrixWorldInverse;r.sort(sn);for(var f=0,S=r.length;f<S;f++){var C=r[f],w=C.color,T=C.intensity,E=C.distance,D=C.shadow&&C.shadow.map?C.shadow.map.texture:null;if(C.isAmbientLight)l+=w.r*T,u+=w.g*T,d+=w.b*T;else if(C.isLightProbe)for(var O=0;O<9;O++)n.probe[O].addScaledVector(C.sh.coefficients[O],T);else if(C.isDirectionalLight){var k=e.get(C);if(k.color.copy(C.color).multiplyScalar(C.intensity),k.direction.setFromMatrixPosition(C.matrixWorld),i.setFromMatrixPosition(C.target.matrixWorld),k.direction.sub(i),k.direction.transformDirection(x),C.castShadow){var A=C.shadow,j=t.get(C);j.shadowBias=A.bias,j.shadowRadius=A.radius,j.shadowMapSize=A.mapSize,n.directionalShadow[p]=j,n.directionalShadowMap[p]=D,n.directionalShadowMatrix[p]=C.shadow.matrix,v++}n.directional[p]=k,p++}else if(C.isSpotLight){var k=e.get(C);if(k.position.setFromMatrixPosition(C.matrixWorld),k.position.applyMatrix4(x),k.color.copy(w).multiplyScalar(T),k.distance=E,k.direction.setFromMatrixPosition(C.matrixWorld),i.setFromMatrixPosition(C.target.matrixWorld),k.direction.sub(i),k.direction.transformDirection(x),k.coneCos=Math.cos(C.angle),k.penumbraCos=Math.cos(C.angle*(1-C.penumbra)),k.decay=C.decay,C.castShadow){var A=C.shadow,j=t.get(C);j.shadowBias=A.bias,j.shadowRadius=A.radius,j.shadowMapSize=A.mapSize,n.spotShadow[h]=j,n.spotShadowMap[h]=D,n.spotShadowMatrix[h]=C.shadow.matrix,b++}n.spot[h]=k,h++}else if(C.isRectAreaLight){var k=e.get(C);k.color.copy(w).multiplyScalar(T),k.position.setFromMatrixPosition(C.matrixWorld),k.position.applyMatrix4(x),o.identity(),a.copy(C.matrixWorld),a.premultiply(x),o.extractRotation(a),k.halfWidth.set(C.width*.5,0,0),k.halfHeight.set(0,C.height*.5,0),k.halfWidth.applyMatrix4(o),k.halfHeight.applyMatrix4(o),n.rectArea[g]=k,g++}else if(C.isPointLight){var k=e.get(C);if(k.position.setFromMatrixPosition(C.matrixWorld),k.position.applyMatrix4(x),k.color.copy(C.color).multiplyScalar(C.intensity),k.distance=C.distance,k.decay=C.decay,C.castShadow){var A=C.shadow,j=t.get(C);j.shadowBias=A.bias,j.shadowRadius=A.radius,j.shadowMapSize=A.mapSize,j.shadowCameraNear=A.camera.near,j.shadowCameraFar=A.camera.far,n.pointShadow[m]=j,n.pointShadowMap[m]=D,n.pointShadowMatrix[m]=C.shadow.matrix,y++}n.point[m]=k,m++}else if(C.isHemisphereLight){var k=e.get(C);k.direction.setFromMatrixPosition(C.matrixWorld),k.direction.transformDirection(x),k.direction.normalize(),k.skyColor.copy(C.color).multiplyScalar(T),k.groundColor.copy(C.groundColor).multiplyScalar(T),n.hemi[_]=k,_++}}n.ambient[0]=l,n.ambient[1]=u,n.ambient[2]=d;var M=n.hash;(M.directionalLength!==p||M.pointLength!==m||M.spotLength!==h||M.rectAreaLength!==g||M.hemiLength!==_||M.numDirectionalShadows!==v||M.numPointShadows!==y||M.numSpotShadows!==b)&&(n.directional.length=p,n.spot.length=h,n.rectArea.length=g,n.point.length=m,n.hemi.length=_,n.directionalShadow.length=v,n.directionalShadowMap.length=v,n.pointShadow.length=y,n.pointShadowMap.length=y,n.spotShadow.length=b,n.spotShadowMap.length=b,n.directionalShadowMatrix.length=v,n.pointShadowMatrix.length=y,n.spotShadowMatrix.length=b,M.directionalLength=p,M.pointLength=m,M.spotLength=h,M.rectAreaLength=g,M.hemiLength=_,M.numDirectionalShadows=v,M.numPointShadows=y,M.numSpotShadows=b,n.version=wu++)}return{setup:s,state:n}}function ln(){var e=new cn,t=[],n=[];function r(){t.length=0,n.length=0}function i(e){t.push(e)}function a(e){n.push(e)}function o(r){e.setup(t,n,r)}return{init:r,state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:o,pushLight:i,pushShadow:a}}function un(){var e=new WeakMap;function t(n){var r=n.target;r.removeEventListener(`dispose`,t),e.delete(r)}function n(n,r){var i;return e.has(n)===!1?(i=new ln,e.set(n,new WeakMap),e.get(n).set(r,i),n.addEventListener(`dispose`,t)):e.get(n).has(r)===!1?(i=new ln,e.get(n).set(r,i)):i=e.get(n).get(r),i}function r(){e=new WeakMap}return{get:n,dispose:r}}function dn(e){V.call(this),this.type=`MeshDepthMaterial`,this.depthPacking=sc,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function fn(e){V.call(this),this.type=`MeshDistanceMaterial`,this.referencePosition=new D,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}function pn(e,t,n){var r=new Se,i=new b,a=new b,o=new C,s=[],c=[],l={},u={0:1,1:0,2:2},d=new ge({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new b},radius:{value:4}},vertexShader:Eu,fragmentShader:Tu}),f=d.clone();f.defines.HORIZONAL_PASS=1;var p=new q;p.setAttribute(`position`,new H(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var m=new de(p,d),h=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,s,c){if(h.enabled!==!1&&!(h.autoUpdate===!1&&h.needsUpdate===!1)&&t.length!==0){var l=e.getRenderTarget(),u=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);for(var p=0,m=t.length;p<m;p++){var _=t[p],v=_.shadow;if(v===void 0){console.warn(`THREE.WebGLShadowMap:`,_,`has no shadow.`);continue}i.copy(v.mapSize);var y=v.getFrameExtents();if(i.multiply(y),a.copy(v.mapSize),(i.x>n||i.y>n)&&(i.x>n&&(a.x=Math.floor(n/y.x),i.x=a.x*y.x,v.mapSize.x=a.x),i.y>n&&(a.y=Math.floor(n/y.y),i.y=a.y*y.y,v.mapSize.y=a.y)),v.map===null&&!v.isPointLightShadow&&this.type===3){var b={minFilter:Ko,magFilter:Ko,format:es};v.map=new w(i.x,i.y,b),v.map.texture.name=_.name+`.shadowMap`,v.mapPass=new w(i.x,i.y,b),v.camera.updateProjectionMatrix()}if(v.map===null){var b={minFilter:Uo,magFilter:Uo,format:es};v.map=new w(i.x,i.y,b),v.map.texture.name=_.name+`.shadowMap`,v.camera.updateProjectionMatrix()}e.setRenderTarget(v.map),e.clear();for(var S=v.getViewportCount(),C=0;C<S;C++){var T=v.getViewport(C);o.set(a.x*T.x,a.y*T.y,a.x*T.z,a.y*T.w),f.viewport(o),v.updateMatrices(_,C),r=v.getFrustum(),x(s,c,v.camera,_,this.type)}!v.isPointLightShadow&&this.type===3&&g(v,c)}h.needsUpdate=!1,e.setRenderTarget(l,u,d)}};function g(n,r){var i=t.update(m);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,d,m,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,f,m,null)}function _(e,t,n){var r=e<<0|t<<1|n<<2,i=s[r];return i===void 0&&(i=new dn({depthPacking:cc,morphTargets:e,skinning:t}),s[r]=i),i}function v(e,t,n){var r=e<<0|t<<1|n<<2,i=c[r];return i===void 0&&(i=new fn({morphTargets:e,skinning:t}),c[r]=i),i}function y(t,n,r,i,a,o,s){var c=null,d=_,f=t.customDepthMaterial;if(i.isPointLight===!0&&(d=v,f=t.customDistanceMaterial),f===void 0){var p=!1;r.morphTargets===!0&&(p=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var m=!1;t.isSkinnedMesh===!0&&(r.skinning===!0?m=!0:console.warn(`THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:`,t));var h=t.isInstancedMesh===!0;c=d(p,m,h)}else c=f;if(e.localClippingEnabled&&r.clipShadows===!0&&r.clippingPlanes.length!==0){var g=c.uuid,y=r.uuid,b=l[g];b===void 0&&(b={},l[g]=b);var x=b[y];x===void 0&&(x=c.clone(),b[y]=x),c=x}return c.visible=r.visible,c.wireframe=r.wireframe,s===3?c.side=r.shadowSide===null?r.side:r.shadowSide:c.side=r.shadowSide===null?u[r.side]:r.shadowSide,c.clipShadows=r.clipShadows,c.clippingPlanes=r.clippingPlanes,c.clipIntersection=r.clipIntersection,c.wireframeLinewidth=r.wireframeLinewidth,c.linewidth=r.linewidth,i.isPointLight===!0&&c.isMeshDistanceMaterial===!0&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=a,c.farDistance=o),c}function x(n,i,a,o,s){if(n.visible!==!1){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var c=t.update(n),l=n.material;if(Array.isArray(l))for(var u=c.groups,d=0,f=u.length;d<f;d++){var p=u[d],m=l[p.materialIndex];if(m&&m.visible){var h=y(n,c,m,o,a.near,a.far,s);e.renderBufferDirect(a,null,c,h,n,p)}}else if(l.visible){var h=y(n,c,l,o,a.near,a.far,s);e.renderBufferDirect(a,null,c,h,n,null)}}for(var g=n.children,_=0,v=g.length;_<v;_++)x(g[_],i,a,o,s)}}}function mn(e,t,n){var r=n.isWebGL2;function i(){var t=!1,n=new C,r=null,i=new C(0,0,0,0);return{setMask:function(n){r!==n&&!t&&(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){s===!0&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),i.equals(n)===!1&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}}function a(){var t=!1,n=null,r=null,i=null;return{setTest:function(e){e?H(2929):U(2929)},setMask:function(r){n!==r&&!t&&(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case 3:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}}function o(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(e){t||(e?H(2960):U(2960))},setMask:function(r){n!==r&&!t&&(e.stencilMask(r),n=r)},setFunc:function(t,n,o){(r!==t||i!==n||a!==o)&&(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){(o!==t||s!==n||c!==r)&&(e.stencilOp(t,n,r),o=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null}}}var s=new i,c=new a,l=new o,u=e.getParameter(34921),d=new Uint8Array(u),f=new Uint8Array(u),p=new Uint8Array(u),m={},h=null,g=null,_=null,v=null,y=null,b=null,x=null,S=null,w=null,T=!1,E=null,D=null,O=null,k=null,A=null,j=e.getParameter(35661),M=!1,N=0,P=e.getParameter(7938);P.indexOf(`WebGL`)===-1?P.indexOf(`OpenGL ES`)!==-1&&(N=parseFloat(/^OpenGL\\ ES\\ ([0-9])/.exec(P)[1]),M=N>=2):(N=parseFloat(/^WebGL\\ ([0-9])/.exec(P)[1]),M=N>=1);var F=null,I={},L=new C,R=new C;function z(t,n,r){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;o<r;o++)e.texImage2D(n+o,0,6408,1,1,0,6408,5121,i);return a}var ee={};ee[3553]=z(3553,3553,1),ee[34067]=z(34067,34069,6),s.setClear(0,0,0,1),c.setClear(1),l.setClear(0),H(2929),c.setFunc(3),K(!1),ce(1),H(2884),oe(0);function te(){for(var e=0,t=d.length;e<t;e++)d[e]=0}function ne(e){B(e,0)}function B(n,i){d[n]=1,f[n]===0&&(e.enableVertexAttribArray(n),f[n]=1),p[n]!==i&&((r?e:t.get(`ANGLE_instanced_arrays`))[r?`vertexAttribDivisor`:`vertexAttribDivisorANGLE`](n,i),p[n]=i)}function V(){for(var t=0,n=f.length;t!==n;++t)f[t]!==d[t]&&(e.disableVertexAttribArray(t),f[t]=0)}function re(t,n,i,a,o,s){r===!0&&(i===5124||i===5125)?e.vertexAttribIPointer(t,n,i,a,o,s):e.vertexAttribPointer(t,n,i,a,o,s)}function H(t){m[t]!==!0&&(e.enable(t),m[t]=!0)}function U(t){m[t]!==!1&&(e.disable(t),m[t]=!1)}function ie(t){return h===t?!1:(e.useProgram(t),h=t,!0)}var W={100:32774,101:32778,102:32779};if(r)W[103]=32775,W[104]=32776;else{var ae=t.get(`EXT_blend_minmax`);ae!==null&&(W[103]=ae.MIN_EXT,W[104]=ae.MAX_EXT)}var G={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function oe(t,n,r,i,a,o,s,c){if(t===0){g&&(U(3042),g=!1);return}if(g||(H(3042),g=!0),t!==5){if(t!==_||c!==T){if((v!==100||x!==100)&&(e.blendEquation(32774),v=100,x=100),c)switch(t){case 1:e.blendFuncSeparate(1,771,1,771);break;case 2:e.blendFunc(1,1);break;case 3:e.blendFuncSeparate(0,0,769,771);break;case 4:e.blendFuncSeparate(0,768,0,770);break;default:console.error(`THREE.WebGLState: Invalid blending: `,t);break}else switch(t){case 1:e.blendFuncSeparate(770,771,1,771);break;case 2:e.blendFunc(770,1);break;case 3:e.blendFunc(0,769);break;case 4:e.blendFunc(0,768);break;default:console.error(`THREE.WebGLState: Invalid blending: `,t);break}y=null,b=null,S=null,w=null,_=t,T=c}return}a=a||n,o=o||r,s=s||i,(n!==v||a!==x)&&(e.blendEquationSeparate(W[n],W[a]),v=n,x=a),(r!==y||i!==b||o!==S||s!==w)&&(e.blendFuncSeparate(G[r],G[i],G[o],G[s]),y=r,b=i,S=o,w=s),_=t,T=null}function se(e,t){e.side===2?U(2884):H(2884);var n=e.side===1;t&&(n=!n),K(n),e.blending===1&&e.transparent===!1?oe(0):oe(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),c.setFunc(e.depthFunc),c.setTest(e.depthTest),c.setMask(e.depthWrite),s.setMask(e.colorWrite);var r=e.stencilWrite;l.setTest(r),r&&(l.setMask(e.stencilWriteMask),l.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),l.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),ue(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function K(t){E!==t&&(t?e.frontFace(2304):e.frontFace(2305),E=t)}function ce(t){t===0?U(2884):(H(2884),t!==D&&(t===1?e.cullFace(1029):t===2?e.cullFace(1028):e.cullFace(1032))),D=t}function le(t){t!==O&&(M&&e.lineWidth(t),O=t)}function ue(t,n,r){t?(H(32823),(k!==n||A!==r)&&(e.polygonOffset(n,r),k=n,A=r)):U(32823)}function q(e){e?H(3089):U(3089)}function de(t){t===void 0&&(t=33984+j-1),F!==t&&(e.activeTexture(t),F=t)}function fe(t,n){F===null&&de();var r=I[F];r===void 0&&(r={type:void 0,texture:void 0},I[F]=r),(r.type!==t||r.texture!==n)&&(e.bindTexture(t,n||ee[t]),r.type=t,r.texture=n)}function pe(){var t=I[F];t!==void 0&&t.type!==void 0&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)}function J(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error(`THREE.WebGLState:`,e)}}function me(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error(`THREE.WebGLState:`,e)}}function he(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error(`THREE.WebGLState:`,e)}}function ge(t){L.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),L.copy(t))}function _e(t){R.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),R.copy(t))}function ve(){for(var t=0;t<f.length;t++)f[t]===1&&(e.disableVertexAttribArray(t),f[t]=0);m={},F=null,I={},h=null,_=null,E=null,D=null,s.reset(),c.reset(),l.reset()}return{buffers:{color:s,depth:c,stencil:l},initAttributes:te,enableAttribute:ne,enableAttributeAndDivisor:B,disableUnusedAttributes:V,vertexAttribPointer:re,enable:H,disable:U,useProgram:ie,setBlending:oe,setMaterial:se,setFlipSided:K,setCullFace:ce,setLineWidth:le,setPolygonOffset:ue,setScissorTest:q,activeTexture:de,bindTexture:fe,unbindTexture:pe,compressedTexImage2D:J,texImage2D:me,texImage3D:he,scissor:ge,viewport:_e,reset:ve}}function hn(e,t,n,r,i,a,o){var s=i.isWebGL2,c=i.maxTextures,l=i.maxCubemapSize,u=i.maxTextureSize,d=i.maxSamples,f=new WeakMap,p,m=!1;try{m=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch(e){}function h(e,t){return m?new OffscreenCanvas(e,t):document.createElementNS(`http://www.w3.org/1999/xhtml`,`canvas`)}function g(e,t,n,r){var i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||t===!0)if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){var a=t?X.floorPowerOfTwo:Math.floor,o=a(i*e.width),s=a(i*e.height);p===void 0&&(p=h(o,s));var c=n?h(o,s):p;return c.width=o,c.height=s,c.getContext(`2d`).drawImage(e,0,0,o,s),console.warn(`THREE.WebGLRenderer: Texture has been resized from (`+e.width+`x`+e.height+`) to (`+o+`x`+s+`).`),c}else return`data`in e&&console.warn(`THREE.WebGLRenderer: Image in DataTexture is too big (`+e.width+`x`+e.height+`).`),e;return e}function _(e){return X.isPowerOfTwo(e.width)&&X.isPowerOfTwo(e.height)}function v(e){return s?!1:e.wrapS!==1001||e.wrapT!==1001||e.minFilter!==1003&&e.minFilter!==1006}function y(e,t){return e.generateMipmaps&&t&&e.minFilter!==1003&&e.minFilter!==1006}function b(t,n,i,a){e.generateMipmap(t);var o=r.get(n);o.__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function x(n,r,i){if(s===!1)return r;if(n!==null){if(e[n]!==void 0)return e[n];console.warn(`THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}var a=r;return r===6403&&(i===5126&&(a=33326),i===5131&&(a=33325),i===5121&&(a=33321)),r===6407&&(i===5126&&(a=34837),i===5131&&(a=34843),i===5121&&(a=32849)),r===6408&&(i===5126&&(a=34836),i===5131&&(a=34842),i===5121&&(a=32856)),(a===33325||a===33326||a===34842||a===34836)&&t.get(`EXT_color_buffer_float`),a}function S(e){return e===1003||e===1004||e===1005?9728:9729}function C(e){var t=e.target;t.removeEventListener(`dispose`,C),T(t),t.isVideoTexture&&f.delete(t),o.memory.textures--}function w(e){var t=e.target;t.removeEventListener(`dispose`,w),E(t),o.memory.textures--}function T(t){var n=r.get(t);n.__webglInit!==void 0&&(e.deleteTexture(n.__webglTexture),r.remove(t))}function E(t){var n=r.get(t),i=r.get(t.texture);if(t){if(i.__webglTexture!==void 0&&e.deleteTexture(i.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}}var D=0;function O(){D=0}function k(){var e=D;return e>=c&&console.warn(`THREE.WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+c),D+=1,e}function A(e,t){var i=r.get(e);if(e.isVideoTexture&&ie(e),e.version>0&&i.__version!==e.version){var a=e.image;if(a===void 0)console.warn(`THREE.WebGLRenderer: Texture marked for update but image is undefined`);else if(a.complete===!1)console.warn(`THREE.WebGLRenderer: Texture marked for update but image is incomplete`);else{z(i,e,t);return}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function j(e,t){var i=r.get(e);if(e.version>0&&i.__version!==e.version){z(i,e,t);return}n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture)}function M(e,t){var i=r.get(e);if(e.version>0&&i.__version!==e.version){z(i,e,t);return}n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture)}function N(t,i){if(t.image.length===6){var o=r.get(t);if(t.version>0&&o.__version!==t.version){R(o,t),n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture),e.pixelStorei(37440,t.flipY);for(var c=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),u=t.image[0]&&t.image[0].isDataTexture,d=[],f=0;f<6;f++)!c&&!u?d[f]=g(t.image[f],!1,!0,l):d[f]=u?t.image[f].image:t.image[f];var p=d[0],m=_(p)||s,h=a.convert(t.format),v=a.convert(t.type),S=x(t.internalFormat,h,v);L(34067,t,m);var C;if(c){for(var f=0;f<6;f++){C=d[f].mipmaps;for(var w=0;w<C.length;w++){var T=C[w];t.format!==1023&&t.format!==1022?h===null?console.warn(`THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()`):n.compressedTexImage2D(34069+f,w,S,T.width,T.height,0,T.data):n.texImage2D(34069+f,w,S,T.width,T.height,0,h,v,T.data)}}o.__maxMipLevel=C.length-1}else{C=t.mipmaps;for(var f=0;f<6;f++)if(u){n.texImage2D(34069+f,0,S,d[f].width,d[f].height,0,h,v,d[f].data);for(var w=0;w<C.length;w++){var T=C[w],E=T.image[f].image;n.texImage2D(34069+f,w+1,S,E.width,E.height,0,h,v,E.data)}}else{n.texImage2D(34069+f,0,S,h,v,d[f]);for(var w=0;w<C.length;w++){var T=C[w];n.texImage2D(34069+f,w+1,S,h,v,T.image[f])}}o.__maxMipLevel=C.length}y(t,m)&&b(34067,t,p.width,p.height),o.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture)}}function P(e,t){n.activeTexture(33984+t),n.bindTexture(34067,r.get(e).__webglTexture)}var F={[Bo]:10497,[Vo]:33071,[Ho]:33648},I={[Uo]:9728,[Wo]:9984,[Go]:9986,[Ko]:9729,[qo]:9985,[Jo]:9987};function L(n,a,o){o?(e.texParameteri(n,10242,F[a.wrapS]),e.texParameteri(n,10243,F[a.wrapT]),(n===32879||n===35866)&&e.texParameteri(n,32882,F[a.wrapR]),e.texParameteri(n,10240,I[a.magFilter]),e.texParameteri(n,10241,I[a.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),(n===32879||n===35866)&&e.texParameteri(n,32882,33071),(a.wrapS!==1001||a.wrapT!==1001)&&console.warn(`THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.`),e.texParameteri(n,10240,S(a.magFilter)),e.texParameteri(n,10241,S(a.minFilter)),a.minFilter!==1003&&a.minFilter!==1006&&console.warn(`THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.`));var c=t.get(`EXT_texture_filter_anisotropic`);if(c){if(a.type===1015&&t.get(`OES_texture_float_linear`)===null||a.type===1016&&(s||t.get(`OES_texture_half_float_linear`))===null)return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function R(t,n){t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,C),t.__webglTexture=e.createTexture(),o.memory.textures++)}function z(t,r,i){var o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),R(t,r),n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var c=v(r)&&_(r.image)===!1,l=g(r.image,c,!1,u),d=_(l)||s,f=a.convert(r.format),p=a.convert(r.type),m=x(r.internalFormat,f,p);L(o,r,d);var h,S=r.mipmaps;if(r.isDepthTexture)m=6402,s?m=r.type===1015?36012:r.type===1014?33190:r.type===1020?35056:33189:r.type===1015&&console.error(`WebGLRenderer: Floating point depth texture requires WebGL2.`),r.format===1026&&m===6402&&r.type!==1012&&r.type!==1014&&(console.warn(`THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.`),r.type=Xo,p=a.convert(r.type)),r.format===1027&&m===6402&&(m=34041,r.type!==1020&&(console.warn(`THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.`),r.type=Qo,p=a.convert(r.type))),n.texImage2D(3553,0,m,l.width,l.height,0,f,p,null);else if(r.isDataTexture)if(S.length>0&&d){for(var C=0,w=S.length;C<w;C++)h=S[C],n.texImage2D(3553,C,m,h.width,h.height,0,f,p,h.data);r.generateMipmaps=!1,t.__maxMipLevel=S.length-1}else n.texImage2D(3553,0,m,l.width,l.height,0,f,p,l.data),t.__maxMipLevel=0;else if(r.isCompressedTexture){for(var C=0,w=S.length;C<w;C++)h=S[C],r.format!==1023&&r.format!==1022?f===null?console.warn(`THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`):n.compressedTexImage2D(3553,C,m,h.width,h.height,0,h.data):n.texImage2D(3553,C,m,h.width,h.height,0,f,p,h.data);t.__maxMipLevel=S.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,m,l.width,l.height,l.depth,0,f,p,l.data),t.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,m,l.width,l.height,l.depth,0,f,p,l.data),t.__maxMipLevel=0;else if(S.length>0&&d){for(var C=0,w=S.length;C<w;C++)h=S[C],n.texImage2D(3553,C,m,f,p,h);r.generateMipmaps=!1,t.__maxMipLevel=S.length-1}else n.texImage2D(3553,0,m,f,p,l),t.__maxMipLevel=0;y(r,d)&&b(o,r,l.width,l.height),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function ee(t,i,o,s){var c=a.convert(i.texture.format),l=a.convert(i.texture.type),u=x(i.texture.internalFormat,c,l);n.texImage2D(s,0,u,i.width,i.height,0,c,l,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,o,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function te(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){var i=33189;if(r){var o=n.depthTexture;o&&o.isDepthTexture&&(o.type===1015?i=36012:o.type===1014&&(i=33190));var s=U(n);e.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else e.renderbufferStorage(36161,i,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){if(r){var s=U(n);e.renderbufferStorageMultisample(36161,s,35056,n.width,n.height)}else e.renderbufferStorage(36161,34041,n.width,n.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{var c=a.convert(n.texture.format),l=a.convert(n.texture.type),i=x(n.texture.internalFormat,c,l);if(r){var s=U(n);e.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else e.renderbufferStorage(36161,i,n.width,n.height)}e.bindRenderbuffer(36161,null)}function ne(t,n){if(n&&n.isWebGLCubeRenderTarget)throw Error(`Depth Texture with cube render targets is not supported`);if(e.bindFramebuffer(36160,t),!(n.depthTexture&&n.depthTexture.isDepthTexture))throw Error(`renderTarget.depthTexture must be an instance of THREE.DepthTexture`);(!r.get(n.depthTexture).__webglTexture||n.depthTexture.image.width!==n.width||n.depthTexture.image.height!==n.height)&&(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),A(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===1026)e.framebufferTexture2D(36160,36096,3553,i,0);else if(n.depthTexture.format===1027)e.framebufferTexture2D(36160,33306,3553,i,0);else throw Error(`Unknown depthTexture format`)}function B(t){var n=r.get(t),i=t.isWebGLCubeRenderTarget===!0;if(t.depthTexture){if(i)throw Error(`target.depthTexture not supported in Cube render targets`);ne(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),te(n.__webglDepthbuffer[a],t,!1)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),te(n.__webglDepthbuffer,t,!1);e.bindFramebuffer(36160,null)}function V(t){var i=r.get(t),c=r.get(t.texture);t.addEventListener(`dispose`,w),c.__webglTexture=e.createTexture(),o.memory.textures++;var l=t.isWebGLCubeRenderTarget===!0,u=t.isWebGLMultisampleRenderTarget===!0,d=_(t)||s;if(s&&t.texture.format===1022&&(t.texture.type===1015||t.texture.type===1016)&&(t.texture.format=es,console.warn(`THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.`)),l){i.__webglFramebuffer=[];for(var f=0;f<6;f++)i.__webglFramebuffer[f]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),u)if(s){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var p=a.convert(t.texture.format),m=a.convert(t.texture.type),h=x(t.texture.internalFormat,p,m),g=U(t);e.renderbufferStorageMultisample(36161,g,h,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),te(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn(`THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.`);if(l){n.bindTexture(34067,c.__webglTexture),L(34067,t.texture,d);for(var f=0;f<6;f++)ee(i.__webglFramebuffer[f],t,36064,34069+f);y(t.texture,d)&&b(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,c.__webglTexture),L(3553,t.texture,d),ee(i.__webglFramebuffer,t,36064,3553),y(t.texture,d)&&b(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&B(t)}function re(e){var t=e.texture;if(y(t,_(e)||s)){var i=e.isWebGLCubeRenderTarget?34067:3553,a=r.get(t).__webglTexture;n.bindTexture(i,a),b(i,t,e.width,e.height),n.bindTexture(i,null)}}function H(t){if(t.isWebGLMultisampleRenderTarget)if(s){var n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var i=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn(`THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.`)}function U(e){return s&&e.isWebGLMultisampleRenderTarget?Math.min(d,e.samples):0}function ie(e){var t=o.render.frame;f.get(e)!==t&&(f.set(e,t),e.update())}var W=!1,ae=!1;function G(e,t){e&&e.isWebGLRenderTarget&&(W===!1&&(console.warn(`THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead.`),W=!0),e=e.texture),A(e,t)}function oe(e,t){e&&e.isWebGLCubeRenderTarget&&(ae===!1&&(console.warn(`THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead.`),ae=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&e.image.length===6?N(e,t):P(e,t)}this.allocateTextureUnit=k,this.resetTextureUnits=O,this.setTexture2D=A,this.setTexture2DArray=j,this.setTexture3D=M,this.setTextureCube=N,this.setTextureCubeDynamic=P,this.setupRenderTarget=V,this.updateRenderTargetMipmap=re,this.updateMultisampleRenderTarget=H,this.safeSetTexture2D=G,this.safeSetTextureCube=oe}function gn(e,t,n){var r=n.isWebGL2;function i(e){var n;if(e===1009)return 5121;if(e===1017)return 32819;if(e===1018)return 32820;if(e===1019)return 33635;if(e===1010)return 5120;if(e===1011)return 5122;if(e===1012)return 5123;if(e===1013)return 5124;if(e===1014)return 5125;if(e===1015)return 5126;if(e===1016)return r?5131:(n=t.get(`OES_texture_half_float`),n===null?null:n.HALF_FLOAT_OES);if(e===1021)return 6406;if(e===1022)return 6407;if(e===1023)return 6408;if(e===1024)return 6409;if(e===1025)return 6410;if(e===1026)return 6402;if(e===1027)return 34041;if(e===1028)return 6403;if(e===1029)return 36244;if(e===1030)return 33319;if(e===1031)return 33320;if(e===1032)return 36248;if(e===1033)return 36249;if(e===33776||e===33777||e===33778||e===33779)if(n=t.get(`WEBGL_compressed_texture_s3tc`),n!==null){if(e===33776)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===33777)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===33778)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===33779)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(e===35840||e===35841||e===35842||e===35843)if(n=t.get(`WEBGL_compressed_texture_pvrtc`),n!==null){if(e===35840)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===35841)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===35842)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===35843)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(e===36196)return n=t.get(`WEBGL_compressed_texture_etc1`),n===null?null:n.COMPRESSED_RGB_ETC1_WEBGL;if((e===37492||e===37496)&&(n=t.get(`WEBGL_compressed_texture_etc`),n!==null)){if(e===37492)return n.COMPRESSED_RGB8_ETC2;if(e===37496)return n.COMPRESSED_RGBA8_ETC2_EAC}if(e===37808||e===37809||e===37810||e===37811||e===37812||e===37813||e===37814||e===37815||e===37816||e===37817||e===37818||e===37819||e===37820||e===37821||e===37840||e===37841||e===37842||e===37843||e===37844||e===37845||e===37846||e===37847||e===37848||e===37849||e===37850||e===37851||e===37852||e===37853)return n=t.get(`WEBGL_compressed_texture_astc`),n===null?null:e;if(e===36492)return n=t.get(`EXT_texture_compression_bptc`),n===null?null:e;if(e===1020)return r?34042:(n=t.get(`WEBGL_depth_texture`),n===null?null:n.UNSIGNED_INT_24_8_WEBGL)}return{convert:i}}function _n(e){ve.call(this),this.cameras=e||[]}function vn(){j.call(this),this.type=`Group`}function yn(){this._targetRay=null,this._grip=null}function bn(e,t){var n=this,r=null,i=1,a=null,o=`local-floor`,s=null,c=[],l=new Map,u=new ve;u.layers.enable(1),u.viewport=new C;var d=new ve;d.layers.enable(2),d.viewport=new C;var f=[u,d],p=new _n;p.layers.enable(1),p.layers.enable(2);var m=null,h=null;this.enabled=!1,this.isPresenting=!1,this.getController=function(e){var t=c[e];return t===void 0&&(t=new yn,c[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){var t=c[e];return t===void 0&&(t=new yn,c[e]=t),t.getGripSpace()};function g(e){var t=l.get(e.inputSource);t&&t.dispatchEvent({type:e.type})}function _(){l.forEach(function(e,t){e.disconnect(t)}),l.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),O.stop(),n.isPresenting=!1,n.dispatchEvent({type:`sessionend`})}function v(e){a=e,O.setContext(r),O.start(),n.isPresenting=!0,n.dispatchEvent({type:`sessionstart`})}this.setFramebufferScaleFactor=function(e){i=e,n.isPresenting===!0&&console.warn(`THREE.WebXRManager: Cannot change framebuffer scale while presenting.`)},this.setReferenceSpaceType=function(e){o=e,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(e){if(r=e,r!==null){r.addEventListener(`select`,g),r.addEventListener(`selectstart`,g),r.addEventListener(`selectend`,g),r.addEventListener(`squeeze`,g),r.addEventListener(`squeezestart`,g),r.addEventListener(`squeezeend`,g),r.addEventListener(`end`,_);var n=t.getContextAttributes();n.xrCompatible!==!0&&t.makeXRCompatible();var a={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil,framebufferScaleFactor:i},s=new XRWebGLLayer(r,t,a);r.updateRenderState({baseLayer:s}),r.requestReferenceSpace(o).then(v),r.addEventListener(`inputsourceschange`,y)}};function y(e){for(var t=r.inputSources,n=0;n<c.length;n++)l.set(t[n],c[n]);for(var n=0;n<e.removed.length;n++){var i=e.removed[n],a=l.get(i);a&&(a.dispatchEvent({type:`disconnected`,data:i}),l.delete(i))}for(var n=0;n<e.added.length;n++){var i=e.added[n],a=l.get(i);a&&a.dispatchEvent({type:`connected`,data:i})}}var b=new D,x=new D;function S(e,t,n){b.setFromMatrixPosition(t.matrixWorld),x.setFromMatrixPosition(n.matrixWorld);var r=b.distanceTo(x),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var g=o+m,_=s+m,v=f-h,y=p+(r-h),S=c*s/_*g,C=l*s/_*g;e.projectionMatrix.makePerspective(v,y,S,C,g,_)}function w(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}this.getCamera=function(e){p.near=d.near=u.near=e.near,p.far=d.far=u.far=e.far,(m!==p.near||h!==p.far)&&(r.updateRenderState({depthNear:p.near,depthFar:p.far}),m=p.near,h=p.far);var t=e.parent,n=p.cameras;w(p,t);for(var i=0;i<n.length;i++)w(n[i],t);e.matrixWorld.copy(p.matrixWorld);for(var a=e.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return n.length===2?S(p,u,d):p.projectionMatrix.copy(u.projectionMatrix),p};var T=null;function E(t,n){if(s=n.getViewerPose(a),s!==null){var i=s.views,o=r.renderState.baseLayer;e.setFramebuffer(o.framebuffer);var l=!1;i.length!==p.cameras.length&&(p.cameras.length=0,l=!0);for(var u=0;u<i.length;u++){var d=i[u],m=o.getViewport(d),h=f[u];h.matrix.fromArray(d.transform.matrix),h.projectionMatrix.fromArray(d.projectionMatrix),h.viewport.set(m.x,m.y,m.width,m.height),u===0&&p.matrix.copy(h.matrix),l===!0&&p.cameras.push(h)}}for(var g=r.inputSources,u=0;u<c.length;u++){var _=c[u],v=g[u];_.update(v,n,a)}T&&T(t,n)}var O=new Ce;O.setAnimationLoop(E),this.setAnimationLoop=function(e){T=e},this.dispose=function(){}}function xn(e){function t(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}function n(e,t,n,_,v){t.isMeshBasicMaterial?r(e,t):t.isMeshLambertMaterial?(r(e,t),c(e,t)):t.isMeshToonMaterial?(r(e,t),u(e,t)):t.isMeshPhongMaterial?(r(e,t),l(e,t)):t.isMeshStandardMaterial?(r(e,t,n),t.isMeshPhysicalMaterial?f(e,t,n):d(e,t,n)):t.isMeshMatcapMaterial?(r(e,t),p(e,t)):t.isMeshDepthMaterial?(r(e,t),m(e,t)):t.isMeshDistanceMaterial?(r(e,t),h(e,t)):t.isMeshNormalMaterial?(r(e,t),g(e,t)):t.isLineBasicMaterial?(i(e,t),t.isLineDashedMaterial&&a(e,t)):t.isPointsMaterial?o(e,t,_,v):t.isSpriteMaterial?s(e,t):t.isShadowMaterial?(e.color.value.copy(t.color),e.opacity.value=t.opacity):t.isShaderMaterial&&(t.uniformsNeedUpdate=!1)}function r(t,n,r){t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap);var i=n.envMap||r;i&&(t.envMap.value=i,t.flipEnvMap.value=i.isCubeTexture?-1:1,t.reflectivity.value=n.reflectivity,t.refractionRatio.value=n.refractionRatio,t.maxMipLevel.value=e.get(i).__maxMipLevel),n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity);var a;n.map?a=n.map:n.specularMap?a=n.specularMap:n.displacementMap?a=n.displacementMap:n.normalMap?a=n.normalMap:n.bumpMap?a=n.bumpMap:n.roughnessMap?a=n.roughnessMap:n.metalnessMap?a=n.metalnessMap:n.alphaMap?a=n.alphaMap:n.emissiveMap&&(a=n.emissiveMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),t.uvTransform.value.copy(a.matrix));var o;n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),o!==void 0&&(o.isWebGLRenderTarget&&(o=o.texture),o.matrixAutoUpdate===!0&&o.updateMatrix(),t.uv2Transform.value.copy(o.matrix))}function i(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}function a(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function o(e,t,n,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=r*.5,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap);var i;t.map?i=t.map:t.alphaMap&&(i=t.alphaMap),i!==void 0&&(i.matrixAutoUpdate===!0&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}function s(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),n!==void 0&&(n.matrixAutoUpdate===!0&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function c(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}function l(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===1&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===1&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.gradientMap&&(e.gradientMap.value=t.gradientMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===1&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===1&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function d(e,t,n){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===1&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===1&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),(t.envMap||n)&&(e.envMapIntensity.value=t.envMapIntensity)}function f(e,t,n){d(e,t,n),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen),t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===1&&e.clearcoatNormalScale.value.negate()),e.transparency.value=t.transparency}function p(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===1&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===1&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function m(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function h(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}function g(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===1&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===1&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}return{refreshFogUniforms:t,refreshMaterialUniforms:n}}function Sn(e){e=e||{};var t=e.canvas===void 0?document.createElementNS(`http://www.w3.org/1999/xhtml`,`canvas`):e.canvas,n=e.context===void 0?null:e.context,r=e.alpha===void 0?!1:e.alpha,i=e.depth===void 0?!0:e.depth,a=e.stencil===void 0?!0:e.stencil,o=e.antialias===void 0?!1:e.antialias,s=e.premultipliedAlpha===void 0?!0:e.premultipliedAlpha,c=e.preserveDrawingBuffer===void 0?!1:e.preserveDrawingBuffer,l=e.powerPreference===void 0?`default`:e.powerPreference,u=e.failIfMajorPerformanceCaveat===void 0?!1:e.failIfMajorPerformanceCaveat,d=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=$s,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var p=this,m=!1,h=null,g=0,_=0,v=null,y=null,x=-1,S={geometry:null,program:null,wireframe:!1},w=null,T=null,E=new C,k=new C,A=null,j=t.width,N=t.height,P=1,F=null,I=null,L=new C(0,0,j,N),R=new C(0,0,j,N),z=!1,ee=new Se,te=new Ae,ne=!1,B=!1,V=new O,re=new D;function H(){return v===null?P:1}var U;try{var ie={alpha:r,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(t.addEventListener(`webglcontextlost`,Te,!1),t.addEventListener(`webglcontextrestored`,Ee,!1),U=n||t.getContext(`webgl`,ie)||t.getContext(`experimental-webgl`,ie),U===null)throw t.getContext(`webgl`)===null?Error(`Error creating WebGL context.`):Error(`Error creating WebGL context with your selected attributes.`);U.getShaderPrecisionFormat===void 0&&(U.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error(`THREE.WebGLRenderer: `+e.message),e}var W,ae,G,oe,se,K,ce,le,ue,q,de,fe,pe,J,me,he,ge,_e;function ve(){W=new je(U),ae=new ke(U,W,e),ae.isWebGL2===!1&&(W.get(`WEBGL_depth_texture`),W.get(`OES_texture_float`),W.get(`OES_texture_half_float`),W.get(`OES_texture_half_float_linear`),W.get(`OES_standard_derivatives`),W.get(`OES_element_index_uint`),W.get(`ANGLE_instanced_arrays`)),W.get(`OES_texture_float_linear`),_e=new gn(U,W,ae),G=new mn(U,W,ae),G.scissor(k.copy(R).multiplyScalar(P).floor()),G.viewport(E.copy(L).multiplyScalar(P).floor()),oe=new Pe(U),se=new $t,K=new hn(U,W,G,se,ae,_e,oe),ce=new we(U,ae),le=new Me(U,ce,oe),ue=new Le(U,le,ce,oe),me=new Ie(U),q=new Qt(p,W,ae),de=new xn(se),fe=new rn,pe=new un,J=new De(p,G,ue,s),he=new Oe(U,W,oe,ae),ge=new Ne(U,W,oe,ae),oe.programs=q.programs,p.capabilities=ae,p.extensions=W,p.properties=se,p.renderLists=fe,p.state=G,p.info=oe}ve();var ye=new bn(p,U);this.xr=ye;var be=new pn(p,ue,ae.maxTextureSize);this.shadowMap=be,this.getContext=function(){return U},this.getContextAttributes=function(){return U.getContextAttributes()},this.forceContextLoss=function(){var e=W.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){var e=W.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return P},this.setPixelRatio=function(e){e!==void 0&&(P=e,this.setSize(j,N,!1))},this.getSize=function(e){return e===void 0&&(console.warn(`WebGLRenderer: .getsize() now requires a Vector2 as an argument`),e=new b),e.set(j,N)},this.setSize=function(e,n,r){if(ye.isPresenting){console.warn(`THREE.WebGLRenderer: Can't change size while VR device is presenting.`);return}j=e,N=n,t.width=Math.floor(e*P),t.height=Math.floor(n*P),r!==!1&&(t.style.width=e+`px`,t.style.height=n+`px`),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e===void 0&&(console.warn(`WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument`),e=new b),e.set(j*P,N*P).floor()},this.setDrawingBufferSize=function(e,n,r){j=e,N=n,P=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e===void 0&&(console.warn(`WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument`),e=new C),e.copy(E)},this.getViewport=function(e){return e.copy(L)},this.setViewport=function(e,t,n,r){e.isVector4?L.set(e.x,e.y,e.z,e.w):L.set(e,t,n,r),G.viewport(E.copy(L).multiplyScalar(P).floor())},this.getScissor=function(e){return e.copy(R)},this.setScissor=function(e,t,n,r){e.isVector4?R.set(e.x,e.y,e.z,e.w):R.set(e,t,n,r),G.scissor(k.copy(R).multiplyScalar(P).floor())},this.getScissorTest=function(){return z},this.setScissorTest=function(e){G.setScissorTest(z=e)},this.setOpaqueSort=function(e){F=e},this.setTransparentSort=function(e){I=e},this.getClearColor=function(){return J.getClearColor()},this.setClearColor=function(){J.setClearColor.apply(J,arguments)},this.getClearAlpha=function(){return J.getClearAlpha()},this.setClearAlpha=function(){J.setClearAlpha.apply(J,arguments)},this.clear=function(e,t,n){var r=0;(e===void 0||e)&&(r|=16384),(t===void 0||t)&&(r|=256),(n===void 0||n)&&(r|=1024),U.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener(`webglcontextlost`,Te,!1),t.removeEventListener(`webglcontextrestored`,Ee,!1),fe.dispose(),pe.dispose(),se.dispose(),ue.dispose(),ye.dispose(),Ge.stop()};function Te(e){e.preventDefault(),console.log(`THREE.WebGLRenderer: Context Lost.`),m=!0}function Ee(){console.log(`THREE.WebGLRenderer: Context Restored.`),m=!1,ve()}function Fe(e){var t=e.target;t.removeEventListener(`dispose`,Fe),Re(t)}function Re(e){ze(e),se.remove(e)}function ze(e){var t=se.get(e).program;e.program=void 0,t!==void 0&&q.releaseProgram(t)}function Be(e,t){e.render(function(e){p.renderBufferImmediate(e,t)})}this.renderBufferImmediate=function(e,t){G.initAttributes();var n=se.get(e);e.hasPositions&&!n.position&&(n.position=U.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=U.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=U.createBuffer()),e.hasColors&&!n.color&&(n.color=U.createBuffer());var r=t.getAttributes();e.hasPositions&&(U.bindBuffer(34962,n.position),U.bufferData(34962,e.positionArray,35048),G.enableAttribute(r.position),U.vertexAttribPointer(r.position,3,5126,!1,0,0)),e.hasNormals&&(U.bindBuffer(34962,n.normal),U.bufferData(34962,e.normalArray,35048),G.enableAttribute(r.normal),U.vertexAttribPointer(r.normal,3,5126,!1,0,0)),e.hasUvs&&(U.bindBuffer(34962,n.uv),U.bufferData(34962,e.uvArray,35048),G.enableAttribute(r.uv),U.vertexAttribPointer(r.uv,2,5126,!1,0,0)),e.hasColors&&(U.bindBuffer(34962,n.color),U.bufferData(34962,e.colorArray,35048),G.enableAttribute(r.color),U.vertexAttribPointer(r.color,3,5126,!1,0,0)),G.disableUnusedAttributes(),U.drawArrays(4,0,e.count),e.count=0};var Ve=new M;this.renderBufferDirect=function(e,t,n,r,i,a){t===null&&(t=Ve);var o=i.isMesh&&i.matrixWorld.determinant()<0,s=Xe(e,t,r,i);G.setMaterial(r,o);var c=!1;(S.geometry!==n.id||S.program!==s.id||S.wireframe!==(r.wireframe===!0))&&(S.geometry=n.id,S.program=s.id,S.wireframe=r.wireframe===!0,c=!0),(r.morphTargets||r.morphNormals)&&(me.update(i,n,r,s),c=!0),i.isInstancedMesh===!0&&(c=!0);var l=n.index,u=n.attributes.position;if(l===null){if(u===void 0||u.count===0)return}else if(l.count===0)return;var d=1;r.wireframe===!0&&(l=le.getWireframeAttribute(n),d=2);var f,p=he;l!==null&&(f=ce.get(l),p=ge,p.setIndex(f)),c&&(He(i,n,r,s),l!==null&&U.bindBuffer(34963,f.buffer));var m=l===null?u.count:l.count,h=n.drawRange.start*d,g=n.drawRange.count*d,_=a===null?0:a.start*d,v=a===null?1/0:a.count*d,y=Math.max(h,_),b=Math.min(m,h+g,_+v)-1,x=Math.max(0,b-y+1);if(x!==0){if(i.isMesh)r.wireframe===!0?(G.setLineWidth(r.wireframeLinewidth*H()),p.setMode(1)):p.setMode(4);else if(i.isLine){var C=r.linewidth;C===void 0&&(C=1),G.setLineWidth(C*H()),i.isLineSegments?p.setMode(1):i.isLineLoop?p.setMode(2):p.setMode(3)}else i.isPoints?p.setMode(0):i.isSprite&&p.setMode(4);if(i.isInstancedMesh)p.renderInstances(n,y,x,i.count);else if(n.isInstancedBufferGeometry){var w=Math.min(n.instanceCount,n._maxInstanceCount);p.renderInstances(n,y,x,w)}else p.render(y,x)}};function He(e,t,n,r){if(!(ae.isWebGL2===!1&&(e.isInstancedMesh||t.isInstancedBufferGeometry)&&W.get(`ANGLE_instanced_arrays`)===null)){G.initAttributes();var i=t.attributes,a=r.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var l=i[s];if(l!==void 0){var u=l.normalized,d=l.itemSize,f=ce.get(l);if(f===void 0)continue;var p=f.buffer,m=f.type,h=f.bytesPerElement;if(l.isInterleavedBufferAttribute){var g=l.data,_=g.stride,v=l.offset;g&&g.isInstancedInterleavedBuffer?(G.enableAttributeAndDivisor(c,g.meshPerAttribute),t._maxInstanceCount===void 0&&(t._maxInstanceCount=g.meshPerAttribute*g.count)):G.enableAttribute(c),U.bindBuffer(34962,p),G.vertexAttribPointer(c,d,m,u,_*h,v*h)}else l.isInstancedBufferAttribute?(G.enableAttributeAndDivisor(c,l.meshPerAttribute),t._maxInstanceCount===void 0&&(t._maxInstanceCount=l.meshPerAttribute*l.count)):G.enableAttribute(c),U.bindBuffer(34962,p),G.vertexAttribPointer(c,d,m,u,0,0)}else if(s===`instanceMatrix`){var f=ce.get(e.instanceMatrix);if(f===void 0)continue;var p=f.buffer,m=f.type;G.enableAttributeAndDivisor(c+0,1),G.enableAttributeAndDivisor(c+1,1),G.enableAttributeAndDivisor(c+2,1),G.enableAttributeAndDivisor(c+3,1),U.bindBuffer(34962,p),U.vertexAttribPointer(c+0,4,m,!1,64,0),U.vertexAttribPointer(c+1,4,m,!1,64,16),U.vertexAttribPointer(c+2,4,m,!1,64,32),U.vertexAttribPointer(c+3,4,m,!1,64,48)}else if(o!==void 0){var y=o[s];if(y!==void 0)switch(y.length){case 2:U.vertexAttrib2fv(c,y);break;case 3:U.vertexAttrib3fv(c,y);break;case 4:U.vertexAttrib4fv(c,y);break;default:U.vertexAttrib1fv(c,y)}}}}G.disableUnusedAttributes()}}this.compile=function(e,t){f=pe.get(e,t),f.init(),e.traverse(function(e){e.isLight&&(f.pushLight(e),e.castShadow&&f.pushShadow(e))}),f.setupLights(t);let n={};e.traverse(function(t){let r=t.material;if(r)if(Array.isArray(r))for(let i=0;i<r.length;i++){let a=r[i];a.uuid in n||(Ye(a,e,t),n[a.uuid]=!0)}else r.uuid in n||(Ye(r,e,t),n[r.uuid]=!0)})};var Ue=null;function We(e){ye.isPresenting||Ue&&Ue(e)}var Ge=new Ce;Ge.setAnimationLoop(We),typeof window<`u`&&Ge.setContext(window),this.setAnimationLoop=function(e){Ue=e,ye.setAnimationLoop(e),Ge.start()},this.render=function(e,t){var n,r;if(arguments[2]!==void 0&&(console.warn(`THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.`),n=arguments[2]),arguments[3]!==void 0&&(console.warn(`THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead.`),r=arguments[3]),!(t&&t.isCamera)){console.error(`THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(!m){S.geometry=null,S.program=null,S.wireframe=!1,x=-1,w=null,e.autoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.updateMatrixWorld(),ye.enabled&&ye.isPresenting&&(t=ye.getCamera(t)),e.onBeforeRender(p,e,t,n||v),f=pe.get(e,t),f.init(),V.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ee.setFromProjectionMatrix(V),B=this.localClippingEnabled,ne=te.init(this.clippingPlanes,B,t),d=fe.get(e,t),d.init(),Ke(e,t,0,p.sortObjects),d.finish(),p.sortObjects===!0&&d.sort(F,I),ne&&te.beginShadows();var i=f.state.shadowsArray;be.render(i,e,t),f.setupLights(t),ne&&te.endShadows(),this.info.autoReset&&this.info.reset(),n!==void 0&&this.setRenderTarget(n),J.render(d,e,t,r);var a=d.opaque,o=d.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&qe(a,e,t,s),o.length&&qe(o,e,t,s)}else a.length&&qe(a,e,t),o.length&&qe(o,e,t);e.onAfterRender(p,e,t),v!==null&&(K.updateRenderTargetMipmap(v),K.updateMultisampleRenderTarget(v)),G.buffers.depth.setTest(!0),G.buffers.depth.setMask(!0),G.buffers.color.setMask(!0),G.setPolygonOffset(!1),d=null,f=null}};function Ke(e,t,n,r){if(e.visible!==!1){if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLight)f.pushLight(e),e.castShadow&&f.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ee.intersectsSprite(e)){r&&re.setFromMatrixPosition(e.matrixWorld).applyMatrix4(V);var i=ue.update(e),a=e.material;a.visible&&d.push(e,i,a,n,re.z,null)}}else if(e.isImmediateRenderObject)r&&re.setFromMatrixPosition(e.matrixWorld).applyMatrix4(V),d.push(e,null,e.material,n,re.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==oe.render.frame&&(e.skeleton.update(),e.skeleton.frame=oe.render.frame),!e.frustumCulled||ee.intersectsObject(e))){r&&re.setFromMatrixPosition(e.matrixWorld).applyMatrix4(V);var i=ue.update(e),a=e.material;if(Array.isArray(a))for(var o=i.groups,s=0,c=o.length;s<c;s++){var l=o[s],u=a[l.materialIndex];u&&u.visible&&d.push(e,i,u,n,re.z,l)}else a.visible&&d.push(e,i,a,n,re.z,null)}}for(var p=e.children,s=0,c=p.length;s<c;s++)Ke(p[s],t,n,r)}}function qe(e,t,n,r){for(var i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,c=o.geometry,l=r===void 0?o.material:r,u=o.group;if(n.isArrayCamera){T=n;for(var d=n.cameras,p=0,m=d.length;p<m;p++){var h=d[p];s.layers.test(h.layers)&&(G.viewport(E.copy(h.viewport)),f.setupLights(h),Je(s,t,h,c,l,u))}}else T=null,Je(s,t,n,c,l,u)}}function Je(e,t,n,r,i,a){if(e.onBeforeRender(p,t,n,r,i,a),f=pe.get(t,T||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=Xe(n,t,i,e);G.setMaterial(i),S.geometry=null,S.program=null,S.wireframe=!1,Be(e,o)}else p.renderBufferDirect(n,t,r,i,e,a);e.onAfterRender(p,t,n,r,i,a),f=pe.get(t,T||n)}function Ye(e,t,n){var r=se.get(e),i=f.state.lights,a=f.state.shadowsArray,o=i.state.version,s=q.getParameters(e,i.state,a,t,te.numPlanes,te.numIntersection,n),c=q.getProgramCacheKey(s),l=r.program,u=!0;if(l===void 0)e.addEventListener(`dispose`,Fe);else if(l.cacheKey!==c)ze(e);else if(r.lightsStateVersion!==o)r.lightsStateVersion=o,u=!1;else if(s.shaderID!==void 0)return;else u=!1;u&&(l=q.acquireProgram(s,c),r.program=l,r.uniforms=s.uniforms,r.outputEncoding=s.outputEncoding,e.program=l);var d=l.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var m=0;m<p.maxMorphTargets;m++)d[`morphTarget`+m]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(var m=0;m<p.maxMorphNormals;m++)d[`morphNormal`+m]>=0&&e.numSupportedMorphNormals++}var h=r.uniforms;(!e.isShaderMaterial&&!e.isRawShaderMaterial||e.clipping===!0)&&(r.numClippingPlanes=te.numPlanes,r.numIntersection=te.numIntersection,h.clippingPlanes=te.uniform),r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.needsLights=Qe(e),r.lightsStateVersion=o,r.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotShadowMatrix.value=i.state.spotShadowMatrix,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix);var g=r.program.getUniforms();r.uniformsList=Dt.seqWithValue(g.seq,h)}function Xe(e,t,n,r){K.resetTextureUnits();var i=t.fog,a=n.isMeshStandardMaterial?t.environment:null,o=v===null?p.outputEncoding:v.texture.encoding,s=se.get(n),c=f.state.lights;if(ne&&(B||e!==w)){var l=e===w&&n.id===x;te.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,s,l)}n.version===s.__version?s.program===void 0||n.fog&&s.fog!==i?Ye(n,t,r):s.environment===a?(s.needsLights&&s.lightsStateVersion!==c.state.version||s.numClippingPlanes!==void 0&&(s.numClippingPlanes!==te.numPlanes||s.numIntersection!==te.numIntersection)||s.outputEncoding!==o)&&Ye(n,t,r):Ye(n,t,r):(Ye(n,t,r),s.__version=n.version);var u=!1,d=!1,m=!1,h=s.program,g=h.getUniforms(),_=s.uniforms;if(G.useProgram(h.program)&&(u=!0,d=!0,m=!0),n.id!==x&&(x=n.id,d=!0),u||w!==e){if(g.setValue(U,`projectionMatrix`,e.projectionMatrix),ae.logarithmicDepthBuffer&&g.setValue(U,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),w!==e&&(w=e,d=!0,m=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var y=g.map.cameraPosition;y!==void 0&&y.setValue(U,re.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&g.setValue(U,`isOrthographic`,e.isOrthographicCamera===!0),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&g.setValue(U,`viewMatrix`,e.matrixWorldInverse)}if(n.skinning){g.setOptional(U,r,`bindMatrix`),g.setOptional(U,r,`bindMatrixInverse`);var b=r.skeleton;if(b){var S=b.bones;if(ae.floatVertexTextures){if(b.boneTexture===void 0){var C=Math.sqrt(S.length*4);C=X.ceilPowerOfTwo(C),C=Math.max(C,4);var T=new Float32Array(C*C*4);T.set(b.boneMatrices);var E=new xe(T,C,C,es,Zo);b.boneMatrices=T,b.boneTexture=E,b.boneTextureSize=C}g.setValue(U,`boneTexture`,b.boneTexture,K),g.setValue(U,`boneTextureSize`,b.boneTextureSize)}else g.setOptional(U,b,`boneMatrices`)}}return(d||s.receiveShadow!==r.receiveShadow)&&(s.receiveShadow=r.receiveShadow,g.setValue(U,`receiveShadow`,r.receiveShadow)),d&&(g.setValue(U,`toneMappingExposure`,p.toneMappingExposure),g.setValue(U,`toneMappingWhitePoint`,p.toneMappingWhitePoint),s.needsLights&&Ze(_,m),i&&n.fog&&de.refreshFogUniforms(_,i),de.refreshMaterialUniforms(_,n,a,P,N),_.ltc_1!==void 0&&(_.ltc_1.value=Z.LTC_1),_.ltc_2!==void 0&&(_.ltc_2.value=Z.LTC_2),Dt.upload(U,s.uniformsList,_,K)),n.isShaderMaterial&&n.uniformsNeedUpdate===!0&&(Dt.upload(U,s.uniformsList,_,K),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&g.setValue(U,`center`,r.center),g.setValue(U,`modelViewMatrix`,r.modelViewMatrix),g.setValue(U,`normalMatrix`,r.normalMatrix),g.setValue(U,`modelMatrix`,r.matrixWorld),h}function Ze(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function Qe(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&e.lights===!0}this.setFramebuffer=function(e){h!==e&&v===null&&U.bindFramebuffer(36160,e),h=e},this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return _},this.getRenderTarget=function(){return v},this.setRenderTarget=function(e,t,n){v=e,g=t,_=n,e&&se.get(e).__webglFramebuffer===void 0&&K.setupRenderTarget(e);var r=h,i=!1;if(e){var a=se.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=a[t||0],i=!0):r=e.isWebGLMultisampleRenderTarget?se.get(e).__webglMultisampledFramebuffer:a,E.copy(e.viewport),k.copy(e.scissor),A=e.scissorTest}else E.copy(L).multiplyScalar(P).floor(),k.copy(R).multiplyScalar(P).floor(),A=z;if(y!==r&&(U.bindFramebuffer(36160,r),y=r),G.viewport(E),G.scissor(k),G.setScissorTest(A),i){var o=se.get(e.texture);U.framebufferTexture2D(36160,36064,34069+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(!(e&&e.isWebGLRenderTarget)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);return}var s=se.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(s=s[o]),s){var c=!1;s!==y&&(U.bindFramebuffer(36160,s),c=!0);try{var l=e.texture,u=l.format,d=l.type;if(u!==1023&&_e.convert(u)!==U.getParameter(35739)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(d!==1009&&_e.convert(d)!==U.getParameter(35738)&&!(d===1015&&(ae.isWebGL2||W.get(`OES_texture_float`)||W.get(`WEBGL_color_buffer_float`)))&&!(d===1016&&(ae.isWebGL2?W.get(`EXT_color_buffer_float`):W.get(`EXT_color_buffer_half_float`)))){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}U.checkFramebufferStatus(36160)===36053?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&U.readPixels(t,n,r,i,_e.convert(u),_e.convert(d),a):console.error(`THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.`)}finally{c&&U.bindFramebuffer(36160,y)}}},this.copyFramebufferToTexture=function(e,t,n){n===void 0&&(n=0);var r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=_e.convert(t.format);K.setTexture2D(t,0),U.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),G.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r){r===void 0&&(r=0);var i=t.image.width,a=t.image.height,o=_e.convert(n.format),s=_e.convert(n.type);K.setTexture2D(n,0),t.isDataTexture?U.texSubImage2D(3553,r,e.x,e.y,i,a,o,s,t.image.data):t.isCompressedTexture?U.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):U.texSubImage2D(3553,r,e.x,e.y,o,s,t.image),r===0&&n.generateMipmaps&&U.generateMipmap(3553),G.unbindTexture()},this.initTexture=function(e){K.setTexture2D(e,0),G.unbindTexture()},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}function Cn(e,t){this.name=``,this.color=new z(e),this.density=t===void 0?25e-5:t}function wn(e,t,n){this.name=``,this.color=new z(e),this.near=t===void 0?1:t,this.far=n===void 0?1e3:n}function Tn(e,t){this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.usage=uc,this.updateRange={offset:0,count:-1},this.version=0}function En(e,t,n,r){this.name=``,this.data=e,this.itemSize=t,this.offset=n,this.normalized=r===!0}function Dn(e){V.call(this),this.type=`SpriteMaterial`,this.color=new z(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}function On(e){if(j.call(this),this.type=`Sprite`,Ou===void 0){Ou=new q;var t=new Tn(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Ou.setIndex([0,1,2,0,2,3]),Ou.setAttribute(`position`,new En(t,3,0,!1)),Ou.setAttribute(`uv`,new En(t,2,3,!1))}this.geometry=Ou,this.material=e===void 0?new Dn:e,this.center=new b(.5,.5)}function kn(e,t,n,r,i,a){Mu.subVectors(e,n).addScalar(.5).multiply(r),i===void 0?Nu.copy(Mu):(Nu.x=a*Mu.x-i*Mu.y,Nu.y=i*Mu.x+a*Mu.y),e.copy(t),e.x+=Nu.x,e.y+=Nu.y,e.applyMatrix4(Pu)}function An(){j.call(this),this._currentLevel=0,this.type=`LOD`,Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function jn(e,t){e&&e.isGeometry&&console.error(`THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.`),de.call(this,e,t),this.type=`SkinnedMesh`,this.bindMode=`attached`,this.bindMatrix=new O,this.bindMatrixInverse=new O}function Mn(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 O)}}function Nn(){j.call(this),this.type=`Bone`}function Pn(e,t,n){de.call(this,e,t),this.instanceMatrix=new H(new Float32Array(n*16),16),this.count=n,this.frustumCulled=!1}function Fn(e){V.call(this),this.type=`LineBasicMaterial`,this.color=new z(16777215),this.linewidth=1,this.linecap=`round`,this.linejoin=`round`,this.morphTargets=!1,this.setValues(e)}function In(e,t,n){n===1&&console.error(`THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead.`),j.call(this),this.type=`Line`,this.geometry=e===void 0?new q:e,this.material=t===void 0?new Fn:t,this.updateMorphTargets()}function Ln(e,t){In.call(this,e,t),this.type=`LineSegments`}function Rn(e,t){In.call(this,e,t),this.type=`LineLoop`}function zn(e){V.call(this),this.type=`PointsMaterial`,this.color=new z(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}function Bn(e,t){j.call(this),this.type=`Points`,this.geometry=e===void 0?new q:e,this.material=t===void 0?new zn:t,this.updateMorphTargets()}function Vn(e,t,n,r,i,a,o){var s=rd.distanceSqToPoint(e);if(s<n){var c=new D;rd.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 Hn(e,t,n,r,i,a,o,s,c){S.call(this,e,t,n,r,i,a,o,s,c),this.format=o===void 0?$o:o,this.minFilter=a===void 0?Ko:a,this.magFilter=i===void 0?Ko:i,this.generateMipmaps=!1}function Un(e,t,n,r,i,a,o,s,c,l,u,d){S.call(this,null,a,o,s,c,l,r,i,u,d),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Wn(e,t,n,r,i,a,o,s,c){S.call(this,e,t,n,r,i,a,o,s,c),this.needsUpdate=!0}function Gn(e,t,n,r,i,a,o,s,c,l){if(l=l===void 0?ns:l,l!==1026&&l!==1027)throw Error(`DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);n===void 0&&l===1026&&(n=Xo),n===void 0&&l===1027&&(n=Qo),S.call(this,null,r,i,a,o,s,l,n,c),this.image={width:e,height:t},this.magFilter=o===void 0?Uo:o,this.minFilter=s===void 0?Uo:s,this.flipY=!1,this.generateMipmaps=!1}function Kn(e){q.call(this),this.type=`WireframeGeometry`;var t=[],n,r,i,a,o,s=[0,0],c={},l,u,d,f,p=[`a`,`b`,`c`],m;if(e&&e.isGeometry){var h=e.faces;for(n=0,i=h.length;n<i;n++){var g=h[n];for(r=0;r<3;r++)u=g[p[r]],d=g[p[(r+1)%3]],s[0]=Math.min(u,d),s[1]=Math.max(u,d),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 _,v,y,b,x,S,C,w;if(m=new D,e.index!==null){for(_=e.attributes.position,v=e.index,y=e.groups,y.length===0&&(y=[{start:0,count:v.count,materialIndex:0}]),a=0,o=y.length;a<o;++a)for(b=y[a],x=b.start,S=b.count,n=x,i=x+S;n<i;n+=3)for(r=0;r<3;r++)u=v.getX(n+r),d=v.getX(n+(r+1)%3),s[0]=Math.min(u,d),s[1]=Math.max(u,d),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(_,l.index1),t.push(m.x,m.y,m.z),m.fromBufferAttribute(_,l.index2),t.push(m.x,m.y,m.z)}else for(_=e.attributes.position,n=0,i=_.count/3;n<i;n++)for(r=0;r<3;r++)C=3*n+r,m.fromBufferAttribute(_,C),t.push(m.x,m.y,m.z),w=3*n+(r+1)%3,m.fromBufferAttribute(_,w),t.push(m.x,m.y,m.z)}this.setAttribute(`position`,new K(t,3))}function qn(e,t,n){J.call(this),this.type=`ParametricGeometry`,this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new Jn(e,t,n)),this.mergeVertices()}function Jn(e,t,n){q.call(this),this.type=`ParametricBufferGeometry`,this.parameters={func:e,slices:t,stacks:n};var r=[],i=[],a=[],o=[],s=1e-5,c=new D,l=new D,u=new D,d=new D,f=new D,p,m;e.length<3&&console.error(`THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.`);var h=t+1;for(p=0;p<=n;p++){var g=p/n;for(m=0;m<=t;m++){var _=m/t;e(_,g,l),i.push(l.x,l.y,l.z),_-s>=0?(e(_-s,g,u),d.subVectors(l,u)):(e(_+s,g,u),d.subVectors(u,l)),g-s>=0?(e(_,g-s,u),f.subVectors(l,u)):(e(_,g+s,u),f.subVectors(u,l)),c.crossVectors(d,f).normalize(),a.push(c.x,c.y,c.z),o.push(_,g)}}for(p=0;p<n;p++)for(m=0;m<t;m++){var v=p*h+m,y=p*h+m+1,b=(p+1)*h+m+1,x=(p+1)*h+m;r.push(v,y,x),r.push(y,b,x)}this.setIndex(r),this.setAttribute(`position`,new K(i,3)),this.setAttribute(`normal`,new K(a,3)),this.setAttribute(`uv`,new K(o,2))}function Yn(e,t,n,r){J.call(this),this.type=`PolyhedronGeometry`,this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new Xn(e,t,n,r)),this.mergeVertices()}function Xn(e,t,n,r){q.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 K(i,3)),this.setAttribute(`normal`,new K(i.slice(),3)),this.setAttribute(`uv`,new K(a,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(e){for(var n=new D,r=new D,i=new D,a=0;a<t.length;a+=3)f(t[a+0],n),f(t[a+1],r),f(t[a+2],i),s(n,r,i,e)}function s(e,t,n,r){var i=Math.pow(2,r),a=[],o,s;for(o=0;o<=i;o++){a[o]=[];var c=e.clone().lerp(n,o/i),l=t.clone().lerp(n,o/i),u=i-o;for(s=0;s<=u;s++)s===0&&o===i?a[o][s]=c:a[o][s]=c.clone().lerp(l,s/u)}for(o=0;o<i;o++)for(s=0;s<2*(i-o)-1;s++){var f=Math.floor(s/2);s%2==0?(d(a[o][f+1]),d(a[o+1][f]),d(a[o][f])):(d(a[o][f+1]),d(a[o+1][f+1]),d(a[o+1][f]))}}function c(e){for(var t=new D,n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}function l(){for(var e=new D,t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];var n=h(e)/2/Math.PI+.5,r=g(e)/Math.PI+.5;a.push(n,1-r)}p(),u()}function u(){for(var e=0;e<a.length;e+=6){var t=a[e+0],n=a[e+2],r=a[e+4];Math.max(t,n,r)>.9&&Math.min(t,n,r)<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}function d(e){i.push(e.x,e.y,e.z)}function f(t,n){var r=t*3;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function p(){for(var e=new D,t=new D,n=new D,r=new D,o=new b,s=new b,c=new b,l=0,u=0;l<i.length;l+=9,u+=6){e.set(i[l+0],i[l+1],i[l+2]),t.set(i[l+3],i[l+4],i[l+5]),n.set(i[l+6],i[l+7],i[l+8]),o.set(a[u+0],a[u+1]),s.set(a[u+2],a[u+3]),c.set(a[u+4],a[u+5]),r.copy(e).add(t).add(n).divideScalar(3);var d=h(r);m(o,u+0,e,d),m(s,u+2,t,d),m(c,u+4,n,d)}}function m(e,t,n,r){r<0&&e.x===1&&(a[t]=e.x-1),n.x===0&&n.z===0&&(a[t]=r/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}function g(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}}function Zn(e,t){J.call(this),this.type=`TetrahedronGeometry`,this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Qn(e,t)),this.mergeVertices()}function Qn(e,t){Xn.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type=`TetrahedronBufferGeometry`,this.parameters={radius:e,detail:t}}function $n(e,t){J.call(this),this.type=`OctahedronGeometry`,this.parameters={radius:e,detail:t},this.fromBufferGeometry(new er(e,t)),this.mergeVertices()}function er(e,t){Xn.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type=`OctahedronBufferGeometry`,this.parameters={radius:e,detail:t}}function tr(e,t){J.call(this),this.type=`IcosahedronGeometry`,this.parameters={radius:e,detail:t},this.fromBufferGeometry(new nr(e,t)),this.mergeVertices()}function nr(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];Xn.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type=`IcosahedronBufferGeometry`,this.parameters={radius:e,detail:t}}function rr(e,t){J.call(this),this.type=`DodecahedronGeometry`,this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ir(e,t)),this.mergeVertices()}function ir(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];Xn.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type=`DodecahedronBufferGeometry`,this.parameters={radius:e,detail:t}}function ar(e,t,n,r,i,a){J.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 or(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function or(e,t,n,r,i){q.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 D,s=new D,c=new b,l=new D,u,d,f=[],p=[],m=[],h=[];g(),this.setIndex(h),this.setAttribute(`position`,new K(f,3)),this.setAttribute(`normal`,new K(p,3)),this.setAttribute(`uv`,new K(m,2));function g(){for(u=0;u<t;u++)_(u);_(i===!1?t:0),y(),v()}function _(i){l=e.getPointAt(i/t,l);var c=a.normals[i],u=a.binormals[i];for(d=0;d<=r;d++){var m=d/r*Math.PI*2,h=Math.sin(m),g=-Math.cos(m);s.x=g*c.x+h*u.x,s.y=g*c.y+h*u.y,s.z=g*c.z+h*u.z,s.normalize(),p.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(d=1;d<=t;d++)for(u=1;u<=r;u++){var e=(r+1)*(d-1)+(u-1),n=(r+1)*d+(u-1),i=(r+1)*d+u,a=(r+1)*(d-1)+u;h.push(e,n,a),h.push(n,i,a)}}function y(){for(u=0;u<=t;u++)for(d=0;d<=r;d++)c.x=u/t,c.y=d/r,m.push(c.x,c.y)}}function sr(e,t,n,r,i,a,o){J.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 cr(e,t,n,r,i,a)),this.mergeVertices()}function cr(e,t,n,r,i,a){q.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,d,f=new D,p=new D,m=new D,h=new D,g=new D,_=new D,v=new D;for(u=0;u<=n;++u){var y=u/n*i*Math.PI*2;for(O(y,i,a,e,m),O(y+.01,i,a,e,h),_.subVectors(h,m),v.addVectors(h,m),g.crossVectors(_,v),v.crossVectors(g,_),g.normalize(),v.normalize(),d=0;d<=r;++d){var b=d/r*Math.PI*2,x=-t*Math.cos(b),S=t*Math.sin(b);f.x=m.x+(x*v.x+S*g.x),f.y=m.y+(x*v.y+S*g.y),f.z=m.z+(x*v.z+S*g.z),s.push(f.x,f.y,f.z),p.subVectors(f,m).normalize(),c.push(p.x,p.y,p.z),l.push(u/n),l.push(d/r)}}for(d=1;d<=n;d++)for(u=1;u<=r;u++){var C=(r+1)*(d-1)+(u-1),w=(r+1)*d+(u-1),T=(r+1)*d+u,E=(r+1)*(d-1)+u;o.push(C,w,E),o.push(w,T,E)}this.setIndex(o),this.setAttribute(`position`,new K(s,3)),this.setAttribute(`normal`,new K(c,3)),this.setAttribute(`uv`,new K(l,2));function O(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}}function lr(e,t,n,r,i){J.call(this),this.type=`TorusGeometry`,this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new ur(e,t,n,r,i)),this.mergeVertices()}function ur(e,t,n,r,i){q.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 D,u=new D,d=new D,f,p;for(f=0;f<=n;f++)for(p=0;p<=r;p++){var m=p/r*i,h=f/n*Math.PI*2;u.x=(e+t*Math.cos(h))*Math.cos(m),u.y=(e+t*Math.cos(h))*Math.sin(m),u.z=t*Math.sin(h),o.push(u.x,u.y,u.z),l.x=e*Math.cos(m),l.y=e*Math.sin(m),d.subVectors(u,l).normalize(),s.push(d.x,d.y,d.z),c.push(p/r),c.push(f/n)}for(f=1;f<=n;f++)for(p=1;p<=r;p++){var g=(r+1)*f+p-1,_=(r+1)*(f-1)+p-1,v=(r+1)*(f-1)+p,y=(r+1)*f+p;a.push(g,_,y),a.push(_,v,y)}this.setIndex(a),this.setAttribute(`position`,new K(o,3)),this.setAttribute(`normal`,new K(s,3)),this.setAttribute(`uv`,new K(c,2))}function dr(e,t,n,r,i){var a,o;if(i===Vr(e,t,n,r)>0)for(a=t;a<n;a+=r)o=Rr(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=Rr(a,e[a],e[a+1],o);return o&&Ar(o,o.next)&&(zr(o),o=o.next),o}function fr(e,t){if(!e)return e;t||(t=e);var n=e,r;do if(r=!1,!n.steiner&&(Ar(n,n.next)||kr(n.prev,n,n.next)===0)){if(zr(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function pr(e,t,n,r,i,a,o){if(e){!o&&a&&Cr(e,r,i,a);for(var s=e,c,l;e.prev!==e.next;){if(c=e.prev,l=e.next,a?hr(e,r,i,a):mr(e)){t.push(c.i/n),t.push(e.i/n),t.push(l.i/n),zr(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=gr(fr(e),t,n),pr(e,t,n,r,i,a,2)):o===2&&_r(e,t,n,r,i,a):pr(fr(e),t,n,r,i,a,1);break}}}}function mr(e){var t=e.prev,n=e,r=e.next;if(kr(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Dr(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&kr(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function hr(e,t,n,r){var i=e.prev,a=e,o=e.next;if(kr(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,d=Tr(s,c,t,n,r),f=Tr(l,u,t,n,r),p=e.prevZ,m=e.nextZ;p&&p.z>=d&&m&&m.z<=f;){if(p!==e.prev&&p!==e.next&&Dr(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&kr(p.prev,p,p.next)>=0||(p=p.prevZ,m!==e.prev&&m!==e.next&&Dr(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&kr(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&Dr(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&kr(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=f;){if(m!==e.prev&&m!==e.next&&Dr(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&kr(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function gr(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!Ar(i,a)&&jr(i,r,r.next,a)&&Fr(i,a)&&Fr(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),zr(r),zr(r.next),r=e=a),r=r.next}while(r!==e);return fr(r)}function _r(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Or(o,s)){var c=Lr(o,s);o=fr(o,o.next),c=fr(c,c.next),pr(o,t,n,r,i,a),pr(c,t,n,r,i,a);return}s=s.next}o=o.next}while(o!==e)}function vr(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=dr(e,s,c,r,!1),l===l.next&&(l.steiner=!0),i.push(Er(l));for(i.sort(yr),a=0;a<i.length;a++)br(i[a],n),n=fr(n,n.next);return n}function yr(e,t){return e.x-t.x}function br(e,t){if(t=xr(e,t),t){var n=Lr(t,e);fr(t,t.next),fr(n,n.next)}}function xr(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,d=1/0,f;n=o;do r>=n.x&&n.x>=l&&r!==n.x&&Dr(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),Fr(n,e)&&(f<d||f===d&&(n.x>o.x||n.x===o.x&&Sr(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function Sr(e,t){return kr(e.prev,e,t.prev)<0&&kr(t.next,e,e.next)<0}function Cr(e,t,n,r){var i=e;do i.z===null&&(i.z=Tr(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,wr(i)}function wr(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 Tr(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 Er(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 Dr(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 Or(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Pr(e,t)&&(Fr(e,t)&&Fr(t,e)&&Ir(e,t)&&(kr(e.prev,e,t.prev)||kr(e,t.prev,t))||Ar(e,t)&&kr(e.prev,e,e.next)>0&&kr(t.prev,t,t.next)>0)}function kr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Ar(e,t){return e.x===t.x&&e.y===t.y}function jr(e,t,n,r){var i=Nr(kr(e,t,n)),a=Nr(kr(e,t,r)),o=Nr(kr(n,r,e)),s=Nr(kr(n,r,t));return!!(i!==a&&o!==s||i===0&&Mr(e,n,t)||a===0&&Mr(e,r,t)||o===0&&Mr(n,e,r)||s===0&&Mr(n,t,r))}function Mr(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 Nr(e){return e>0?1:e<0?-1:0}function Pr(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&&jr(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Fr(e,t){return kr(e.prev,e,e.next)<0?kr(e,t,e.next)>=0&&kr(e,e.prev,t)>=0:kr(e,t,e.prev)<0||kr(e,e.next,t)<0}function Ir(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 Lr(e,t){var n=new Br(e.i,e.x,e.y),r=new Br(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 Rr(e,t,n,r){var i=new Br(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 zr(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 Br(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 Vr(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}function Hr(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Ur(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function Wr(e,t){J.call(this),this.type=`ExtrudeGeometry`,this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Gr(e,t)),this.mergeVertices()}function Gr(e,t){q.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 K(r,3)),this.setAttribute(`uv`,new K(i,2)),this.computeVertexNormals();function c(e){var a=[],o=t.curveSegments===void 0?12:t.curveSegments,s=t.steps===void 0?1:t.steps,c=t.depth===void 0?100:t.depth,l=t.bevelEnabled===void 0?!0:t.bevelEnabled,u=t.bevelThickness===void 0?6:t.bevelThickness,d=t.bevelSize===void 0?u-2:t.bevelSize,f=t.bevelOffset===void 0?0:t.bevelOffset,p=t.bevelSegments===void 0?3:t.bevelSegments,m=t.extrudePath,h=t.UVGenerator===void 0?cd:t.UVGenerator;t.amount!==void 0&&(console.warn(`THREE.ExtrudeBufferGeometry: amount has been renamed to depth.`),c=t.amount);var g,_=!1,v,y,x,S;m&&(g=m.getSpacedPoints(s),_=!0,l=!1,v=m.computeFrenetFrames(s,!1),y=new D,x=new D,S=new D),l||(p=0,u=0,d=0,f=0);var C,w,T,E=e.extractPoints(o),O=E.shape,k=E.holes;if(!sd.isClockWise(O))for(O=O.reverse(),w=0,T=k.length;w<T;w++)C=k[w],sd.isClockWise(C)&&(k[w]=C.reverse());var A=sd.triangulateShape(O,k),j=O;for(w=0,T=k.length;w<T;w++)C=k[w],O=O.concat(C);function M(e,t,n){return t||console.error(`THREE.ExtrudeGeometry: vec does not exist`),t.clone().multiplyScalar(n).add(e)}var N,P,F,I,L,R=O.length,z,ee=A.length;function te(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,c=n.x-e.x,l=n.y-e.y,u=o*o+s*s,d=o*l-s*c;if(Math.abs(d)>Number.EPSILON){var f=Math.sqrt(u),p=Math.sqrt(c*c+l*l),m=t.x-s/f,h=t.y+o/f,g=n.x-l/p,_=n.y+c/p,v=((g-m)*l-(_-h)*c)/(o*l-s*c);r=m+o*v-e.x,i=h+s*v-e.y;var y=r*r+i*i;if(y<=2)return new b(r,i);a=Math.sqrt(y/2)}else{var x=!1;o>Number.EPSILON?c>Number.EPSILON&&(x=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(x=!0):Math.sign(s)===Math.sign(l)&&(x=!0),x?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new b(r/a,i/a)}for(var ne=[],B=0,V=j.length,re=V-1,H=B+1;B<V;B++,re++,H++)re===V&&(re=0),H===V&&(H=0),ne[B]=te(j[B],j[re],j[H]);var U=[],ie,W=ne.concat();for(w=0,T=k.length;w<T;w++){for(C=k[w],ie=[],B=0,V=C.length,re=V-1,H=B+1;B<V;B++,re++,H++)re===V&&(re=0),H===V&&(H=0),ie[B]=te(C[B],C[re],C[H]);U.push(ie),W=W.concat(ie)}for(N=0;N<p;N++){for(F=N/p,I=u*Math.cos(F*Math.PI/2),P=d*Math.sin(F*Math.PI/2)+f,B=0,V=j.length;B<V;B++)L=M(j[B],ne[B],P),K(L.x,L.y,-I);for(w=0,T=k.length;w<T;w++)for(C=k[w],ie=U[w],B=0,V=C.length;B<V;B++)L=M(C[B],ie[B],P),K(L.x,L.y,-I)}for(P=d+f,B=0;B<R;B++)L=l?M(O[B],W[B],P):O[B],_?(x.copy(v.normals[0]).multiplyScalar(L.x),y.copy(v.binormals[0]).multiplyScalar(L.y),S.copy(g[0]).add(x).add(y),K(S.x,S.y,S.z)):K(L.x,L.y,0);var ae;for(ae=1;ae<=s;ae++)for(B=0;B<R;B++)L=l?M(O[B],W[B],P):O[B],_?(x.copy(v.normals[ae]).multiplyScalar(L.x),y.copy(v.binormals[ae]).multiplyScalar(L.y),S.copy(g[ae]).add(x).add(y),K(S.x,S.y,S.z)):K(L.x,L.y,c/s*ae);for(N=p-1;N>=0;N--){for(F=N/p,I=u*Math.cos(F*Math.PI/2),P=d*Math.sin(F*Math.PI/2)+f,B=0,V=j.length;B<V;B++)L=M(j[B],ne[B],P),K(L.x,L.y,c+I);for(w=0,T=k.length;w<T;w++)for(C=k[w],ie=U[w],B=0,V=C.length;B<V;B++)L=M(C[B],ie[B],P),_?K(L.x,L.y+g[s-1].y,g[s-1].x+I):K(L.x,L.y,c+I)}G(),oe();function G(){var e=r.length/3;if(l){var t=0,i=R*t;for(B=0;B<ee;B++)z=A[B],ce(z[2]+i,z[1]+i,z[0]+i);for(t=s+p*2,i=R*t,B=0;B<ee;B++)z=A[B],ce(z[0]+i,z[1]+i,z[2]+i)}else{for(B=0;B<ee;B++)z=A[B],ce(z[2],z[1],z[0]);for(B=0;B<ee;B++)z=A[B],ce(z[0]+R*s,z[1]+R*s,z[2]+R*s)}n.addGroup(e,r.length/3-e,0)}function oe(){var e=r.length/3,t=0;for(se(j,t),t+=j.length,w=0,T=k.length;w<T;w++)C=k[w],se(C,t),t+=C.length;n.addGroup(e,r.length/3-e,1)}function se(e,t){var n,r;for(B=e.length;--B>=0;){n=B,r=B-1,r<0&&(r=e.length-1);var i=0,a=s+p*2;for(i=0;i<a;i++){var o=R*i,c=R*(i+1);le(t+n+o,t+r+o,t+r+c,t+n+c)}}}function K(e,t,n){a.push(e),a.push(t),a.push(n)}function ce(e,t,i){ue(e),ue(t),ue(i);var a=r.length/3,o=h.generateTopUV(n,r,a-3,a-2,a-1);q(o[0]),q(o[1]),q(o[2])}function le(e,t,i,a){ue(e),ue(t),ue(a),ue(t),ue(i),ue(a);var o=r.length/3,s=h.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);q(s[0]),q(s[1]),q(s[3]),q(s[1]),q(s[2]),q(s[3])}function ue(e){r.push(a[e*3+0]),r.push(a[e*3+1]),r.push(a[e*3+2])}function q(e){i.push(e.x),i.push(e.y)}}}function Kr(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 qr(e,t){J.call(this),this.type=`TextGeometry`,this.parameters={text:e,parameters:t},this.fromBufferGeometry(new Jr(e,t)),this.mergeVertices()}function Jr(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 J;var r=n.generateShapes(e,t.size);t.depth=t.height===void 0?50:t.height,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),Gr.call(this,r,t),this.type=`TextBufferGeometry`}function Yr(e,t,n,r,i,a,o){J.call(this),this.type=`SphereGeometry`,this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Xr(e,t,n,r,i,a,o)),this.mergeVertices()}function Xr(e,t,n,r,i,a,o){q.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?0:r,i=i===void 0?Math.PI*2:i,a=a===void 0?0:a,o=o===void 0?Math.PI:o;var s=Math.min(a+o,Math.PI),c,l,u=0,d=[],f=new D,p=new D,m=[],h=[],g=[],_=[];for(l=0;l<=n;l++){var v=[],y=l/n,b=0;for(l==0&&a==0?b=.5/t:l==n&&s==Math.PI&&(b=-.5/t),c=0;c<=t;c++){var x=c/t;f.x=-e*Math.cos(r+x*i)*Math.sin(a+y*o),f.y=e*Math.cos(a+y*o),f.z=e*Math.sin(r+x*i)*Math.sin(a+y*o),h.push(f.x,f.y,f.z),p.copy(f).normalize(),g.push(p.x,p.y,p.z),_.push(x+b,1-y),v.push(u++)}d.push(v)}for(l=0;l<n;l++)for(c=0;c<t;c++){var S=d[l][c+1],C=d[l][c],w=d[l+1][c],T=d[l+1][c+1];(l!==0||a>0)&&m.push(S,C,T),(l!==n-1||s<Math.PI)&&m.push(C,w,T)}this.setIndex(m),this.setAttribute(`position`,new K(h,3)),this.setAttribute(`normal`,new K(g,3)),this.setAttribute(`uv`,new K(_,2))}function Zr(e,t,n,r,i,a){J.call(this),this.type=`RingGeometry`,this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new Qr(e,t,n,r,i,a)),this.mergeVertices()}function Qr(e,t,n,r,i,a){q.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?0:i,a=a===void 0?Math.PI*2:a,n=n===void 0?8:Math.max(3,n),r=r===void 0?1:Math.max(1,r);var o=[],s=[],c=[],l=[],u,d=e,f=(t-e)/r,p=new D,m=new b,h,g;for(h=0;h<=r;h++){for(g=0;g<=n;g++)u=i+g/n*a,p.x=d*Math.cos(u),p.y=d*Math.sin(u),s.push(p.x,p.y,p.z),c.push(0,0,1),m.x=(p.x/t+1)/2,m.y=(p.y/t+1)/2,l.push(m.x,m.y);d+=f}for(h=0;h<r;h++){var _=h*(n+1);for(g=0;g<n;g++){u=g+_;var v=u,y=u+n+1,x=u+n+2,S=u+1;o.push(v,y,S),o.push(y,x,S)}}this.setIndex(o),this.setAttribute(`position`,new K(s,3)),this.setAttribute(`normal`,new K(c,3)),this.setAttribute(`uv`,new K(l,2))}function $r(e,t,n,r){J.call(this),this.type=`LatheGeometry`,this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new ei(e,t,n,r)),this.mergeVertices()}function ei(e,t,n,r){q.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=X.clamp(r,0,Math.PI*2);var i=[],a=[],o=[],s,c=1/t,l=new D,u=new b,d,f;for(d=0;d<=t;d++){var p=n+d*c*r,m=Math.sin(p),h=Math.cos(p);for(f=0;f<=e.length-1;f++)l.x=e[f].x*m,l.y=e[f].y,l.z=e[f].x*h,a.push(l.x,l.y,l.z),u.x=d/t,u.y=f/(e.length-1),o.push(u.x,u.y)}for(d=0;d<t;d++)for(f=0;f<e.length-1;f++){s=f+d*e.length;var g=s,_=s+e.length,v=s+e.length+1,y=s+1;i.push(g,_,y),i.push(_,v,y)}if(this.setIndex(i),this.setAttribute(`position`,new K(a,3)),this.setAttribute(`uv`,new K(o,2)),this.computeVertexNormals(),r===Math.PI*2){var x=this.attributes.normal.array,S=new D,C=new D,w=new D;for(s=t*e.length*3,d=0,f=0;d<e.length;d++,f+=3)S.x=x[f+0],S.y=x[f+1],S.z=x[f+2],C.x=x[s+f+0],C.y=x[s+f+1],C.z=x[s+f+2],w.addVectors(S,C).normalize(),x[f+0]=x[s+f+0]=w.x,x[f+1]=x[s+f+1]=w.y,x[f+2]=x[s+f+2]=w.z}}function ti(e,t){J.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 ni(e,t)),this.mergeVertices()}function ni(e,t){q.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 K(r,3)),this.setAttribute(`normal`,new K(i,3)),this.setAttribute(`uv`,new K(a,2));function l(e){var o,c,l,u=r.length/3,d=e.extractPoints(t),f=d.shape,p=d.holes;for(sd.isClockWise(f)===!1&&(f=f.reverse()),o=0,c=p.length;o<c;o++)l=p[o],sd.isClockWise(l)===!0&&(p[o]=l.reverse());var m=sd.triangulateShape(f,p);for(o=0,c=p.length;o<c;o++)l=p[o],f=f.concat(l);for(o=0,c=f.length;o<c;o++){var h=f[o];r.push(h.x,h.y,0),i.push(0,0,1),a.push(h.x,h.y)}for(o=0,c=m.length;o<c;o++){var g=m[o],_=g[0]+u,v=g[1]+u,y=g[2]+u;n.push(_,v,y),s+=3}}}function ri(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 ii(e,t){q.call(this),this.type=`EdgesGeometry`,this.parameters={thresholdAngle:t},t=t===void 0?1:t;var n=[],r=Math.cos(X.DEG2RAD*t),i=[0,0],a={},o,s,c,l=[`a`,`b`,`c`],u;e.isBufferGeometry?(u=new J,u.fromBufferGeometry(e)):u=e.clone(),u.mergeVertices(),u.computeFaceNormals();for(var d=u.vertices,f=u.faces,p=0,m=f.length;p<m;p++)for(var h=f[p],g=0;g<3;g++)o=h[l[g]],s=h[l[(g+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:p,face2:void 0}:a[c].face2=p;for(c in a){var _=a[c];if(_.face2===void 0||f[_.face1].normal.dot(f[_.face2].normal)<=r){var v=d[_.index1];n.push(v.x,v.y,v.z),v=d[_.index2],n.push(v.x,v.y,v.z)}}this.setAttribute(`position`,new K(n,3))}function ai(e,t,n,r,i,a,o,s){J.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 oi(e,t,n,r,i,a,o,s)),this.mergeVertices()}function oi(e,t,n,r,i,a,o,s){q.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?1:e,t=t===void 0?1:t,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,a=a===void 0?!1:a,o=o===void 0?0:o,s=s===void 0?Math.PI*2:s;var l=[],u=[],d=[],f=[],p=0,m=[],h=n/2,g=0;_(),a===!1&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new K(u,3)),this.setAttribute(`normal`,new K(d,3)),this.setAttribute(`uv`,new K(f,2));function _(){var a,_,v=new D,y=new D,b=0,x=(t-e)/n;for(_=0;_<=i;_++){var S=[],C=_/i,w=C*(t-e)+e;for(a=0;a<=r;a++){var T=a/r,E=T*s+o,O=Math.sin(E),k=Math.cos(E);y.x=w*O,y.y=-C*n+h,y.z=w*k,u.push(y.x,y.y,y.z),v.set(O,x,k).normalize(),d.push(v.x,v.y,v.z),f.push(T,1-C),S.push(p++)}m.push(S)}for(a=0;a<r;a++)for(_=0;_<i;_++){var A=m[_][a],j=m[_+1][a],M=m[_+1][a+1],N=m[_][a+1];l.push(A,j,N),l.push(j,M,N),b+=6}c.addGroup(g,b,0),g+=b}function v(n){var i,a,m,_=new b,v=new D,y=0,x=n===!0?e:t,S=n===!0?1:-1;for(a=p,i=1;i<=r;i++)u.push(0,h*S,0),d.push(0,S,0),f.push(.5,.5),p++;for(m=p,i=0;i<=r;i++){var C=i/r*s+o,w=Math.cos(C),T=Math.sin(C);v.x=x*T,v.y=h*S,v.z=x*w,u.push(v.x,v.y,v.z),d.push(0,S,0),_.x=w*.5+.5,_.y=T*.5*S+.5,f.push(_.x,_.y),p++}for(i=0;i<r;i++){var E=a+i,O=m+i;n===!0?l.push(O,O+1,E):l.push(O+1,O,E),y+=3}c.addGroup(g,y,n===!0?1:2),g+=y}}function si(e,t,n,r,i,a,o){ai.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}}function ci(e,t,n,r,i,a,o){oi.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}}function li(e,t,n,r){J.call(this),this.type=`CircleGeometry`,this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new ui(e,t,n,r)),this.mergeVertices()}function ui(e,t,n,r){q.call(this),this.type=`CircleBufferGeometry`,this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=t===void 0?8:Math.max(3,t),n=n===void 0?0:n,r=r===void 0?Math.PI*2:r;var i=[],a=[],o=[],s=[],c,l,u=new D,d=new b;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),d.x=(a[c]/e+1)/2,d.y=(a[c+1]/e+1)/2,s.push(d.x,d.y)}for(c=1;c<=t;c++)i.push(c,c+1,0);this.setIndex(i),this.setAttribute(`position`,new K(a,3)),this.setAttribute(`normal`,new K(o,3)),this.setAttribute(`uv`,new K(s,2))}function di(e){V.call(this),this.type=`ShadowMaterial`,this.color=new z(0),this.transparent=!0,this.setValues(e)}function fi(e){ge.call(this,e),this.type=`RawShaderMaterial`}function pi(e){V.call(this),this.defines={STANDARD:``},this.type=`MeshStandardMaterial`,this.color=new z(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 z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new b(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)}function mi(e){pi.call(this),this.defines={STANDARD:``,PHYSICAL:``},this.type=`MeshPhysicalMaterial`,this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new b(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(e)}function hi(e){V.call(this),this.type=`MeshPhongMaterial`,this.color=new z(16777215),this.specular=new z(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function gi(e){V.call(this),this.defines={TOON:``},this.type=`MeshToonMaterial`,this.color=new z(16777215),this.specular=new z(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 z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new b(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)}function _i(e){V.call(this),this.type=`MeshNormalMaterial`,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function vi(e){V.call(this),this.type=`MeshLambertMaterial`,this.color=new z(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function yi(e){V.call(this),this.defines={MATCAP:``},this.type=`MeshMatcapMaterial`,this.color=new z(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function bi(e){Fn.call(this),this.type=`LineDashedMaterial`,this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}function xi(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r===void 0?new t.constructor(n):r,this.sampleValues=t,this.valueSize=n}function Si(e,t,n,r){xi.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Ci(e,t,n,r){xi.call(this,e,t,n,r)}function wi(e,t,n,r){xi.call(this,e,t,n,r)}function Ti(e,t,n,r){if(e===void 0)throw Error(`THREE.KeyframeTrack: track name is undefined`);if(t===void 0||t.length===0)throw Error(`THREE.KeyframeTrack: no keyframes in track named `+e);this.name=e,this.times=dd.convertArray(t,this.TimeBufferType),this.values=dd.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function Ei(e,t,n){Ti.call(this,e,t,n)}function Di(e,t,n,r){Ti.call(this,e,t,n,r)}function Oi(e,t,n,r){Ti.call(this,e,t,n,r)}function ki(e,t,n,r){xi.call(this,e,t,n,r)}function Ai(e,t,n,r){Ti.call(this,e,t,n,r)}function ji(e,t,n,r){Ti.call(this,e,t,n,r)}function Mi(e,t,n,r){Ti.call(this,e,t,n,r)}function Ni(e,t,n,r){this.name=e,this.tracks=n,this.duration=t===void 0?-1:t,this.blendMode=r===void 0?Zs:r,this.uuid=X.generateUUID(),this.duration<0&&this.resetDuration()}function Pi(e){switch(e.toLowerCase()){case`scalar`:case`double`:case`float`:case`number`:case`integer`:return Oi;case`vector`:case`vector2`:case`vector3`:case`vector4`:return Mi;case`color`:return Di;case`quaternion`:return Ai;case`bool`:case`boolean`:return Ei;case`string`:return ji}throw Error(`THREE.KeyframeTrack: Unsupported typeName: `+e)}function Fi(e){if(e.type===void 0)throw Error(`THREE.KeyframeTrack: track type undefined, can not parse`);var t=Pi(e.type);if(e.times===void 0){var n=[],r=[];dd.flattenJSON(e.keys,n,r,`value`),e.times=n,e.values=r}return t.parse===void 0?new t(e.name,e.times,e.values,e.interpolation):t.parse(e)}function Ii(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(e){o++,i===!1&&r.onStart!==void 0&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,r.onProgress!==void 0&&r.onProgress(e,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(e){r.onError!==void 0&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){var t=c.indexOf(e);return t!==-1&&c.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=c.length;t<n;t+=2){var r=c[t],i=c[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null}}function Li(e){this.manager=e===void 0?pd:e,this.crossOrigin=`anonymous`,this.path=``,this.resourcePath=``,this.requestHeader={}}function Ri(e){Li.call(this,e)}function zi(e){Li.call(this,e)}function Bi(e){Li.call(this,e)}function Vi(e){Li.call(this,e)}function Hi(e){Li.call(this,e)}function Ui(e){Li.call(this,e)}function Wi(e){Li.call(this,e)}function Y(){this.type=`Curve`,this.arcLengthDivisions=200}function Gi(e,t,n,r,i,a,o,s){Y.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}function Ki(e,t,n,r,i,a){Gi.call(this,e,t,n,n,r,i,a),this.type=`ArcCurve`}function qi(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;c*=o,l*=o,i(t,n,c,l)},calc:function(i){var a=i*i,o=a*i;return e+t*i+n*a+r*o}}}function Ji(e,t,n,r){Y.call(this),this.type=`CatmullRomCurve3`,this.points=e||[],this.closed=t||!1,this.curveType=n||`centripetal`,this.tension=r||.5}function Yi(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 Xi(e,t){var n=1-e;return n*n*t}function Zi(e,t){return 2*(1-e)*e*t}function Qi(e,t){return e*e*t}function $i(e,t,n,r){return Xi(e,t)+Zi(e,n)+Qi(e,r)}function ea(e,t){var n=1-e;return n*n*n*t}function ta(e,t){var n=1-e;return 3*n*n*e*t}function na(e,t){return 3*(1-e)*e*e*t}function ra(e,t){return e*e*e*t}function ia(e,t,n,r,i){return ea(e,t)+ta(e,n)+na(e,r)+ra(e,i)}function aa(e,t,n,r){Y.call(this),this.type=`CubicBezierCurve`,this.v0=e||new b,this.v1=t||new b,this.v2=n||new b,this.v3=r||new b}function oa(e,t,n,r){Y.call(this),this.type=`CubicBezierCurve3`,this.v0=e||new D,this.v1=t||new D,this.v2=n||new D,this.v3=r||new D}function sa(e,t){Y.call(this),this.type=`LineCurve`,this.v1=e||new b,this.v2=t||new b}function ca(e,t){Y.call(this),this.type=`LineCurve3`,this.v1=e||new D,this.v2=t||new D}function la(e,t,n){Y.call(this),this.type=`QuadraticBezierCurve`,this.v0=e||new b,this.v1=t||new b,this.v2=n||new b}function ua(e,t,n){Y.call(this),this.type=`QuadraticBezierCurve3`,this.v0=e||new D,this.v1=t||new D,this.v2=n||new D}function da(e){Y.call(this),this.type=`SplineCurve`,this.points=e||[]}function fa(){Y.call(this),this.type=`CurvePath`,this.curves=[],this.autoClose=!1}function pa(e){fa.call(this),this.type=`Path`,this.currentPoint=new b,e&&this.setFromPoints(e)}function ma(e){pa.call(this,e),this.uuid=X.generateUUID(),this.type=`Shape`,this.holes=[]}function ha(e,t){j.call(this),this.type=`Light`,this.color=new z(e),this.intensity=t===void 0?1:t,this.receiveShadow=void 0}function ga(e,t,n){ha.call(this,e,n),this.type=`HemisphereLight`,this.castShadow=void 0,this.position.copy(j.DefaultUp),this.updateMatrix(),this.groundColor=new z(t)}function _a(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new b(512,512),this.map=null,this.mapPass=null,this.matrix=new O,this._frustum=new Se,this._frameExtents=new b(1,1),this._viewportCount=1,this._viewports=[new C(0,0,1,1)]}function va(){_a.call(this,new ve(50,1,.5,500))}function ya(e,t,n,r,i,a){ha.call(this,e,t),this.type=`SpotLight`,this.position.copy(j.DefaultUp),this.updateMatrix(),this.target=new j,Object.defineProperty(this,`power`,{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=n===void 0?0:n,this.angle=r===void 0?Math.PI/3:r,this.penumbra=i===void 0?0:i,this.decay=a===void 0?1:a,this.shadow=new va}function ba(){_a.call(this,new ve(90,1,.5,500)),this._frameExtents=new b(4,2),this._viewportCount=6,this._viewports=[new C(2,1,1,1),new C(0,1,1,1),new C(3,1,1,1),new C(1,1,1,1),new C(3,0,1,1),new C(1,0,1,1)],this._cubeDirections=[new D(1,0,0),new D(-1,0,0),new D(0,0,1),new D(0,0,-1),new D(0,1,0),new D(0,-1,0)],this._cubeUps=[new D(0,1,0),new D(0,1,0),new D(0,1,0),new D(0,1,0),new D(0,0,1),new D(0,0,-1)]}function xa(e,t,n,r){ha.call(this,e,t),this.type=`PointLight`,Object.defineProperty(this,`power`,{get:function(){return this.intensity*4*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=n===void 0?0:n,this.decay=r===void 0?1:r,this.shadow=new ba}function Sa(e,t,n,r,i,a){_e.call(this),this.type=`OrthographicCamera`,this.zoom=1,this.view=null,this.left=e===void 0?-1:e,this.right=t===void 0?1:t,this.top=n===void 0?1:n,this.bottom=r===void 0?-1:r,this.near=i===void 0?.1:i,this.far=a===void 0?2e3:a,this.updateProjectionMatrix()}function Ca(){_a.call(this,new Sa(-5,5,5,-5,.5,500))}function wa(e,t){ha.call(this,e,t),this.type=`DirectionalLight`,this.position.copy(j.DefaultUp),this.updateMatrix(),this.target=new j,this.shadow=new Ca}function Ta(e,t){ha.call(this,e,t),this.type=`AmbientLight`,this.castShadow=void 0}function Ea(e,t,n,r){ha.call(this,e,t),this.type=`RectAreaLight`,this.width=n===void 0?10:n,this.height=r===void 0?10:r}function Da(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new D)}function Oa(e,t){ha.call(this,void 0,t),this.type=`LightProbe`,this.sh=e===void 0?new Da:e}function ka(e){Li.call(this,e),this.textures={}}function Aa(){q.call(this),this.type=`InstancedBufferGeometry`,this.instanceCount=1/0}function ja(e,t,n,r){typeof n==`number`&&(r=n,n=!1,console.error(`THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.`)),H.call(this,e,t,n),this.meshPerAttribute=r||1}function Ma(e){Li.call(this,e)}function Na(e){Li.call(this,e)}function Pa(e){typeof createImageBitmap>`u`&&console.warn(`THREE.ImageBitmapLoader: createImageBitmap() not supported.`),typeof fetch>`u`&&console.warn(`THREE.ImageBitmapLoader: fetch() not supported.`),Li.call(this,e),this.options=void 0}function Fa(){this.type=`ShapePath`,this.color=new z,this.subPaths=[],this.currentPath=null}function Ia(e){this.type=`Font`,this.data=e}function La(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===`\n`)s=0,c-=a;else{var d=Ra(u,i,s,c,n);s+=d.offsetX,o.push(d.path)}}return o}function Ra(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 Fa,s,c,l,u,d,f,p,m;if(a.o)for(var h=a._cachedOutline||(a._cachedOutline=a.o.split(` `)),g=0,_=h.length;g<_;)switch(h[g++]){case`m`:s=h[g++]*t+n,c=h[g++]*t+r,o.moveTo(s,c);break;case`l`:s=h[g++]*t+n,c=h[g++]*t+r,o.lineTo(s,c);break;case`q`:l=h[g++]*t+n,u=h[g++]*t+r,d=h[g++]*t+n,f=h[g++]*t+r,o.quadraticCurveTo(d,f,l,u);break;case`b`:l=h[g++]*t+n,u=h[g++]*t+r,d=h[g++]*t+n,f=h[g++]*t+r,p=h[g++]*t+n,m=h[g++]*t+r,o.bezierCurveTo(d,f,p,m,l,u);break}return{offsetX:a.ha*t,path:o}}function za(e){Li.call(this,e)}function Ba(e){Li.call(this,e)}function Va(e,t,n){Oa.call(this,void 0,n);var r=new z().set(e),i=new z().set(t),a=new D(r.r,r.g,r.b),o=new D(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)}function Ha(e,t){Oa.call(this,void 0,t);var n=new z().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}function Ua(){this.type=`StereoCamera`,this.aspect=1,this.eyeSep=.064,this.cameraL=new ve,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ve,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}}function Wa(e){this.autoStart=e===void 0?!0:e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function Ga(){j.call(this),this.type=`AudioListener`,this.context=Ed.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Wa}function Ka(e){j.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=[]}function qa(e){Ka.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel=`HRTF`,this.panner.connect(this.gain)}function Ja(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t===void 0?2048:t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Ya(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=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}function Xa(e,t,n){var r=n||Za.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Za(e,t,n){this.path=t,this.parsedPath=n||Za.parseTrackName(t),this.node=Za.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Qa(){this.uuid=X.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}}}function $a(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=Array(a),s={endingStart:Js,endingEnd:Js},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=Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Us,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function eo(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function to(e){typeof e==`string`&&(console.warn(`THREE.Uniform: Type parameter is no longer needed.`),e=arguments[1]),this.value=e}function no(e,t,n){Tn.call(this,e,t),this.meshPerAttribute=n||1}function ro(e,t,n,r){this.ray=new I(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new A,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 io(e,t){return e.distance-t.distance}function ao(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++)ao(i[a],t,n,!0)}function oo(e,t,n){return this.radius=e===void 0?1:e,this.phi=t===void 0?0:t,this.theta=n===void 0?0:n,this}function so(e,t,n){return this.radius=e===void 0?1:e,this.theta=t===void 0?0:t,this.y=n===void 0?0:n,this}function co(e,t){this.min=e===void 0?new b(1/0,1/0):e,this.max=t===void 0?new b(-1/0,-1/0):t}function lo(e,t){this.start=e===void 0?new D:e,this.end=t===void 0?new D:t}function uo(e){j.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}function fo(e,t){j.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new q,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 K(r,3));var l=new Fn({fog:!1,toneMapped:!1});this.cone=new Ln(n,l),this.add(this.cone),this.update()}function po(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,po(e.children[n]));return t}function mo(e){for(var t=po(e),n=new q,r=[],i=[],a=new z(0,0,1),o=new z(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 K(r,3)),n.setAttribute(`color`,new K(i,3));var l=new Fn({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});Ln.call(this,n,l),this.type=`SkeletonHelper`,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function ho(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new Xr(t,4,2),i=new re({wireframe:!0,fog:!1,toneMapped:!1});de.call(this,r,i),this.type=`PointLightHelper`,this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function go(e,t,n){j.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new er(t);r.rotateY(Math.PI*.5),this.material=new re({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 H(a,3)),this.add(new de(r,this.material)),this.update()}function _o(e,t,n,r){e=e||10,t=t||10,n=new z(n===void 0?4473924:n),r=new z(r===void 0?8947848:r);for(var i=t/2,a=e/t,o=e/2,s=[],c=[],l=0,u=0,d=-o;l<=t;l++,d+=a){s.push(-o,0,d,o,0,d),s.push(d,0,-o,d,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 p=new q;p.setAttribute(`position`,new K(s,3)),p.setAttribute(`color`,new K(c,3));var m=new Fn({vertexColors:!0,toneMapped:!1});Ln.call(this,p,m),this.type=`GridHelper`}function vo(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new z(i===void 0?4473924:i),a=new z(a===void 0?8947848:a);var o=[],s=[],c,l,u,d,f,p,m;for(d=0;d<=t;d++)u=d/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=d&1?i:a,s.push(m.r,m.g,m.b),s.push(m.r,m.g,m.b);for(d=0;d<=n;d++)for(m=d&1?i:a,p=e-e/n*d,f=0;f<r;f++)u=f/r*(Math.PI*2),c=Math.sin(u)*p,l=Math.cos(u)*p,o.push(c,0,l),s.push(m.r,m.g,m.b),u=(f+1)/r*(Math.PI*2),c=Math.sin(u)*p,l=Math.cos(u)*p,o.push(c,0,l),s.push(m.r,m.g,m.b);var h=new q;h.setAttribute(`position`,new K(o,3)),h.setAttribute(`color`,new K(s,3));var g=new Fn({vertexColors:!0,toneMapped:!1});Ln.call(this,h,g),this.type=`PolarGridHelper`}function yo(e,t,n){j.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 q;r.setAttribute(`position`,new K([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new Fn({fog:!1,toneMapped:!1});this.lightPlane=new In(r,i),this.add(this.lightPlane),r=new q,r.setAttribute(`position`,new K([0,0,0,0,0,1],3)),this.targetLine=new In(r,i),this.add(this.targetLine),this.update()}function bo(e){var t=new q,n=new Fn({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],a={},o=new z(16755200),s=new z(16711680),c=new z(43775),l=new z(16777215),u=new z(3355443);d(`n1`,`n2`,o),d(`n2`,`n4`,o),d(`n4`,`n3`,o),d(`n3`,`n1`,o),d(`f1`,`f2`,o),d(`f2`,`f4`,o),d(`f4`,`f3`,o),d(`f3`,`f1`,o),d(`n1`,`f1`,o),d(`n2`,`f2`,o),d(`n3`,`f3`,o),d(`n4`,`f4`,o),d(`p`,`n1`,s),d(`p`,`n2`,s),d(`p`,`n3`,s),d(`p`,`n4`,s),d(`u1`,`u2`,c),d(`u2`,`u3`,c),d(`u3`,`u1`,c),d(`c`,`t`,l),d(`p`,`c`,u),d(`cn1`,`cn2`,u),d(`cn3`,`cn4`,u),d(`cf1`,`cf2`,u),d(`cf3`,`cf4`,u);function d(e,t,n){f(e,n),f(t,n)}function f(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),a[e]===void 0&&(a[e]=[]),a[e].push(r.length/3-1)}t.setAttribute(`position`,new K(r,3)),t.setAttribute(`color`,new K(i,3)),Ln.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()}function xo(e,t,n,r,i,a,o){sf.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],sf.x,sf.y,sf.z)}function So(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(24),i=new q;i.setIndex(new H(n,1)),i.setAttribute(`position`,new H(r,3)),Ln.call(this,i,new Fn({color:t,toneMapped:!1})),this.type=`BoxHelper`,this.matrixAutoUpdate=!1,this.update()}function Co(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 q;i.setIndex(new H(n,1)),i.setAttribute(`position`,new K(r,3)),Ln.call(this,i,new Fn({color:t,toneMapped:!1})),this.type=`Box3Helper`,this.geometry.computeBoundingSphere()}function wo(e,t,n){this.plane=e,this.size=t===void 0?1:t;var r=n===void 0?16776960: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,0,1,0,0,0],a=new q;a.setAttribute(`position`,new K(i,3)),a.computeBoundingSphere(),In.call(this,a,new Fn({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 q;s.setAttribute(`position`,new K(o,3)),s.computeBoundingSphere(),this.add(new de(s,new re({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}function To(e,t,n,r,i,a){j.call(this),this.type=`ArrowHelper`,e===void 0&&(e=new D(0,0,1)),t===void 0&&(t=new D(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),df===void 0&&(df=new q,df.setAttribute(`position`,new K([0,0,0,0,1,0],3)),ff=new oi(0,.5,1,5,1),ff.translate(0,-.5,0)),this.position.copy(t),this.line=new In(df,new Fn({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new de(ff,new re({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}function Eo(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 q;r.setAttribute(`position`,new K(t,3)),r.setAttribute(`color`,new K(n,3));var i=new Fn({vertexColors:!0,toneMapped:!1});Ln.call(this,r,i),this.type=`AxesHelper`}function Do(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=Mo(vf),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}function Oo(e){return e===void 0||e.type!==1009?!1:e.encoding===3e3||e.encoding===3001||e.encoding===3007}function ko(){for(var e=[],t=[],n=[],r=mf,i=0;i<_f;i++){var a=Math.pow(2,r);t.push(a);var o=1/a;i>mf-pf?o=gf[i-mf+pf-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],d=6,f=6,p=3,m=2,h=1,g=new Float32Array(p*f*d),_=new Float32Array(m*f*d),v=new Float32Array(h*f*d),y=0;y<d;y++){var b=y%3*2/3-1,x=y>2?0:-1,S=[b,x,0,b+2/3,x,0,b+2/3,x+1,0,b,x,0,b+2/3,x+1,0,b,x+1,0];g.set(S,p*f*y),_.set(u,m*f*y);var C=[y,y,y,y,y,y];v.set(C,h*f*y)}var w=new q;w.setAttribute(`position`,new H(g,p)),w.setAttribute(`uv`,new H(_,m)),w.setAttribute(`faceIndex`,new H(v,h)),e.push(w),r>pf&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function Ao(e){var t=new w(3*hf,3*hf,e);return t.texture.mapping=306,t.texture.name=`PMREM.cubeUv`,t.scissorTest=!0,t}function jo(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Mo(e){var t=new Float32Array(e),n=new D(0,1,0),r=new fi({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:yf[$s]},outputEncoding:{value:yf[$s]}},vertexShader:Fo(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n${Io()}\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvec3 getSample(float theta, vec3 axis) {\n float cosTheta = cos(theta);\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross(axis, vOutputDirection) * sin(theta)\n + axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n return bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n vec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n if (all(equal(axis, vec3(0.0))))\n axis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n axis = normalize(axis);\n gl_FragColor = vec4(0.0);\n gl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n for (int i = 1; i < n; i++) {\n if (i >= samples)\n break;\n float theta = dTheta * float(i);\n gl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n gl_FragColor.rgb += weights[i] * getSample(theta, axis);\n }\n gl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n `,blending:0,depthTest:!1,depthWrite:!1});return r.type=`SphericalGaussianBlur`,r}function No(){var e=new fi({uniforms:{envMap:{value:null},texelSize:{value:new b(1,1)},inputEncoding:{value:yf[$s]},outputEncoding:{value:yf[$s]}},vertexShader:Fo(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n${Io()}\n\n#include <common>\n\nvoid main() {\n gl_FragColor = vec4(0.0);\n vec3 outputDirection = normalize(vOutputDirection);\n vec2 uv = equirectUv( outputDirection );\n vec2 f = fract(uv / texelSize - 0.5);\n uv -= f * texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize.x;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize.y;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize.x;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n gl_FragColor.rgb = mix(tm, bm, f.y);\n gl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n `,blending:0,depthTest:!1,depthWrite:!1});return e.type=`EquirectangularToCubeUV`,e}function Po(){var e=new fi({uniforms:{envMap:{value:null},inputEncoding:{value:yf[$s]},outputEncoding:{value:yf[$s]}},vertexShader:Fo(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n${Io()}\n\nvoid main() {\n gl_FragColor = vec4(0.0);\n gl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n gl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n `,blending:0,depthTest:!1,depthWrite:!1});return e.type=`CubemapToCubeUV`,e}function Fo(){return`\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n uv = 2.0 * uv - 1.0;\n vec3 direction = vec3(uv, 1.0);\n if (face == 0.0) {\n direction = direction.zyx; // ( 1, v, u ) pos x\n } else if (face == 1.0) {\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n } else if (face == 2.0) {\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n } else if (face == 3.0) {\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n } else if (face == 4.0) {\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n } else if (face == 5.0) {\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n }\n return direction;\n}\n\nvoid main() {\n vOutputDirection = getDirection(uv, faceIndex);\n gl_Position = vec4( position, 1.0 );\n}\n `}function Io(){return`\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n if(inputEncoding == 0){\n return value;\n }else if(inputEncoding == 1){\n return sRGBToLinear(value);\n }else if(inputEncoding == 2){\n return RGBEToLinear(value);\n }else if(inputEncoding == 3){\n return RGBMToLinear(value, 7.0);\n }else if(inputEncoding == 4){\n return RGBMToLinear(value, 16.0);\n }else if(inputEncoding == 5){\n return RGBDToLinear(value, 256.0);\n }else{\n return GammaToLinear(value, 2.2);\n }\n}\n\nvec4 linearToOutputTexel(vec4 value){\n if(outputEncoding == 0){\n return value;\n }else if(outputEncoding == 1){\n return LinearTosRGB(value);\n }else if(outputEncoding == 2){\n return LinearToRGBE(value);\n }else if(outputEncoding == 3){\n return LinearToRGBM(value, 7.0);\n }else if(outputEncoding == 4){\n return LinearToRGBM(value, 16.0);\n }else if(outputEncoding == 5){\n return LinearToRGBD(value, 256.0);\n }else{\n return LinearToGamma(value, 2.2);\n }\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n return inputTexelToLinear(color);\n}\n `}function Lo(e){console.warn(`THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.`),Ji.call(this,e),this.type=`catmullrom`,this.closed=!0}function Ro(e){console.warn(`THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.`),Ji.call(this,e),this.type=`catmullrom`}function zo(e){console.warn(`THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.`),Ji.call(this,e),this.type=`catmullrom`}var Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,as,os,ss,cs,ls,us,ds,fs,ps,ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,X,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,Z,Q,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af,of,sf,cf,lf,uf,df,ff,pf,mf,hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf,Tf,Ef,Df,Of=e((()=>{for(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 TypeError(`Cannot convert undefined or null to object`);let t=Object(e);for(let e=1;e<arguments.length;e++){let n=arguments[e];if(n!=null)for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t}),Bo=1e3,Vo=1001,Ho=1002,Uo=1003,Wo=1004,Go=1005,Ko=1006,qo=1007,Jo=1008,Yo=1009,Xo=1012,Zo=1015,Qo=1020,$o=1022,es=1023,ts=es,ns=1026,rs=33776,is=33777,as=33778,os=33779,ss=35840,cs=35841,ls=35842,us=35843,ds=36196,fs=37492,ps=37496,ms=37808,hs=37809,gs=37810,_s=37811,vs=37812,ys=37813,bs=37814,xs=37815,Ss=37816,Cs=37817,ws=37818,Ts=37819,Es=37820,Ds=37821,Os=36492,ks=37840,As=37841,js=37842,Ms=37843,Ns=37844,Ps=37845,Fs=37846,Is=37847,Ls=37848,Rs=37849,zs=37850,Bs=37851,Vs=37852,Hs=37853,Us=2201,Ws=2202,Gs=2300,Ks=2301,qs=2302,Js=2400,Ys=2401,Xs=2402,Zs=2500,Qs=2501,$s=3e3,ec=3001,tc=3007,nc=3002,rc=3003,ic=3004,ac=3005,oc=3006,sc=3200,cc=3201,lc=7680,uc=35044,dc=35048,Object.assign(y.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[e];if(n!==void 0){var r=n.indexOf(t);r!==-1&&n.splice(r,1)}}},dispatchEvent:function(e){if(this._listeners!==void 0){var t=this._listeners[e.type];if(t!==void 0){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}}),fc=[],pc=0;pc<256;pc++)fc[pc]=(pc<16?`0`:``)+pc.toString(16);X={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;return(fc[e&255]+fc[e>>8&255]+fc[e>>16&255]+fc[e>>24&255]+`-`+fc[t&255]+fc[t>>8&255]+`-`+fc[t>>16&15|64]+fc[t>>24&255]+`-`+fc[n&63|128]+fc[n>>8&255]+`-`+fc[n>>16&255]+fc[n>>24&255]+fc[r&255]+fc[r>>8&255]+fc[r>>16&255]+fc[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,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*X.DEG2RAD},radToDeg:function(e){return e*X.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),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:console.warn(`THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}},Object.defineProperties(b.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(b.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 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 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?(this.x+=e.x,this.y+=e.y,this):(console.warn(`THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.`),this.addVectors(e,t))},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?(this.x-=e.x,this.y-=e.y,this):(console.warn(`THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.`),this.subVectors(e,t))},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(){return Math.atan2(-this.y,-this.x)+Math.PI},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}}),Object.assign(x.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],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,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],d=n[7],f=n[8],p=f*c-l*d,m=l*u-f*s,h=d*s-c*u,g=i*p+a*m+o*h;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);var _=1/g;return r[0]=p*_,r[1]=(o*d-f*a)*_,r[2]=(l*a-o*c)*_,r[3]=m*_,r[4]=(f*i-o*u)*_,r[5]=(o*s-l*i)*_,r[6]=h*_,r[7]=(a*u-d*i)*_,r[8]=(c*i-a*s)*_,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}}),hc={getDataURL:function(e){var t;if(typeof HTMLCanvasElement>`u`)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{mc===void 0&&(mc=document.createElementNS(`http://www.w3.org/1999/xhtml`,`canvas`)),mc.width=e.width,mc.height=e.height;var n=mc.getContext(`2d`);e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=mc}return t.width>2048||t.height>2048?t.toDataURL(`image/jpeg`,.6):t.toDataURL(`image/png`)}},gc=0,S.DEFAULT_IMAGE=void 0,S.DEFAULT_MAPPING=300,S.prototype=Object.assign(Object.create(y.prototype),{constructor:S,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=X.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(hc.getDataURL(r[a]))}else i=hc.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!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Bo:e.x-=Math.floor(e.x);break;case Vo:e.x=e.x<0?0:1;break;case Ho:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Bo:e.y-=Math.floor(e.y);break;case Vo:e.y=e.y<0?0:1;break;case Ho:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(S.prototype,`needsUpdate`,{set:function(e){e===!0&&this.version++}}),Object.defineProperties(C.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(C.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 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 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?1:e.w,this},add:function(e,t){return t===void 0?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this):(console.warn(`THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.`),this.addVectors(e,t))},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?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this):(console.warn(`THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.`),this.subVectors(e,t))},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],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var _=(c+1)/2,v=(f+1)/2,y=(g+1)/2,b=(l+d)/4,x=(u+m)/4,S=(p+h)/4;return _>v&&_>y?_<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(_),r=b/n,i=x/n):v>y?v<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(v),n=b/r,i=S/r):y<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(y),n=x/i,r=S/i),this.set(n,r,i,t),this}var C=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(C)<.001&&(C=1),this.x=(h-p)/C,this.y=(u-m)/C,this.z=(d-l)/C,this.w=Math.acos((c+f+g-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.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}}),w.prototype=Object.assign(Object.create(y.prototype),{constructor:w,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`})}}),T.prototype=Object.assign(Object.create(w.prototype),{constructor:T,isWebGLMultisampleRenderTarget:!0,copy:function(e){return w.prototype.copy.call(this,e),this.samples=e.samples,this}}),Object.assign(E,{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],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){var h=1-o,g=s*d+c*f+l*p+u*m,_=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){var y=Math.sqrt(v),b=Math.atan2(y,g*_);h=Math.sin(h*b)/y,o=Math.sin(o*b)/y}var x=o*_;if(s=s*h+d*x,c=c*h+f*x,l=l*h+p*x,u=u*h+m*x,h===1-o){var S=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=S,c*=S,l*=S,u*=S}}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],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}}),Object.defineProperties(E.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(E.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 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),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;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],d=n+o+u,f;return d>0?(f=.5/Math.sqrt(d+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(X.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*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this},multiply:function(e,t){return t===void 0?this.multiplyQuaternions(this,e):(console.warn(`THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.`),this.multiplyQuaternions(e,t))},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),d=Math.sin((1-t)*u)/l,f=Math.sin(t*u)/l;return this._w=a*d+this._w*f,this._x=n*d+this._x*f,this._y=r*d+this._y*f,this._z=i*d+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(){}}),_c=new D,vc=new E,Object.assign(D.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 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 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?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this):(console.warn(`THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.`),this.addVectors(e,t))},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?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this):(console.warn(`THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.`),this.subVectors(e,t))},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?(this.x*=e.x,this.y*=e.y,this.z*=e.z,this):(console.warn(`THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.`),this.multiplyVectors(e,t))},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(vc.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(vc.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,d=-i*t-a*n-o*r;return this.x=c*s+d*-i+l*-o-u*-a,this.y=l*s+d*-a+u*-i-c*-o,this.z=u*s+d*-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?this.crossVectors(this,e):(console.warn(`THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.`),this.crossVectors(e,t))},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 _c.copy(this).projectOnVector(e),this.sub(_c)},reflect:function(e){return this.sub(_c.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(X.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}}),yc=new D,bc=new O,xc=new D(0,0,0),Sc=new D(1,1,1),Cc=new D,wc=new D,Tc=new D,Object.assign(O.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,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 O().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/yc.setFromMatrixColumn(e,0).length(),i=1/yc.setFromMatrixColumn(e,1).length(),a=1/yc.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 d=a*l,f=a*u,p=o*l,m=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-o*s,t[2]=m-d*c,t[6]=p+f*c,t[10]=a*s}else if(e.order===`YXZ`){var h=s*l,g=s*u,_=c*l,v=c*u;t[0]=h+v*o,t[4]=_*o-g,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=g*o-_,t[6]=v+h*o,t[10]=a*s}else if(e.order===`ZXY`){var h=s*l,g=s*u,_=c*l,v=c*u;t[0]=h-v*o,t[4]=-a*u,t[8]=_+g*o,t[1]=g+_*o,t[5]=a*l,t[9]=v-h*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){var d=a*l,f=a*u,p=o*l,m=o*u;t[0]=s*l,t[4]=p*c-f,t[8]=d*c+m,t[1]=s*u,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){var y=a*s,b=a*c,x=o*s,S=o*c;t[0]=s*l,t[4]=S-y*u,t[8]=x*u+b,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=b*u+x,t[10]=y-S*u}else if(e.order===`XZY`){var y=a*s,b=a*c,x=o*s,S=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=y*u+S,t[5]=a*l,t[9]=b*u-x,t[2]=x*u-b,t[6]=o*l,t[10]=S*u+y}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(xc,e,Sc)},lookAt:function(e,t,n){var r=this.elements;return Tc.subVectors(e,t),Tc.lengthSq()===0&&(Tc.z=1),Tc.normalize(),Cc.crossVectors(n,Tc),Cc.lengthSq()===0&&(Math.abs(n.z)===1?Tc.x+=1e-4:Tc.z+=1e-4,Tc.normalize(),Cc.crossVectors(n,Tc)),Cc.normalize(),wc.crossVectors(Tc,Cc),r[0]=Cc.x,r[4]=wc.x,r[8]=Tc.x,r[1]=Cc.y,r[5]=wc.y,r[9]=Tc.y,r[2]=Cc.z,r[6]=wc.z,r[10]=Tc.z,this},multiply:function(e,t){return t===void 0?this.multiplyMatrices(this,e):(console.warn(`THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.`),this.multiplyMatrices(e,t))},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],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],M=r[14],N=r[3],P=r[7],F=r[11],I=r[15];return i[0]=a*x+o*T+s*k+c*N,i[4]=a*S+o*E+s*A+c*P,i[8]=a*C+o*D+s*j+c*F,i[12]=a*w+o*O+s*M+c*I,i[1]=l*x+u*T+d*k+f*N,i[5]=l*S+u*E+d*A+f*P,i[9]=l*C+u*D+d*j+f*F,i[13]=l*w+u*O+d*M+f*I,i[2]=p*x+m*T+h*k+g*N,i[6]=p*S+m*E+h*A+g*P,i[10]=p*C+m*D+h*j+g*F,i[14]=p*w+m*O+h*M+g*I,i[3]=_*x+v*T+y*k+b*N,i[7]=_*S+v*E+y*A+b*P,i[11]=_*C+v*D+y*j+b*F,i[15]=_*w+v*O+y*M+b*I,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],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15];return p*(+i*s*u-r*c*u-i*o*d+n*c*d+r*o*f-n*s*f)+m*(+t*s*f-t*c*d+i*a*d-r*a*f+r*c*l-i*s*l)+h*(+t*c*u-t*o*f-i*a*u+n*a*f+i*o*l-n*c*l)+g*(-r*o*l-t*s*u+t*o*d+r*a*u-n*a*d+n*s*l)},transpose:function(){var e=this.elements,t=e[1];return 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],d=r[7],f=r[8],p=r[9],m=r[10],h=r[11],g=r[12],_=r[13],v=r[14],y=r[15],b=p*v*d-_*m*d+_*u*h-l*v*h-p*u*y+l*m*y,x=g*m*d-f*v*d-g*u*h+c*v*h+f*u*y-c*m*y,S=f*_*d-g*p*d+g*l*h-c*_*h-f*l*y+c*p*y,C=g*p*u-f*_*u-g*l*m+c*_*m+f*l*v-c*p*v,w=i*b+a*x+o*S+s*C;if(w===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var T=1/w;return n[0]=b*T,n[1]=(_*m*s-p*v*s-_*o*h+a*v*h+p*o*y-a*m*y)*T,n[2]=(l*v*s-_*u*s+_*o*d-a*v*d-l*o*y+a*u*y)*T,n[3]=(p*u*s-l*m*s-p*o*d+a*m*d+l*o*h-a*u*h)*T,n[4]=x*T,n[5]=(f*v*s-g*m*s+g*o*h-i*v*h-f*o*y+i*m*y)*T,n[6]=(g*u*s-c*v*s-g*o*d+i*v*d+c*o*y-i*u*y)*T,n[7]=(c*m*s-f*u*s+f*o*d-i*m*d-c*o*h+i*u*h)*T,n[8]=S*T,n[9]=(g*p*s-f*_*s-g*a*h+i*_*h+f*a*y-i*p*y)*T,n[10]=(c*_*s-g*l*s+g*a*d-i*_*d-c*a*y+i*l*y)*T,n[11]=(f*l*s-c*p*s-f*a*d+i*p*d+c*a*h-i*l*h)*T,n[12]=C*T,n[13]=(f*_*o-g*p*o+g*a*m-i*_*m-f*a*v+i*p*v)*T,n[14]=(g*l*o-c*_*o-g*a*u+i*_*u+c*a*v-i*l*v)*T,n[15]=(c*p*o-f*l*o+f*a*u-i*p*u-c*a*m+i*l*m)*T,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,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,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=yc.set(r[0],r[1],r[2]).length(),a=yc.set(r[4],r[5],r[6]).length(),o=yc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],bc.copy(this);var s=1/i,c=1/a,l=1/o;return bc.elements[0]*=s,bc.elements[1]*=s,bc.elements[2]*=s,bc.elements[4]*=c,bc.elements[5]*=c,bc.elements[6]*=c,bc.elements[8]*=l,bc.elements[9]*=l,bc.elements[10]*=l,t.setFromRotationMatrix(bc),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),d=-(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]=d,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,d=(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]=-d,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}}),Ec=new O,Dc=new E,k.RotationOrders=[`XYZ`,`YZX`,`ZXY`,`XZY`,`YXZ`,`ZYX`],k.DefaultOrder=`XYZ`,Object.defineProperties(k.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(k.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=X.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],c=i[1],l=i[5],u=i[9],d=i[2],f=i[6],p=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,p),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,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-d,a),this._z=0);break;case`ZXY`:this._x=Math.asin(r(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a));break;case`ZYX`:this._y=Math.asin(-r(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),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(-d,a)):(this._x=0,this._y=Math.atan2(s,p));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,p),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 Ec.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ec,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return Dc.setFromEuler(this),this.setFromQuaternion(Dc,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 D(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(A.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}}),Oc=0,kc=new D,Ac=new E,jc=new O,Mc=new D,Nc=new D,Pc=new D,Fc=new E,Ic=new D(1,0,0),Lc=new D(0,1,0),Rc=new D(0,0,1),zc={type:`added`},Bc={type:`removed`},j.DefaultUp=new D(0,1,0),j.DefaultMatrixAutoUpdate=!0,j.prototype=Object.assign(Object.create(y.prototype),{constructor:j,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 Ac.setFromAxisAngle(e,t),this.quaternion.multiply(Ac),this},rotateOnWorldAxis:function(e,t){return Ac.setFromAxisAngle(e,t),this.quaternion.premultiply(Ac),this},rotateX:function(e){return this.rotateOnAxis(Ic,e)},rotateY:function(e){return this.rotateOnAxis(Lc,e)},rotateZ:function(e){return this.rotateOnAxis(Rc,e)},translateOnAxis:function(e,t){return kc.copy(e).applyQuaternion(this.quaternion),this.position.add(kc.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(Ic,e)},translateY:function(e){return this.translateOnAxis(Lc,e)},translateZ:function(e){return this.translateOnAxis(Rc,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(jc.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?Mc.copy(e):Mc.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),Nc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?jc.lookAt(Nc,Mc,this.up):jc.lookAt(Mc,Nc,this.up),this.quaternion.setFromRotationMatrix(jc),r&&(jc.extractRotation(r.matrixWorld),Ac.setFromRotationMatrix(jc),this.quaternion.premultiply(Ac.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(zc)):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(Bc)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),jc.getInverse(this.matrixWorld),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),jc.multiply(e.parent.matrixWorld)),e.applyMatrix4(jc),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].getObjectByProperty(e,t);if(i!==void 0)return i}},getWorldPosition:function(e){return e===void 0&&(console.warn(`THREE.Object3D: .getWorldPosition() target is now required`),e=new D),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 E),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Nc,e,Pc),e},getWorldScale:function(e){return e===void 0&&(console.warn(`THREE.Object3D: .getWorldScale() target is now required`),e=new D),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Nc,Fc,e),e},getWorldDirection:function(e){e===void 0&&(console.warn(`THREE.Object3D: .getWorldDirection() target is now required`),e=new D),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(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.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 d=h(e.geometries),f=h(e.materials),p=h(e.textures),m=h(e.images),o=h(e.shapes);d.length>0&&(n.geometries=d),f.length>0&&(n.materials=f),p.length>0&&(n.textures=p),m.length>0&&(n.images=m),o.length>0&&(n.shapes=o)}return n.object=r,n;function h(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},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}}),M.prototype=Object.assign(Object.create(j.prototype),{constructor:M,isScene:!0,copy:function(e,t){return j.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=j.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`})}}),Vc=[new D,new D,new D,new D,new D,new D,new D,new D],Hc=new D,Uc=new N,Wc=new D,Gc=new D,Kc=new D,qc=new D,Jc=new D,Yc=new D,Xc=new D,Zc=new D,Qc=new D,$c=new D,Object.assign(N.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],d=e[s+2];l<t&&(t=l),u<n&&(n=u),d<r&&(r=d),l>i&&(i=l),u>a&&(a=u),d>o&&(o=d)}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),d=e.getZ(s);l<t&&(t=l),u<n&&(n=u),d<r&&(r=d),l>i&&(i=l),u>a&&(a=u),d>o&&(o=d)}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=Hc.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 D),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 D),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(),Uc.copy(t.boundingBox),Uc.applyMatrix4(e.matrixWorld),this.union(Uc));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 D),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,Hc),Hc.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(Xc),Zc.subVectors(this.max,Xc),Wc.subVectors(e.a,Xc),Gc.subVectors(e.b,Xc),Kc.subVectors(e.c,Xc),qc.subVectors(Gc,Wc),Jc.subVectors(Kc,Gc),Yc.subVectors(Wc,Kc);var t=[0,-qc.z,qc.y,0,-Jc.z,Jc.y,0,-Yc.z,Yc.y,qc.z,0,-qc.x,Jc.z,0,-Jc.x,Yc.z,0,-Yc.x,-qc.y,qc.x,0,-Jc.y,Jc.x,0,-Yc.y,Yc.x,0];return!P(t,Wc,Gc,Kc,Zc)||(t=[1,0,0,0,1,0,0,0,1],!P(t,Wc,Gc,Kc,Zc))?!1:(Qc.crossVectors(qc,Jc),t=[Qc.x,Qc.y,Qc.z],P(t,Wc,Gc,Kc,Zc))},clampPoint:function(e,t){return t===void 0&&(console.warn(`THREE.Box3: .clampPoint() target is now required`),t=new D),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return Hc.copy(e).clamp(this.min,this.max).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(Hc).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:(Vc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Vc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Vc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Vc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Vc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Vc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Vc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Vc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Vc),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)}}),el=new N,Object.assign(F.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?el.setFromPoints(e).getCenter(n):n.copy(t);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 D),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 N),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*=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}}),tl=new D,nl=new D,rl=new D,il=new D,al=new D,ol=new D,sl=new D,Object.assign(I.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 D),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,tl)),this},closestPointToPoint:function(e,t){t===void 0&&(console.warn(`THREE.Ray: .closestPointToPoint() target is now required`),t=new D),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=tl.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(tl.copy(this.direction).multiplyScalar(t).add(this.origin),tl.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,r){nl.copy(e).add(t).multiplyScalar(.5),rl.copy(t).sub(e).normalize(),il.copy(this.origin).sub(nl);var i=e.distanceTo(t)*.5,a=-this.direction.dot(rl),o=il.dot(this.direction),s=-il.dot(rl),c=il.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){var m=1/l;u*=m,d*=m,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(rl).multiplyScalar(d).add(nl),f},intersectSphere:function(e,t){tl.subVectors(e.center,this.origin);var n=tl.dot(this.direction),r=tl.dot(tl)-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);return t===0||e.normal.dot(this.direction)*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,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||n!==n)&&(n=i),(a<r||r!==r)&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.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,tl)!==null},intersectTriangle:function(e,t,n,r,i){al.subVectors(t,e),ol.subVectors(n,e),sl.crossVectors(al,ol);var a=this.direction.dot(sl),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;il.subVectors(this.origin,e);var s=o*this.direction.dot(ol.crossVectors(il,ol));if(s<0)return null;var c=o*this.direction.dot(al.cross(il));if(c<0||s+c>a)return null;var l=-o*il.dot(sl);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)}}),cl=new D,ll=new D,ul=new x,Object.assign(L.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=cl.subVectors(n,t).cross(ll.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 D),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 D);var n=e.delta(cl),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 D),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||ul.getNormalMatrix(e),r=this.coplanarPoint(cl).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}}),dl=new D,fl=new D,pl=new D,ml=new D,hl=new D,gl=new D,_l=new D,vl=new D,yl=new D,bl=new D,Object.assign(R,{getNormal:function(e,t,n,r){r===void 0&&(console.warn(`THREE.Triangle: .getNormal() target is now required`),r=new D),r.subVectors(n,t),dl.subVectors(e,t),r.cross(dl);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){dl.subVectors(r,t),fl.subVectors(n,t),pl.subVectors(e,t);var a=dl.dot(dl),o=dl.dot(fl),s=dl.dot(pl),c=fl.dot(fl),l=fl.dot(pl),u=a*c-o*o;if(i===void 0&&(console.warn(`THREE.Triangle: .getBarycoord() target is now required`),i=new D),u===0)return i.set(-2,-1,-1);var d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)},containsPoint:function(e,t,n,r){return R.getBarycoord(e,t,n,r,ml),ml.x>=0&&ml.y>=0&&ml.x+ml.y<=1},getUV:function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,ml),s.set(0,0),s.addScaledVector(i,ml.x),s.addScaledVector(a,ml.y),s.addScaledVector(o,ml.z),s},isFrontFacing:function(e,t,n,r){return dl.subVectors(n,t),fl.subVectors(e,t),dl.cross(fl).dot(r)<0}}),Object.assign(R.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 dl.subVectors(this.c,this.b),fl.subVectors(this.a,this.b),dl.cross(fl).length()*.5},getMidpoint:function(e){return e===void 0&&(console.warn(`THREE.Triangle: .getMidpoint() target is now required`),e=new D),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return R.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 L),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return R.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,r,i){return R.getUV(e,this.a,this.b,this.c,t,n,r,i)},containsPoint:function(e){return R.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return R.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 D);var n=this.a,r=this.b,i=this.c,a,o;hl.subVectors(r,n),gl.subVectors(i,n),vl.subVectors(e,n);var s=hl.dot(vl),c=gl.dot(vl);if(s<=0&&c<=0)return t.copy(n);yl.subVectors(e,r);var l=hl.dot(yl),u=gl.dot(yl);if(l>=0&&u<=l)return t.copy(r);var d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(hl,a);bl.subVectors(e,i);var f=hl.dot(bl),p=gl.dot(bl);if(p>=0&&f<=p)return t.copy(i);var m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(gl,o);var h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return _l.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(_l,o);var g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(hl,a).addScaledVector(gl,o)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),xl={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},Sl={h:0,s:0,l:0},Cl={h:0,s:0,l:0},Object.assign(z.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=X.euclideanModulo(e,1),t=X.clamp(t,0,1),n=X.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=ee(i,r,e+1/3),this.g=ee(i,r,e),this.b=ee(i,r,e-1/3)}return this},setStyle:function(e){function t(t){t!==void 0&&parseFloat(t)<1&&console.warn(`THREE.Color: Alpha component of `+e+` will be ignored.`)}var n;if(n=/^((?:rgb|hsl)a?)\\(\\s*([^\\)]*)\\)/.exec(e)){var 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=xl[e];return t===void 0?console.warn(`THREE.Color: Unknown color `+e):this.setHex(t),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=te(e.r),this.g=te(e.g),this.b=te(e.b),this},copyLinearToSRGB:function(e){return this.r=ne(e.r),this.g=ne(e.g),this.b=ne(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(Sl),Sl.h+=e,Sl.s+=t,Sl.l+=n,this.setHSL(Sl.h,Sl.s,Sl.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(Sl),e.getHSL(Cl);var n=X.lerp(Sl.h,Cl.h,t),r=X.lerp(Sl.s,Cl.s,t),i=X.lerp(Sl.l,Cl.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()}}),z.NAMES=xl,Object.assign(B.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}}),wl=0,V.prototype=Object.assign(Object.create(y.prototype),{constructor:V,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===1;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!==1&&(n.blending=this.blending),this.flatShading===!0&&(n.flatShading=this.flatShading),this.side!==0&&(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(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}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=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(V.prototype,`needsUpdate`,{set:function(e){e===!0&&this.version++}}),re.prototype=Object.create(V.prototype),re.prototype.constructor=re,re.prototype.isMeshBasicMaterial=!0,re.prototype.copy=function(e){return V.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},Tl=new D,Object.defineProperty(H.prototype,`needsUpdate`,{set:function(e){e===!0&&this.version++}}),Object.assign(H.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 z),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 b),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 D),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 C),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++)Tl.x=this.getX(t),Tl.y=this.getY(t),Tl.z=this.getZ(t),Tl.applyMatrix3(e),this.setXYZ(t,Tl.x,Tl.y,Tl.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)Tl.x=this.getX(t),Tl.y=this.getY(t),Tl.z=this.getZ(t),Tl.applyMatrix4(e),this.setXYZ(t,Tl.x,Tl.y,Tl.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)Tl.x=this.getX(t),Tl.y=this.getY(t),Tl.z=this.getZ(t),Tl.applyNormalMatrix(e),this.setXYZ(t,Tl.x,Tl.y,Tl.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)Tl.x=this.getX(t),Tl.y=this.getY(t),Tl.z=this.getZ(t),Tl.transformDirection(e),this.setXYZ(t,Tl.x,Tl.y,Tl.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}}}),U.prototype=Object.create(H.prototype),U.prototype.constructor=U,ie.prototype=Object.create(H.prototype),ie.prototype.constructor=ie,W.prototype=Object.create(H.prototype),W.prototype.constructor=W,ae.prototype=Object.create(H.prototype),ae.prototype.constructor=ae,G.prototype=Object.create(H.prototype),G.prototype.constructor=G,oe.prototype=Object.create(H.prototype),oe.prototype.constructor=oe,se.prototype=Object.create(H.prototype),se.prototype.constructor=se,K.prototype=Object.create(H.prototype),K.prototype.constructor=K,ce.prototype=Object.create(H.prototype),ce.prototype.constructor=ce,Object.assign(le.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,d=u.length,f;if(d>0){f=[];for(var l=0;l<d;l++)f[l]={name:u[l].name,data:[]};this.morphTargets.normal=f}var p=e.skinIndices,m=e.skinWeights,h=p.length===n.length,g=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 _=t[l];this.vertices.push(n[_.a],n[_.b],n[_.c]);var v=_.vertexNormals;if(v.length===3)this.normals.push(v[0],v[1],v[2]);else{var y=_.normal;this.normals.push(y,y,y)}var x=_.vertexColors;if(x.length===3)this.colors.push(x[0],x[1],x[2]);else{var S=_.color;this.colors.push(S,S,S)}if(i===!0){var C=r[0][l];C===void 0?(console.warn(`THREE.DirectGeometry.fromGeometry(): Undefined vertexUv `,l),this.uvs.push(new b,new b,new b)):this.uvs.push(C[0],C[1],C[2])}if(a===!0){var C=r[1][l];C===void 0?(console.warn(`THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 `,l),this.uvs2.push(new b,new b,new b)):this.uvs2.push(C[0],C[1],C[2])}for(var w=0;w<s;w++){var T=o[w].vertices;c[w].data.push(T[_.a],T[_.b],T[_.c])}for(var w=0;w<d;w++){var E=u[w].vertexNormals[l];f[w].data.push(E.a,E.b,E.c)}h&&this.skinIndices.push(p[_.a],p[_.b],p[_.c]),g&&this.skinWeights.push(m[_.a],m[_.b],m[_.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}}),El=1,Dl=new O,Ol=new j,kl=new D,Al=new N,jl=new N,Ml=new D,q.prototype=Object.assign(Object.create(y.prototype),{constructor:q,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(ue(e)>65535?se:G)(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?0:n})},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 x().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 Dl.makeRotationX(e),this.applyMatrix4(Dl),this},rotateY:function(e){return Dl.makeRotationY(e),this.applyMatrix4(Dl),this},rotateZ:function(e){return Dl.makeRotationZ(e),this.applyMatrix4(Dl),this},translate:function(e,t,n){return Dl.makeTranslation(e,t,n),this.applyMatrix4(Dl),this},scale:function(e,t,n){return Dl.makeScale(e,t,n),this.applyMatrix4(Dl),this},lookAt:function(e){return Ol.lookAt(e),Ol.updateMatrix(),this.applyMatrix4(Ol.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(kl).negate(),this.translate(kl.x,kl.y,kl.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new K(t.vertices.length*3,3),r=new K(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 K(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 K(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 le().fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(e.vertices.length*3);if(this.setAttribute(`position`,new H(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(e.normals.length*3);this.setAttribute(`normal`,new H(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(e.colors.length*3);this.setAttribute(`color`,new H(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(e.uvs.length*2);this.setAttribute(`uv`,new H(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(e.uvs2.length*2);this.setAttribute(`uv2`,new H(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],c=e.morphTargets[o],l=0,u=c.length;l<u;l++){var d=c[l],f=new K(d.data.length*3,3);f.name=d.name,s.push(f.copyVector3sArray(d.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var p=new K(e.skinIndices.length*4,4);this.setAttribute(`skinIndex`,p.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new K(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 N);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];Al.setFromBufferAttribute(i),this.morphTargetsRelative?(Ml.addVectors(this.boundingBox.min,Al.min),this.boundingBox.expandByPoint(Ml),Ml.addVectors(this.boundingBox.max,Al.max),this.boundingBox.expandByPoint(Ml)):(this.boundingBox.expandByPoint(Al.min),this.boundingBox.expandByPoint(Al.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 F);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(Al.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];jl.setFromBufferAttribute(a),this.morphTargetsRelative?(Ml.addVectors(Al.min,jl.min),Al.expandByPoint(Ml),Ml.addVectors(Al.max,jl.max),Al.expandByPoint(Ml)):(Al.expandByPoint(jl.min),Al.expandByPoint(jl.max))}Al.getCenter(n);for(var o=0,r=0,i=e.count;r<i;r++)Ml.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(Ml));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++)Ml.fromBufferAttribute(a,c),s&&(kl.fromBufferAttribute(e,c),Ml.add(kl)),o=Math.max(o,n.distanceToSquared(Ml));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 H(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 D,d=new D,f=new D,p=new D,m=new D;if(e)for(var h=e.array,i=0,a=e.count;i<a;i+=3)s=h[i+0]*3,c=h[i+1]*3,l=h[i+2]*3,u.fromArray(n,s),d.fromArray(n,c),f.fromArray(n,l),p.subVectors(f,d),m.subVectors(u,d),p.cross(m),o[s]+=p.x,o[s+1]+=p.y,o[s+2]+=p.z,o[c]+=p.x,o[c+1]+=p.y,o[c+2]+=p.z,o[l]+=p.x,o[l+1]+=p.y,o[l+2]+=p.z;else for(var i=0,a=n.length;i<a;i+=9)u.fromArray(n,i),d.fromArray(n,i+3),f.fromArray(n,i+6),p.subVectors(f,d),m.subVectors(u,d),p.cross(m),o[i]=p.x,o[i+1]=p.y,o[i+2]=p.z,o[i+3]=p.x,o[i+4]=p.y,o[i+5]=p.z,o[i+6]=p.x,o[i+7]=p.y,o[i+8]=p.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].array,a=e.attributes[r],o=a.array,s=a.itemSize*t,c=Math.min(o.length,i.length-s),l=0,u=s;l<c;l++,u++)i[u]=o[l];return this},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)Ml.x=e.getX(t),Ml.y=e.getY(t),Ml.z=e.getZ(t),Ml.normalize(),e.setXYZ(t,Ml.x,Ml.y,Ml.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0,c=0,l=t.length;c<l;c++){o=t[c]*r;for(var u=0;u<r;u++)a[s++]=n[o++]}return new H(a,r,i)}if(this.index===null)return console.warn(`THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.`),this;var t=new q,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,d=l.length;u<d;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,p=f.length;u<p;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=[],d=0,f=l.length;d<f;d++){var a=l[d],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 p=this.groups;p.length>0&&(e.data.groups=JSON.parse(JSON.stringify(p)));var m=this.boundingSphere;return m!==null&&(e.data.boundingSphere={center:m.center.toArray(),radius:m.radius}),e},clone:function(){return new q().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 d=u[n];this.addGroup(d.start,d.count,d.materialIndex)}var f=e.boundingBox;f!==null&&(this.boundingBox=f.clone());var p=e.boundingSphere;return p!==null&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:`dispose`})}}),Nl=new O,Pl=new I,Fl=new F,Il=new D,Ll=new D,Rl=new D,zl=new D,Bl=new D,Vl=new D,Hl=new D,Ul=new D,Wl=new D,Gl=new b,Kl=new b,ql=new b,Jl=new D,Yl=new D,de.prototype=Object.assign(Object.create(j.prototype),{constructor:de,isMesh:!0,copy:function(e){return j.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(),Fl.copy(n.boundingSphere),Fl.applyMatrix4(i),e.ray.intersectsSphere(Fl)!==!1&&(Nl.getInverse(i),Pl.copy(e.ray).applyMatrix4(Nl),!(n.boundingBox!==null&&Pl.intersectsBox(n.boundingBox)===!1)))){var a;if(n.isBufferGeometry){var o,s,c,l=n.index,u=n.attributes.position,d=n.morphAttributes.position,f=n.morphTargetsRelative,p=n.attributes.uv,m=n.attributes.uv2,h=n.groups,g=n.drawRange,_,v,y,x,S,C,w,T;if(l!==null)if(Array.isArray(r))for(_=0,y=h.length;_<y;_++)for(S=h[_],C=r[S.materialIndex],w=Math.max(S.start,g.start),T=Math.min(S.start+S.count,g.start+g.count),v=w,x=T;v<x;v+=3)o=l.getX(v),s=l.getX(v+1),c=l.getX(v+2),a=pe(this,C,e,Pl,u,d,f,p,m,o,s,c),a&&(a.faceIndex=Math.floor(v/3),a.face.materialIndex=S.materialIndex,t.push(a));else for(w=Math.max(0,g.start),T=Math.min(l.count,g.start+g.count),_=w,y=T;_<y;_+=3)o=l.getX(_),s=l.getX(_+1),c=l.getX(_+2),a=pe(this,r,e,Pl,u,d,f,p,m,o,s,c),a&&(a.faceIndex=Math.floor(_/3),t.push(a));else if(u!==void 0)if(Array.isArray(r))for(_=0,y=h.length;_<y;_++)for(S=h[_],C=r[S.materialIndex],w=Math.max(S.start,g.start),T=Math.min(S.start+S.count,g.start+g.count),v=w,x=T;v<x;v+=3)o=v,s=v+1,c=v+2,a=pe(this,C,e,Pl,u,d,f,p,m,o,s,c),a&&(a.faceIndex=Math.floor(v/3),a.face.materialIndex=S.materialIndex,t.push(a));else for(w=Math.max(0,g.start),T=Math.min(u.count,g.start+g.count),_=w,y=T;_<y;_+=3)o=_,s=_+1,c=_+2,a=pe(this,r,e,Pl,u,d,f,p,m,o,s,c),a&&(a.faceIndex=Math.floor(_/3),t.push(a))}else if(n.isGeometry){var E,D,O,k=Array.isArray(r),A=n.vertices,j=n.faces,M,N=n.faceVertexUvs[0];N.length>0&&(M=N);for(var P=0,F=j.length;P<F;P++){var I=j[P],L=k?r[I.materialIndex]:r;if(L!==void 0&&(E=A[I.a],D=A[I.b],O=A[I.c],a=fe(this,L,e,Pl,E,D,O,Jl),a)){if(M&&M[P]){var z=M[P];Gl.copy(z[0]),Kl.copy(z[1]),ql.copy(z[2]),a.uv=R.getUV(Jl,E,D,O,Gl,Kl,ql,new b)}a.face=I,a.faceIndex=P,t.push(a)}}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Xl=0,Zl=new O,Ql=new j,$l=new D,J.prototype=Object.assign(Object.create(y.prototype),{constructor:J,isGeometry:!0,applyMatrix4:function(e){for(var t=new x().getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++)this.vertices[n].applyMatrix4(e);for(var n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(t).normalize();for(var a=0,o=i.vertexNormals.length;a<o;a++)i.vertexNormals[a].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 Zl.makeRotationX(e),this.applyMatrix4(Zl),this},rotateY:function(e){return Zl.makeRotationY(e),this.applyMatrix4(Zl),this},rotateZ:function(e){return Zl.makeRotationZ(e),this.applyMatrix4(Zl),this},translate:function(e,t,n){return Zl.makeTranslation(e,t,n),this.applyMatrix4(Zl),this},scale:function(e,t,n){return Zl.makeScale(e,t,n),this.applyMatrix4(Zl),this},lookAt:function(e){return Ql.lookAt(e),Ql.updateMatrix(),this.applyMatrix4(Ql.matrix),this},fromBufferGeometry:function(e){var t=this,n=e.index===null?void 0:e.index.array,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?void 0:r.normal.array,o=r.color===void 0?void 0:r.color.array,s=r.uv===void 0?void 0:r.uv.array,c=r.uv2===void 0?void 0:r.uv2.array;c!==void 0&&(this.faceVertexUvs[1]=[]);for(var l=0;l<i.length;l+=3)t.vertices.push(new D().fromArray(i,l)),o!==void 0&&t.colors.push(new z().fromArray(o,l));function u(e,n,r,i){var l=o===void 0?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()],u=new B(e,n,r,a===void 0?[]:[new D().fromArray(a,e*3),new D().fromArray(a,n*3),new D().fromArray(a,r*3)],l,i);t.faces.push(u),s!==void 0&&t.faceVertexUvs[0].push([new b().fromArray(s,e*2),new b().fromArray(s,n*2),new b().fromArray(s,r*2)]),c!==void 0&&t.faceVertexUvs[1].push([new b().fromArray(c,e*2),new b().fromArray(c,n*2),new b().fromArray(c,r*2)])}var d=e.groups;if(d.length>0)for(var l=0;l<d.length;l++)for(var f=d[l],p=f.start,m=f.count,h=p,g=p+m;h<g;h+=3)n===void 0?u(h,h+1,h+2,f.materialIndex):u(n[h],n[h+1],n[h+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($l).negate(),this.translate($l.x,$l.y,$l.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=t===0?1:1/t,r=new O;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 D,t=new D,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=Array(this.vertices.length);for(t=0,n=this.vertices.length;t<n;t++)o[t]=new D;if(e){var s,c,l,u=new D,d=new D;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),d.subVectors(s,c),u.cross(d),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 J;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,c,l;for(n=0,r=this.faces.length;n<r;n++)c=new D,l={a:new D,b:new D,c:new D},o.push(c),s.push(l)}var u=this.morphNormals[e];a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals();var c,l;for(n=0,r=this.faces.length;n<r;n++)i=this.faces[n],c=u.faceNormals[n],l=u.vertexNormals[n],c.copy(i.normal),l.a.copy(i.vertexNormals[0]),l.b.copy(i.vertexNormals[1]),l.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 N),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new F),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 x().getNormalMatrix(t));for(var d=0,f=o.length;d<f;d++){var p=o[d].clone();t!==void 0&&p.applyMatrix4(t),a.push(p)}for(var d=0,f=u.length;d<f;d++)l.push(u[d].clone());for(d=0,f=c.length;d<f;d++){var m=c[d],h,g,_,v=m.vertexNormals,y=m.vertexColors;h=new B(m.a+i,m.b+i,m.c+i),h.normal.copy(m.normal),r!==void 0&&h.normal.applyMatrix3(r).normalize();for(var b=0,S=v.length;b<S;b++)g=v[b].clone(),r!==void 0&&g.applyMatrix3(r).normalize(),h.vertexNormals.push(g);h.color.copy(m.color);for(var b=0,S=y.length;b<S;b++)_=y[b],h.vertexColors.push(_.clone());h.materialIndex=m.materialIndex+n,s.push(h)}for(var d=0,f=e.faceVertexUvs.length;d<f;d++){var C=e.faceVertexUvs[d];this.faceVertexUvs[d]===void 0&&(this.faceVertexUvs[d]=[]);for(var b=0,S=C.length;b<S;b++){for(var w=C[b],T=[],E=0,D=w.length;E<D;E++)T.push(w[E].clone());this.faceVertexUvs[d].push(T)}}},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=Math.pow(10,4),o,s,c,l,u,d;for(o=0,s=this.vertices.length;o<s;o++)r=this.vertices[o],i=Math.round(r.x*a)+`_`+Math.round(r.y*a)+`_`+Math.round(r.z*a),e[i]===void 0?(e[i]=o,t.push(this.vertices[o]),n[o]=t.length-1):n[o]=n[e[i]];var f=[];for(o=0,s=this.faces.length;o<s;o++){c=this.faces[o],c.a=n[c.a],c.b=n[c.b],c.c=n[c.c],l=[c.a,c.b,c.c];for(var p=0;p<3;p++)if(l[p]===l[(p+1)%3]){f.push(o);break}}for(o=f.length-1;o>=0;o--){var m=f[o];for(this.faces.splice(m,1),u=0,d=this.faceVertexUvs.length;u<d;u++)this.faceVertexUvs[u].splice(m,1)}var h=this.vertices.length-t.length;return this.vertices=t,h},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new D(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(e,t){return e.materialIndex-t.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={},d=[],f={},i=0;i<this.faces.length;i++){var p=this.faces[i],m=!0,h=!1,g=this.faceVertexUvs[0][i]!==void 0,_=p.normal.length()>0,v=p.vertexNormals.length>0,y=p.color.r!==1||p.color.g!==1||p.color.b!==1,b=p.vertexColors.length>0,x=0;if(x=T(x,0,0),x=T(x,1,m),x=T(x,2,h),x=T(x,3,g),x=T(x,4,_),x=T(x,5,v),x=T(x,6,y),x=T(x,7,b),o.push(x),o.push(p.a,p.b,p.c),o.push(p.materialIndex),g){var S=this.faceVertexUvs[0][i];o.push(O(S[0]),O(S[1]),O(S[2]))}if(_&&o.push(E(p.normal)),v){var C=p.vertexNormals;o.push(E(C[0]),E(C[1]),E(C[2]))}if(y&&o.push(D(p.color)),b){var w=p.vertexColors;o.push(D(w[0]),D(w[1]),D(w[2]))}}function T(e,t,n){return n?e|1<<t:e&~(1<<t)}function E(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return c[t]===void 0?(c[t]=s.length/3,s.push(e.x,e.y,e.z),c[t]):c[t]}function D(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return u[t]===void 0?(u[t]=l.length,l.push(e.getHex()),u[t]):u[t]}function O(e){var t=e.x.toString()+e.y.toString();return f[t]===void 0?(f[t]=d.length/2,d.push(e.x,e.y),f[t]):f[t]}return e.data={},e.data.vertices=r,e.data.normals=s,l.length>0&&(e.data.colors=l),d.length>0&&(e.data.uvs=[d]),e.data.faces=o,e},clone:function(){return new J().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 d=u[r],f=[];for(a=0,o=d.length;a<o;a++){var p=d[a];f.push(p.clone())}this.faceVertexUvs[t].push(f)}}var m=e.morphTargets;for(t=0,n=m.length;t<n;t++){var h={};if(h.name=m[t].name,m[t].vertices!==void 0)for(h.vertices=[],r=0,i=m[t].vertices.length;r<i;r++)h.vertices.push(m[t].vertices[r].clone());if(m[t].normals!==void 0)for(h.normals=[],r=0,i=m[t].normals.length;r<i;r++)h.normals.push(m[t].normals[r].clone());this.morphTargets.push(h)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var _={};if(g[t].vertexNormals!==void 0)for(_.vertexNormals=[],r=0,i=g[t].vertexNormals.length;r<i;r++){var v=g[t].vertexNormals[r],y={};y.a=v.a.clone(),y.b=v.b.clone(),y.c=v.c.clone(),_.vertexNormals.push(y)}if(g[t].faceNormals!==void 0)for(_.faceNormals=[],r=0,i=g[t].faceNormals.length;r<i;r++)_.faceNormals.push(g[t].faceNormals[r].clone());this.morphNormals.push(_)}var b=e.skinWeights;for(t=0,n=b.length;t<n;t++)this.skinWeights.push(b[t].clone());var x=e.skinIndices;for(t=0,n=x.length;t<n;t++)this.skinIndices.push(x[t].clone());var S=e.lineDistances;for(t=0,n=S.length;t<n;t++)this.lineDistances.push(S[t]);var C=e.boundingBox;C!==null&&(this.boundingBox=C.clone());var w=e.boundingSphere;return w!==null&&(this.boundingSphere=w.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`})}}),eu=class extends J{constructor(e,t,n,r,i,a){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new tu(e,t,n,r,i,a)),this.mergeVertices()}},tu=class extends q{constructor(e,t,n,r,i,a){super(),this.type=`BoxBufferGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;e=e||1,t=t||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,a=Math.floor(a)||1;let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new K(c,3)),this.setAttribute(`normal`,new K(l,3)),this.setAttribute(`uv`,new K(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,O=new D;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)O[e]=(s*v-b)*r,O[t]=o*i,O[n]=S,c.push(O.x,O.y,O.z),O[e]=0,O[t]=0,O[n]=m>0?1:-1,l.push(O.x,O.y,O.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}},nu={clone:me,merge:he},ru=`void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}`,iu=`void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}`,ge.prototype=Object.create(V.prototype),ge.prototype.constructor=ge,ge.prototype.isShaderMaterial=!0,ge.prototype.copy=function(e){return V.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=me(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},ge.prototype.toJSON=function(e){var t=V.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:`t`,value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:`c`,value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:`v2`,value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:`v3`,value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:`v4`,value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:`m3`,value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:`m4`,value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)this.extensions[a]===!0&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t},_e.prototype=Object.assign(Object.create(j.prototype),{constructor:_e,isCamera:!0,copy:function(e,t){return j.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 D),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){j.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){j.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return new this.constructor().copy(this)}}),ve.prototype=Object.assign(Object.create(_e.prototype),{constructor:ve,isPerspectiveCamera:!0,copy:function(e,t){return _e.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=X.RAD2DEG*2*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(X.DEG2RAD*.5*this.fov);return .5*this.getFilmHeight()/e},getEffectiveFOV:function(){return X.RAD2DEG*2*Math.atan(Math.tan(X.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(X.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=j.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}}),au=90,ou=1,ye.prototype=Object.create(j.prototype),ye.prototype.constructor=ye,be.prototype=Object.create(w.prototype),be.prototype.constructor=be,be.prototype.isWebGLCubeRenderTarget=!0,be.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new M,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(`\n`),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(`\n`)},i=new ge({type:`CubemapFromEquirect`,uniforms:me(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;var a=new de(new tu(5,5,5),i);return n.add(a),new ye(1,10,this).update(e,n),a.geometry.dispose(),a.material.dispose(),this},xe.prototype=Object.create(S.prototype),xe.prototype.constructor=xe,xe.prototype.isDataTexture=!0,su=new F,cu=new D,Object.assign(Se.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],d=n[8],f=n[9],p=n[10],m=n[11],h=n[12],g=n[13],_=n[14],v=n[15];return t[0].setComponents(o-r,u-s,m-d,v-h).normalize(),t[1].setComponents(o+r,u+s,m+d,v+h).normalize(),t[2].setComponents(o+i,u+c,m+f,v+g).normalize(),t[3].setComponents(o-i,u-c,m-f,v-g).normalize(),t[4].setComponents(o-a,u-l,m-p,v-_).normalize(),t[5].setComponents(o+a,u+l,m+p,v+_).normalize(),this},intersectsObject:function(e){var t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),su.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(su)},intersectsSprite:function(e){return su.center.set(0,0,0),su.radius=.7071067811865476,su.applyMatrix4(e.matrixWorld),this.intersectsSphere(su)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++)if(t[i].distanceToPoint(n)<r)return!1;return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(cu.x=r.normal.x>0?e.max.x:e.min.x,cu.y=r.normal.y>0?e.max.y:e.min.y,cu.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(cu)<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}}),Z={common:{diffuse:{value:new z(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x},uv2Transform:{value:new x},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 b(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 z(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 z(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}},sprite:{diffuse:{value:new z(15658734)},opacity:{value:1},center:{value:new b(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}}},Te.prototype=Object.create(J.prototype),Te.prototype.constructor=Te,Ee.prototype=Object.create(q.prototype),Ee.prototype.constructor=Ee,Q={alphamap_fragment:`#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif`,alphamap_pars_fragment:`#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif`,alphatest_fragment:`#ifdef ALPHATEST\n if ( diffuseColor.a < ALPHATEST ) discard;\n#endif`,aomap_fragment:`#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n #endif\n#endif`,aomap_pars_fragment:`#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif`,begin_vertex:`vec3 transformed = vec3( position );`,beginnormal_vertex:`vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif`,bsdfs:`vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n return vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n#else\n if( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n }\n return 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n return ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n return Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n return 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( incidentLight.direction + viewDir );\n float dotNL = saturate( dot( normal, incidentLight.direction ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n vec3 F = F_Schlick( specularColor, dotLH );\n float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n return specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n vec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n vec3 FssEss = F * brdf.x + brdf.y;\n float Ess = brdf.x + brdf.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n float dotNH = saturate( dot( geometry.normal, halfDir ) );\n float dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n vec3 F = F_Schlick( specularColor, dotLH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n return sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n float invAlpha = 1.0 / roughness;\n float cos2h = NoH * NoH;\n float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n vec3 N = geometry.normal;\n vec3 V = geometry.viewDir;\n vec3 H = normalize( V + L );\n float dotNH = saturate( dot( N, H ) );\n return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif`,bumpmap_pars_fragment:`#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 );\n fDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif`,clipping_planes_fragment:`#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n#endif`,clipping_planes_pars_fragment:`#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif`,clipping_planes_pars_vertex:`#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif`,clipping_planes_vertex:`#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif`,color_fragment:`#ifdef USE_COLOR\n diffuseColor.rgb *= vColor;\n#endif`,color_pars_fragment:`#ifdef USE_COLOR\n varying vec3 vColor;\n#endif`,color_pars_vertex:`#ifdef USE_COLOR\n varying vec3 vColor;\n#endif`,color_vertex:`#ifdef USE_COLOR\n vColor.xyz = color.xyz;\n#endif`,common:`#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n#ifdef CLEARCOAT\n vec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n float distance = dot( planeNormal, point - pointOnPlane );\n return - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n vec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n return dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}`,cube_uv_reflection_fragment:`#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x); } else if (face == 1.0) {\n uv = vec2(-direction.x, -direction.z) / abs(direction.y); } else if (face == 2.0) {\n uv = vec2(-direction.x, direction.y) / abs(direction.z); } else if (face == 3.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x); } else if (face == 4.0) {\n uv = vec2(-direction.x, direction.z) / abs(direction.y); } else {\n uv = vec2(direction.x, direction.y) / abs(direction.z); }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif`,defaultnormal_vertex:`vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n mat3 m = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n transformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif`,displacementmap_pars_vertex:`#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif`,displacementmap_vertex:`#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif`,emissivemap_fragment:`#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vUv );\n emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif`,emissivemap_pars_fragment:`#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif`,encodings_fragment:`gl_FragColor = linearToOutputTexel( gl_FragColor );`,encodings_pars_fragment:`\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.r, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.r, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract( Le );\n vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n return vec4( max( vRGB, 0.0 ), 1.0 );\n}`,envmap_fragment:`#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n \n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n #elif defined( ENVMAP_TYPE_EQUIREC )\n reflectVec = normalize( reflectVec );\n vec2 sampleUV = equirectUv( reflectVec );\n vec4 envColor = texture2D( envMap, sampleUV );\n #elif defined( ENVMAP_TYPE_SPHERE )\n reflectVec = normalize( reflectVec );\n vec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifndef ENVMAP_TYPE_CUBE_UV\n envColor = envMapTexelToLinear( envColor );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif`,envmap_common_pars_fragment:`#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform int maxMipLevel;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif`,envmap_pars_fragment:`#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif`,envmap_pars_vertex:`#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif`,envmap_physical_pars_fragment:`#if defined( USE_ENVMAP )\n #ifdef ENVMAP_MODE_REFRACTION\n uniform float refractionRatio;\n #endif\n vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n #ifdef ENVMAP_TYPE_CUBE\n vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n #else\n vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n #else\n vec4 envMapColor = vec4( 0.0 );\n #endif\n return PI * envMapColor.rgb * envMapIntensity;\n }\n float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n float maxMIPLevelScalar = float( maxMIPLevel );\n float sigma = PI * roughness * roughness / ( 1.0 + roughness );\n float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n }\n vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( -viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n #else\n vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n #endif\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n #ifdef ENVMAP_TYPE_CUBE\n vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n #else\n vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n #elif defined( ENVMAP_TYPE_EQUIREC )\n vec2 sampleUV = equirectUv( reflectVec );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n #else\n vec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_SPHERE )\n vec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n #else\n vec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #endif\n return envMapColor.rgb * envMapIntensity;\n }\n#endif`,envmap_vertex:`#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) { \n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif`,fog_vertex:`#ifdef USE_FOG\n fogDepth = -mvPosition.z;\n#endif`,fog_pars_vertex:`#ifdef USE_FOG\n varying float fogDepth;\n#endif`,fog_fragment:`#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif`,fog_pars_fragment:`#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float fogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif`,gradientmap_pars_fragment:`#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return texture2D( gradientMap, coord ).rgb;\n #else\n return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n #endif\n}`,lightmap_fragment:`#ifdef USE_LIGHTMAP\n vec4 lightMapTexel= texture2D( lightMap, vUv2 );\n reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif`,lightmap_pars_fragment:`#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif`,lights_lambert_vertex:`vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n vLightBack = vec3( 0.0 );\n vIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n vIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n #ifdef DOUBLE_SIDED\n vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n #endif\n }\n #pragma unroll_loop_end\n#endif`,lights_pars_begin:`uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n return irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n struct DirectionalLightShadow {\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n directLight.color = directionalLight.color;\n directLight.direction = directionalLight.direction;\n directLight.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n struct PointLightShadow {\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = pointLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n directLight.color = pointLight.color;\n directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n directLight.visible = ( directLight.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = spotLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n float angleCos = dot( directLight.direction, spotLight.direction );\n if ( angleCos > spotLight.coneCos ) {\n float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n directLight.color = spotLight.color;\n directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n directLight.visible = true;\n } else {\n directLight.color = vec3( 0.0 );\n directLight.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n float dotNL = dot( geometry.normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n return irradiance;\n }\n#endif`,lights_toon_fragment:`ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;`,lights_toon_pars_fragment:`varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material ) (0)`,lights_phong_fragment:`BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;`,lights_phong_pars_fragment:`varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material ) (0)`,lights_physical_fragment:`PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheen;\n#endif`,lights_physical_pars_fragment:`struct PhysicalMaterial {\n vec3 diffuseColor;\n float specularRoughness;\n vec3 specularColor;\n#ifdef CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n vec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometry.normal;\n vec3 viewDir = geometry.viewDir;\n vec3 position = geometry.position;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.specularRoughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n #ifdef CLEARCOAT\n float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = ccDotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n ccIrradiance *= PI;\n #endif\n float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n #else\n float clearcoatDHR = 0.0;\n #endif\n #ifdef USE_SHEEN\n reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n material.specularRoughness,\n directLight.direction,\n geometry,\n material.sheenColor\n );\n #else\n reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n #endif\n reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef CLEARCOAT\n float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n float ccDotNL = ccDotNV;\n float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n #else\n float clearcoatDHR = 0.0;\n #endif\n float clearcoatInv = 1.0 - clearcoatDHR;\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}`,lights_fragment_begin:`\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n geometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointDirectLightIrradiance( pointLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotDirectLightIrradiance( spotLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n irradiance += getLightProbeIrradiance( lightProbe, geometry );\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif`,lights_fragment_maps:`#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel= texture2D( lightMap, vUv2 );\n vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n lightMapIrradiance *= PI;\n #endif\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n #ifdef CLEARCOAT\n clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n #endif\n#endif`,lights_fragment_end:`#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif`,logdepthbuf_fragment:`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif`,logdepthbuf_pars_fragment:`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif`,logdepthbuf_pars_vertex:`#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n varying float vFragDepth;\n varying float vIsPerspective;\n #else\n uniform float logDepthBufFC;\n #endif\n#endif`,logdepthbuf_vertex:`#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n #else\n if ( isPerspectiveMatrix( projectionMatrix ) ) {\n gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n gl_Position.z *= gl_Position.w;\n }\n #endif\n#endif`,map_fragment:`#ifdef USE_MAP\n vec4 texelColor = texture2D( map, vUv );\n texelColor = mapTexelToLinear( texelColor );\n diffuseColor *= texelColor;\n#endif`,map_pars_fragment:`#ifdef USE_MAP\n uniform sampler2D map;\n#endif`,map_particle_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n vec4 mapTexel = texture2D( map, uv );\n diffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif`,map_particle_pars_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif`,metalnessmap_fragment:`float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vUv );\n metalnessFactor *= texelMetalness.b;\n#endif`,metalnessmap_pars_fragment:`#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif`,morphnormal_vertex:`#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif`,morphtarget_pars_vertex:`#ifdef USE_MORPHTARGETS\n uniform float morphTargetBaseInfluence;\n #ifndef USE_MORPHNORMALS\n uniform float morphTargetInfluences[ 8 ];\n #else\n uniform float morphTargetInfluences[ 4 ];\n #endif\n#endif`,morphtarget_vertex:`#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n transformed += morphTarget0 * morphTargetInfluences[ 0 ];\n transformed += morphTarget1 * morphTargetInfluences[ 1 ];\n transformed += morphTarget2 * morphTargetInfluences[ 2 ];\n transformed += morphTarget3 * morphTargetInfluences[ 3 ];\n #ifndef USE_MORPHNORMALS\n transformed += morphTarget4 * morphTargetInfluences[ 4 ];\n transformed += morphTarget5 * morphTargetInfluences[ 5 ];\n transformed += morphTarget6 * morphTargetInfluences[ 6 ];\n transformed += morphTarget7 * morphTargetInfluences[ 7 ];\n #endif\n#endif`,normal_fragment_begin:`#ifdef FLAT_SHADED\n vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #endif\n #ifdef USE_TANGENT\n vec3 tangent = normalize( vTangent );\n vec3 bitangent = normalize( vBitangent );\n #ifdef DOUBLE_SIDED\n tangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n bitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #endif\n #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n mat3 vTBN = mat3( tangent, bitangent, normal );\n #endif\n #endif\n#endif\nvec3 geometryNormal = normal;`,normal_fragment_maps:`#ifdef OBJECTSPACE_NORMALMAP\n normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n #ifdef USE_TANGENT\n normal = normalize( vTBN * mapN );\n #else\n normal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n #endif\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif`,normalmap_pars_fragment:`#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n float scale = sign( st1.t * st0.s - st0.t * st1.s );\n vec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n vec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n vec3 N = normalize( surf_norm );\n mat3 tsn = mat3( S, T, N );\n mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n return normalize( tsn * mapN );\n }\n#endif`,clearcoat_normal_fragment_begin:`#ifdef CLEARCOAT\n vec3 clearcoatNormal = geometryNormal;\n#endif`,clearcoat_normal_fragment_maps:`#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n #ifdef USE_TANGENT\n clearcoatNormal = normalize( vTBN * clearcoatMapN );\n #else\n clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n #endif\n#endif`,clearcoat_pars_fragment:`#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif`,packing:`vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n vec4 r = vec4( fract( v * PackFactors ), v );\n r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}`,premultiplied_alpha_fragment:`#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif`,project_vertex:`vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;`,dithering_fragment:`#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif`,dithering_pars_fragment:`#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif`,roughnessmap_fragment:`float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vUv );\n roughnessFactor *= texelRoughness.g;\n#endif`,roughnessmap_pars_fragment:`#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif`,shadowmap_pars_fragment:`#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n bool frustumTest = all( frustumTestVec );\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return shadow;\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n vec3 lightToPosition = shadowCoord.xyz;\n float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n return (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n#endif`,shadowmap_pars_vertex:`#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif`,shadowmap_vertex:`#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif`,shadowmask_pars_fragment:`float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}`,skinbase_vertex:`#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif`,skinning_pars_vertex:`#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n #ifdef BONE_TEXTURE\n uniform highp sampler2D boneTexture;\n uniform int boneTextureSize;\n mat4 getBoneMatrix( const in float i ) {\n float j = i * 4.0;\n float x = mod( j, float( boneTextureSize ) );\n float y = floor( j / float( boneTextureSize ) );\n float dx = 1.0 / float( boneTextureSize );\n float dy = 1.0 / float( boneTextureSize );\n y = dy * ( y + 0.5 );\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n mat4 bone = mat4( v1, v2, v3, v4 );\n return bone;\n }\n #else\n uniform mat4 boneMatrices[ MAX_BONES ];\n mat4 getBoneMatrix( const in float i ) {\n mat4 bone = boneMatrices[ int(i) ];\n return bone;\n }\n #endif\n#endif`,skinning_vertex:`#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif`,skinnormal_vertex:`#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif`,specularmap_fragment:`float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif`,specularmap_pars_fragment:`#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif`,tonemapping_fragment:`#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif`,tonemapping_pars_fragment:`#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}`,uv_pars_fragment:`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n varying vec2 vUv;\n#endif`,uv_pars_vertex:`#ifdef USE_UV\n #ifdef UVS_VERTEX_ONLY\n vec2 vUv;\n #else\n varying vec2 vUv;\n #endif\n uniform mat3 uvTransform;\n#endif`,uv_vertex:`#ifdef USE_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif`,uv2_pars_fragment:`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n varying vec2 vUv2;\n#endif`,uv2_pars_vertex:`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n attribute vec2 uv2;\n varying vec2 vUv2;\n uniform mat3 uv2Transform;\n#endif`,uv2_vertex:`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif`,worldpos_vertex:`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif`,background_frag:`uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n gl_FragColor = mapTexelToLinear( texColor );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n}`,background_vert:`varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}`,cube_frag:`#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n vec3 vReflect = vWorldDirection;\n #include <envmap_fragment>\n gl_FragColor = envColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n}`,cube_vert:`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}`,depth_frag:`#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( 1.0 );\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <logdepthbuf_fragment>\n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #endif\n}`,depth_vert:`#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <skinbase_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}`,distanceRGBA_frag:`#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( 1.0 );\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}`,distanceRGBA_vert:`#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <skinbase_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}`,equirect_frag:`uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n vec4 texColor = texture2D( tEquirect, sampleUV );\n gl_FragColor = mapTexelToLinear( texColor );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n}`,equirect_vert:`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}`,linedashed_frag:`uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}`,linedashed_vert:`uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <color_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}`,meshbasic_frag:`uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n \n vec4 lightMapTexel= texture2D( lightMap, vUv2 );\n reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshbasic_vert:`#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <skinbase_vertex>\n #ifdef USE_ENVMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}`,meshlambert_frag:`uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <emissivemap_fragment>\n #ifdef DOUBLE_SIDED\n reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n #else\n reflectedLight.indirectDiffuse += vIndirectFront;\n #endif\n #include <lightmap_fragment>\n reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n #ifdef DOUBLE_SIDED\n reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n #else\n reflectedLight.directDiffuse = vLightFront;\n #endif\n reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshlambert_vert:`#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <lights_lambert_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}`,meshmatcap_frag:`#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n matcapColor = matcapTexelToLinear( matcapColor );\n #else\n vec4 matcapColor = vec4( 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshmatcap_vert:`#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}`,meshtoon_frag:`#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshtoon_vert:`#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n#endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}`,meshphong_frag:`#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshphong_vert:`#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n#endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}`,meshphysical_frag:`#define STANDARD\n#ifdef PHYSICAL\n #define REFLECTIVITY\n #define CLEARCOAT\n #define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n uniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n uniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #ifdef TRANSPARENCY\n diffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n #endif\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshphysical_vert:`#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}`,normal_frag:`#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n varying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}`,normal_vert:`#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n varying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n vViewPosition = - mvPosition.xyz;\n#endif\n}`,points_frag:`uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n outgoingLight = diffuseColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}`,points_vert:`uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <color_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}`,shadow_frag:`uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}`,shadow_vert:`#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <begin_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}`,sprite_frag:`uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n outgoingLight = diffuseColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}`,sprite_vert:`uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n vec2 scale;\n scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}`},lu={basic:{uniforms:he([Z.common,Z.specularmap,Z.envmap,Z.aomap,Z.lightmap,Z.fog]),vertexShader:Q.meshbasic_vert,fragmentShader:Q.meshbasic_frag},lambert:{uniforms:he([Z.common,Z.specularmap,Z.envmap,Z.aomap,Z.lightmap,Z.emissivemap,Z.fog,Z.lights,{emissive:{value:new z(0)}}]),vertexShader:Q.meshlambert_vert,fragmentShader:Q.meshlambert_frag},phong:{uniforms:he([Z.common,Z.specularmap,Z.envmap,Z.aomap,Z.lightmap,Z.emissivemap,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.fog,Z.lights,{emissive:{value:new z(0)},specular:{value:new z(1118481)},shininess:{value:30}}]),vertexShader:Q.meshphong_vert,fragmentShader:Q.meshphong_frag},standard:{uniforms:he([Z.common,Z.envmap,Z.aomap,Z.lightmap,Z.emissivemap,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.roughnessmap,Z.metalnessmap,Z.fog,Z.lights,{emissive:{value:new z(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Q.meshphysical_vert,fragmentShader:Q.meshphysical_frag},toon:{uniforms:he([Z.common,Z.specularmap,Z.aomap,Z.lightmap,Z.emissivemap,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.gradientmap,Z.fog,Z.lights,{emissive:{value:new z(0)},specular:{value:new z(1118481)},shininess:{value:30}}]),vertexShader:Q.meshtoon_vert,fragmentShader:Q.meshtoon_frag},matcap:{uniforms:he([Z.common,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.fog,{matcap:{value:null}}]),vertexShader:Q.meshmatcap_vert,fragmentShader:Q.meshmatcap_frag},points:{uniforms:he([Z.points,Z.fog]),vertexShader:Q.points_vert,fragmentShader:Q.points_frag},dashed:{uniforms:he([Z.common,Z.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Q.linedashed_vert,fragmentShader:Q.linedashed_frag},depth:{uniforms:he([Z.common,Z.displacementmap]),vertexShader:Q.depth_vert,fragmentShader:Q.depth_frag},normal:{uniforms:he([Z.common,Z.bumpmap,Z.normalmap,Z.displacementmap,{opacity:{value:1}}]),vertexShader:Q.normal_vert,fragmentShader:Q.normal_frag},sprite:{uniforms:he([Z.sprite,Z.fog]),vertexShader:Q.sprite_vert,fragmentShader:Q.sprite_frag},background:{uniforms:{uvTransform:{value:new x},t2D:{value:null}},vertexShader:Q.background_vert,fragmentShader:Q.background_frag},cube:{uniforms:he([Z.envmap,{opacity:{value:1}}]),vertexShader:Q.cube_vert,fragmentShader:Q.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Q.equirect_vert,fragmentShader:Q.equirect_frag},distanceRGBA:{uniforms:he([Z.common,Z.displacementmap,{referencePosition:{value:new D},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Q.distanceRGBA_vert,fragmentShader:Q.distanceRGBA_frag},shadow:{uniforms:he([Z.lights,Z.fog,{color:{value:new z(0)},opacity:{value:1}}]),vertexShader:Q.shadow_vert,fragmentShader:Q.shadow_frag}},lu.physical={uniforms:he([lu.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new b(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new z(0)},transparency:{value:0}}]),vertexShader:Q.meshphysical_vert,fragmentShader:Q.meshphysical_frag},Re.prototype=Object.create(S.prototype),Re.prototype.constructor=Re,Re.prototype.isCubeTexture=!0,Object.defineProperty(Re.prototype,`images`,{get:function(){return this.image},set:function(e){this.image=e}}),ze.prototype=Object.create(S.prototype),ze.prototype.constructor=ze,ze.prototype.isDataTexture2DArray=!0,Be.prototype=Object.create(S.prototype),Be.prototype.constructor=Be,Be.prototype.isDataTexture3D=!0,uu=new S,du=new ze,fu=new Be,pu=new Re,mu=[],hu=[],gu=new Float32Array(16),_u=new Float32Array(9),vu=new Float32Array(4),Ct.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Ue(t,e)},wt.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)}},yu=/([\\w\\d_]+)(\\])?(\\[|\\.)?/g,Dt.prototype.setValue=function(e,t,n,r){var i=this.map[t];i!==void 0&&i.setValue(e,n,r)},Dt.prototype.setOptional=function(e,t,n){var r=t[n];r!==void 0&&this.setValue(e,n,r)},Dt.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)}},Dt.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},bu=0,xu=/^[ \\t]*#include +<([\\w\\d./]+)>/gm,Su=/#pragma unroll_loop[\\s]+?for \\( int i \\= (\\d+)\\; i < (\\d+)\\; i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}/g,Cu=/#pragma unroll_loop_start[\\s]+?for \\( int i \\= (\\d+)\\; i < (\\d+)\\; i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}[\\s]+?#pragma unroll_loop_end/g,wu=0,dn.prototype=Object.create(V.prototype),dn.prototype.constructor=dn,dn.prototype.isMeshDepthMaterial=!0,dn.prototype.copy=function(e){return V.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},fn.prototype=Object.create(V.prototype),fn.prototype.constructor=fn,fn.prototype.isMeshDistanceMaterial=!0,fn.prototype.copy=function(e){return V.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},Tu=`uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}`,Eu=`void main() {\n gl_Position = vec4( position, 1.0 );\n}`,_n.prototype=Object.assign(Object.create(ve.prototype),{constructor:_n,isArrayCamera:!0}),vn.prototype=Object.assign(Object.create(j.prototype),{constructor:vn,isGroup:!0}),Object.assign(yn.prototype,{constructor:yn,getTargetRaySpace:function(){return this._targetRay===null&&(this._targetRay=new vn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return this._grip===null&&(this._grip=new vn,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}}),Object.assign(bn.prototype,y.prototype),Object.assign(Cn.prototype,{isFogExp2:!0,clone:function(){return new Cn(this.color,this.density)},toJSON:function(){return{type:`FogExp2`,color:this.color.getHex(),density:this.density}}}),Object.assign(wn.prototype,{isFog:!0,clone:function(){return new wn(this.color,this.near,this.far)},toJSON:function(){return{type:`Fog`,color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Tn.prototype,`needsUpdate`,{set:function(e){e===!0&&this.version++}}),Object.assign(Tn.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}}),Du=new D,Object.defineProperties(En.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(En.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)Du.x=this.getX(t),Du.y=this.getY(t),Du.z=this.getZ(t),Du.applyMatrix4(e),this.setXYZ(t,Du.x,Du.y,Du.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 H(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}}}),Dn.prototype=Object.create(V.prototype),Dn.prototype.constructor=Dn,Dn.prototype.isSpriteMaterial=!0,Dn.prototype.copy=function(e){return V.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},ku=new D,Au=new D,ju=new D,Mu=new b,Nu=new b,Pu=new O,Fu=new D,Iu=new D,Lu=new D,Ru=new b,zu=new b,Bu=new b,On.prototype=Object.assign(Object.create(j.prototype),{constructor:On,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.`),Au.setFromMatrixScale(this.matrixWorld),Pu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ju.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Au.multiplyScalar(-ju.z);var n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));var a=this.center;kn(Fu.set(-.5,-.5,0),ju,a,Au,r,i),kn(Iu.set(.5,-.5,0),ju,a,Au,r,i),kn(Lu.set(.5,.5,0),ju,a,Au,r,i),Ru.set(0,0),zu.set(1,0),Bu.set(1,1);var o=e.ray.intersectTriangle(Fu,Iu,Lu,!1,ku);if(!(o===null&&(kn(Iu.set(-.5,.5,0),ju,a,Au,r,i),zu.set(0,1),o=e.ray.intersectTriangle(Fu,Lu,Iu,!1,ku),o===null))){var s=e.ray.origin.distanceTo(ku);s<e.near||s>e.far||t.push({distance:s,point:ku.clone(),uv:R.getUV(ku,Fu,Iu,Lu,Ru,zu,Bu,new b),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return j.prototype.copy.call(this,e),e.center!==void 0&&this.center.copy(e.center),this}}),Vu=new D,Hu=new D,An.prototype=Object.assign(Object.create(j.prototype),{constructor:An,isLOD:!0,copy:function(e){j.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){if(this.levels.length>0){Vu.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(Vu);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){Vu.setFromMatrixPosition(e.matrixWorld),Hu.setFromMatrixPosition(this.matrixWorld);var n=Vu.distanceTo(Hu)/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=j.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}}),jn.prototype=Object.assign(Object.create(de.prototype),{constructor:jn,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 C,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.set(1,0,0,0):e.multiplyScalar(i),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){de.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 D,t=new C,n=new C,r=new D,i=new O;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 d=t.getComponent(l);i.multiplyMatrices(s.bones[d].matrixWorld,s.boneInverses[d]),o.addScaledVector(r.copy(e).applyMatrix4(i),u)}}return o.applyMatrix4(this.bindMatrixInverse)}}()}),Uu=new O,Wu=new O,Object.assign(Mn.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new O;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:Wu;Uu.multiplyMatrices(o,t[i]),Uu.toArray(n,i*16)}r!==void 0&&(r.needsUpdate=!0)},clone:function(){return new Mn(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)}}),Nn.prototype=Object.assign(Object.create(j.prototype),{constructor:Nn,isBone:!0}),Gu=new O,Ku=new O,qu=[],Ju=new de,Pn.prototype=Object.assign(Object.create(de.prototype),{constructor:Pn,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(Ju.geometry=this.geometry,Ju.material=this.material,Ju.material!==void 0)for(var i=0;i<r;i++){this.getMatrixAt(i,Gu),Ku.multiplyMatrices(n,Gu),Ju.matrixWorld=Ku,Ju.raycast(e,qu);for(var a=0,o=qu.length;a<o;a++){var s=qu[a];s.instanceId=i,s.object=this,t.push(s)}qu.length=0}},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,e*16)},updateMorphTargets:function(){}}),Fn.prototype=Object.create(V.prototype),Fn.prototype.constructor=Fn,Fn.prototype.isLineBasicMaterial=!0,Fn.prototype.copy=function(e){return V.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},Yu=new D,Xu=new D,Zu=new O,Qu=new I,$u=new F,In.prototype=Object.assign(Object.create(j.prototype),{constructor:In,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++)Yu.fromBufferAttribute(t,r-1),Xu.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=Yu.distanceTo(Xu);e.setAttribute(`lineDistance`,new K(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(),$u.copy(n.boundingSphere),$u.applyMatrix4(r),$u.radius+=i,e.ray.intersectsSphere($u)!==!1){Zu.getInverse(r),Qu.copy(e.ray).applyMatrix4(Zu);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new D,c=new D,l=new D,u=new D,d=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var f=n.index,p=n.attributes.position.array;if(f!==null)for(var m=f.array,h=0,g=m.length-1;h<g;h+=d){var _=m[h],v=m[h+1];s.fromArray(p,_*3),c.fromArray(p,v*3);var y=Qu.distanceSqToSegment(s,c,u,l);if(!(y>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:h,face:null,faceIndex:null,object:this})}}else for(var h=0,g=p.length/3-1;h<g;h+=d){s.fromArray(p,3*h),c.fromArray(p,3*h+3);var y=Qu.distanceSqToSegment(s,c,u,l);if(!(y>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:h,face:null,faceIndex:null,object:this})}}}else if(n.isGeometry)for(var x=n.vertices,S=x.length,h=0;h<S-1;h+=d){var y=Qu.distanceSqToSegment(x[h],x[h+1],u,l);if(!(y>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:h,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)}}),ed=new D,td=new D,Ln.prototype=Object.assign(Object.create(In.prototype),{constructor:Ln,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)ed.fromBufferAttribute(t,r),td.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+ed.distanceTo(td);e.setAttribute(`lineDistance`,new K(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)ed.copy(a[r]),td.copy(a[r+1]),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+ed.distanceTo(td);return this}}),Rn.prototype=Object.assign(Object.create(In.prototype),{constructor:Rn,isLineLoop:!0}),zn.prototype=Object.create(V.prototype),zn.prototype.constructor=zn,zn.prototype.isPointsMaterial=!0,zn.prototype.copy=function(e){return V.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},nd=new O,rd=new I,id=new F,ad=new D,Bn.prototype=Object.assign(Object.create(j.prototype),{constructor:Bn,isPoints:!0,raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(n.boundingSphere===null&&n.computeBoundingSphere(),id.copy(n.boundingSphere),id.applyMatrix4(r),id.radius+=i,e.ray.intersectsSphere(id)!==!1){nd.getInverse(r),rd.copy(e.ray).applyMatrix4(nd);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.position.array;if(s!==null)for(var l=s.array,u=0,d=l.length;u<d;u++){var f=l[u];ad.fromArray(c,f*3),Vn(ad,f,o,r,e,t,this)}else for(var u=0,p=c.length/3;u<p;u++)ad.fromArray(c,u*3),Vn(ad,u,o,r,e,t,this)}else for(var m=n.vertices,u=0,p=m.length;u<p;u++)Vn(m[u],u,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)}}),Hn.prototype=Object.assign(Object.create(S.prototype),{constructor:Hn,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Un.prototype=Object.create(S.prototype),Un.prototype.constructor=Un,Un.prototype.isCompressedTexture=!0,Wn.prototype=Object.create(S.prototype),Wn.prototype.constructor=Wn,Wn.prototype.isCanvasTexture=!0,Gn.prototype=Object.create(S.prototype),Gn.prototype.constructor=Gn,Gn.prototype.isDepthTexture=!0,Kn.prototype=Object.create(q.prototype),Kn.prototype.constructor=Kn,qn.prototype=Object.create(J.prototype),qn.prototype.constructor=qn,Jn.prototype=Object.create(q.prototype),Jn.prototype.constructor=Jn,Yn.prototype=Object.create(J.prototype),Yn.prototype.constructor=Yn,Xn.prototype=Object.create(q.prototype),Xn.prototype.constructor=Xn,Zn.prototype=Object.create(J.prototype),Zn.prototype.constructor=Zn,Qn.prototype=Object.create(Xn.prototype),Qn.prototype.constructor=Qn,$n.prototype=Object.create(J.prototype),$n.prototype.constructor=$n,er.prototype=Object.create(Xn.prototype),er.prototype.constructor=er,tr.prototype=Object.create(J.prototype),tr.prototype.constructor=tr,nr.prototype=Object.create(Xn.prototype),nr.prototype.constructor=nr,rr.prototype=Object.create(J.prototype),rr.prototype.constructor=rr,ir.prototype=Object.create(Xn.prototype),ir.prototype.constructor=ir,ar.prototype=Object.create(J.prototype),ar.prototype.constructor=ar,or.prototype=Object.create(q.prototype),or.prototype.constructor=or,or.prototype.toJSON=function(){var e=q.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},sr.prototype=Object.create(J.prototype),sr.prototype.constructor=sr,cr.prototype=Object.create(q.prototype),cr.prototype.constructor=cr,lr.prototype=Object.create(J.prototype),lr.prototype.constructor=lr,ur.prototype=Object.create(q.prototype),ur.prototype.constructor=ur,od={triangulate:function(e,t,n){n=n||2;var r=t&&t.length,i=r?t[0]*n:e.length,a=dr(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;var s,c,l,u,d,f,p;if(r&&(a=vr(e,t,a,n)),e.length>80*n){s=l=e[0],c=u=e[1];for(var m=n;m<i;m+=n)d=e[m],f=e[m+1],d<s&&(s=d),f<c&&(c=f),d>l&&(l=d),f>u&&(u=f);p=Math.max(l-s,u-c),p=p===0?0:1/p}return pr(a,o,n,s,c,p),o}},sd={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 sd.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];Hr(e),Ur(n,e);var a=e.length;t.forEach(Hr);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,Ur(n,t[o]);for(var s=od.triangulate(n,r),o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}},Wr.prototype=Object.create(J.prototype),Wr.prototype.constructor=Wr,Wr.prototype.toJSON=function(){var e=J.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return Kr(t,n,e)},Gr.prototype=Object.create(q.prototype),Gr.prototype.constructor=Gr,Gr.prototype.toJSON=function(){var e=q.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return Kr(t,n,e)},cd={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 b(a,o),new b(s,c),new b(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],d=t[r*3+2],f=t[i*3],p=t[i*3+1],m=t[i*3+2],h=t[a*3],g=t[a*3+1],_=t[a*3+2];return Math.abs(s-u)<.01?[new b(o,1-c),new b(l,1-d),new b(f,1-m),new b(h,1-_)]:[new b(s,1-c),new b(u,1-d),new b(p,1-m),new b(g,1-_)]}},qr.prototype=Object.create(J.prototype),qr.prototype.constructor=qr,Jr.prototype=Object.create(Gr.prototype),Jr.prototype.constructor=Jr,Yr.prototype=Object.create(J.prototype),Yr.prototype.constructor=Yr,Xr.prototype=Object.create(q.prototype),Xr.prototype.constructor=Xr,Zr.prototype=Object.create(J.prototype),Zr.prototype.constructor=Zr,Qr.prototype=Object.create(q.prototype),Qr.prototype.constructor=Qr,$r.prototype=Object.create(J.prototype),$r.prototype.constructor=$r,ei.prototype=Object.create(q.prototype),ei.prototype.constructor=ei,ti.prototype=Object.create(J.prototype),ti.prototype.constructor=ti,ti.prototype.toJSON=function(){var e=J.prototype.toJSON.call(this),t=this.parameters.shapes;return ri(t,e)},ni.prototype=Object.create(q.prototype),ni.prototype.constructor=ni,ni.prototype.toJSON=function(){var e=q.prototype.toJSON.call(this),t=this.parameters.shapes;return ri(t,e)},ii.prototype=Object.create(q.prototype),ii.prototype.constructor=ii,ai.prototype=Object.create(J.prototype),ai.prototype.constructor=ai,oi.prototype=Object.create(q.prototype),oi.prototype.constructor=oi,si.prototype=Object.create(ai.prototype),si.prototype.constructor=si,ci.prototype=Object.create(oi.prototype),ci.prototype.constructor=ci,li.prototype=Object.create(J.prototype),li.prototype.constructor=li,ui.prototype=Object.create(q.prototype),ui.prototype.constructor=ui,ld=Object.freeze({__proto__:null,WireframeGeometry:Kn,ParametricGeometry:qn,ParametricBufferGeometry:Jn,TetrahedronGeometry:Zn,TetrahedronBufferGeometry:Qn,OctahedronGeometry:$n,OctahedronBufferGeometry:er,IcosahedronGeometry:tr,IcosahedronBufferGeometry:nr,DodecahedronGeometry:rr,DodecahedronBufferGeometry:ir,PolyhedronGeometry:Yn,PolyhedronBufferGeometry:Xn,TubeGeometry:ar,TubeBufferGeometry:or,TorusKnotGeometry:sr,TorusKnotBufferGeometry:cr,TorusGeometry:lr,TorusBufferGeometry:ur,TextGeometry:qr,TextBufferGeometry:Jr,SphereGeometry:Yr,SphereBufferGeometry:Xr,RingGeometry:Zr,RingBufferGeometry:Qr,PlaneGeometry:Te,PlaneBufferGeometry:Ee,LatheGeometry:$r,LatheBufferGeometry:ei,ShapeGeometry:ti,ShapeBufferGeometry:ni,ExtrudeGeometry:Wr,ExtrudeBufferGeometry:Gr,EdgesGeometry:ii,ConeGeometry:si,ConeBufferGeometry:ci,CylinderGeometry:ai,CylinderBufferGeometry:oi,CircleGeometry:li,CircleBufferGeometry:ui,BoxGeometry:eu,BoxBufferGeometry:tu}),di.prototype=Object.create(V.prototype),di.prototype.constructor=di,di.prototype.isShadowMaterial=!0,di.prototype.copy=function(e){return V.prototype.copy.call(this,e),this.color.copy(e.color),this},fi.prototype=Object.create(ge.prototype),fi.prototype.constructor=fi,fi.prototype.isRawShaderMaterial=!0,pi.prototype=Object.create(V.prototype),pi.prototype.constructor=pi,pi.prototype.isMeshStandardMaterial=!0,pi.prototype.copy=function(e){return V.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},mi.prototype=Object.create(pi.prototype),mi.prototype.constructor=mi,mi.prototype.isMeshPhysicalMaterial=!0,mi.prototype.copy=function(e){return pi.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 z).copy(e.sheen):this.sheen=null,this.transparency=e.transparency,this},hi.prototype=Object.create(V.prototype),hi.prototype.constructor=hi,hi.prototype.isMeshPhongMaterial=!0,hi.prototype.copy=function(e){return V.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},gi.prototype=Object.create(V.prototype),gi.prototype.constructor=gi,gi.prototype.isMeshToonMaterial=!0,gi.prototype.copy=function(e){return V.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},_i.prototype=Object.create(V.prototype),_i.prototype.constructor=_i,_i.prototype.isMeshNormalMaterial=!0,_i.prototype.copy=function(e){return V.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},vi.prototype=Object.create(V.prototype),vi.prototype.constructor=vi,vi.prototype.isMeshLambertMaterial=!0,vi.prototype.copy=function(e){return V.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},yi.prototype=Object.create(V.prototype),yi.prototype.constructor=yi,yi.prototype.isMeshMatcapMaterial=!0,yi.prototype.copy=function(e){return V.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},bi.prototype=Object.create(Fn.prototype),bi.prototype.constructor=bi,bi.prototype.isLineDashedMaterial=!0,bi.prototype.copy=function(e){return Fn.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this},ud=Object.freeze({__proto__:null,ShadowMaterial:di,SpriteMaterial:Dn,RawShaderMaterial:fi,ShaderMaterial:ge,PointsMaterial:zn,MeshPhysicalMaterial:mi,MeshStandardMaterial:pi,MeshPhongMaterial:hi,MeshToonMaterial:gi,MeshNormalMaterial:_i,MeshLambertMaterial:vi,MeshDepthMaterial:dn,MeshDistanceMaterial:fn,MeshBasicMaterial:re,MeshMatcapMaterial:yi,LineDashedMaterial:bi,LineBasicMaterial:Fn,Material:V}),dd={arraySlice:function(e,t,n){return dd.isTypedArray(e)?new e.constructor(e.subarray(t,n===void 0?e.length:n)):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(t,n){return e[t]-e[n]}for(var n=e.length,r=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=[],d=[],f=0;f<c.times.length;++f){var p=c.times[f]*i;if(!(p<n||p>=r)){u.push(c.times[f]);for(var m=0;m<l;++m)d.push(c.values[f*l+m])}}u.length!==0&&(c.times=dd.convertArray(u,c.times.constructor),c.values=dd.convertArray(d,c.values.constructor),o.push(c))}a.tracks=o;for(var h=1/0,s=0;s<a.tracks.length;++s)h>a.tracks[s].times[0]&&(h=a.tracks[s].times[0]);for(var s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*h);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(e){return e.name===s.name&&e.ValueTypeName===c});if(l!==void 0){var u=s.getValueSize(),d=s.times.length-1,f;if(a<=s.times[0])f=dd.arraySlice(s.values,0,s.valueSize);else if(a>=s.times[d]){var p=d*u;f=dd.arraySlice(s.values,p)}else{var m=s.createInterpolant();m.evaluate(a),f=m.resultBuffer}c===`quaternion`&&new E(f[0],f[1],f[2],f[3]).normalize().conjugate().toArray(f);for(var h=l.times.length,g=0;g<h;++g){var _=g*u;if(c===`quaternion`)E.multiplyQuaternionsFlat(l.values,_,f,0,l.values,_);else for(var v=0;v<u;++v)l.values[_+v]-=f[v]}}}}return e.blendMode=Qs,e}},Object.assign(xi.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];validate_interval:{seek:{var a;linear_scan:{forward_scan:if(!(e<r)){for(var o=n+2;;){if(r===void 0){if(e<i)break forward_scan;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 seek}a=t.length;break linear_scan}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 seek}a=n,n=0;break linear_scan}break validate_interval}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 Error(`call to abstract method`)},intervalChanged_:function(){}}),Object.assign(xi.prototype,{beforeStart_:xi.prototype.copySampleValue_,afterEnd_:xi.prototype.copySampleValue_}),Si.prototype=Object.assign(Object.create(xi.prototype),{constructor:Si,DefaultSettings_:{endingStart:Js,endingEnd:Js},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 Ys:i=e,o=2*t-n;break;case Xs: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 Ys:a=e,s=2*n-t;break;case Xs: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,d=this._weightPrev,f=this._weightNext,p=(n-t)/(r-t),m=p*p,h=m*p,g=-d*h+2*d*m-d*p,_=(1+d)*h+(-1.5-2*d)*m+(-.5+d)*p+1,v=(-1-f)*h+(1.5+f)*m+.5*p,y=f*h-f*m,b=0;b!==o;++b)i[b]=g*a[l+b]+_*a[c+b]+v*a[s+b]+y*a[u+b];return i}}),Ci.prototype=Object.assign(Object.create(xi.prototype),{constructor:Ci,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,d=0;d!==o;++d)i[d]=a[c+d]*u+a[s+d]*l;return i}}),wi.prototype=Object.assign(Object.create(xi.prototype),{constructor:wi,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(Ti,{toJSON:function(e){var t=e.constructor,n;if(t.toJSON!==void 0)n=t.toJSON(e);else{n={name:e.name,times:dd.convertArray(e.times,Array),values:dd.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(n.interpolation=r)}return n.type=e.ValueTypeName,n}}),Object.assign(Ti.prototype,{constructor:Ti,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Ks,InterpolantFactoryMethodDiscrete:function(e){return new wi(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Ci(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Si(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case Gs:t=this.InterpolantFactoryMethodDiscrete;break;case Ks:t=this.InterpolantFactoryMethodLinear;break;case qs: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 Error(n);return console.warn(`THREE.KeyframeTrack:`,n),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Gs;case this.InterpolantFactoryMethodLinear:return Ks;case this.InterpolantFactoryMethodSmooth:return qs}},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=dd.arraySlice(n,i,a),this.values=dd.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&&dd.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=dd.arraySlice(this.times),t=dd.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===qs,i=1,a=e.length-1,o=1;o<a;++o){var s=!1,c=e[o];if(c!==e[o+1]&&(o!==1||c!==c[0]))if(r)s=!0;else for(var l=o*n,u=l-n,d=l+n,f=0;f!==n;++f){var p=t[l+f];if(p!==t[u+f]||p!==t[d+f]){s=!0;break}}if(s){if(o!==i){e[i]=e[o];for(var m=o*n,h=i*n,f=0;f!==n;++f)t[h+f]=t[m+f]}++i}}if(a>0){e[i]=e[a];for(var m=a*n,h=i*n,f=0;f!==n;++f)t[h+f]=t[m+f];++i}return i===e.length?(this.times=e,this.values=t):(this.times=dd.arraySlice(e,0,i),this.values=dd.arraySlice(t,0,i*n)),this},clone:function(){var e=dd.arraySlice(this.times,0),t=dd.arraySlice(this.values,0),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}),Ei.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Ei,ValueTypeName:`bool`,ValueBufferType:Array,DefaultInterpolation:Gs,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Di.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Di,ValueTypeName:`color`}),Oi.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Oi,ValueTypeName:`number`}),ki.prototype=Object.assign(Object.create(xi.prototype),{constructor:ki,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)E.slerpFlat(i,0,a,s-o,a,s,c);return i}}),Ai.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Ai,ValueTypeName:`quaternion`,DefaultInterpolation:Ks,InterpolantFactoryMethodLinear:function(e){return new ki(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),ji.prototype=Object.assign(Object.create(Ti.prototype),{constructor:ji,ValueTypeName:`string`,ValueBufferType:Array,DefaultInterpolation:Gs,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Mi.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Mi,ValueTypeName:`vector`}),Object.assign(Ni,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(Fi(n[i]).scale(r));return new Ni(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(Ti.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=dd.getKeyframeOrder(s);s=dd.sortedArray(s,1,l),c=dd.sortedArray(c,1,l),!r&&s[0]===0&&(s.push(i),c.push(c[0])),a.push(new Oi(`.morphTargetInfluences[`+t[o].name+`]`,s,c).scale(1/n))}return new Ni(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 d=[];for(var l in r)d.push(Ni.CreateFromMorphTargetSequence(l,r[l],t,n));return d},parseAnimation:function(e,t){if(!e)return console.error(`THREE.AnimationClip: No animation in JSONLoader data.`),null;for(var n=function(e,t,n,r,i){if(n.length!==0){var a=[],o=[];dd.flattenJSON(n,a,o,r),a.length!==0&&i.push(new e(t,a,o))}},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 d={},f=0;f<u.length;f++)if(u[f].morphTargets)for(var p=0;p<u[f].morphTargets.length;p++)d[u[f].morphTargets[p]]=-1;for(var m in d){for(var h=[],g=[],p=0;p!==u[f].morphTargets.length;++p){var _=u[f];h.push(_.time),g.push(+(_.morphTarget===m))}r.push(new Oi(`.morphTargetInfluence[`+m+`]`,h,g))}a=d.length*(o||1)}else{var v=`.bones[`+t[l].name+`]`;n(Mi,v+`.position`,u,`pos`,r),n(Ai,v+`.quaternion`,u,`rot`,r),n(Mi,v+`.scale`,u,`scl`,r)}}return r.length===0?null:new Ni(i,a,r,s)}}),Object.assign(Ni.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 Ni(this.name,this.duration,e,this.blendMode)}}),fd={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={}}},pd=new Ii,Object.assign(Li.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}}),md={},Ri.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ri,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=fd.get(e);if(a!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;if(md[e]!==void 0){md[e].push({onLoad:t,onProgress:n,onError:r});return}var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],c=!!o[2],l=o[3];l=decodeURIComponent(l),c&&(l=atob(l));try{var u,d=(this.responseType||``).toLowerCase();switch(d){case`arraybuffer`:case`blob`:for(var f=new Uint8Array(l.length),p=0;p<l.length;p++)f[p]=l.charCodeAt(p);u=d===`blob`?new Blob([f.buffer],{type:s}):f.buffer;break;case`document`:u=new DOMParser().parseFromString(l,s);break;case`json`:u=JSON.parse(l);break;default:u=l;break}setTimeout(function(){t&&t(u),i.manager.itemEnd(e)},0)}catch(t){setTimeout(function(){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)},0)}}else{md[e]=[],md[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var h in m.open(`GET`,e,!0),m.addEventListener(`load`,function(t){var n=this.response,r=md[e];if(delete md[e],this.status===200||this.status===0){this.status===0&&console.warn(`THREE.FileLoader: HTTP Status 0 received.`),fd.add(e,n);for(var a=0,o=r.length;a<o;a++){var s=r[a];s.onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(var a=0,o=r.length;a<o;a++){var s=r[a];s.onError&&s.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}},!1),m.addEventListener(`progress`,function(t){for(var n=md[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}},!1),m.addEventListener(`error`,function(t){var n=md[e];delete md[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),m.addEventListener(`abort`,function(t){var n=md[e];delete md[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),this.responseType!==void 0&&(m.responseType=this.responseType),this.withCredentials!==void 0&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(this.mimeType===void 0?`text/plain`:this.mimeType),this.requestHeader)m.setRequestHeader(h,this.requestHeader[h]);m.send(null)}return i.manager.itemStart(e),m},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this}}),zi.prototype=Object.assign(Object.create(Li.prototype),{constructor:zi,load:function(e,t,n,r){var i=this,a=new Ri(i.manager);a.setPath(i.path),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=Ni.parse(e[n]);t.push(r)}return t}}),Bi.prototype=Object.assign(Object.create(Li.prototype),{constructor:Bi,load:function(e,t,n,r){var i=this,a=[],o=new Un;o.image=a;var s=new Ri(this.manager);s.setPath(this.path),s.setResponseType(`arraybuffer`);function c(c){s.load(e[c],function(e){var n=i.parse(e,!0);a[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,l===6&&(n.mipmapCount===1&&(o.minFilter=Ko),o.format=n.format,o.needsUpdate=!0,t&&t(o))},n,r)}if(Array.isArray(e))for(var l=0,u=0,d=e.length;u<d;++u)c(u);else s.load(e,function(e){var n=i.parse(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){a[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;n.mipmapCount===1&&(o.minFilter=Ko),o.format=n.format,o.needsUpdate=!0,t&&t(o)},n,r);return o}}),Vi.prototype=Object.assign(Object.create(Li.prototype),{constructor:Vi,load:function(e,t,n,r){var i=this,a=new xe,o=new Ri(this.manager);return o.setResponseType(`arraybuffer`),o.setPath(this.path),o.load(e,function(e){var n=i.parse(e);n&&(n.image===void 0?n.data!==void 0&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data):a.image=n.image,a.wrapS=n.wrapS===void 0?Vo:n.wrapS,a.wrapT=n.wrapT===void 0?Vo:n.wrapT,a.magFilter=n.magFilter===void 0?Ko:n.magFilter,a.minFilter=n.minFilter===void 0?Ko:n.minFilter,a.anisotropy=n.anisotropy===void 0?1:n.anisotropy,n.format!==void 0&&(a.format=n.format),n.type!==void 0&&(a.type=n.type),n.mipmaps!==void 0&&(a.mipmaps=n.mipmaps,a.minFilter=Jo),n.mipmapCount===1&&(a.minFilter=Ko),a.needsUpdate=!0,t&&t(a,n))},n,r),a}}),Hi.prototype=Object.assign(Object.create(Li.prototype),{constructor:Hi,load:function(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=fd.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),fd.add(e,this),t&&t(this),i.manager.itemEnd(e)}function c(t){o.removeEventListener(`load`,s,!1),o.removeEventListener(`error`,c,!1),r&&r(t),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}}),Ui.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ui,load:function(e,t,n,r){var i=new Re,a=new Hi(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],function(e){i.images[n]=e,o++,o===6&&(i.needsUpdate=!0,t&&t(i))},void 0,r)}for(var c=0;c<e.length;++c)s(c);return i}}),Wi.prototype=Object.assign(Object.create(Li.prototype),{constructor:Wi,load:function(e,t,n,r){var i=new S,a=new Hi(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(n){i.image=n,i.format=e.search(/\\.jpe?g($|\\?)/i)>0||e.search(/^data\\:image\\/jpeg/)===0?$o:es,i.needsUpdate=!0,t!==void 0&&t(i)},n,r),i}}),Object.assign(Y.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){for(var n=this.getLengths(),r=0,i=n.length,a=t||e*n[i-1],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]-l,d=(a-l)/u;return(r+d)/(i-1)},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 b:new D);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 D,r=[],i=[],a=[],o=new D,s=new O,c,l,u;for(c=0;c<=e;c++)l=c/e,r[c]=this.getTangentAt(l,new D),r[c].normalize();i[0]=new D,a[0]=new D;var d=Number.MAX_VALUE,f=Math.abs(r[0].x),p=Math.abs(r[0].y),m=Math.abs(r[0].z);for(f<=d&&(d=f,n.set(1,0,0)),p<=d&&(d=p,n.set(0,1,0)),m<=d&&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(X.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(X.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}}),Gi.prototype=Object.create(Y.prototype),Gi.prototype.constructor=Gi,Gi.prototype.isEllipseCurve=!0,Gi.prototype.getPoint=function(e,t){for(var n=t||new b,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&&(i=a?0:r),this.aClockwise===!0&&!a&&(i===r?i=-r: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),d=s-this.aX,f=c-this.aY;s=d*l-f*u+this.aX,c=d*u+f*l+this.aY}return n.set(s,c)},Gi.prototype.copy=function(e){return Y.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},Gi.prototype.toJSON=function(){var e=Y.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},Gi.prototype.fromJSON=function(e){return Y.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},Ki.prototype=Object.create(Gi.prototype),Ki.prototype.constructor=Ki,Ki.prototype.isArcCurve=!0,hd=new D,gd=new qi,_d=new qi,vd=new qi,Ji.prototype=Object.create(Y.prototype),Ji.prototype.constructor=Ji,Ji.prototype.isCatmullRomCurve3=!0,Ji.prototype.getPoint=function(e,t){var n=t||new D,r=this.points,i=r.length,a=(i-+!this.closed)*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,d;if(this.closed||o>0?c=r[(o-1)%i]:(hd.subVectors(r[0],r[1]).add(r[0]),c=hd),l=r[o%i],u=r[(o+1)%i],this.closed||o+2<i?d=r[(o+2)%i]:(hd.subVectors(r[i-1],r[i-2]).add(r[i-1]),d=hd),this.curveType===`centripetal`||this.curveType===`chordal`){var f=this.curveType===`chordal`?.5:.25,p=Math.pow(c.distanceToSquared(l),f),m=Math.pow(l.distanceToSquared(u),f),h=Math.pow(u.distanceToSquared(d),f);m<1e-4&&(m=1),p<1e-4&&(p=m),h<1e-4&&(h=m),gd.initNonuniformCatmullRom(c.x,l.x,u.x,d.x,p,m,h),_d.initNonuniformCatmullRom(c.y,l.y,u.y,d.y,p,m,h),vd.initNonuniformCatmullRom(c.z,l.z,u.z,d.z,p,m,h)}else this.curveType===`catmullrom`&&(gd.initCatmullRom(c.x,l.x,u.x,d.x,this.tension),_d.initCatmullRom(c.y,l.y,u.y,d.y,this.tension),vd.initCatmullRom(c.z,l.z,u.z,d.z,this.tension));return n.set(gd.calc(s),_d.calc(s),vd.calc(s)),n},Ji.prototype.copy=function(e){Y.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},Ji.prototype.toJSON=function(){var e=Y.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},Ji.prototype.fromJSON=function(e){Y.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 D().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},aa.prototype=Object.create(Y.prototype),aa.prototype.constructor=aa,aa.prototype.isCubicBezierCurve=!0,aa.prototype.getPoint=function(e,t){var n=t||new b,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},aa.prototype.copy=function(e){return Y.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},aa.prototype.toJSON=function(){var e=Y.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},aa.prototype.fromJSON=function(e){return Y.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},oa.prototype=Object.create(Y.prototype),oa.prototype.constructor=oa,oa.prototype.isCubicBezierCurve3=!0,oa.prototype.getPoint=function(e,t){var n=t||new D,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},oa.prototype.copy=function(e){return Y.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},oa.prototype.toJSON=function(){var e=Y.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},oa.prototype.fromJSON=function(e){return Y.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},sa.prototype=Object.create(Y.prototype),sa.prototype.constructor=sa,sa.prototype.isLineCurve=!0,sa.prototype.getPoint=function(e,t){var n=t||new b;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},sa.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},sa.prototype.getTangent=function(e,t){var n=t||new b,n=n.copy(this.v2).sub(this.v1).normalize();return n},sa.prototype.copy=function(e){return Y.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},sa.prototype.toJSON=function(){var e=Y.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},sa.prototype.fromJSON=function(e){return Y.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},ca.prototype=Object.create(Y.prototype),ca.prototype.constructor=ca,ca.prototype.isLineCurve3=!0,ca.prototype.getPoint=function(e,t){var n=t||new D;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},ca.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},ca.prototype.copy=function(e){return Y.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},ca.prototype.toJSON=function(){var e=Y.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},ca.prototype.fromJSON=function(e){return Y.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},la.prototype=Object.create(Y.prototype),la.prototype.constructor=la,la.prototype.isQuadraticBezierCurve=!0,la.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,a=this.v2;return n.set($i(e,r.x,i.x,a.x),$i(e,r.y,i.y,a.y)),n},la.prototype.copy=function(e){return Y.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},la.prototype.toJSON=function(){var e=Y.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},la.prototype.fromJSON=function(e){return Y.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},ua.prototype=Object.create(Y.prototype),ua.prototype.constructor=ua,ua.prototype.isQuadraticBezierCurve3=!0,ua.prototype.getPoint=function(e,t){var n=t||new D,r=this.v0,i=this.v1,a=this.v2;return n.set($i(e,r.x,i.x,a.x),$i(e,r.y,i.y,a.y),$i(e,r.z,i.z,a.z)),n},ua.prototype.copy=function(e){return Y.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},ua.prototype.toJSON=function(){var e=Y.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},ua.prototype.fromJSON=function(e){return Y.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},da.prototype=Object.create(Y.prototype),da.prototype.constructor=da,da.prototype.isSplineCurve=!0,da.prototype.getPoint=function(e,t){var n=t||new b,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(Yi(o,s.x,c.x,l.x,u.x),Yi(o,s.y,c.y,l.y,u.y)),n},da.prototype.copy=function(e){Y.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},da.prototype.toJSON=function(){var e=Y.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},da.prototype.fromJSON=function(e){Y.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 b().fromArray(r))}return this},yd=Object.freeze({__proto__:null,ArcCurve:Ki,CatmullRomCurve3:Ji,CubicBezierCurve:aa,CubicBezierCurve3:oa,EllipseCurve:Gi,LineCurve:sa,LineCurve3:ca,QuadraticBezierCurve:la,QuadraticBezierCurve3:ua,SplineCurve:da}),fa.prototype=Object.assign(Object.create(Y.prototype),{constructor:fa,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 sa(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){Y.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=Y.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){Y.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 yd[r.type]().fromJSON(r))}return this}}),pa.prototype=Object.assign(Object.create(fa.prototype),{constructor:pa,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 sa(this.currentPoint.clone(),new b(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,r){var i=new la(this.currentPoint.clone(),new b(e,t),new b(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(e,t,n,r,i,a){var o=new aa(this.currentPoint.clone(),new b(e,t),new b(n,r),new b(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this},splineThru:function(e){var t=new da([this.currentPoint.clone()].concat(e));return this.curves.push(t),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 Gi(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 fa.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=fa.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return fa.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),ma.prototype=Object.assign(Object.create(pa.prototype),{constructor:ma,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){pa.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=pa.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){pa.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 pa().fromJSON(r))}return this}}),ha.prototype=Object.assign(Object.create(j.prototype),{constructor:ha,isLight:!0,copy:function(e){return j.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=j.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}}),ga.prototype=Object.assign(Object.create(ha.prototype),{constructor:ga,isHemisphereLight:!0,copy:function(e){return ha.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(_a.prototype,{_projScreenMatrix:new O,_lightPositionWorld:new D,_lookTarget:new D,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}}),va.prototype=Object.assign(Object.create(_a.prototype),{constructor:va,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=X.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()),_a.prototype.updateMatrices.call(this,e)}}),ya.prototype=Object.assign(Object.create(ha.prototype),{constructor:ya,isSpotLight:!0,copy:function(e){return ha.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}}),ba.prototype=Object.assign(Object.create(_a.prototype),{constructor:ba,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)}}),xa.prototype=Object.assign(Object.create(ha.prototype),{constructor:xa,isPointLight:!0,copy:function(e){return ha.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Sa.prototype=Object.assign(Object.create(_e.prototype),{constructor:Sa,isOrthographicCamera:!0,copy:function(e,t){return _e.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=j.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}}),Ca.prototype=Object.assign(Object.create(_a.prototype),{constructor:Ca,isDirectionalLightShadow:!0,updateMatrices:function(e){_a.prototype.updateMatrices.call(this,e)}}),wa.prototype=Object.assign(Object.create(ha.prototype),{constructor:wa,isDirectionalLight:!0,copy:function(e){return ha.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Ta.prototype=Object.assign(Object.create(ha.prototype),{constructor:Ta,isAmbientLight:!0}),Ea.prototype=Object.assign(Object.create(ha.prototype),{constructor:Ea,isRectAreaLight:!0,copy:function(e){return ha.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=ha.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Object.assign(Da.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],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t},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(Da,{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)}}),Oa.prototype=Object.assign(Object.create(ha.prototype),{constructor:Oa,isLightProbe:!0,copy:function(e){return ha.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=ha.prototype.toJSON.call(this,e);return t.object.sh=this.sh.toArray(),t}}),ka.prototype=Object.assign(Object.create(Li.prototype),{constructor:ka,load:function(e,t,n,r){var i=this,a=new Ri(i.manager);a.setPath(i.path),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)},parse:function(e){var t=this.textures;function n(e){return t[e]===void 0&&console.warn(`THREE.MaterialLoader: Undefined texture`,e),t[e]}var r=new ud[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 z().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 z().setHex(a.value);break;case`v2`:r.uniforms[i].value=new b().fromArray(a.value);break;case`v3`:r.uniforms[i].value=new D().fromArray(a.value);break;case`v4`:r.uniforms[i].value=new C().fromArray(a.value);break;case`m3`:r.uniforms[i].value=new x().fromArray(a.value);case`m4`:r.uniforms[i].value=new O().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 b().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 b().fromArray(e.clearcoatNormalScale)),r},setTextures:function(e){return this.textures=e,this}}),bd={decodeText:function(e){if(typeof TextDecoder<`u`)return new TextDecoder().decode(e);for(var t=``,n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf(`/`);return t===-1?`./`:e.substr(0,t+1)}},Aa.prototype=Object.assign(Object.create(q.prototype),{constructor:Aa,isInstancedBufferGeometry:!0,copy:function(e){return q.prototype.copy.call(this,e),this.instanceCount=e.instanceCount,this},clone:function(){return new this.constructor().copy(this)},toJSON:function(){var e=q.prototype.toJSON.call(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}),ja.prototype=Object.assign(Object.create(H.prototype),{constructor:ja,isInstancedBufferAttribute:!0,copy:function(e){return H.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=H.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),Ma.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ma,load:function(e,t,n,r){var i=this,a=new Ri(i.manager);a.setPath(i.path),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)},parse:function(e){var t=e.isInstancedBufferGeometry?new Aa:new q,n=e.data.index;if(n!==void 0){var r=new xd[n.type](n.array);t.setIndex(new H(r,1))}var i=e.data.attributes;for(var a in i){var o=i[a],r=new xd[o.type](o.array),s=new(o.isInstancedBufferAttribute?ja:H)(r,o.itemSize,o.normalized);o.name!==void 0&&(s.name=o.name),t.setAttribute(a,s)}var c=e.data.morphAttributes;if(c)for(var a in c){for(var l=c[a],u=[],d=0,f=l.length;d<f;d++){var o=l[d],r=new xd[o.type](o.array),s=new H(r,o.itemSize,o.normalized);o.name!==void 0&&(s.name=o.name),u.push(s)}t.morphAttributes[a]=u}e.data.morphTargetsRelative&&(t.morphTargetsRelative=!0);var p=e.data.groups||e.data.drawcalls||e.data.offsets;if(p!==void 0)for(var d=0,m=p.length;d!==m;++d){var h=p[d];t.addGroup(h.start,h.count,h.materialIndex)}var g=e.data.boundingSphere;if(g!==void 0){var _=new D;g.center!==void 0&&_.fromArray(g.center),t.boundingSphere=new F(_,g.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}}),xd={Int8Array,Uint8Array,Uint8ClampedArray:typeof Uint8ClampedArray<`u`?Uint8ClampedArray:Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array},Na.prototype=Object.assign(Object.create(Li.prototype),{constructor:Na,load:function(e,t,n,r){var i=this,a=this.path===``?bd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new Ri(i.manager);o.setPath(this.path),o.load(e,function(n){var a=null;try{a=JSON.parse(n)}catch(t){r!==void 0&&r(t),console.error(`THREE:ObjectLoader: Can't parse `+e+`.`,t.message);return}var o=a.metadata;if(o===void 0||o.type===void 0||o.type.toLowerCase()===`geometry`){console.error(`THREE.ObjectLoader: Can't load `+e);return}i.parse(a,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 ma().fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(e!==void 0)for(var r=new Ma,i=0,a=e.length;i<a;i++){var o,s=e[i];switch(s.type){case`PlaneGeometry`:case`PlaneBufferGeometry`:o=new ld[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case`BoxGeometry`:case`BoxBufferGeometry`:case`CubeGeometry`:o=new ld[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case`CircleGeometry`:case`CircleBufferGeometry`:o=new ld[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case`CylinderGeometry`:case`CylinderBufferGeometry`:o=new ld[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 ld[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case`SphereGeometry`:case`SphereBufferGeometry`:o=new ld[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 ld[s.type](s.radius,s.detail);break;case`RingGeometry`:case`RingBufferGeometry`:o=new ld[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case`TorusGeometry`:case`TorusBufferGeometry`:o=new ld[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case`TorusKnotGeometry`:case`TorusKnotBufferGeometry`:o=new ld[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case`TubeGeometry`:case`TubeBufferGeometry`:o=new ld[s.type](new yd[s.path.type]().fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case`LatheGeometry`:case`LatheBufferGeometry`:o=new ld[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case`PolyhedronGeometry`:case`PolyhedronBufferGeometry`:o=new ld[s.type](s.vertices,s.indices,s.radius,s.details);break;case`ShapeGeometry`:case`ShapeBufferGeometry`:for(var c=[],l=0,u=s.shapes.length;l<u;l++){var d=t[s.shapes[l]];c.push(d)}o=new ld[s.type](c,s.curveSegments);break;case`ExtrudeGeometry`:case`ExtrudeBufferGeometry`:for(var c=[],l=0,u=s.shapes.length;l<u;l++){var d=t[s.shapes[l]];c.push(d)}var f=s.options.extrudePath;f!==void 0&&(s.options.extrudePath=new yd[f.type]().fromJSON(f)),o=new ld[s.type](c,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 ka;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=Ni.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(e){return n.manager.itemStart(e),a.load(e,function(){n.manager.itemEnd(e)},void 0,function(){n.manager.itemError(e),n.manager.itemEnd(e)})}if(e!==void 0&&e.length>0){var a=new Hi(new Ii(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var c=e[o],l=c.url;if(Array.isArray(l)){r[c.uuid]=[];for(var u=0,d=l.length;u<d;u++){var f=l[u],p=/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(f)?f:n.resourcePath+f;r[c.uuid].push(i(p))}}else{var p=/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(c.url)?c.url:n.resourcePath+c.url;r[c.uuid]=i(p)}}}return r},parseTextures:function(e,t){function n(e,t){return typeof e==`number`?e:(console.warn(`THREE.ObjectLoader.parseTexture: Constant should be in numeric form.`,e),t[e])}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])?new Re(t[o.image]):new S(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,Sd)),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],Cd),s.wrapT=n(o.wrap[1],Cd)),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,wd)),o.magFilter!==void 0&&(s.magFilter=n(o.magFilter,wd)),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(e){return t[e]===void 0&&console.warn(`THREE.ObjectLoader: Undefined geometry`,e),t[e]}function a(e){if(e!==void 0){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];n[a]===void 0&&console.warn(`THREE.ObjectLoader: Undefined material`,a),t.push(n[a])}return t}return n[e]===void 0&&console.warn(`THREE.ObjectLoader: Undefined material`,e),n[e]}}switch(e.type){case`Scene`:r=new M,e.background!==void 0&&Number.isInteger(e.background)&&(r.background=new z(e.background)),e.fog!==void 0&&(e.fog.type===`Fog`?r.fog=new wn(e.fog.color,e.fog.near,e.fog.far):e.fog.type===`FogExp2`&&(r.fog=new Cn(e.fog.color,e.fog.density)));break;case`PerspectiveCamera`:r=new ve(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 Sa(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 Ta(e.color,e.intensity);break;case`DirectionalLight`:r=new wa(e.color,e.intensity);break;case`PointLight`:r=new xa(e.color,e.intensity,e.distance,e.decay);break;case`RectAreaLight`:r=new Ea(e.color,e.intensity,e.width,e.height);break;case`SpotLight`:r=new ya(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case`HemisphereLight`:r=new ga(e.color,e.groundColor,e.intensity);break;case`LightProbe`:r=new Oa().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 de(o,s);break;case`InstancedMesh`:var o=i(e.geometry),s=a(e.material),c=e.count,l=e.instanceMatrix;r=new Pn(o,s,c),r.instanceMatrix=new H(new Float32Array(l.array),16);break;case`LOD`:r=new An;break;case`Line`:r=new In(i(e.geometry),a(e.material),e.mode);break;case`LineLoop`:r=new Rn(i(e.geometry),a(e.material));break;case`LineSegments`:r=new Ln(i(e.geometry),a(e.material));break;case`PointCloud`:case`Points`:r=new Bn(i(e.geometry),a(e.material));break;case`Sprite`:r=new On(a(e.material));break;case`Group`:r=new vn;break;default:r=new j}if(r.uuid=e.uuid,e.name!==void 0&&(r.name=e.name),e.matrix===void 0?(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)):(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.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,d=0;d<u.length;d++)r.add(this.parseObject(u[d],t,n));if(e.type===`LOD`){e.autoUpdate!==void 0&&(r.autoUpdate=e.autoUpdate);for(var f=e.levels,p=0;p<f.length;p++){var m=f[p],h=r.getObjectByProperty(`uuid`,m.object);h!==void 0&&r.addLevel(h,m.distance)}}return r}}),Sd={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},Cd={RepeatWrapping:Bo,ClampToEdgeWrapping:Vo,MirroredRepeatWrapping:Ho},wd={NearestFilter:Uo,NearestMipmapNearestFilter:Wo,NearestMipmapLinearFilter:Go,LinearFilter:Ko,LinearMipmapNearestFilter:qo,LinearMipmapLinearFilter:Jo},Pa.prototype=Object.assign(Object.create(Li.prototype),{constructor:Pa,setOptions:function(e){return this.options=e,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=fd.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(e){return e.blob()}).then(function(e){return i.options===void 0?createImageBitmap(e):createImageBitmap(e,i.options)}).then(function(n){fd.add(e,n),t&&t(n),i.manager.itemEnd(e)}).catch(function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}),i.manager.itemStart(e)}}),Object.assign(Fa.prototype,{moveTo:function(e,t){return this.currentPath=new pa,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(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=new ma;a.curves=i.curves,t.push(a)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=t[i],s=t[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=t[a],c=-c,s=t[i],l=-l),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var u=l*(e.x-o.x)-c*(e.y-o.y);if(u===0)return!0;if(u<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var i=sd.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 ma,c.curves=s.curves,l.push(c),l;var u=!i(a[0].getPoints());u=e?!u:u;var d=[],f=[],p=[],m=0,h;f[m]=void 0,p[m]=[];for(var g=0,_=a.length;g<_;g++)s=a[g],h=s.getPoints(),o=i(h),o=e?!o:o,o?(!u&&f[m]&&m++,f[m]={s:new ma,p:h},f[m].s.curves=s.curves,u&&m++,p[m]=[]):p[m].push({h:s,p:h[0]});if(!f[0])return n(a);if(f.length>1){for(var v=!1,y=[],b=0,x=f.length;b<x;b++)d[b]=[];for(var b=0,x=f.length;b<x;b++)for(var S=p[b],C=0;C<S.length;C++){for(var w=S[C],T=!0,E=0;E<f.length;E++)r(w.p,f[E].p)&&(b!==E&&y.push({froms:b,tos:E,hole:C}),T?(T=!1,d[E].push(w)):v=!0);T&&d[b].push(w)}y.length>0&&(v||(p=d))}for(var D,g=0,O=f.length;g<O;g++){c=f[g].s,l.push(c),D=p[g];for(var k=0,A=D.length;k<A;k++)c.holes.push(D[k].h)}return l}}),Object.assign(Ia.prototype,{isFont:!0,generateShapes:function(e,t){t===void 0&&(t=100);for(var n=[],r=La(e,t,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),za.prototype=Object.assign(Object.create(Li.prototype),{constructor:za,load:function(e,t,n,r){var i=this,a=new Ri(this.manager);a.setPath(this.path),a.load(e,function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn(`THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.`),n=JSON.parse(e.substring(65,e.length-2))}var r=i.parse(n);t&&t(r)},n,r)},parse:function(e){return new Ia(e)}}),Ed={getContext:function(){return Td===void 0&&(Td=new(window.AudioContext||window.webkitAudioContext)),Td},setContext:function(e){Td=e}},Ba.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ba,load:function(e,t,n,r){var i=this,a=new Ri(i.manager);a.setResponseType(`arraybuffer`),a.setPath(i.path),a.load(e,function(n){try{var a=n.slice(0);Ed.getContext().decodeAudioData(a,function(e){t(e)})}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}}),Va.prototype=Object.assign(Object.create(Oa.prototype),{constructor:Va,isHemisphereLightProbe:!0,copy:function(e){return Oa.prototype.copy.call(this,e),this},toJSON:function(e){return Oa.prototype.toJSON.call(this,e)}}),Ha.prototype=Object.assign(Object.create(Oa.prototype),{constructor:Ha,isAmbientLightProbe:!0,copy:function(e){return Oa.prototype.copy.call(this,e),this},toJSON:function(e){return Oa.prototype.toJSON.call(this,e)}}),Dd=new O,Od=new O,Object.assign(Ua.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n=e.projectionMatrix.clone(),r=t.eyeSep/2,i=r*t.near/t.focus,a=t.near*Math.tan(X.DEG2RAD*t.fov*.5)/t.zoom,o,s;Od.elements[12]=-r,Dd.elements[12]=r,o=-a*t.aspect+i,s=a*t.aspect+i,n.elements[0]=2*t.near/(s-o),n.elements[8]=(s+o)/(s-o),this.cameraL.projectionMatrix.copy(n),o=-a*t.aspect-i,s=a*t.aspect-i,n.elements[0]=2*t.near/(s-o),n.elements[8]=(s+o)/(s-o),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Od),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Dd)}}),Object.assign(Wa.prototype,{start:function(){this.startTime=(typeof performance>`u`?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>`u`?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}),kd=new D,Ad=new E,jd=new D,Md=new D,Ga.prototype=Object.assign(Object.create(j.prototype),{constructor:Ga,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.context.destination):(this.gain.disconnect(this.filter),this.filter.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){j.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(kd,Ad,jd),Md.set(0,0,-1).applyQuaternion(Ad),t.positionX){var r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(kd.x,r),t.positionY.linearRampToValueAtTime(kd.y,r),t.positionZ.linearRampToValueAtTime(kd.z,r),t.forwardX.linearRampToValueAtTime(Md.x,r),t.forwardY.linearRampToValueAtTime(Md.y,r),t.forwardZ.linearRampToValueAtTime(Md.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(kd.x,kd.y,kd.z),t.setOrientation(Md.x,Md.y,Md.z,n.x,n.y,n.z)}}),Ka.prototype=Object.assign(Object.create(j.prototype),{constructor:Ka,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.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}}),Nd=new D,Pd=new E,Fd=new D,Id=new D,qa.prototype=Object.assign(Object.create(Ka.prototype),{constructor:qa,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(j.prototype.updateMatrixWorld.call(this,e),!(this.hasPlaybackControl===!0&&this.isPlaying===!1)){this.matrixWorld.decompose(Nd,Pd,Fd),Id.set(0,0,1).applyQuaternion(Pd);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Nd.x,n),t.positionY.linearRampToValueAtTime(Nd.y,n),t.positionZ.linearRampToValueAtTime(Nd.z,n),t.orientationX.linearRampToValueAtTime(Id.x,n),t.orientationY.linearRampToValueAtTime(Id.y,n),t.orientationZ.linearRampToValueAtTime(Id.z,n)}else t.setPosition(Nd.x,Nd.y,Nd.z),t.setOrientation(Id.x,Id.y,Id.z)}}}),Object.assign(Ja.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(Ya.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){E.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){var a=this._workIndex*i;E.multiplyQuaternionsFlat(e,a,e,t,e,n),E.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}}}),Ld=`\\\\[\\\\]\\\\.:\\\\/`,Rd=RegExp(`[`+Ld+`]`,`g`),zd=`[^`+Ld+`]`,Bd=`[^`+Ld.replace(`\\\\.`,``)+`]`,Vd=`((?:WC+[\\\\/:])*)`.replace(`WC`,zd),Hd=`(WCOD+)?`.replace(`WCOD`,Bd),Ud=`(?:\\\\.(WC+)(?:\\\\[(.+)\\\\])?)?`.replace(`WC`,zd),Wd=`\\\\.(WC+)(?:\\\\[(.+)\\\\])?`.replace(`WC`,zd),Gd=RegExp(`^`+Vd+Hd+Ud+Wd+`$`),Kd=[`material`,`materials`,`bones`],Object.assign(Xa.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()}}),Object.assign(Za,{Composite:Xa,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Za.Composite(e,t,n):new Za(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\\s/g,`_`).replace(Rd,``)},parseTrackName:function(e){var t=Gd.exec(e);if(!t)throw 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);Kd.indexOf(i)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(n.propertyName===null||n.propertyName.length===0)throw 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(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===t||i.uuid===t)return i;var a=r(i.children);if(a)return a}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(Za.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=Za.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?e.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate):l=this.Versioning.NeedsUpdate;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(Za.prototype,{_getValue_unbound:Za.prototype.getValue,_setValue_unbound:Za.prototype.setValue}),Object.assign(Qa.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 d=arguments[l],f=d.uuid,p=r[f];if(p===void 0){p=t++,r[f]=p,e.push(d);for(var m=0,h=s;m!==h;++m)o[m].push(new Za(d,i[m],a[m]))}else if(p<n){c=e[p];var g=--n,_=e[g];r[_.uuid]=p,e[p]=_,r[f]=g,e[g]=d;for(var m=0,h=s;m!==h;++m){var v=o[m],y=v[g],b=v[p];v[p]=y,b===void 0&&(b=new Za(d,i[m],a[m])),v[g]=b}}else e[p]!==c&&console.error(`THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.`)}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,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++,d=e[u];n[d.uuid]=l,e[l]=d,n[c]=u,e[u]=s;for(var f=0,p=i;f!==p;++f){var m=r[f],h=m[u],g=m[l];m[l]=h,m[u]=g}}}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].uuid,l=r[c];if(l!==void 0)if(delete r[c],l<n){var u=--n,d=e[u],f=--t,p=e[f];r[d.uuid]=l,e[l]=d,r[p.uuid]=u,e[u]=p,e.pop();for(var m=0,h=a;m!==h;++m){var g=i[m],_=g[u],v=g[f];g[l]=_,g[u]=v,g.pop()}}else{var f=--t,p=e[f];r[p.uuid]=l,e[l]=p,e.pop();for(var m=0,h=a;m!==h;++m){var g=i[m];g[l]=g[f],g.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=Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(var d=l,f=s.length;d!==f;++d){var p=s[d];u[d]=new Za(p,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()}}}),Object.assign($a.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 Qs:for(var u=0,d=c.length;u!==d;++u)c[u].evaluate(o),l[u].accumulateAdditive(s);break;case Zs:default:for(var u=0,d=c.length;u!==d;++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===Ws;if(e===0)return i===-1?t:a&&(i&1)==1?n-t:t;if(r===2200){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));handle_stop:{if(t>=n)t=n;else if(t<0)t=0;else{this.time=t;break handle_stop}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=Ys,r.endingEnd=Ys):(e?r.endingStart=this.zeroSlopeAtStart?Ys:Js:r.endingStart=Xs,t?r.endingEnd=this.zeroSlopeAtEnd?Ys:Js:r.endingEnd=Xs)},_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}}),eo.prototype=Object.assign(Object.create(y.prototype),{constructor:eo,_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 d=r[u],f=d.name,p=l[f];if(p!==void 0)a[u]=p;else{if(p=a[u],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,s,f));continue}var m=t&&t._propertyBindings[u].binding.parsedPath;p=new Ya(Za.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,s,f),a[u]=p}o[u].resultBuffer=p.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,d=(e._localRoot||this._root).uuid;delete u[d],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 Ci(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`?Ni.findByName(r,e):e,o=a===null?e:a.uuid,s=this._actionsByClip[o],c=null;if(n===void 0&&(n=a===null?Zs:a.blendMode),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 $a(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`?Ni.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return o===void 0?null:o.actionByRoot[r]||null},stopAllAction:function(){for(var e=this._actions,t=this._nActiveActions-1;t>=0;--t)e[t].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)t[o]._update(r,e,i,a);for(var s=this._bindings,c=this._nActiveBindings,o=0;o!==c;++o)s[o].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,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[t];i!==void 0&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[t];if(a!==void 0)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),to.prototype.clone=function(){return new to(this.value.clone===void 0?this.value:this.value.clone())},no.prototype=Object.assign(Object.create(Tn.prototype),{constructor:no,isInstancedInterleavedBuffer:!0,copy:function(e){return Tn.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(ro.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 ao(e,this,r,t),r.sort(io),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++)ao(e[i],this,r,t);return r.sort(io),r}}),Object.assign(oo.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(X.clamp(t/this.radius,-1,1))),this}}),Object.assign(so.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}}),qd=new b,Object.assign(co.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=qd.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 b),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 b),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 b),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 b),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return qd.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Jd=new D,Yd=new D,Object.assign(lo.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 D),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 D),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 D),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){Jd.subVectors(e,this.start),Yd.subVectors(this.end,this.start);var n=Yd.dot(Yd),r=Yd.dot(Jd)/n;return t&&(r=X.clamp(r,0,1)),r},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 D),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)}}),uo.prototype=Object.create(j.prototype),uo.prototype.constructor=uo,uo.prototype.isImmediateRenderObject=!0,Xd=new D,fo.prototype=Object.create(j.prototype),fo.prototype.constructor=fo,fo.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},fo.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),Xd.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Xd),this.color===void 0?this.cone.material.color.copy(this.light.color):this.cone.material.color.set(this.color)},Zd=new D,Qd=new O,$d=new O,mo.prototype=Object.create(Ln.prototype),mo.prototype.constructor=mo,mo.prototype.isSkeletonHelper=!0,mo.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,r=n.getAttribute(`position`);$d.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<t.length;i++){var o=t[i];o.parent&&o.parent.isBone&&(Qd.multiplyMatrices($d,o.matrixWorld),Zd.setFromMatrixPosition(Qd),r.setXYZ(a,Zd.x,Zd.y,Zd.z),Qd.multiplyMatrices($d,o.parent.matrixWorld),Zd.setFromMatrixPosition(Qd),r.setXYZ(a+1,Zd.x,Zd.y,Zd.z),a+=2)}n.getAttribute(`position`).needsUpdate=!0,j.prototype.updateMatrixWorld.call(this,e)},ho.prototype=Object.create(de.prototype),ho.prototype.constructor=ho,ho.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},ho.prototype.update=function(){this.color===void 0?this.material.color.copy(this.light.color):this.material.color.set(this.color)},ef=new D,tf=new z,nf=new z,go.prototype=Object.create(j.prototype),go.prototype.constructor=go,go.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},go.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`);tf.copy(this.light.color),nf.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?tf:nf;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(ef.setFromMatrixPosition(this.light.matrixWorld).negate())},_o.prototype=Object.assign(Object.create(Ln.prototype),{constructor:_o,copy:function(e){return Ln.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return new this.constructor().copy(this)}}),vo.prototype=Object.create(Ln.prototype),vo.prototype.constructor=vo,rf=new D,af=new D,of=new D,yo.prototype=Object.create(j.prototype),yo.prototype.constructor=yo,yo.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},yo.prototype.update=function(){rf.setFromMatrixPosition(this.light.matrixWorld),af.setFromMatrixPosition(this.light.target.matrixWorld),of.subVectors(af,rf),this.lightPlane.lookAt(af),this.color===void 0?(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)):(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)),this.targetLine.lookAt(af),this.targetLine.scale.z=of.length()},sf=new D,cf=new _e,bo.prototype=Object.create(Ln.prototype),bo.prototype.constructor=bo,bo.prototype.update=function(){var e=this.geometry,t=this.pointMap,n=1,r=1;cf.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),xo(`c`,t,e,cf,0,0,-1),xo(`t`,t,e,cf,0,0,1),xo(`n1`,t,e,cf,-n,-r,-1),xo(`n2`,t,e,cf,n,-r,-1),xo(`n3`,t,e,cf,-n,r,-1),xo(`n4`,t,e,cf,n,r,-1),xo(`f1`,t,e,cf,-n,-r,1),xo(`f2`,t,e,cf,n,-r,1),xo(`f3`,t,e,cf,-n,r,1),xo(`f4`,t,e,cf,n,r,1),xo(`u1`,t,e,cf,n*.7,r*1.1,-1),xo(`u2`,t,e,cf,-n*.7,r*1.1,-1),xo(`u3`,t,e,cf,0,r*2,-1),xo(`cf1`,t,e,cf,-n,0,1),xo(`cf2`,t,e,cf,n,0,1),xo(`cf3`,t,e,cf,0,-r,1),xo(`cf4`,t,e,cf,0,r,1),xo(`cn1`,t,e,cf,-n,0,-1),xo(`cn2`,t,e,cf,n,0,-1),xo(`cn3`,t,e,cf,0,-r,-1),xo(`cn4`,t,e,cf,0,r,-1),e.getAttribute(`position`).needsUpdate=!0},lf=new N,So.prototype=Object.create(Ln.prototype),So.prototype.constructor=So,So.prototype.update=function(e){if(e!==void 0&&console.warn(`THREE.BoxHelper: .update() has no longer arguments.`),this.object!==void 0&&lf.setFromObject(this.object),!lf.isEmpty()){var t=lf.min,n=lf.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()}},So.prototype.setFromObject=function(e){return this.object=e,this.update(),this},So.prototype.copy=function(e){return Ln.prototype.copy.call(this,e),this.object=e.object,this},So.prototype.clone=function(){return new this.constructor().copy(this)},Co.prototype=Object.create(Ln.prototype),Co.prototype.constructor=Co,Co.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),j.prototype.updateMatrixWorld.call(this,e))},wo.prototype=Object.create(In.prototype),wo.prototype.constructor=wo,wo.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),this.lookAt(this.plane.normal),j.prototype.updateMatrixWorld.call(this,e)},uf=new D,To.prototype=Object.create(j.prototype),To.prototype.constructor=To,To.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{uf.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(uf,t)}},To.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()},To.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},To.prototype.copy=function(e){return j.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},To.prototype.clone=function(){return new this.constructor().copy(this)},Eo.prototype=Object.create(Ln.prototype),Eo.prototype.constructor=Eo,pf=4,mf=8,hf=Math.pow(2,mf),gf=[.125,.215,.35,.446,.526,.582],_f=mf-pf+1+gf.length,vf=20,yf={[$s]:0,[ec]:1,[nc]:2,[ic]:3,[ac]:4,[oc]:5,[tc]:6},bf=new Sa,{_lodPlanes:xf,_sizeLods:Sf,_sigmas:Cf}=ko(),wf=null,Tf=(1+Math.sqrt(5))/2,Ef=1/Tf,Df=[new D(1,1,1),new D(-1,1,1),new D(1,1,-1),new D(-1,1,-1),new D(0,Tf,Ef),new D(0,Tf,-Ef),new D(Ef,0,Tf),new D(-Ef,0,Tf),new D(Tf,Ef,0),new D(-Tf,Ef,0)],Do.prototype={constructor:Do,fromScene:function(e,t=0,n=.1,r=100){wf=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=Uo,e.minFilter=Uo,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){wf=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=Po(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){this._equirectShader===null&&(this._equirectShader=No(),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<xf.length;e++)xf[e].dispose()},_cleanup:function(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(wf),e.scissorTest=!1,e.setSize(e.width,e.height)},_allocateTargets:function(e){var t={magFilter:Uo,minFilter:Uo,generateMipmaps:!1,type:Yo,format:ts,encoding:Oo(e)?e.encoding:nc,depthBuffer:!1,stencilBuffer:!1},n=Ao(t);return n.depthBuffer=!e,this._pingPongRenderTarget=Ao(t),n},_compileMaterial:function(e){var t=new de(xf[0],e);this._renderer.compile(t,bf)},_sceneToCubeUV:function(e,t,n,r){var i=new ve(90,1,t,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,c=s.outputEncoding,l=s.toneMapping,u=s.toneMappingExposure,d=s.getClearColor(),f=s.getClearAlpha();s.toneMapping=1,s.toneMappingExposure=1,s.outputEncoding=$s;var p=e.background;if(p&&p.isColor){p.convertSRGBToLinear();var m=Math.max(p.r,p.g,p.b),h=Math.min(Math.max(Math.ceil(Math.log2(m)),-128),127);p=p.multiplyScalar(Math.pow(2,-h));var g=(h+128)/255;s.setClearColor(p,g),e.background=null}for(var _=0;_<6;_++){var v=_%3;v==0?(i.up.set(0,a[_],0),i.lookAt(o[_],0,0)):v==1?(i.up.set(0,0,a[_]),i.lookAt(0,o[_],0)):(i.up.set(0,a[_],0),i.lookAt(0,0,o[_])),jo(r,v*hf,_>2?hf:0,hf,hf),s.setRenderTarget(r),s.render(e,i)}s.toneMapping=l,s.toneMappingExposure=u,s.outputEncoding=c,s.setClearColor(d,f)},_textureToCubeUV:function(e,t){var n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Po()):this._equirectShader==null&&(this._equirectShader=No());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new de(xf[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=yf[e.encoding],a.outputEncoding.value=yf[t.texture.encoding],jo(t,0,0,3*hf,2*hf),n.setRenderTarget(t),n.render(i,bf)},_applyPMREM:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;r<_f;r++){var i=Math.sqrt(Cf[r]*Cf[r]-Cf[r-1]*Cf[r-1]),a=Df[(r-1)%Df.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 de(xf[r],c),d=c.uniforms,f=Sf[n]-1,p=isFinite(i)?Math.PI/(2*f):2*Math.PI/(2*vf-1),m=i/p,h=isFinite(i)?1+Math.floor(l*m):vf;h>vf&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${h} samples when the maximum is set to ${vf}`);for(var g=[],_=0,v=0;v<vf;++v){var y=v/m,b=Math.exp(-y*y/2);g.push(b),v==0?_+=b:v<h&&(_+=2*b)}for(var v=0;v<g.length;v++)g[v]=g[v]/_;d.envMap.value=e.texture,d.samples.value=h,d.weights.value=g,d.latitudinal.value=a===`latitudinal`,o&&(d.poleAxis.value=o),d.dTheta.value=p,d.mipInt.value=mf-n,d.inputEncoding.value=yf[e.texture.encoding],d.outputEncoding.value=yf[e.texture.encoding];var x=Sf[r],y=3*Math.max(0,hf-2*x);jo(t,y,(r===0?0:2*hf)+2*x*(r>mf-pf?r-mf+pf:0),3*x,2*x),s.setRenderTarget(t),s.render(u,bf)}},Y.create=function(e,t){return console.log(`THREE.Curve.create() has been deprecated`),e.prototype=Object.create(Y.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(fa.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 J,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new D(i.x,i.y,i.z||0))}return t}}),Object.assign(pa.prototype,{fromPoints:function(e){return console.warn(`THREE.Path: .fromPoints() has been renamed to .setFromPoints().`),this.setFromPoints(e)}}),Lo.prototype=Object.create(Ji.prototype),Ro.prototype=Object.create(Ji.prototype),zo.prototype=Object.create(Ji.prototype),Object.assign(zo.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.`)}}),_o.prototype.setColors=function(){console.error(`THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.`)},mo.prototype.update=function(){console.error(`THREE.SkeletonHelper: update() no longer needs to be called.`)},Object.assign(Li.prototype,{extractUrlBase:function(e){return console.warn(`THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.`),bd.extractUrlBase(e)}}),Li.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(Na.prototype,{setTexturePath:function(e){return console.warn(`THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().`),this.setResourcePath(e)}}),Object.assign(co.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(N.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(F.prototype,{empty:function(){return console.warn(`THREE.Sphere: .empty() has been renamed to .isEmpty().`),this.isEmpty()}}),Se.prototype.setFromMatrix=function(e){return console.warn(`THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix().`),this.setFromProjectionMatrix(e)},lo.prototype.center=function(e){return console.warn(`THREE.Line3: .center() has been renamed to .getCenter().`),this.getCenter(e)},Object.assign(X,{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().`),X.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn(`THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo().`),X.ceilPowerOfTwo(e)}}),Object.assign(x.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(O.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 D().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)}}),L.prototype.isIntersectionLine=function(e){return console.warn(`THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().`),this.intersectsLine(e)},E.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(I.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(R.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(R,{barycoordFromPoint:function(e,t,n,r,i){return console.warn(`THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().`),R.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn(`THREE.Triangle: .normal() has been renamed to .getNormal().`),R.getNormal(e,t,n,r)}}),Object.assign(ma.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 Wr(this,e)},makeGeometry:function(e){return console.warn(`THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.`),new ti(this,e)}}),Object.assign(b.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(D.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(C.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(J.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(j.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(j.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(de.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(de.prototype,{drawMode:{get:function(){return console.error(`THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode.`),0},set:function(){console.error(`THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.`)}}}),Object.defineProperties(An.prototype,{objects:{get:function(){return console.warn(`THREE.LOD: .objects has been renamed to .levels.`),this.levels}}}),Object.defineProperty(Mn.prototype,`useVertexTexture`,{get:function(){console.warn(`THREE.Skeleton: useVertexTexture has been removed.`)},set:function(){console.warn(`THREE.Skeleton: useVertexTexture has been removed.`)}}),jn.prototype.initBones=function(){console.error(`THREE.SkinnedMesh: initBones() has been removed.`)},Object.defineProperty(Y.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}}),ve.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(ha.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(H.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===dc},set:function(){console.warn(`THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.`),this.setUsage(dc)}}}),Object.assign(H.prototype,{setDynamic:function(e){return console.warn(`THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.`),this.setUsage(e===!0?dc:uc),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(q.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 H(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(q.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(Aa.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(ro.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(Tn.prototype,{dynamic:{get:function(){return console.warn(`THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.`),this.usage===dc},set:function(e){console.warn(`THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.`),this.setUsage(e)}}}),Object.assign(Tn.prototype,{setDynamic:function(e){return console.warn(`THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.`),this.setUsage(e===!0?dc:uc),this},setArray:function(){console.error(`THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers`)}}),Object.assign(Gr.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(to.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(V.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 z}},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===1}},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(hi.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(ge.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(Sn.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(Sn.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?ec:$s}}}),Object.defineProperties(pn.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(w.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(Ka.prototype,{load:{value:function(e){console.warn(`THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.`);var t=this;return new Ba().load(e,function(e){t.setBuffer(e)}),this}},startTime:{set:function(){console.warn(`THREE.Audio: .startTime is now .play( delay ).`)}}}),Ja.prototype.getData=function(){return console.warn(`THREE.AudioAnalyser: .getData() is now .getFrequencyData().`),this.getFrequencyData()},ye.prototype.updateCubeMap=function(e,t){return console.warn(`THREE.CubeCamera: .updateCubeMap() is now .update().`),this.update(e,t)},hc.crossOrigin=void 0,hc.loadTexture=function(e,t,n,r){console.warn(`THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.`);var i=new Wi;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},hc.loadTextureCube=function(e,t,n,r){console.warn(`THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.`);var i=new Ui;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},hc.loadCompressedTexture=function(){console.error(`THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.`)},hc.loadCompressedTextureCube=function(){console.error(`THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.`)},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`register`,{detail:{revision:`117`}}))})),kf=e((()=>{Of()}));Of(),kf();function $(e,t,n){return function(r,i,a){return((r+e-1)/e|0)*((i+t-1)/t|0)*n*a}}function Af(e,t,n){return function(r,i,a){return(Math.max(r,e)*Math.max(i,t)/n|0)*a}}new Map([[rs,$(4,4,8)],[is,$(4,4,8)],[as,$(4,4,16)],[os,$(4,4,16)],[ds,$(4,4,8)],[ss,Af(8,8,2)],[ls,Af(8,8,2)],[cs,Af(16,8,4)],[us,Af(16,8,4)],[fs,$(4,4,8)],[ps,$(4,4,16)],[ms,$(4,4,16)],[ks,$(4,4,16)],[hs,$(5,4,16)],[As,$(5,4,16)],[gs,$(5,5,16)],[js,$(5,5,16)],[_s,$(6,5,16)],[Ms,$(6,5,16)],[vs,$(6,6,16)],[Ns,$(6,6,16)],[ys,$(8,5,16)],[Ps,$(8,5,16)],[bs,$(8,6,16)],[Fs,$(8,6,16)],[xs,$(8,8,16)],[Is,$(8,8,16)],[Ss,$(10,5,16)],[Ls,$(10,5,16)],[Cs,$(10,6,16)],[Rs,$(10,6,16)],[ws,$(10,8,16)],[zs,$(10,8,16)],[Ts,$(10,10,16)],[Bs,$(10,10,16)],[Es,$(12,10,16)],[Vs,$(12,10,16)],[Ds,$(12,12,16)],[Hs,$(12,12,16)],[Os,$(4,4,16)]]),Of();let jf=new O().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);new O().getInverse(jf);function Mf(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Nf(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Mf(a,r,i,o,s,`next`,e)}function s(e){Mf(a,r,i,o,s,`throw`,e)}o(void 0)})}}function Pf(){return Ff.apply(this,arguments)}function Ff(){return Ff=Nf(function*(e={}){var t,n=e,r=!1,i=!0,a=self.location.href;if(r||i){try{new URL(`.`,a).href}catch(e){}(function(){var e=Nf(function*(e){var t=yield fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});return function(t){return e.apply(this,arguments)}})()}console.log.bind(console),console.error.bind(console);var o=!1;function s(e){for(var t=0,n=e.length,r=new Uint8Array(n),i;t<n;++t)i=e.charCodeAt(t),r[t]=~i>>8&i;return r}var c,l,u=!1;function d(){var e=M.buffer;new Int8Array(e),new Int16Array(e),n.HEAPU8=l=new Uint8Array(e),new Uint16Array(e),new Int32Array(e),n.HEAPU32=new Uint32Array(e),n.HEAPF32=new Float32Array(e),new Float64Array(e),new BigInt64Array(e),new BigUint64Array(e)}function f(){if(n.preRun)for(typeof n.preRun==`function`&&(n.preRun=[n.preRun]);n.preRun.length;)T(n.preRun.shift());x(w)}function p(){u=!0,I.c()}function m(){if(n.postRun)for(typeof n.postRun==`function`&&(n.postRun=[n.postRun]);n.postRun.length;)C(n.postRun.shift());x(S)}var h;function g(){return s(`\\0asm\\0\\0\\0&\\`\\`}}\\`}\\`\\0\\`\\v\\0\\`\\0\\0\\x07aa\\0\\0\\b\\x07\\0\\0\\x07‚€€\\bA€Œ\\v\\x07b\\0c\\0\\x07d\\0e\\0f\\0\\f\n‘;\\x07T~@A€\\b(\\0\"­ \\0­B\\x07|Bøÿÿÿƒ|\"BÿÿÿÿX@ §\"\\0?\\0AtM\\r \\0\\0\\r\\vA„\\bA06\\0A\\vA€\\b \\x006\\0 \\v\\0 \\0 Atr\\vr \\0¼\"Aÿÿÿq!@ AvAÿq\"E\\r\\0 Að\\0M@ A€€€rAñ\\0 kv!\\f\\v AK@A€ø!A\\0!\\f\\v A\ntA€€\\x07k!\\v  AvA€€qr A\\rvr\\vß\\v\\b@ \\0E\\r\\0 \\0A\\bk\" \\0Ak(\\0\"Axq\"\\0j!@ Aq\\r\\0 AqE\\r  (\\0\"k\"A˜\\b(\\0I\\r \\0 j!\\0@@@Aœ\\b(\\0 G@ (\\f! AÿM@  (\\b\"G\\rAˆ\\bAˆ\\b(\\0A~ Avwq6\\0\\f\\v (!\\x07  G@ (\\b\" 6\\f  6\\b\\f\\v (\" Aj (\"E\\r Aj\\v!@ ! \"Aj! (\"\\r\\0 Aj! (\"\\r\\0\\v A\\x006\\0\\f\\v (\"AqAG\\rA\\b \\x006\\0  A~q6  \\0Ar6  \\x006\\0\\v  6\\f  6\\b\\f\\vA\\0!\\v \\x07E\\r\\0@ (\"At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ wq6\\0\\f\\v@  \\x07(F@ \\x07 6\\f\\v \\x07 6\\v E\\r\\v  \\x076 (\"@  6  6\\v (\"E\\r\\0  6  6\\v  O\\r\\0 (\"AqE\\r\\0@@@@ AqE@A\\xA0\\b(\\0 F@A\\xA0\\b 6\\0A”\\bA”\\b(\\0 \\0j\"\\x006\\0  \\0Ar6 Aœ\\b(\\0G\\rA\\bA\\x006\\0Aœ\\bA\\x006\\0\\vAœ\\b(\\0\"\\x07 F@Aœ\\b 6\\0A\\bA\\b(\\0 \\0j\"\\x006\\0  \\0Ar6 \\0 j \\x006\\0\\v Axq \\0j!\\0 (\\f! AÿM@ (\\b\" F@Aˆ\\bAˆ\\b(\\0A~ Avwq6\\0\\f\\v  6\\f  6\\b\\f\\v (!\\b  G@ (\\b\" 6\\f  6\\b\\f\\v (\" Aj (\"E\\r Aj\\v!@ ! \"Aj! (\"\\r\\0 Aj! (\"\\r\\0\\v A\\x006\\0\\f\\v  A~q6  \\0Ar6 \\0 j \\x006\\0\\f\\vA\\0!\\v \\bE\\r\\0@ (\"At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ wq6\\0\\f\\v@  \\b(F@ \\b 6\\f\\v \\b 6\\v E\\r\\v  \\b6 (\"@  6  6\\v (\"E\\r\\0  6  6\\v  \\0Ar6 \\0 j \\x006\\0  \\x07G\\r\\0A\\b \\x006\\0\\v \\0AÿM@ \\0AøqA°\\bj!Aˆ\\b(\\0\"A \\0Avt\"\\0qE@Aˆ\\b \\0 r6\\0 \\f\\v (\\b\\v!\\0  6\\b \\0 6\\f  6\\f  \\x006\\b\\vA! \\0Aÿÿÿ\\x07M@ \\0A& \\0A\\bvg\"kvAq AtrA>s!\\v  6 B\\x007 AtA¸\nj!@AŒ\\b(\\0\"A t\"qE@AŒ\\b  r6\\0  6\\0A!A\\b\\f\\v \\0A AvkA\\0 AG\\x1Bt! (\\0!@ \"(Axq \\0F\\r Av! At!  Aqj\"(\"\\r\\0\\v  6A! !A\\b\\v!\\0 \"\\f\\v (\\b\" 6\\f  6\\bA!\\0A\\b!A\\0\\v!  j 6\\0  6\\f \\0 j 6\\0A¨\\bA¨\\b(\\0Ak\"\\0A \\0\\x1B6\\0\\v\\v¸'\\v#\\0Ak\"\n$\\0@@@@@@@@@@ \\0AôM@Aˆ\\b(\\0\"A \\0A\\vjAøq \\0A\\vI\\x1B\"Av\"\\0v\"Aq@@ AsAq \\0j\"At\"A°\\bj\"\\0 (¸\\b\"(\\b\"F@Aˆ\\b A~ wq6\\0\\f\\v  \\x006\\f \\0 6\\b\\v A\\bj!\\0  Ar6  j\" (Ar6\\f\\v\\v A\\b(\\0\"\\bM\\r @@A \\0t\"A\\0 kr  \\0tqh\"At\"A°\\bj\" (¸\\b\"\\0(\\b\"F@Aˆ\\b A~ wq\"6\\0\\f\\v  6\\f  6\\b\\v \\0 Ar6 \\0 j\"\\x07  k\"Ar6 \\0 j 6\\0 \\b@ \\bAxqA°\\bj!Aœ\\b(\\0! A \\bAvt\"qE@Aˆ\\b  r6\\0 \\f\\v (\\b\\v!  6\\b  6\\f  6\\f  6\\b\\v \\0A\\bj!\\0Aœ\\b \\x076\\0A\\b 6\\0\\f\\v\\vAŒ\\b(\\0\"\\vE\\r \\vhAt(¸\n\"(Axq k! !@@ (\"\\0E@ (\"\\0E\\r\\v \\0(Axq k\"   I\"\\x1B! \\0  \\x1B! \\0!\\f\\v\\v (!  (\\f\"\\0G@ (\\b\" \\x006\\f \\0 6\\b\\f\n\\v (\" Aj (\"E\\r Aj\\v!@ !\\x07 \"\\0Aj! \\0(\"\\r\\0 \\0Aj! \\0(\"\\r\\0\\v \\x07A\\x006\\0\\f \\vA! \\0A¿K\\r\\0 \\0A\\vj\"Axq!AŒ\\b(\\0\"\\x07E\\r\\0A!\\bA\\0 k! \\0Aôÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtkA>j!\\b\\v@@@ \\bAt(¸\n\"E@A\\0!\\0\\f\\vA\\0!\\0 A \\bAvkA\\0 \\bAG\\x1Bt!@@ (Axq k\" O\\r\\0 ! \"\\r\\0A\\0! !\\0\\f\\v \\0 (\"   AvAqj(\"F\\x1B \\0 \\x1B!\\0 At! \\r\\0\\v\\v \\0 rE@A\\0!A \\bt\"\\0A\\0 \\0kr \\x07q\"\\0E\\r \\0hAt(¸\n!\\0\\v \\0E\\r\\v@ \\0(Axq k\" I!   \\x1B! \\0  \\x1B! \\0(\"  \\0(\\v\"\\0\\r\\0\\v\\v E\\r\\0 A\\b(\\0 kO\\r\\0 (!\\b  (\\f\"\\0G@ (\\b\" \\x006\\f \\0 6\\b\\f\\b\\v (\" Aj (\"E\\r Aj\\v!@ ! \"\\0Aj! \\0(\"\\r\\0 \\0Aj! \\0(\"\\r\\0\\v A\\x006\\0\\f\\x07\\v A\\b(\\0\"M@Aœ\\b(\\0!\\0@  k\"AO@ \\0 j\" Ar6 \\0 j 6\\0 \\0 Ar6\\f\\v \\0 Ar6 \\0 j\" (Ar6A\\0!A\\0!\\vA\\b 6\\0Aœ\\b 6\\0 \\0A\\bj!\\0\\f \\v A”\\b(\\0\"I@A”\\b  k\"6\\0A\\xA0\\bA\\xA0\\b(\\0\"\\0 j\"6\\0  Ar6 \\0 Ar6 \\0A\\bj!\\0\\f \\vA\\0!\\0 A/j\"Aà\\v(\\0@Aè\\v(\\0\\f\\vAì\\vB7\\0Aä\\vB€\\xA0€€€€7\\0Aà\\v \nA\\fjApqAتժs6\\0Aô\\vA\\x006\\0AÄ\\vA\\x006\\0A€ \\v\"j\"A\\0 k\"\\x07q\" M\\r\\bAÀ\\v(\\0\"@A¸\\v(\\0\"\\b j\" \\bM  Ir\\r \\v@AÄ\\v-\\0\\0AqE@@@@@A\\xA0\\b(\\0\"@AÈ\\v!\\0@ \\0(\\0\"\\b M@  \\b \\0(jI\\r\\v \\0(\\b\"\\0\\r\\0\\v\\vA\\0\"AF\\r !Aä\\v(\\0\"\\0Ak\" q@  k  jA\\0 \\0kqj!\\v  M\\rAÀ\\v(\\0\"\\0@A¸\\v(\\0\" j\"\\x07 M \\0 \\x07Ir\\r\\v \"\\0 G\\r\\f\\v  k \\x07q\"\" \\0(\\0 \\0(jF\\r !\\0\\v \\0AF\\r A0j M@ \\0!\\f\\vAè\\v(\\0\"  kjA\\0 kq\"AF\\r  j! \\0!\\f\\v AG\\r\\vAÄ\\vAÄ\\v(\\0Ar6\\0\\v \"AFA\\0\"\\0AFr \\0 Mr\\r \\0 k\" A(jM\\r\\vA¸\\vA¸\\v(\\0 j\"\\x006\\0A¼\\v(\\0 \\0I@A¼\\v \\x006\\0\\v@A\\xA0\\b(\\0\"@AÈ\\v!\\0@  \\0(\\0\" \\0(\"jF\\r \\0(\\b\"\\0\\r\\0\\v\\f\\vA˜\\b(\\0\"\\0A\\0 \\0 M\\x1BE@A˜\\b 6\\0\\vA\\0!\\0AÌ\\v 6\\0AÈ\\v 6\\0A¨\\bA6\\0A¬\\bAà\\v(\\x006\\0AÔ\\vA\\x006\\0@ \\0At\" A°\\bj\"6¸\\b  6¼\\b \\0Aj\"\\0A G\\r\\0\\vA”\\b A(k\"\\0Ax kA\\x07q\"k\"6\\0A\\xA0\\b  j\"6\\0  Ar6 \\0 jA(6A¤\\bAð\\v(\\x006\\0\\f\\v  M  Kr\\r \\0(\\fA\\bq\\r \\0  j6A\\xA0\\b Ax kA\\x07q\"\\0j\"6\\0A”\\bA”\\b(\\0 j\" \\0k\"\\x006\\0  \\0Ar6  jA(6A¤\\bAð\\v(\\x006\\0\\f\\vA\\0!\\0\\f\\vA\\0!\\0\\f\\vA˜\\b(\\0 K@A˜\\b 6\\0\\v  j!AÈ\\v!\\0@@  \\0(\\0\"G@ \\0(\\b\"\\0\\r\\f\\v\\v \\0-\\0\\fA\\bqE\\r\\vAÈ\\v!\\0@@ \\0(\\0\" M@   \\0(j\"I\\r\\v \\0(\\b!\\0\\f\\v\\vA”\\b A(k\"\\0Ax kA\\x07q\"k\"\\x076\\0A\\xA0\\b  j\"6\\0  \\x07Ar6 \\0 jA(6A¤\\bAð\\v(\\x006\\0  A' kA\\x07qjA/k\"\\0 \\0 AjI\\x1B\"A\\x1B6 AÐ\\v)\\x007 AÈ\\v)\\x007\\bAÐ\\v A\\bj6\\0AÌ\\v 6\\0AÈ\\v 6\\0AÔ\\vA\\x006\\0 Aj!\\0@ \\0A\\x076 \\0A\\bj \\0Aj!\\0 I\\r\\0\\v  F\\r\\0  (A~q6   k\"Ar6  6\\0 AÿM@ AøqA°\\bj!\\0Aˆ\\b(\\0\"A Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\fA\\f!A\\b\\f\\vA!\\0 Aÿÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtrA>s!\\0\\v  \\x006 B\\x007 \\0AtA¸\nj!@@AŒ\\b(\\0\"A \\0t\"qE@AŒ\\b  r6\\0  6\\0\\f\\v A \\0AvkA\\0 \\0AG\\x1Bt!\\0 (\\0!@ \"(Axq F\\r \\0Av! \\0At!\\0  Aqj\"(\"\\r\\0\\v  6\\v  6A\\b! \"!\\0A\\f\\f\\v (\\b\"\\0 6\\f  6\\b  \\x006\\bA\\0!\\0A!A\\f\\v j 6\\0  j \\x006\\0\\vA”\\b(\\0\"\\0 M\\r\\0A”\\b \\0 k\"6\\0A\\xA0\\bA\\xA0\\b(\\0\"\\0 j\"6\\0  Ar6 \\0 Ar6 \\0A\\bj!\\0\\f\\vA„\\bA06\\0A\\0!\\0\\f\\v \\0 6\\0 \\0 \\0( j6 Ax kA\\x07qj\"\\b Ar6 Ax kA\\x07qj\"  \\bj\"k!\\x07@A\\xA0\\b(\\0 F@A\\xA0\\b 6\\0A”\\bA”\\b(\\0 \\x07j\"\\x006\\0  \\0Ar6\\f\\vAœ\\b(\\0 F@Aœ\\b 6\\0A\\bA\\b(\\0 \\x07j\"\\x006\\0  \\0Ar6 \\0 j \\x006\\0\\f\\v (\"\\0AqAF@ \\0Axq! (\\f!@ \\0AÿM@ (\\b\" F@Aˆ\\bAˆ\\b(\\0A~ \\0Avwq6\\0\\f\\v  6\\f  6\\b\\f\\v (!@  G@ (\\b\"\\0 6\\f  \\x006\\b\\f\\v@ (\"\\0 Aj (\"\\0E\\r Aj\\v!@ ! \\0\"Aj! \\0(\"\\0\\r\\0 Aj! (\"\\0\\r\\0\\v A\\x006\\0\\f\\vA\\0!\\v E\\r\\0@ (\"\\0At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ \\0wq6\\0\\f\\v@  (F@  6\\f\\v  6\\v E\\r\\v  6 (\"\\0@  \\x006 \\0 6\\v (\"\\0E\\r\\0  \\x006 \\0 6\\v \\x07 j!\\x07  j\"(!\\0\\v  \\0A~q6  \\x07Ar6  \\x07j \\x076\\0 \\x07AÿM@ \\x07AøqA°\\bj!\\0Aˆ\\b(\\0\"A \\x07Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\f\\vA! \\x07Aÿÿÿ\\x07M@ \\x07A& \\x07A\\bvg\"\\0kvAq \\0AtrA>s!\\v  6 B\\x007 AtA¸\nj!\\0@@AŒ\\b(\\0\"A t\"qE@AŒ\\b  r6\\0 \\0 6\\0\\f\\v \\x07A AvkA\\0 AG\\x1Bt! \\0(\\0!@ \"\\0(Axq \\x07F\\r Av! At! \\0 Aqj\"(\"\\r\\0\\v  6\\v  \\x006  6\\f  6\\b\\f\\v \\0(\\b\" 6\\f \\0 6\\b A\\x006  \\x006\\f  6\\b\\v \\bA\\bj!\\0\\f\\v@ \\bE\\r\\0@ (\"At\"(¸\n F@ A¸\nj \\x006\\0 \\0\\rAŒ\\b \\x07A~ wq\"\\x076\\0\\f\\v@  \\b(F@ \\b \\x006\\f\\v \\b \\x006\\v \\0E\\r\\v \\0 \\b6 (\"@ \\0 6  \\x006\\v (\"E\\r\\0 \\0 6  \\x006\\v@ AM@   j\"\\0Ar6 \\0 j\"\\0 \\0(Ar6\\f\\v  Ar6  j\" Ar6  j 6\\0 AÿM@ AøqA°\\bj!\\0Aˆ\\b(\\0\"A Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\f\\vA!\\0 Aÿÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtrA>s!\\0\\v  \\x006 B\\x007 \\0AtA¸\nj!@@ \\x07A \\0t\"qE@AŒ\\b  \\x07r6\\0  6\\0  6\\f\\v A \\0AvkA\\0 \\0AG\\x1Bt!\\0 (\\0!@ \"(Axq F\\r \\0Av! \\0At!\\0  Aqj\"\\x07(\"\\r\\0\\v \\x07 6  6\\v  6\\f  6\\b\\f\\v (\\b\"\\0 6\\f  6\\b A\\x006  6\\f  \\x006\\b\\v A\\bj!\\0\\f\\v@ E\\r\\0@ (\"At\"(¸\n F@ A¸\nj \\x006\\0 \\0\\rAŒ\\b \\vA~ wq6\\0\\f\\v@  (F@ \\x006\\f\\v \\x006\\v \\0E\\r\\v \\0 6 (\"@ \\0 6  \\x006\\v (\"E\\r\\0 \\0 6  \\x006\\v@ AM@   j\"\\0Ar6 \\0 j\"\\0 \\0(Ar6\\f\\v  Ar6  j\" Ar6  j 6\\0 \\b@ \\bAxqA°\\bj!\\0Aœ\\b(\\0!A \\bAvt\"\\x07 qE@Aˆ\\b  \\x07r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\vAœ\\b 6\\0A\\b 6\\0\\v A\\bj!\\0\\v \nAj$\\0 \\0\\v™}\\vA\\0!\\0@ \\0 FE@  \\0A\\fl\"Aj\"j*\\0!\\f  A\\bj\"j*\\0!\\v  \\bj  j*\\0\"\\r8\\0 \\b j \\v8\\0 \\b j \\f8\\0 \\0At\"j  j\"#*\\x008\\0 \\0At\"Ar\"$At\" j  j\" *\\x008\\0 Ar\"%At\"!j  !j\"!*\\x008\\0 Ar\"&At\"\"j  \"j\"\"*\\x008\\0  \nj  j\"'*\\x008\\0 \n j  j\"*\\x008\\0 \n j  j*\\0\"8\\0 \\x07 \\0Atj\" \\v8\\b  \\f8  \\r8\\0   j-\\0\\0  $j-\\0\\0A\\btr  %j-\\0\\0Atr  &j-\\0\\0Atr6\\f *\\0! '*\\0! \"*\\0\"\\f \\f” !*\\0\"\\v \\v” #*\\0\" ” *\\0\"\\r \\r”’’’\"C\\0\\0\\0\\0^@ \\f ‘\"•!\\f \\r •!\\r  •! \\v •!\\v\\v   \\r \\f”\" \\v ”\"’\" ’”\" ” C\\0\\0€? \\v \\v”\" \\f \\f”\"’\" ’“”\" ”  \\r \\v”\" \\f ”\"“\" ’”\" ”’’C\\0\\0€@”   \\v \\f”\"\\x1B \\r ”\"“\"\\f \\f’”\"\\f”    ’\"\\v \\v’”\"\\v” C\\0\\0€? \\r \\r”\" ’\"\\r \\r’“”\"\\r ”’’C\\0\\0€@”6   C\\0\\0€?  ’\" ’“”\"”    “\" ’”\"”   \\x1B ’\" ’”\"”’’C\\0\\0€@” \\f \\f” \\v \\v” \\r \\r”’’C\\0\\0€@”6 A\\x006  \\f ” \\v ” \\r ”’’C\\0\\0€@”  ”  ”  ”’’C\\0\\0€@”6 \\0Aj!\\0\\f\\v\\v\\v\\0\\v\\v \\0A\\b\\v`)}function _(e){return e}function v(e,t){var n,r=_(e);return n=new WebAssembly.Module(r),[new WebAssembly.Instance(n,t),n]}function y(){return{a:P}}function b(){function e(e,t){return I=e.exports,N(I),d(),I}var t=y();return n.instantiateWasm?new Promise((r,i)=>{n.instantiateWasm(t,(t,n)=>{r(e(t,n))})}):(h!=null||(h=g()),e(v(h,t)[0]))}for(var x=e=>{for(;e.length>0;)e.shift()(n)},S=[],C=e=>S.push(e),w=[],T=e=>w.push(e),E=()=>2147483648,D=(e,t)=>Math.ceil(e/t)*t,O=e=>{var t=(e-M.buffer.byteLength+65535)/65536|0;try{return M.grow(t),d(),1}catch(e){}},k=e=>{var t=l.length;e>>>=0;var n=E();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),O(Math.min(n,D(Math.max(e,i),65536))))return!0}return!1},A=new Uint8Array(123),j=25;j>=0;--j)A[48+j]=52+j,A[65+j]=j,A[97+j]=26+j;if(A[43]=62,A[47]=63,n.noExitRuntime&&n.noExitRuntime,n.print&&n.print,n.printErr&&n.printErr,n.wasmBinary&&n.wasmBinary,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram,n.preInit)for(typeof n.preInit==`function`&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.shift()();var M;function N(e){n._pack=e.d,n._malloc=e.e,n._free=e.f,M=e.b,e.__indirect_function_table}var P={a:k};function F(){f();function e(){var e;n.calledRun=!0,!o&&(p(),c==null||c(n),(e=n.onRuntimeInitialized)==null||e.call(n),m())}n.setStatus?(n.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>n.setStatus(``),1),e()},1)):e()}var I=b();return F(),t=u?n:new Promise((e,t)=>{c=e}),t}),Ff.apply(this,arguments)}let If=new Float32Array(1),Lf=new Uint32Array(If.buffer),Rf=typeof Float16Array<`u`,zf=Rf?new Float16Array(1):null,Bf=Rf?new Uint16Array(zf.buffer):new Uint16Array(1);function Vf(e){if(Rf&&zf)return Bf[0]=e,zf[0];let t=e>>15&1,n=e>>10&31,r=e&1023,i;if(n===0)if(r===0)i=t<<31;else{let e=r,n=-14;for(;!(e&1024);)e<<=1,n--;e&=1023;let a=n+127,o=e<<13;i=t<<31|a<<23|o}else if(n===31)i=r===0?t<<31|2139095040:t<<31|2143289344;else{let e=n-15+127,a=r<<13;i=t<<31|e<<23|a}return Lf[0]=i,If[0]}var Hf=class{constructor({fileBytes:e}){this.fileBytes=e,this.chunks=[],this.totalBytes=0;let t=new DecompressionStream(`gzip`),n=new Blob([e]).stream().pipeThrough(t);this.reader=n.getReader()}read(e){return t(this,void 0,void 0,function*(){for(;this.totalBytes<e;){let{value:e,done:t}=yield this.reader.read();if(t)break;this.chunks.push(e),this.totalBytes+=e.length}if(this.totalBytes<e)throw Error(`Unexpected EOF: needed ${e}, got ${this.totalBytes}`);let t=new Uint8Array(this.totalBytes),n=0;for(let e of this.chunks)t.set(e,n),n+=e.length;let r=t.subarray(0,e);return this.chunks=[t.subarray(e)],this.totalBytes-=e,r})}},Uf=class{constructor({fileBytes:e}){this.version=-1,this.numSplats=0,this.shDegree=0,this.fractionalBits=0,this.flags=0,this.flagAntiAlias=!1,this.reserved=0,this.headerParsed=!1,this.parsed=!1,this.fileBytes=e instanceof ArrayBuffer?new Uint8Array(e):e,this.reader=new Hf({fileBytes:this.fileBytes})}parseHeader(){return t(this,void 0,void 0,function*(){if(this.headerParsed)throw Error(`SPZ file header already parsed`);let e=new DataView((yield this.reader.read(16)).buffer);if(e.getUint32(0,!0)!==1347635022)throw Error(`Invalid SPZ file`);if(this.version=e.getUint32(4,!0),this.version<1||this.version>3)throw Error(`Unsupported SPZ version: ${this.version}`);this.numSplats=e.getUint32(8,!0),this.shDegree=e.getUint8(12),this.fractionalBits=e.getUint8(13),this.flags=e.getUint8(14),this.flagAntiAlias=(this.flags&1)!=0,this.reserved=e.getUint8(15),this.headerParsed=!0,this.parsed=!1})}parseSplats(e,n,r,i,a,o){return t(this,void 0,void 0,function*(){if(!this.headerParsed)throw Error(`SPZ file header must be parsed first`);if(this.parsed)throw Error(`SPZ file already parsed`);if(this.parsed=!0,this.version===1){let t=yield this.reader.read(this.numSplats*3*2),n=new Uint16Array(t.buffer);for(let t=0;t<this.numSplats;t++){let r=t*3;e==null||e(t,Vf(n[r]),Vf(n[r+1]),Vf(n[r+2]))}}else if(this.version===2||this.version===3){let t=1<<this.fractionalBits,n=yield this.reader.read(this.numSplats*3*3);for(let r=0;r<this.numSplats;r++){let i=r*9,a=((n[i+2]<<24|n[i+1]<<16|n[i]<<8)>>8)/t,o=((n[i+5]<<24|n[i+4]<<16|n[i+3]<<8)>>8)/t,s=((n[i+8]<<24|n[i+7]<<16|n[i+6]<<8)>>8)/t;e==null||e(r,a,o,s)}}{let e=yield this.reader.read(this.numSplats);for(let t=0;t<this.numSplats;t++)n==null||n(t,e[t]/255)}{let e=yield this.reader.read(this.numSplats*3),t=.28209479177387814/.15;for(let n=0;n<this.numSplats;n++){let i=n*3;r==null||r(n,(e[i]/255-.5)*t+.5,(e[i+1]/255-.5)*t+.5,(e[i+2]/255-.5)*t+.5)}}{let e=yield this.reader.read(this.numSplats*3);for(let t=0;t<this.numSplats;t++){let n=t*3;i==null||i(t,Math.exp(e[n]/16-10),Math.exp(e[n+1]/16-10),Math.exp(e[n+2]/16-10))}}if(this.version===3){let e=1/Math.sqrt(2),t=yield this.reader.read(this.numSplats*4);for(let n=0;n<this.numSplats;n++){let r=n*4,i=[0,0,0,0],o=[t[r],t[r+1],t[r+2],t[r+3]],s=o[0]+(o[1]<<8)+(o[2]<<16)+(o[3]<<24),c=s>>>30,l=s,u=0;for(let t=3;t>=0;--t)if(t!==c){let n=l&511,r=l>>>9&1;l>>>=10,i[t]=n/511*e,i[t]=r===0?i[t]:-i[t],u+=i[t]*i[t]}i[c]=Math.sqrt(Math.max(1-u,0)),a==null||a(n,i[0],i[1],i[2],i[3])}}else{let e=yield this.reader.read(this.numSplats*3);for(let t=0;t<this.numSplats;t++){let n=t*3,r=e[n]/127.5-1,i=e[n+1]/127.5-1,o=e[n+2]/127.5-1,s=Math.sqrt(Math.max(0,1-r*r-i*i-o*o));a==null||a(t,r,i,o,s)}}if(o&&this.shDegree>=1){let e={1:3,2:8,3:15}[this.shDegree]||0,t=yield this.reader.read(this.numSplats*e*3),n=new Float32Array(9),r=this.shDegree>=2?new Float32Array(15):void 0,i=this.shDegree>=3?new Float32Array(21):void 0,a=0;for(let e=0;e<this.numSplats;e++){for(let e=0;e<9;++e)n[e]=(t[a+e]-128)/128;if(a+=9,r){for(let e=0;e<15;++e)r[e]=(t[a+e]-128)/128;a+=15}if(i){for(let e=0;e<21;++e)i[e]=(t[a+e]-128)/128;a+=21}o==null||o(e,new Float32Array(n),r?new Float32Array(r):void 0,i?new Float32Array(i):void 0)}}})}};function Wf(e){return t(this,void 0,void 0,function*(){let t=new Uf({fileBytes:e});yield t.parseHeader();let n=t.numSplats,r=new Float32Array(n*3),i=new Uint8Array(n*4),a=new Float32Array(n*3),o=new Float32Array(n*4),s,c,l;return t.shDegree>=1&&(s=new Float32Array(n*9)),t.shDegree>=2&&(c=new Float32Array(n*15)),t.shDegree>=3&&(l=new Float32Array(n*21)),yield t.parseSplats((e,t,n,i)=>{r[e*3]=t,r[e*3+1]=n,r[e*3+2]=i},(e,t)=>{i[e*4+3]=Math.round(t*255)},(e,t,n,r)=>{i[e*4]=Math.round(Math.max(0,Math.min(1,t))*255),i[e*4+1]=Math.round(Math.max(0,Math.min(1,n))*255),i[e*4+2]=Math.round(Math.max(0,Math.min(1,r))*255)},(e,t,n,r)=>{a[e*3]=t,a[e*3+1]=n,a[e*3+2]=r},(e,t,n,r,i)=>{o[e*4]=i,o[e*4+1]=t,o[e*4+2]=n,o[e*4+3]=r},(e,t,n,r)=>{s&&t&&s.set(t,e*9),c&&n&&c.set(n,e*15),l&&r&&l.set(r,e*21)}),{numPoints:n,shDegree:t.shDegree,positions:r,colors:i,scales:a,rotations:o,sh1:s,sh2:c,sh3:l}})}let Gf,Kf=!1;function qf(){return t(this,void 0,void 0,function*(){if(!Gf){for(;Kf;)yield new Promise(e=>setTimeout(e,0));Gf||(Kf=!0,Gf=yield Pf(),Kf=!1)}})}let Jf=0,Yf=0,Xf=0,Zf=0,Qf=0,$f=0,ep=0,tp=0,np=0,rp=0;function ip(e){let t=Math.pow(2,Math.ceil(Math.log2(Math.max(1,e))));t<=Jf||(Jf>0&&(Gf._free(Yf),Gf._free(Xf),Gf._free(Zf),Gf._free(Qf),Gf._free($f),Gf._free(ep),Gf._free(tp),Gf._free(np),Gf._free(rp)),Jf=t,Yf=Gf._malloc(3*t*4),Xf=Gf._malloc(4*t*4),Zf=Gf._malloc(3*t*4),Qf=Gf._malloc(4*t),$f=Gf._malloc(t),ep=Gf._malloc(8*t*4),tp=Gf._malloc(3*t*4),np=Gf._malloc(4*t*4),rp=Gf._malloc(3*t*4))}function ap(e,t,n,r,i){ip(e);let a=new Uint8Array(e);Gf.HEAPF32.set(t,Yf/4),Gf.HEAPF32.set(n,Xf/4),Gf.HEAPF32.set(r,Zf/4),Gf.HEAPU8.set(i,Qf),Gf.HEAPU8.set(a,$f),Gf._pack(!1,e,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp);let o=new Uint32Array(Gf.HEAPU32.buffer,ep,e*8);return new Uint32Array(o.slice().buffer)}typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope&&(self.onmessage=e=>t(void 0,void 0,void 0,function*(){var t;let{requestId:n,fileBytes:r}=e.data;if(!(r===void 0||n===void 0))try{let e=yield Wf(new Uint8Array(r));yield qf();let t=ap(e.numPoints,e.positions,e.rotations,e.scales,e.colors),i=Object.assign(Object.assign({},e),{packedData:t}),a=[t.buffer,e.positions.buffer,e.colors.buffer,e.scales.buffer,e.rotations.buffer];e.sh1&&a.push(e.sh1.buffer),e.sh2&&a.push(e.sh2.buffer),e.sh3&&a.push(e.sh3.buffer),self.postMessage({requestId:n,decoded:i},a)}catch(e){self.postMessage({requestId:n,error:(t=e==null?void 0:e.message)==null?String(e):t})}}))})();", cs = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", ss], { type: "text/javascript;charset=utf-8" });
8743
+ var ss = "(function(){var e=(e,t)=>()=>(e&&(t=e(e=0)),t);function t(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function n(...e){}function r(e){return typeof Symbol>`u`?`$Symbol<${e}>$`:Symbol(e)}r(`$$FIVE_EVENT$$`);let i=Date.now();typeof performance<`u`&&(typeof performance.timeOrigin==`number`?i=performance.timeOrigin:performance.timing!==void 0&&(i=performance.timing.navigationStart));let a=typeof performance<`u`?(()=>i+performance.now()):(()=>Date.now()),o=[/\\.([0-9a-z]+)\\.jsonp([\\?\\#].*)?$/i,/jsonp_([0-9a-z]+)([\\?\\#].*)?$/i],s=typeof location<`u`?location.href:``,c=/^https\\:/.test(s);var l=class extends Error{constructor(e,t,n){super(`[NETWORK]: request proxy error(type: ${t}, reason: ${n}): ${e}`)}},u=class extends Error{constructor(e,t,n){super(`[NETWORK]: response error(type: ${t}, status: ${n}): ${e}`),this.httpStatus=n}},d=class extends Error{constructor(e,t,n){super(`[NETWORK]: request timeout(type: ${t}, timeout: ${n}ms): ${e}`)}};function f(e){if(!e)return{};let t={},n=e.trim().split(`\n`);for(let e=0;e<n.length;e++){let r=n[e],i=r.indexOf(`:`),a=r.slice(0,i).trim().toLowerCase(),o=r.slice(i+1).trim();o&&(t[a]?t[a]+=`, `+o:t[a]=o)}return t}function p(e){for(let t of o){let n=e.match(t);if(n)return`jsonp_`+n[1]}return null}function m(e){return p(e)!==null}function h(e,t={},r=n,i=n,o=n){let m=a(),h=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>c&&/^http\\:/.test(e)?(console.warn(`The page at '${s}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\\:/,`https:`)):e).catch(n=>{var r;p(e);let i=new l(h,`XMLHttpRequest`,n&&n.message?String(n.message):String(n));return(r=t.networkSubscribe)==null||r.emit(`network`,e,`XMLHttpRequest`,`forbidden`,i.message),Promise.reject(i)}).then(e=>new Promise((s,c)=>{let l=p(e);if(l){let n=window,o=null,f=!1,p=document.createElement(`script`);n[l]=d=>{var g,_;let v=a(),y=v-m;if(delete n[l],p.parentNode&&p.parentNode.removeChild(p),o!==null&&(window.clearTimeout(o),o=null),f===!0)return;if(d.indexOf(`data:`)!==0){let n=new u(e,`XMLHttpRequest`,500);i(n),c(n),(g=t.networkSubscribe)==null||g.emit(`network`,e,`XMLHttpRequest`,`error`,n.message);return}let b=d.split(`,`),x=(b[0].match(/:(.*?);/)||[])[1],S=b[1];if(t.responseType===`arraybuffer`||t.responseType===`blob`){let e=atob(b[1]),n=e.length,r=new Uint8Array(n);for(let t=0;t<n;t++)r[t]=e.charCodeAt(t);S=t.responseType===`arraybuffer`?r.buffer:new Blob([r],{type:x})}let C={body:S,meta:{origin:h,source:e,requestTime:m,responseTime:v,costs:y,headers:{}}};r(C),s(C),(_=t.networkSubscribe)==null||_.emit(`network`,e,`XMLHttpRequest`,`ok`,JSON.stringify(C.meta)),f=!0},p.src=e,document.body.appendChild(p),typeof t.timeout==`number`&&(o=window.setTimeout(()=>{var n;if(o=null,f!==!0){f=!0;let r=new d(e,`XMLHttpRequest`,t.timeout||NaN);i(r),c(r),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`timeout`,r.message)}},t.timeout))}else{let l=!1,p=new XMLHttpRequest,g=()=>{p&&(p.removeEventListener(`timeout`,_,!1),p.removeEventListener(`progress`,v,!1),p.removeEventListener(`load`,y,!1),p.removeEventListener(`error`,b,!1)),p=null,g=n},_=function(){var n;if(l===!0)return;l=!0,g();let r=new d(e,`XMLHttpRequest`,t.timeout||NaN);i(r),c(r),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`timeout`,r.message)},v=function(e){l!==!0&&e.lengthComputable&&(e.total<=0||o(e.loaded/e.total,e.loaded,e.total))},y=function(n){var i;if(l===!0)return;let o=this.status;if(o===0||o>=200&&o<400){l=!0,g();let o=a(),c=o-m,u=f(this.getAllResponseHeaders()),d=n.total,p={body:this.response,meta:{origin:h,source:e,requestTime:m,responseTime:o,costs:c,headers:u,size:d}};r(p),s(p),(i=t.networkSubscribe)==null||i.emit(`network`,e,`XMLHttpRequest`,`ok`,JSON.stringify(p.meta))}else b.call(this)},b=function(){var n;if(l===!0)return;l=!0,g();let r=new u(e,`XMLHttpRequest`,this.status);i(r),c(r),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`error`,r.message)};p.addEventListener(`timeout`,_,!1),p.addEventListener(`progress`,v,!1),p.addEventListener(`load`,y,!1),p.addEventListener(`error`,b,!1),t.responseType&&(p.responseType=t.responseType),typeof t.timeout==`number`&&(p.timeout=t.timeout),p.open(`GET`,e,!0),p.send(null)}}))}let g={};function _(e,t={}){let r=a(),i=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>c&&/^http\\:/.test(e)?(console.warn(`The page at '${s}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\\:/,`https:`)):e).catch(n=>{var r;let a=new l(i,`Link`,n&&n.message?String(n.message):String(n));return(r=t.networkSubscribe)==null||r.emit(`network`,e,`Link`,`forbidden`,a.message),Promise.reject(a)}).then(e=>e in g?g[e]:g[e]=new Promise((o,s)=>{let c=document.head||document.getElementsByTagName(`head`)[0],l=document.createElement(`link`),d=!1,f=null;l.onload=s=>{var c;if(f!==null&&(clearTimeout(f),f=null),d===!0)return;d=!0,o(),l.onerror=n,l.onload=n;let u=a(),p={origin:i,source:e,requestTime:r,responseTime:u,costs:u-r,headers:{}};(c=t.networkSubscribe)==null||c.emit(`network`,e,`Link`,`preload`,JSON.stringify(p))},l.onerror=r=>{var i;if(f!==null&&(clearTimeout(f),f=null),d===!0)return;d=!0,delete g[e],c&&l.parentNode===c&&c.removeChild(l);let a=new u(e,`Link`,0);s(a),l.onerror=n,l.onload=n,(i=t.networkSubscribe)==null||i.emit(`network`,e,`Link`,`error`,a.message)},typeof t.timeout==`number`&&(f=window.setTimeout(()=>{var s;if(f=null,d===!0)return;d=!0,o(),l.onerror=n,l.onload=n;let c=a(),u={origin:i,source:e,requestTime:r,responseTime:c,costs:c-r,headers:{}};(s=t.networkSubscribe)==null||s.emit(`network`,e,`Link`,`timeout`,JSON.stringify(u))},t.timeout)),l.rel=l.relList&&l.relList.supports(`prefetch`)?`prefetch`:`preload`,l.as=`fetch`,l.crossOrigin=``,l.fetchPriority=`high`,l.href=e,c&&c.appendChild(l)}))}function v(e,t={},r=n,i=n,o=n,f){let p=a(),g=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>c&&/^http\\:/.test(e)?(console.warn(`The page at '${s}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\\:/,`https:`)):e).catch(n=>{var r;let i=new l(g,`Image`,n&&n.message?String(n.message):String(n));return(r=t.networkSubscribe)==null||r.emit(`network`,e,`Image`,`forbidden`,i.message),Promise.reject(i)}).then(e=>m(e)?h(e,{responseType:`blob`,networkSubscribe:t.networkSubscribe}).then(e=>URL.createObjectURL(e.body)):e).then(e=>new Promise((s,c)=>{let l=f==null?new Image:f,m=!1,h=null;typeof t.timeout==`number`&&(h=window.setTimeout(()=>{var r;if(l.onload=n,l.onerror=n,h=null,m===!0)return;m=!0;let a=new d(e,`Image`,t.timeout);i(a),c(a),(r=t.networkSubscribe)==null||r.emit(`network`,e,`Image`,`timeout`,a.message)},t.timeout)),l.onload=()=>{var i;if(l.onload=n,l.onerror=n,h!==null&&(clearTimeout(h),h=null),m===!0)return;let c=a(),u={headers:{},origin:g,source:e,requestTime:p,responseTime:c,costs:c-p};m=!0;let d={body:l,meta:u};o(1),r(d),s(d),(i=t.networkSubscribe)==null||i.emit(`network`,e,`Image`,`ok`,JSON.stringify(d.meta))},l.onerror=()=>{var r;if(l.onload=n,l.onerror=n,h!==null&&(clearTimeout(h),h=null),m===!0)return;m=!0;let a=new u(e,`Image`,0);i(a),c(a),(r=t.networkSubscribe)==null||r.emit(`network`,e,`Image`,`ok`,a.message)},o(0),l.src=e}))}new class{constructor(e={}){this.options=e}ajax(e,t={},r=n,i=n,a=n){var o;let s=this.options;return h(e,{responseType:t.responseType,timeout:(o=t.timeout)==null?s.timeout:o,get requestProxy(){var e;return(e=t.requestProxy)==null?s.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?s.networkSubscribe:e}},r,i,a)}loadImage(e,t={},r=n,i=n,a=n,o){var s;let c=this.options;return v(e,{timeout:(s=t.timeout)==null?c.timeout:s,get requestProxy(){var e;return(e=t.requestProxy)==null?c.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?c.networkSubscribe:e}},r,i,a,o)}preload(e,t={}){var n;let r=this.options;return _(e,{timeout:(n=t.timeout)==null?r.timeout:n,get requestProxy(){var e;return(e=t.requestProxy)==null?r.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?r.networkSubscribe:e}})}};function y(){}function b(e,t){this.x=e||0,this.y=t||0}function x(){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.`)}function S(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(this,`id`,{value:gc++}),this.uuid=X.generateUUID(),this.name=``,this.image=e===void 0?S.DEFAULT_IMAGE:e,this.mipmaps=[],this.mapping=t===void 0?S.DEFAULT_MAPPING:t,this.wrapS=n===void 0?Vo:n,this.wrapT=r===void 0?Vo:r,this.magFilter=i===void 0?Ko:i,this.minFilter=a===void 0?Jo:a,this.anisotropy=c===void 0?1:c,this.format=o===void 0?es:o,this.internalFormat=null,this.type=s===void 0?Yo:s,this.offset=new b(0,0),this.repeat=new b(1,1),this.center=new b(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new x,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l===void 0?$s:l,this.version=0,this.onUpdate=null}function C(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=r===void 0?1:r}function w(e,t,n){this.width=e,this.height=t,this.scissor=new C(0,0,e,t),this.scissorTest=!1,this.viewport=new C(0,0,e,t),n=n||{},this.texture=new S(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?!1:n.generateMipmaps,this.texture.minFilter=n.minFilter===void 0?Ko:n.minFilter,this.depthBuffer=n.depthBuffer===void 0?!0:n.depthBuffer,this.stencilBuffer=n.stencilBuffer===void 0?!0:n.stencilBuffer,this.depthTexture=n.depthTexture===void 0?null:n.depthTexture}function T(e,t,n){w.call(this,e,t,n),this.samples=4}function E(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=r===void 0?1:r}function D(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function O(){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.`)}function k(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||k.DefaultOrder}function A(){this.mask=1}function j(){Object.defineProperty(this,`id`,{value:Oc++}),this.uuid=X.generateUUID(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=j.DefaultUp.clone();var e=new D,t=new k,n=new E,r=new D(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 O},normalMatrix:{value:new x}}),this.matrix=new O,this.matrixWorld=new O,this.matrixAutoUpdate=j.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new A,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function M(){j.call(this),this.type=`Scene`,this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}function N(e,t){this.min=e===void 0?new D(1/0,1/0,1/0):e,this.max=t===void 0?new D(-1/0,-1/0,-1/0):t}function P(e,t,n,r,i){var a,o;for(a=0,o=e.length-3;a<=o;a+=3){$c.fromArray(e,a);var s=i.x*Math.abs($c.x)+i.y*Math.abs($c.y)+i.z*Math.abs($c.z),c=t.dot($c),l=n.dot($c),u=r.dot($c);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>s)return!1}return!0}function F(e,t){this.center=e===void 0?new D:e,this.radius=t===void 0?-1:t}function I(e,t){this.origin=e===void 0?new D:e,this.direction=t===void 0?new D(0,0,-1):t}function L(e,t){this.normal=e===void 0?new D(1,0,0):e,this.constant=t===void 0?0:t}function R(e,t,n){this.a=e===void 0?new D:e,this.b=t===void 0?new D:t,this.c=n===void 0?new D:n}function z(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}function ee(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}function te(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function ne(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}function B(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new D,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new z,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=a===void 0?0:a}function V(){Object.defineProperty(this,`id`,{value:wl++}),this.uuid=X.generateUUID(),this.name=``,this.type=`Material`,this.fog=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=lc,this.stencilZFail=lc,this.stencilZPass=lc,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function re(e){V.call(this),this.type=`MeshBasicMaterial`,this.color=new z(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=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.skinning=!1,this.morphTargets=!1,this.setValues(e)}function H(e,t,n){if(Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n===!0,this.usage=uc,this.updateRange={offset:0,count:-1},this.version=0}function U(e,t,n){H.call(this,new Int8Array(e),t,n)}function ie(e,t,n){H.call(this,new Uint8Array(e),t,n)}function W(e,t,n){H.call(this,new Uint8ClampedArray(e),t,n)}function ae(e,t,n){H.call(this,new Int16Array(e),t,n)}function G(e,t,n){H.call(this,new Uint16Array(e),t,n)}function oe(e,t,n){H.call(this,new Int32Array(e),t,n)}function se(e,t,n){H.call(this,new Uint32Array(e),t,n)}function K(e,t,n){H.call(this,new Float32Array(e),t,n)}function ce(e,t,n){H.call(this,new Float64Array(e),t,n)}function le(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function ue(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}function q(){Object.defineProperty(this,`id`,{value:El+=2}),this.uuid=X.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={}}function de(e,t){j.call(this),this.type=`Mesh`,this.geometry=e===void 0?new q:e,this.material=t===void 0?new re:t,this.updateMorphTargets()}function fe(e,t,n,r,i,a,o,s){if((t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side!==2,s))===null)return null;Yl.copy(s),Yl.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(Yl);return c<n.near||c>n.far?null:{distance:c,point:Yl.clone(),object:e}}function pe(e,t,n,r,i,a,o,s,c,l,u,d){Il.fromBufferAttribute(i,l),Ll.fromBufferAttribute(i,u),Rl.fromBufferAttribute(i,d);var f=e.morphTargetInfluences;if(t.morphTargets&&a&&f){Hl.set(0,0,0),Ul.set(0,0,0),Wl.set(0,0,0);for(var p=0,m=a.length;p<m;p++){var h=f[p],g=a[p];h!==0&&(zl.fromBufferAttribute(g,l),Bl.fromBufferAttribute(g,u),Vl.fromBufferAttribute(g,d),o?(Hl.addScaledVector(zl,h),Ul.addScaledVector(Bl,h),Wl.addScaledVector(Vl,h)):(Hl.addScaledVector(zl.sub(Il),h),Ul.addScaledVector(Bl.sub(Ll),h),Wl.addScaledVector(Vl.sub(Rl),h)))}Il.add(Hl),Ll.add(Ul),Rl.add(Wl)}e.isSkinnedMesh&&(e.boneTransform(l,Il),e.boneTransform(u,Ll),e.boneTransform(d,Rl));var _=fe(e,t,n,r,Il,Ll,Rl,Jl);if(_){s&&(Gl.fromBufferAttribute(s,l),Kl.fromBufferAttribute(s,u),ql.fromBufferAttribute(s,d),_.uv=R.getUV(Jl,Il,Ll,Rl,Gl,Kl,ql,new b)),c&&(Gl.fromBufferAttribute(c,l),Kl.fromBufferAttribute(c,u),ql.fromBufferAttribute(c,d),_.uv2=R.getUV(Jl,Il,Ll,Rl,Gl,Kl,ql,new b));var v=new B(l,u,d);R.getNormal(Il,Ll,Rl,v.normal),_.face=v}return _}function J(){Object.defineProperty(this,`id`,{value:Xl+=2}),this.uuid=X.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}function me(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}function he(e){for(var t={},n=0;n<e.length;n++){var r=me(e[n]);for(var i in r)t[i]=r[i]}return t}function ge(e){V.call(this),this.type=`ShaderMaterial`,this.defines={},this.uniforms={},this.vertexShader=ru,this.fragmentShader=iu,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))}function _e(){j.call(this),this.type=`Camera`,this.matrixWorldInverse=new O,this.projectionMatrix=new O,this.projectionMatrixInverse=new O}function ve(e,t,n,r){_e.call(this),this.type=`PerspectiveCamera`,this.fov=e===void 0?50:e,this.zoom=1,this.near=n===void 0?.1:n,this.far=r===void 0?2e3:r,this.focus=10,this.aspect=t===void 0?1:t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function ye(e,t,n){if(j.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 ve(au,ou,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new D(1,0,0)),this.add(r);var i=new ve(au,ou,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new D(-1,0,0)),this.add(i);var a=new ve(au,ou,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new D(0,1,0)),this.add(a);var o=new ve(au,ou,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new D(0,-1,0)),this.add(o);var s=new ve(au,ou,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new D(0,0,1)),this.add(s);var c=new ve(au,ou,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new D(0,0,-1)),this.add(c),this.update=function(e,t){this.parent===null&&this.updateMatrixWorld();var l=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;var d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(u),e.xr.enabled=l},this.clear=function(e,t,r,i){for(var a=e.getRenderTarget(),o=0;o<6;o++)e.setRenderTarget(n,o),e.clear(t,r,i);e.setRenderTarget(a)}}function be(e,t,n){Number.isInteger(t)&&(console.warn(`THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )`),t=n),w.call(this,e,e,t)}function xe(e,t,n,r,i,a,o,s,c,l,u,d){S.call(this,null,a,o,s,c,l,r,i,u,d),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=c===void 0?Uo:c,this.minFilter=l===void 0?Uo:l,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}function Se(e,t,n,r,i,a){this.planes=[e===void 0?new L:e,t===void 0?new L:t,n===void 0?new L:n,r===void 0?new L:r,i===void 0?new L:i,a===void 0?new L:a]}function Ce(){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(e){n=e},setContext:function(t){e=t}}}function we(e,t){var n=t.isWebGL2,r=new WeakMap;function i(t,n){var r=t.array,i=t.usage,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,r,i),t.onUploadCallback();var o=5126;return r instanceof Float32Array?o=5126:r instanceof Float64Array?console.warn(`THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.`):r instanceof Uint16Array?o=5123:r instanceof Int16Array?o=5122:r instanceof Uint32Array?o=5125:r instanceof Int32Array?o=5124:r instanceof Int8Array?o=5120:r instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}function a(t,r,i){var a=r.array,o=r.updateRange;e.bindBuffer(i,t),o.count===-1?e.bufferSubData(i,0,a):(n?e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1)}function o(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)}function s(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))}function c(e,t){e.isInterleavedBufferAttribute&&(e=e.data);var n=r.get(e);n===void 0?r.set(e,i(e,t)):n.version<e.version&&(a(n.buffer,e,t),n.version=e.version)}return{get:o,remove:s,update:c}}function Te(e,t,n,r){J.call(this),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Ee(e,t,n,r)),this.mergeVertices()}function Ee(e,t,n,r){q.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,d=t/s,f,p,m=[],h=[],g=[],_=[];for(p=0;p<l;p++){var v=p*d-a;for(f=0;f<c;f++){var y=f*u-i;h.push(y,-v,0),g.push(0,0,1),_.push(f/o),_.push(1-p/s)}}for(p=0;p<s;p++)for(f=0;f<o;f++){var b=f+c*p,x=f+c*(p+1),S=f+1+c*(p+1),C=f+1+c*p;m.push(b,x,C),m.push(x,S,C)}this.setIndex(m),this.setAttribute(`position`,new K(h,3)),this.setAttribute(`normal`,new K(g,3)),this.setAttribute(`uv`,new K(_,2))}function De(e,t,n,r){var i=new z(0),a=0,o,s,c=null,l=0,u=null;function d(t,r,d,p){var m=r.background,h=e.xr,g=h.getSession&&h.getSession();if(g&&g.environmentBlendMode===`additive`&&(m=null),m===null?f(i,a):m&&m.isColor&&(f(m,1),p=!0),(e.autoClear||p)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||m.mapping===306)){s===void 0&&(s=new de(new tu(1,1,1),new ge({type:`BackgroundCubeMaterial`,uniforms:me(lu.cube.uniforms),vertexShader:lu.cube.vertexShader,fragmentShader:lu.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute(`normal`),s.geometry.deleteAttribute(`uv`),s.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(s.material,`envMap`,{get:function(){return this.uniforms.envMap.value}}),n.update(s));var _=m.isWebGLCubeRenderTarget?m.texture:m;s.material.uniforms.envMap.value=_,s.material.uniforms.flipEnvMap.value=_.isCubeTexture?-1:1,(c!==m||l!==_.version||u!==e.toneMapping)&&(s.material.needsUpdate=!0,c=m,l=_.version,u=e.toneMapping),t.unshift(s,s.geometry,s.material,0,0,null)}else m&&m.isTexture&&(o===void 0&&(o=new de(new Ee(2,2),new ge({type:`BackgroundMaterial`,uniforms:me(lu.background.uniforms),vertexShader:lu.background.vertexShader,fragmentShader:lu.background.fragmentShader,side:0,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=m,m.matrixAutoUpdate===!0&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),(c!==m||l!==m.version||u!==e.toneMapping)&&(o.material.needsUpdate=!0,c=m,l=m.version,u=e.toneMapping),t.unshift(o,o.geometry,o.material,0,0,null))}function f(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}return{getClearColor:function(){return i},setClearColor:function(e,t){i.set(e),a=t===void 0?1:t,f(i,a)},getClearAlpha:function(){return a},setClearAlpha:function(e){a=e,f(i,a)},render:d}}function Oe(e,t,n,r){var i=r.isWebGL2,a;function o(e){a=e}function s(t,r){e.drawArrays(a,t,r),n.update(r,a)}function c(r,o,s,c){if(c!==0){var l,u;if(i)l=e,u=`drawArraysInstanced`;else if(l=t.get(`ANGLE_instanced_arrays`),u=`drawArraysInstancedANGLE`,l===null){console.error(`THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.`);return}l[u](a,o,s,c),n.update(s,a,c)}}this.setMode=o,this.render=s,this.renderInstances=c}function ke(e,t,n){var r;function i(){if(r!==void 0)return r;var n=t.get(`EXT_texture_filter_anisotropic`);return r=n===null?0:e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT),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<`u`&&e instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<`u`&&e instanceof WebGL2ComputeRenderingContext,s=n.precision===void 0?`highp`:n.precision,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),d=e.getParameter(35660),f=e.getParameter(3379),p=e.getParameter(34076),m=e.getParameter(34921),h=e.getParameter(36347),g=e.getParameter(36348),_=e.getParameter(36349),v=d>0,y=o||!!t.get(`OES_texture_float`),b=v&&y,x=o?e.getParameter(36183):0;return{isWebGL2:o,getMaxAnisotropy:i,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:h,maxVaryings:g,maxFragmentUniforms:_,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:b,maxSamples:x}}function Ae(){var e=this,t=null,n=0,r=!1,i=!1,a=new L,o=new x,s={value:null,needsUpdate:!1};this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,a){var o=e.length!==0||i||n!==0||r;return r=i,t=l(e,a,0),n=e.length,o},this.beginShadows=function(){i=!0,l(null)},this.endShadows=function(){i=!1,c()},this.setState=function(e,a,o,u,d,f){if(!r||e===null||e.length===0||i&&!o)i?l(null):c();else{var p=i?0:n,m=p*4,h=d.clippingState||null;s.value=h,h=l(e,u,m,f);for(var g=0;g!==m;++g)h[g]=t[g];d.clippingState=h,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=p}};function c(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function l(t,n,r,i){var c=t===null?0:t.length,l=null;if(c!==0){if(l=s.value,i!==!0||l===null){var u=r+c*4,d=n.matrixWorldInverse;o.getNormalMatrix(d),(l===null||l.length<u)&&(l=new Float32Array(u));for(var f=0,p=r;f!==c;++f,p+=4)a.copy(t[f]).applyMatrix4(d,o),a.normal.toArray(l,p),l[p+3]=a.constant}s.value=l,s.needsUpdate=!0}return e.numPlanes=c,e.numIntersection=0,l}}function je(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 Me(e,t,n){var r=new WeakMap,i=new WeakMap;function a(e){var o=e.target,s=r.get(o);for(var c in s.index!==null&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);o.removeEventListener(`dispose`,a),r.delete(o);var l=i.get(s);l&&(t.remove(l),i.delete(s)),n.memory.geometries--}function o(e,t){var i=r.get(t);return i||(t.addEventListener(`dispose`,a),t.isBufferGeometry?i=t:t.isGeometry&&(t._bufferGeometry===void 0&&(t._bufferGeometry=new q().setFromObject(e)),i=t._bufferGeometry),r.set(t,i),n.memory.geometries++,i)}function s(e){var n=e.index,r=e.attributes;for(var i in n!==null&&t.update(n,34963),r)t.update(r[i],34962);var a=e.morphAttributes;for(var i in a)for(var o=a[i],s=0,c=o.length;s<c;s++)t.update(o[s],34962)}function c(e){var n=[],r=e.index,a=e.attributes.position,o=0;if(r!==null){var s=r.array;o=r.version;for(var c=0,l=s.length;c<l;c+=3){var u=s[c+0],d=s[c+1],f=s[c+2];n.push(u,d,d,f,f,u)}}else{var s=a.array;o=a.version;for(var c=0,l=s.length/3-1;c<l;c+=3){var u=c+0,d=c+1,f=c+2;n.push(u,d,d,f,f,u)}}var p=new(ue(n)>65535?se:G)(n,1);p.version=o,t.update(p,34963);var m=i.get(e);m&&t.remove(m),i.set(e,p)}function l(e){var t=i.get(e);if(t){var n=e.index;n!==null&&t.version<n.version&&c(e)}else c(e);return i.get(e)}return{get:o,update:s,getWireframeAttribute:l}}function Ne(e,t,n,r){var i=r.isWebGL2,a;function o(e){a=e}var s,c;function l(e){s=e.type,c=e.bytesPerElement}function u(t,r){e.drawElements(a,r,s,t*c),n.update(r,a)}function d(r,o,l,u){if(u!==0){var d,f;if(i)d=e,f=`drawElementsInstanced`;else if(d=t.get(`ANGLE_instanced_arrays`),f=`drawElementsInstancedANGLE`,d===null){console.error(`THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.`);return}d[f](a,l,s,o*c,u),n.update(l,a,u)}}this.setMode=o,this.setIndex=l,this.render=u,this.renderInstances=d}function Pe(e){var t={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(e,t,r){switch(r=r||1,n.calls++,t){case 4:n.triangles+=e/3*r;break;case 1:n.lines+=e/2*r;break;case 3:n.lines+=r*(e-1);break;case 2:n.lines+=r*e;break;case 0:n.points+=r*e;break;default:console.error(`THREE.WebGLInfo: Unknown draw mode:`,t);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 Fe(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Ie(e){var t={},n=new Float32Array(8);function r(r,i,a,o){var s=r.morphTargetInfluences,c=s===void 0?0:s.length,l=t[i.id];if(l===void 0){l=[];for(var u=0;u<c;u++)l[u]=[u,0];t[i.id]=l}for(var d=a.morphTargets&&i.morphAttributes.position,f=a.morphNormals&&i.morphAttributes.normal,u=0;u<c;u++){var p=l[u];p[1]!==0&&(d&&i.deleteAttribute(`morphTarget`+u),f&&i.deleteAttribute(`morphNormal`+u))}for(var u=0;u<c;u++){var p=l[u];p[0]=u,p[1]=s[u]}l.sort(Fe);for(var m=0,u=0;u<8;u++){var p=l[u];if(p){var h=p[0],g=p[1];if(g){d&&i.setAttribute(`morphTarget`+u,d[h]),f&&i.setAttribute(`morphNormal`+u,f[h]),n[u]=g,m+=g;continue}}n[u]=0}var _=i.morphTargetsRelative?1:1-m;o.getUniforms().setValue(e,`morphTargetBaseInfluence`,_),o.getUniforms().setValue(e,`morphTargetInfluences`,n)}return{update:r}}function Le(e,t,n,r){var i=new WeakMap;function a(e){var a=r.render.frame,o=e.geometry,s=t.get(e,o);return i.get(s)!==a&&(o.isGeometry&&s.updateFromObject(e),t.update(s),i.set(s,a)),e.isInstancedMesh&&n.update(e.instanceMatrix,34962),s}function o(){i=new WeakMap}return{update:a,dispose:o}}function Re(e,t,n,r,i,a,o,s,c,l){e=e===void 0?[]:e,t=t===void 0?301:t,o=o===void 0?$o:o,S.call(this,e,t,n,r,i,a,o,s,c,l),this.flipY=!1}function ze(e,t,n,r){S.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=Uo,this.minFilter=Uo,this.wrapR=Vo,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Be(e,t,n,r){S.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=Uo,this.minFilter=Uo,this.wrapR=Vo,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Ve(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=mu[i];if(a===void 0&&(a=new Float32Array(i),mu[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 He(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 Ue(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function We(e,t){var n=hu[t];n===void 0&&(n=new Int32Array(t),hu[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Ge(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Ke(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(He(n,t))return;e.uniform2fv(this.addr,t),Ue(n,t)}}function qe(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(He(n,t))return;e.uniform3fv(this.addr,t),Ue(n,t)}}function Je(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(He(n,t))return;e.uniform4fv(this.addr,t),Ue(n,t)}}function Ye(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(He(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Ue(n,t)}else{if(He(n,r))return;vu.set(r),e.uniformMatrix2fv(this.addr,!1,vu),Ue(n,r)}}function Xe(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(He(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Ue(n,t)}else{if(He(n,r))return;_u.set(r),e.uniformMatrix3fv(this.addr,!1,_u),Ue(n,r)}}function Ze(e,t){var n=this.cache,r=t.elements;if(r===void 0){if(He(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Ue(n,t)}else{if(He(n,r))return;gu.set(r),e.uniformMatrix4fv(this.addr,!1,gu),Ue(n,r)}}function Qe(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||uu,i)}function $e(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||du,i)}function et(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||fu,i)}function tt(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||pu,i)}function nt(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function rt(e,t){var n=this.cache;He(n,t)||(e.uniform2iv(this.addr,t),Ue(n,t))}function it(e,t){var n=this.cache;He(n,t)||(e.uniform3iv(this.addr,t),Ue(n,t))}function at(e,t){var n=this.cache;He(n,t)||(e.uniform4iv(this.addr,t),Ue(n,t))}function ot(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function st(e){switch(e){case 5126:return Ge;case 35664:return Ke;case 35665:return qe;case 35666:return Je;case 35674:return Ye;case 35675:return Xe;case 35676:return Ze;case 5124:case 35670:return nt;case 35667:case 35671:return rt;case 35668:case 35672:return it;case 35669:case 35673:return at;case 5125:return ot;case 35678:case 36198:case 36298:case 36306:case 35682:return Qe;case 35679:case 36299:case 36307:return et;case 35680:case 36300:case 36308:case 36293:return tt;case 36289:case 36303:case 36311:case 36292:return $e}}function ct(e,t){e.uniform1fv(this.addr,t)}function lt(e,t){e.uniform1iv(this.addr,t)}function ut(e,t){e.uniform2iv(this.addr,t)}function dt(e,t){e.uniform3iv(this.addr,t)}function ft(e,t){e.uniform4iv(this.addr,t)}function pt(e,t){var n=Ve(t,this.size,2);e.uniform2fv(this.addr,n)}function mt(e,t){var n=Ve(t,this.size,3);e.uniform3fv(this.addr,n)}function ht(e,t){var n=Ve(t,this.size,4);e.uniform4fv(this.addr,n)}function gt(e,t){var n=Ve(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function _t(e,t){var n=Ve(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function vt(e,t){var n=Ve(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function yt(e,t,n){var r=t.length,i=We(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(t[a]||uu,i[a])}function bt(e,t,n){var r=t.length,i=We(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(t[a]||pu,i[a])}function xt(e){switch(e){case 5126:return ct;case 35664:return pt;case 35665:return mt;case 35666:return ht;case 35674:return gt;case 35675:return _t;case 35676:return vt;case 5124:case 35670:return lt;case 35667:case 35671:return ut;case 35668:case 35672:return dt;case 35669:case 35673:return ft;case 35678:case 36198:case 36298:case 36306:case 35682:return yt;case 35680:case 36300:case 36308:case 36293:return bt}}function St(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=st(t.type)}function Ct(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=xt(t.type)}function wt(e){this.id=e,this.seq=[],this.map={}}function Tt(e,t){e.seq.push(t),e.map[t.id]=t}function Et(e,t,n){var r=e.name,i=r.length;for(yu.lastIndex=0;;){var a=yu.exec(r),o=yu.lastIndex,s=a[1],c=a[2]===`]`,l=a[3];if(c&&(s|=0),l===void 0||l===`[`&&o+2===i){Tt(n,l===void 0?new St(s,e,t):new Ct(s,e,t));break}else{var u=n.map[s];u===void 0&&(u=new wt(s),Tt(n,u)),n=u}}}function Dt(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r);Et(i,e.getUniformLocation(t,i.name),this)}}function Ot(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}function kt(e){for(var t=e.split(`\n`),n=0;n<t.length;n++)t[n]=n+1+`: `+t[n];return t.join(`\n`)}function At(e){switch(e){case $s:return[`Linear`,`( value )`];case ec:return[`sRGB`,`( value )`];case nc:return[`RGBE`,`( value )`];case ic:return[`RGBM`,`( value, 7.0 )`];case ac:return[`RGBM`,`( value, 16.0 )`];case oc:return[`RGBD`,`( value, 256.0 )`];case tc:return[`Gamma`,`( value, float( GAMMA_FACTOR ) )`];case rc:return[`LogLuv`,`( value )`];default:throw Error(`unsupported encoding: `+e)}}function jt(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+`\n`+i+kt(a)}function Mt(e,t){var n=At(t);return`vec4 `+e+`( vec4 value ) { return `+n[0]+`ToLinear`+n[1]+`; }`}function Nt(e,t){var n=At(t);return`vec4 `+e+`( vec4 value ) { return LinearTo`+n[0]+n[1]+`; }`}function Pt(e,t){var n;switch(t){case 1:n=`Linear`;break;case 2:n=`Reinhard`;break;case 3:n=`Uncharted2`;break;case 4:n=`OptimizedCineon`;break;case 5:n=`ACESFilmic`;break;default:throw Error(`unsupported toneMapping: `+t)}return`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}function Ft(e){return[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`:``].filter(Rt).join(`\n`)}function It(e){var t=[];for(var n in e){var r=e[n];r!==!1&&t.push(`#define `+n+` `+r)}return t.join(`\n`)}function Lt(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var a=e.getActiveAttrib(t,i).name;n[a]=e.getAttribLocation(t,a)}return n}function Rt(e){return e!==``}function zt(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 Bt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function Vt(e){return e.replace(xu,Ht)}function Ht(e,t){var n=Q[t];if(n===void 0)throw Error(`Can not resolve #include <`+t+`>`);return Vt(n)}function Ut(e){return e.replace(Cu,Gt).replace(Su,Wt)}function Wt(e,t,n,r){return console.warn(`WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.`),Gt(e,t,n,r)}function Gt(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 Kt(e){var t=`precision `+e.precision+` float;\nprecision `+e.precision+` int;`;return e.precision===`highp`?t+=`\n#define HIGH_PRECISION`:e.precision===`mediump`?t+=`\n#define MEDIUM_PRECISION`:e.precision===`lowp`&&(t+=`\n#define LOW_PRECISION`),t}function qt(e){var t=`SHADOWMAP_TYPE_BASIC`;return e.shadowMapType===1?t=`SHADOWMAP_TYPE_PCF`:e.shadowMapType===2?t=`SHADOWMAP_TYPE_PCF_SOFT`:e.shadowMapType===3&&(t=`SHADOWMAP_TYPE_VSM`),t}function Jt(e){var t=`ENVMAP_TYPE_CUBE`;if(e.envMap)switch(e.envMapMode){case 301:case 302:t=`ENVMAP_TYPE_CUBE`;break;case 306:case 307:t=`ENVMAP_TYPE_CUBE_UV`;break;case 303:case 304:t=`ENVMAP_TYPE_EQUIREC`;break;case 305:t=`ENVMAP_TYPE_SPHERE`;break}return t}function Yt(e){var t=`ENVMAP_MODE_REFLECTION`;if(e.envMap)switch(e.envMapMode){case 302:case 304:t=`ENVMAP_MODE_REFRACTION`;break}return t}function Xt(e){var t=`ENVMAP_BLENDING_NONE`;if(e.envMap)switch(e.combine){case 0:t=`ENVMAP_BLENDING_MULTIPLY`;break;case 1:t=`ENVMAP_BLENDING_MIX`;break;case 2:t=`ENVMAP_BLENDING_ADD`;break}return t}function Zt(e,t,n){var r=e.getContext(),i=n.defines,a=n.vertexShader,o=n.fragmentShader,s=qt(n),c=Jt(n),l=Yt(n),u=Xt(n),d=e.gammaFactor>0?e.gammaFactor:1,f=n.isWebGL2?``:Ft(n),p=It(i),m=r.createProgram(),h,g;if(n.isRawShaderMaterial?(h=[p].filter(Rt).join(`\n`),h.length>0&&(h+=`\n`),g=[f,p].filter(Rt).join(`\n`),g.length>0&&(g+=`\n`)):(h=[Kt(n),`#define SHADER_NAME `+n.shaderName,p,n.instancing?`#define USE_INSTANCING`:``,n.supportsVertexTextures?`#define VERTEX_TEXTURES`:``,`#define GAMMA_FACTOR `+d,`#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`,`\n`].filter(Rt).join(`\n`),g=[f,Kt(n),`#define SHADER_NAME `+n.shaderName,p,n.alphaTest?`#define ALPHATEST `+n.alphaTest+(n.alphaTest%1?``:`.0`):``,`#define GAMMA_FACTOR `+d,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===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:Q.tonemapping_pars_fragment,n.toneMapping===0?``:Pt(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?Q.encodings_pars_fragment:``,n.mapEncoding?Mt(`mapTexelToLinear`,n.mapEncoding):``,n.matcapEncoding?Mt(`matcapTexelToLinear`,n.matcapEncoding):``,n.envMapEncoding?Mt(`envMapTexelToLinear`,n.envMapEncoding):``,n.emissiveMapEncoding?Mt(`emissiveMapTexelToLinear`,n.emissiveMapEncoding):``,n.lightMapEncoding?Mt(`lightMapTexelToLinear`,n.lightMapEncoding):``,n.outputEncoding?Nt(`linearToOutputTexel`,n.outputEncoding):``,n.depthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,`\n`].filter(Rt).join(`\n`)),a=Vt(a),a=zt(a,n),a=Bt(a,n),o=Vt(o),o=zt(o,n),o=Bt(o,n),a=Ut(a),o=Ut(o),n.isWebGL2&&!n.isRawShaderMaterial){var _=!1,v=/^\\s*#version\\s+300\\s+es\\s*\\n/;n.isShaderMaterial&&a.match(v)!==null&&o.match(v)!==null&&(_=!0,a=a.replace(v,``),o=o.replace(v,``)),h=[`#version 300 es\n`,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(`\n`)+`\n`+h,g=[`#version 300 es\n`,`#define varying in`,_?``:`out highp vec4 pc_fragColor;`,_?``:`#define gl_FragColor pc_fragColor`,`#define gl_FragDepthEXT gl_FragDepth`,`#define texture2D texture`,`#define textureCube texture`,`#define texture2DProj textureProj`,`#define texture2DLodEXT textureLod`,`#define texture2DProjLodEXT textureProjLod`,`#define textureCubeLodEXT textureLod`,`#define texture2DGradEXT textureGrad`,`#define texture2DProjGradEXT textureProjGrad`,`#define textureCubeGradEXT textureGrad`].join(`\n`)+`\n`+g}var y=h+a,b=g+o,x=Ot(r,35633,y),S=Ot(r,35632,b);if(r.attachShader(m,x),r.attachShader(m,S),n.index0AttributeName===void 0?n.morphTargets===!0&&r.bindAttribLocation(m,0,`position`):r.bindAttribLocation(m,0,n.index0AttributeName),r.linkProgram(m),e.debug.checkShaderErrors){var C=r.getProgramInfoLog(m).trim(),w=r.getShaderInfoLog(x).trim(),T=r.getShaderInfoLog(S).trim(),E=!0,D=!0;if(r.getProgramParameter(m,35714)===!1){E=!1;var O=jt(r,x,`vertex`),k=jt(r,S,`fragment`);console.error(`THREE.WebGLProgram: shader error: `,r.getError(),`35715`,r.getProgramParameter(m,35715),`gl.getProgramInfoLog`,C,O,k)}else C===``?(w===``||T===``)&&(D=!1):console.warn(`THREE.WebGLProgram: gl.getProgramInfoLog()`,C);D&&(this.diagnostics={runnable:E,programLog:C,vertexShader:{log:w,prefix:h},fragmentShader:{log:T,prefix:g}})}r.deleteShader(x),r.deleteShader(S);var A;this.getUniforms=function(){return A===void 0&&(A=new Dt(r,m)),A};var j;return this.getAttributes=function(){return j===void 0&&(j=Lt(r,m)),j},this.destroy=function(){r.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=bu++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=x,this.fragmentShader=S,this}function Qt(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`},d=`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`.split(`.`);function f(e,t){var n;if(t){var r=lu[t];n={name:e.type,uniforms:nu.clone(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}}else n={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};return n}function p(e){var t=e.skeleton.bones;if(o)return 1024;var n=Math.floor((c-20)/4),r=Math.min(n,t.length);return r<t.length?(console.warn(`THREE.WebGLRenderer: Skeleton has `+t.length+` bones. This GPU supports `+r+`.`),0):r}function m(e){var t;return e?e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn(`THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead.`),t=e.texture.encoding):t=$s,t}this.getParameters=function(r,c,d,h,g,_,v){var y=h.fog,b=r.isMeshStandardMaterial?h.environment:null,x=r.envMap||b,S=u[r.type],C=v.isSkinnedMesh?p(v):0;r.precision!==null&&(s=n.getMaxPrecision(r.precision),s!==r.precision&&console.warn(`THREE.WebGLProgram.getParameters:`,r.precision,`not supported, using`,s,`instead.`));var w=f(r,S);r.onBeforeCompile(w,e);var T=e.getRenderTarget();return{isWebGL2:i,shaderID:S,shaderName:w.name,uniforms:w.uniforms,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,defines:r.defines,isRawShaderMaterial:r.isRawShaderMaterial,isShaderMaterial:r.isShaderMaterial,precision:s,instancing:v.isInstancedMesh===!0,supportsVertexTextures:l,outputEncoding:T===null?e.outputEncoding:m(T.texture),map:!!r.map,mapEncoding:m(r.map),matcap:!!r.matcap,matcapEncoding:m(r.matcap),envMap:!!x,envMapMode:x&&x.mapping,envMapEncoding:m(x),envMapCubeUV:!!x&&(x.mapping===306||x.mapping===307),lightMap:!!r.lightMap,lightMapEncoding:m(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:m(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:r.normalMapType===1,tangentSpaceNormalMap:r.normalMapType===0,clearcoatMap:!!r.clearcoatMap,clearcoatRoughnessMap:!!r.clearcoatRoughnessMap,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexUvs:!!r.map||!!r.bumpMap||!!r.normalMap||!!r.specularMap||!!r.alphaMap||!!r.emissiveMap||!!r.roughnessMap||!!r.metalnessMap||!!r.clearcoatMap||!!r.clearcoatRoughnessMap||!!r.clearcoatNormalMap||!!r.displacementMap,uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap)&&!!r.displacementMap,fog:!!y,useFog:r.fog,fogExp2:y&&y.isFogExp2,flatShading:r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:a,skinning:r.skinning&&C>0,maxBones:C,useVertexTexture:o,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:c.directional.length,numPointLights:c.point.length,numSpotLights:c.spot.length,numRectAreaLights:c.rectArea.length,numHemiLights:c.hemi.length,numDirLightShadows:c.directionalShadowMap.length,numPointLightShadows:c.pointShadowMap.length,numSpotLightShadows:c.spotShadowMap.length,numClippingPlanes:g,numClipIntersection:_,dithering:r.dithering,shadowMapEnabled:e.shadowMap.enabled&&d.length>0,shadowMapType:e.shadowMap.type,toneMapping:r.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:r.side===2,flipSided:r.side===1,depthPacking:r.depthPacking===void 0?!1:r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.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:r.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),t.defines!==void 0)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(t.isRawShaderMaterial===void 0){for(var i=0;i<d.length;i++)n.push(t[d[i]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(t,n){for(var i,a=0,o=r.length;a<o;a++){var s=r[a];if(s.cacheKey===n){i=s,++i.usedTimes;break}}return i===void 0&&(i=new Zt(e,n,t),r.push(i)),i},this.releaseProgram=function(e){if(--e.usedTimes===0){var t=r.indexOf(e);r[t]=r[r.length-1],r.pop(),e.destroy()}},this.programs=r}function $t(){var e=new WeakMap;function t(t){var n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function n(t){e.delete(t)}function r(t,n,r){e.get(t)[n]=r}function i(){e=new WeakMap}return{get:t,remove:n,update:r,dispose:i}}function en(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.program===t.program?e.material.id===t.material.id?e.z===t.z?e.id-t.id:e.z-t.z:e.material.id-t.material.id:e.program.id-t.program.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function tn(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function nn(){var e=[],t=0,n=[],r=[],i={id:-1};function a(){t=0,n.length=0,r.length=0}function o(n,r,a,o,s,c){var l=e[t];return l===void 0?(l={id:n.id,object:n,geometry:r,material:a,program:a.program||i,groupOrder:o,renderOrder:n.renderOrder,z:s,group:c},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=a,l.program=a.program||i,l.groupOrder=o,l.renderOrder=n.renderOrder,l.z=s,l.group=c),t++,l}function s(e,t,i,a,s,c){var l=o(e,t,i,a,s,c);(i.transparent===!0?r:n).push(l)}function c(e,t,i,a,s,c){var l=o(e,t,i,a,s,c);(i.transparent===!0?r:n).unshift(l)}function l(e,t){n.length>1&&n.sort(e||en),r.length>1&&r.sort(t||tn)}function u(){for(var n=t,r=e.length;n<r;n++){var i=e[n];if(i.id===null)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}}return{opaque:n,transparent:r,init:a,push:s,unshift:c,finish:u,sort:l}}function rn(){var e=new WeakMap;function t(n){var r=n.target;r.removeEventListener(`dispose`,t),e.delete(r)}function n(n,r){var i=e.get(n),a;return i===void 0?(a=new nn,e.set(n,new WeakMap),e.get(n).set(r,a),n.addEventListener(`dispose`,t)):(a=i.get(r),a===void 0&&(a=new nn,i.set(r,a))),a}function r(){e=new WeakMap}return{get:n,dispose:r}}function an(){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 D,color:new z};break;case`SpotLight`:n={position:new D,direction:new D,color:new z,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new D,color:new z,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new D,skyColor:new z,groundColor:new z};break;case`RectAreaLight`:n={color:new z,position:new D,halfWidth:new D,halfHeight:new D};break}return e[t.id]=n,n}}}function on(){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 b};break;case`SpotLight`:n={shadowBias:0,shadowRadius:1,shadowMapSize:new b};break;case`PointLight`:n={shadowBias:0,shadowRadius:1,shadowMapSize:new b,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}function sn(e,t){return!!t.castShadow-+!!e.castShadow}function cn(){for(var e=new an,t=on(),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 D);var i=new D,a=new O,o=new O;function s(r,s,c){for(var l=0,u=0,d=0,f=0;f<9;f++)n.probe[f].set(0,0,0);var p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=c.matrixWorldInverse;r.sort(sn);for(var f=0,S=r.length;f<S;f++){var C=r[f],w=C.color,T=C.intensity,E=C.distance,D=C.shadow&&C.shadow.map?C.shadow.map.texture:null;if(C.isAmbientLight)l+=w.r*T,u+=w.g*T,d+=w.b*T;else if(C.isLightProbe)for(var O=0;O<9;O++)n.probe[O].addScaledVector(C.sh.coefficients[O],T);else if(C.isDirectionalLight){var k=e.get(C);if(k.color.copy(C.color).multiplyScalar(C.intensity),k.direction.setFromMatrixPosition(C.matrixWorld),i.setFromMatrixPosition(C.target.matrixWorld),k.direction.sub(i),k.direction.transformDirection(x),C.castShadow){var A=C.shadow,j=t.get(C);j.shadowBias=A.bias,j.shadowRadius=A.radius,j.shadowMapSize=A.mapSize,n.directionalShadow[p]=j,n.directionalShadowMap[p]=D,n.directionalShadowMatrix[p]=C.shadow.matrix,v++}n.directional[p]=k,p++}else if(C.isSpotLight){var k=e.get(C);if(k.position.setFromMatrixPosition(C.matrixWorld),k.position.applyMatrix4(x),k.color.copy(w).multiplyScalar(T),k.distance=E,k.direction.setFromMatrixPosition(C.matrixWorld),i.setFromMatrixPosition(C.target.matrixWorld),k.direction.sub(i),k.direction.transformDirection(x),k.coneCos=Math.cos(C.angle),k.penumbraCos=Math.cos(C.angle*(1-C.penumbra)),k.decay=C.decay,C.castShadow){var A=C.shadow,j=t.get(C);j.shadowBias=A.bias,j.shadowRadius=A.radius,j.shadowMapSize=A.mapSize,n.spotShadow[h]=j,n.spotShadowMap[h]=D,n.spotShadowMatrix[h]=C.shadow.matrix,b++}n.spot[h]=k,h++}else if(C.isRectAreaLight){var k=e.get(C);k.color.copy(w).multiplyScalar(T),k.position.setFromMatrixPosition(C.matrixWorld),k.position.applyMatrix4(x),o.identity(),a.copy(C.matrixWorld),a.premultiply(x),o.extractRotation(a),k.halfWidth.set(C.width*.5,0,0),k.halfHeight.set(0,C.height*.5,0),k.halfWidth.applyMatrix4(o),k.halfHeight.applyMatrix4(o),n.rectArea[g]=k,g++}else if(C.isPointLight){var k=e.get(C);if(k.position.setFromMatrixPosition(C.matrixWorld),k.position.applyMatrix4(x),k.color.copy(C.color).multiplyScalar(C.intensity),k.distance=C.distance,k.decay=C.decay,C.castShadow){var A=C.shadow,j=t.get(C);j.shadowBias=A.bias,j.shadowRadius=A.radius,j.shadowMapSize=A.mapSize,j.shadowCameraNear=A.camera.near,j.shadowCameraFar=A.camera.far,n.pointShadow[m]=j,n.pointShadowMap[m]=D,n.pointShadowMatrix[m]=C.shadow.matrix,y++}n.point[m]=k,m++}else if(C.isHemisphereLight){var k=e.get(C);k.direction.setFromMatrixPosition(C.matrixWorld),k.direction.transformDirection(x),k.direction.normalize(),k.skyColor.copy(C.color).multiplyScalar(T),k.groundColor.copy(C.groundColor).multiplyScalar(T),n.hemi[_]=k,_++}}n.ambient[0]=l,n.ambient[1]=u,n.ambient[2]=d;var M=n.hash;(M.directionalLength!==p||M.pointLength!==m||M.spotLength!==h||M.rectAreaLength!==g||M.hemiLength!==_||M.numDirectionalShadows!==v||M.numPointShadows!==y||M.numSpotShadows!==b)&&(n.directional.length=p,n.spot.length=h,n.rectArea.length=g,n.point.length=m,n.hemi.length=_,n.directionalShadow.length=v,n.directionalShadowMap.length=v,n.pointShadow.length=y,n.pointShadowMap.length=y,n.spotShadow.length=b,n.spotShadowMap.length=b,n.directionalShadowMatrix.length=v,n.pointShadowMatrix.length=y,n.spotShadowMatrix.length=b,M.directionalLength=p,M.pointLength=m,M.spotLength=h,M.rectAreaLength=g,M.hemiLength=_,M.numDirectionalShadows=v,M.numPointShadows=y,M.numSpotShadows=b,n.version=wu++)}return{setup:s,state:n}}function ln(){var e=new cn,t=[],n=[];function r(){t.length=0,n.length=0}function i(e){t.push(e)}function a(e){n.push(e)}function o(r){e.setup(t,n,r)}return{init:r,state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:o,pushLight:i,pushShadow:a}}function un(){var e=new WeakMap;function t(n){var r=n.target;r.removeEventListener(`dispose`,t),e.delete(r)}function n(n,r){var i;return e.has(n)===!1?(i=new ln,e.set(n,new WeakMap),e.get(n).set(r,i),n.addEventListener(`dispose`,t)):e.get(n).has(r)===!1?(i=new ln,e.get(n).set(r,i)):i=e.get(n).get(r),i}function r(){e=new WeakMap}return{get:n,dispose:r}}function dn(e){V.call(this),this.type=`MeshDepthMaterial`,this.depthPacking=sc,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function fn(e){V.call(this),this.type=`MeshDistanceMaterial`,this.referencePosition=new D,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}function pn(e,t,n){var r=new Se,i=new b,a=new b,o=new C,s=[],c=[],l={},u={0:1,1:0,2:2},d=new ge({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new b},radius:{value:4}},vertexShader:Eu,fragmentShader:Tu}),f=d.clone();f.defines.HORIZONAL_PASS=1;var p=new q;p.setAttribute(`position`,new H(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var m=new de(p,d),h=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,s,c){if(h.enabled!==!1&&!(h.autoUpdate===!1&&h.needsUpdate===!1)&&t.length!==0){var l=e.getRenderTarget(),u=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);for(var p=0,m=t.length;p<m;p++){var _=t[p],v=_.shadow;if(v===void 0){console.warn(`THREE.WebGLShadowMap:`,_,`has no shadow.`);continue}i.copy(v.mapSize);var y=v.getFrameExtents();if(i.multiply(y),a.copy(v.mapSize),(i.x>n||i.y>n)&&(i.x>n&&(a.x=Math.floor(n/y.x),i.x=a.x*y.x,v.mapSize.x=a.x),i.y>n&&(a.y=Math.floor(n/y.y),i.y=a.y*y.y,v.mapSize.y=a.y)),v.map===null&&!v.isPointLightShadow&&this.type===3){var b={minFilter:Ko,magFilter:Ko,format:es};v.map=new w(i.x,i.y,b),v.map.texture.name=_.name+`.shadowMap`,v.mapPass=new w(i.x,i.y,b),v.camera.updateProjectionMatrix()}if(v.map===null){var b={minFilter:Uo,magFilter:Uo,format:es};v.map=new w(i.x,i.y,b),v.map.texture.name=_.name+`.shadowMap`,v.camera.updateProjectionMatrix()}e.setRenderTarget(v.map),e.clear();for(var S=v.getViewportCount(),C=0;C<S;C++){var T=v.getViewport(C);o.set(a.x*T.x,a.y*T.y,a.x*T.z,a.y*T.w),f.viewport(o),v.updateMatrices(_,C),r=v.getFrustum(),x(s,c,v.camera,_,this.type)}!v.isPointLightShadow&&this.type===3&&g(v,c)}h.needsUpdate=!1,e.setRenderTarget(l,u,d)}};function g(n,r){var i=t.update(m);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,d,m,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,f,m,null)}function _(e,t,n){var r=e<<0|t<<1|n<<2,i=s[r];return i===void 0&&(i=new dn({depthPacking:cc,morphTargets:e,skinning:t}),s[r]=i),i}function v(e,t,n){var r=e<<0|t<<1|n<<2,i=c[r];return i===void 0&&(i=new fn({morphTargets:e,skinning:t}),c[r]=i),i}function y(t,n,r,i,a,o,s){var c=null,d=_,f=t.customDepthMaterial;if(i.isPointLight===!0&&(d=v,f=t.customDistanceMaterial),f===void 0){var p=!1;r.morphTargets===!0&&(p=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var m=!1;t.isSkinnedMesh===!0&&(r.skinning===!0?m=!0:console.warn(`THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:`,t));var h=t.isInstancedMesh===!0;c=d(p,m,h)}else c=f;if(e.localClippingEnabled&&r.clipShadows===!0&&r.clippingPlanes.length!==0){var g=c.uuid,y=r.uuid,b=l[g];b===void 0&&(b={},l[g]=b);var x=b[y];x===void 0&&(x=c.clone(),b[y]=x),c=x}return c.visible=r.visible,c.wireframe=r.wireframe,s===3?c.side=r.shadowSide===null?r.side:r.shadowSide:c.side=r.shadowSide===null?u[r.side]:r.shadowSide,c.clipShadows=r.clipShadows,c.clippingPlanes=r.clippingPlanes,c.clipIntersection=r.clipIntersection,c.wireframeLinewidth=r.wireframeLinewidth,c.linewidth=r.linewidth,i.isPointLight===!0&&c.isMeshDistanceMaterial===!0&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=a,c.farDistance=o),c}function x(n,i,a,o,s){if(n.visible!==!1){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var c=t.update(n),l=n.material;if(Array.isArray(l))for(var u=c.groups,d=0,f=u.length;d<f;d++){var p=u[d],m=l[p.materialIndex];if(m&&m.visible){var h=y(n,c,m,o,a.near,a.far,s);e.renderBufferDirect(a,null,c,h,n,p)}}else if(l.visible){var h=y(n,c,l,o,a.near,a.far,s);e.renderBufferDirect(a,null,c,h,n,null)}}for(var g=n.children,_=0,v=g.length;_<v;_++)x(g[_],i,a,o,s)}}}function mn(e,t,n){var r=n.isWebGL2;function i(){var t=!1,n=new C,r=null,i=new C(0,0,0,0);return{setMask:function(n){r!==n&&!t&&(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){s===!0&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),i.equals(n)===!1&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}}function a(){var t=!1,n=null,r=null,i=null;return{setTest:function(e){e?H(2929):U(2929)},setMask:function(r){n!==r&&!t&&(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case 3:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}}function o(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(e){t||(e?H(2960):U(2960))},setMask:function(r){n!==r&&!t&&(e.stencilMask(r),n=r)},setFunc:function(t,n,o){(r!==t||i!==n||a!==o)&&(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){(o!==t||s!==n||c!==r)&&(e.stencilOp(t,n,r),o=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null}}}var s=new i,c=new a,l=new o,u=e.getParameter(34921),d=new Uint8Array(u),f=new Uint8Array(u),p=new Uint8Array(u),m={},h=null,g=null,_=null,v=null,y=null,b=null,x=null,S=null,w=null,T=!1,E=null,D=null,O=null,k=null,A=null,j=e.getParameter(35661),M=!1,N=0,P=e.getParameter(7938);P.indexOf(`WebGL`)===-1?P.indexOf(`OpenGL ES`)!==-1&&(N=parseFloat(/^OpenGL\\ ES\\ ([0-9])/.exec(P)[1]),M=N>=2):(N=parseFloat(/^WebGL\\ ([0-9])/.exec(P)[1]),M=N>=1);var F=null,I={},L=new C,R=new C;function z(t,n,r){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;o<r;o++)e.texImage2D(n+o,0,6408,1,1,0,6408,5121,i);return a}var ee={};ee[3553]=z(3553,3553,1),ee[34067]=z(34067,34069,6),s.setClear(0,0,0,1),c.setClear(1),l.setClear(0),H(2929),c.setFunc(3),K(!1),ce(1),H(2884),oe(0);function te(){for(var e=0,t=d.length;e<t;e++)d[e]=0}function ne(e){B(e,0)}function B(n,i){d[n]=1,f[n]===0&&(e.enableVertexAttribArray(n),f[n]=1),p[n]!==i&&((r?e:t.get(`ANGLE_instanced_arrays`))[r?`vertexAttribDivisor`:`vertexAttribDivisorANGLE`](n,i),p[n]=i)}function V(){for(var t=0,n=f.length;t!==n;++t)f[t]!==d[t]&&(e.disableVertexAttribArray(t),f[t]=0)}function re(t,n,i,a,o,s){r===!0&&(i===5124||i===5125)?e.vertexAttribIPointer(t,n,i,a,o,s):e.vertexAttribPointer(t,n,i,a,o,s)}function H(t){m[t]!==!0&&(e.enable(t),m[t]=!0)}function U(t){m[t]!==!1&&(e.disable(t),m[t]=!1)}function ie(t){return h===t?!1:(e.useProgram(t),h=t,!0)}var W={100:32774,101:32778,102:32779};if(r)W[103]=32775,W[104]=32776;else{var ae=t.get(`EXT_blend_minmax`);ae!==null&&(W[103]=ae.MIN_EXT,W[104]=ae.MAX_EXT)}var G={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function oe(t,n,r,i,a,o,s,c){if(t===0){g&&(U(3042),g=!1);return}if(g||(H(3042),g=!0),t!==5){if(t!==_||c!==T){if((v!==100||x!==100)&&(e.blendEquation(32774),v=100,x=100),c)switch(t){case 1:e.blendFuncSeparate(1,771,1,771);break;case 2:e.blendFunc(1,1);break;case 3:e.blendFuncSeparate(0,0,769,771);break;case 4:e.blendFuncSeparate(0,768,0,770);break;default:console.error(`THREE.WebGLState: Invalid blending: `,t);break}else switch(t){case 1:e.blendFuncSeparate(770,771,1,771);break;case 2:e.blendFunc(770,1);break;case 3:e.blendFunc(0,769);break;case 4:e.blendFunc(0,768);break;default:console.error(`THREE.WebGLState: Invalid blending: `,t);break}y=null,b=null,S=null,w=null,_=t,T=c}return}a=a||n,o=o||r,s=s||i,(n!==v||a!==x)&&(e.blendEquationSeparate(W[n],W[a]),v=n,x=a),(r!==y||i!==b||o!==S||s!==w)&&(e.blendFuncSeparate(G[r],G[i],G[o],G[s]),y=r,b=i,S=o,w=s),_=t,T=null}function se(e,t){e.side===2?U(2884):H(2884);var n=e.side===1;t&&(n=!n),K(n),e.blending===1&&e.transparent===!1?oe(0):oe(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),c.setFunc(e.depthFunc),c.setTest(e.depthTest),c.setMask(e.depthWrite),s.setMask(e.colorWrite);var r=e.stencilWrite;l.setTest(r),r&&(l.setMask(e.stencilWriteMask),l.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),l.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),ue(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function K(t){E!==t&&(t?e.frontFace(2304):e.frontFace(2305),E=t)}function ce(t){t===0?U(2884):(H(2884),t!==D&&(t===1?e.cullFace(1029):t===2?e.cullFace(1028):e.cullFace(1032))),D=t}function le(t){t!==O&&(M&&e.lineWidth(t),O=t)}function ue(t,n,r){t?(H(32823),(k!==n||A!==r)&&(e.polygonOffset(n,r),k=n,A=r)):U(32823)}function q(e){e?H(3089):U(3089)}function de(t){t===void 0&&(t=33984+j-1),F!==t&&(e.activeTexture(t),F=t)}function fe(t,n){F===null&&de();var r=I[F];r===void 0&&(r={type:void 0,texture:void 0},I[F]=r),(r.type!==t||r.texture!==n)&&(e.bindTexture(t,n||ee[t]),r.type=t,r.texture=n)}function pe(){var t=I[F];t!==void 0&&t.type!==void 0&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)}function J(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error(`THREE.WebGLState:`,e)}}function me(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error(`THREE.WebGLState:`,e)}}function he(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error(`THREE.WebGLState:`,e)}}function ge(t){L.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),L.copy(t))}function _e(t){R.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),R.copy(t))}function ve(){for(var t=0;t<f.length;t++)f[t]===1&&(e.disableVertexAttribArray(t),f[t]=0);m={},F=null,I={},h=null,_=null,E=null,D=null,s.reset(),c.reset(),l.reset()}return{buffers:{color:s,depth:c,stencil:l},initAttributes:te,enableAttribute:ne,enableAttributeAndDivisor:B,disableUnusedAttributes:V,vertexAttribPointer:re,enable:H,disable:U,useProgram:ie,setBlending:oe,setMaterial:se,setFlipSided:K,setCullFace:ce,setLineWidth:le,setPolygonOffset:ue,setScissorTest:q,activeTexture:de,bindTexture:fe,unbindTexture:pe,compressedTexImage2D:J,texImage2D:me,texImage3D:he,scissor:ge,viewport:_e,reset:ve}}function hn(e,t,n,r,i,a,o){var s=i.isWebGL2,c=i.maxTextures,l=i.maxCubemapSize,u=i.maxTextureSize,d=i.maxSamples,f=new WeakMap,p,m=!1;try{m=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch(e){}function h(e,t){return m?new OffscreenCanvas(e,t):document.createElementNS(`http://www.w3.org/1999/xhtml`,`canvas`)}function g(e,t,n,r){var i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||t===!0)if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){var a=t?X.floorPowerOfTwo:Math.floor,o=a(i*e.width),s=a(i*e.height);p===void 0&&(p=h(o,s));var c=n?h(o,s):p;return c.width=o,c.height=s,c.getContext(`2d`).drawImage(e,0,0,o,s),console.warn(`THREE.WebGLRenderer: Texture has been resized from (`+e.width+`x`+e.height+`) to (`+o+`x`+s+`).`),c}else return`data`in e&&console.warn(`THREE.WebGLRenderer: Image in DataTexture is too big (`+e.width+`x`+e.height+`).`),e;return e}function _(e){return X.isPowerOfTwo(e.width)&&X.isPowerOfTwo(e.height)}function v(e){return s?!1:e.wrapS!==1001||e.wrapT!==1001||e.minFilter!==1003&&e.minFilter!==1006}function y(e,t){return e.generateMipmaps&&t&&e.minFilter!==1003&&e.minFilter!==1006}function b(t,n,i,a){e.generateMipmap(t);var o=r.get(n);o.__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function x(n,r,i){if(s===!1)return r;if(n!==null){if(e[n]!==void 0)return e[n];console.warn(`THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}var a=r;return r===6403&&(i===5126&&(a=33326),i===5131&&(a=33325),i===5121&&(a=33321)),r===6407&&(i===5126&&(a=34837),i===5131&&(a=34843),i===5121&&(a=32849)),r===6408&&(i===5126&&(a=34836),i===5131&&(a=34842),i===5121&&(a=32856)),(a===33325||a===33326||a===34842||a===34836)&&t.get(`EXT_color_buffer_float`),a}function S(e){return e===1003||e===1004||e===1005?9728:9729}function C(e){var t=e.target;t.removeEventListener(`dispose`,C),T(t),t.isVideoTexture&&f.delete(t),o.memory.textures--}function w(e){var t=e.target;t.removeEventListener(`dispose`,w),E(t),o.memory.textures--}function T(t){var n=r.get(t);n.__webglInit!==void 0&&(e.deleteTexture(n.__webglTexture),r.remove(t))}function E(t){var n=r.get(t),i=r.get(t.texture);if(t){if(i.__webglTexture!==void 0&&e.deleteTexture(i.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}}var D=0;function O(){D=0}function k(){var e=D;return e>=c&&console.warn(`THREE.WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+c),D+=1,e}function A(e,t){var i=r.get(e);if(e.isVideoTexture&&ie(e),e.version>0&&i.__version!==e.version){var a=e.image;if(a===void 0)console.warn(`THREE.WebGLRenderer: Texture marked for update but image is undefined`);else if(a.complete===!1)console.warn(`THREE.WebGLRenderer: Texture marked for update but image is incomplete`);else{z(i,e,t);return}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function j(e,t){var i=r.get(e);if(e.version>0&&i.__version!==e.version){z(i,e,t);return}n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture)}function M(e,t){var i=r.get(e);if(e.version>0&&i.__version!==e.version){z(i,e,t);return}n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture)}function N(t,i){if(t.image.length===6){var o=r.get(t);if(t.version>0&&o.__version!==t.version){R(o,t),n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture),e.pixelStorei(37440,t.flipY);for(var c=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),u=t.image[0]&&t.image[0].isDataTexture,d=[],f=0;f<6;f++)!c&&!u?d[f]=g(t.image[f],!1,!0,l):d[f]=u?t.image[f].image:t.image[f];var p=d[0],m=_(p)||s,h=a.convert(t.format),v=a.convert(t.type),S=x(t.internalFormat,h,v);L(34067,t,m);var C;if(c){for(var f=0;f<6;f++){C=d[f].mipmaps;for(var w=0;w<C.length;w++){var T=C[w];t.format!==1023&&t.format!==1022?h===null?console.warn(`THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()`):n.compressedTexImage2D(34069+f,w,S,T.width,T.height,0,T.data):n.texImage2D(34069+f,w,S,T.width,T.height,0,h,v,T.data)}}o.__maxMipLevel=C.length-1}else{C=t.mipmaps;for(var f=0;f<6;f++)if(u){n.texImage2D(34069+f,0,S,d[f].width,d[f].height,0,h,v,d[f].data);for(var w=0;w<C.length;w++){var T=C[w],E=T.image[f].image;n.texImage2D(34069+f,w+1,S,E.width,E.height,0,h,v,E.data)}}else{n.texImage2D(34069+f,0,S,h,v,d[f]);for(var w=0;w<C.length;w++){var T=C[w];n.texImage2D(34069+f,w+1,S,h,v,T.image[f])}}o.__maxMipLevel=C.length}y(t,m)&&b(34067,t,p.width,p.height),o.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture)}}function P(e,t){n.activeTexture(33984+t),n.bindTexture(34067,r.get(e).__webglTexture)}var F={[Bo]:10497,[Vo]:33071,[Ho]:33648},I={[Uo]:9728,[Wo]:9984,[Go]:9986,[Ko]:9729,[qo]:9985,[Jo]:9987};function L(n,a,o){o?(e.texParameteri(n,10242,F[a.wrapS]),e.texParameteri(n,10243,F[a.wrapT]),(n===32879||n===35866)&&e.texParameteri(n,32882,F[a.wrapR]),e.texParameteri(n,10240,I[a.magFilter]),e.texParameteri(n,10241,I[a.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),(n===32879||n===35866)&&e.texParameteri(n,32882,33071),(a.wrapS!==1001||a.wrapT!==1001)&&console.warn(`THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.`),e.texParameteri(n,10240,S(a.magFilter)),e.texParameteri(n,10241,S(a.minFilter)),a.minFilter!==1003&&a.minFilter!==1006&&console.warn(`THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.`));var c=t.get(`EXT_texture_filter_anisotropic`);if(c){if(a.type===1015&&t.get(`OES_texture_float_linear`)===null||a.type===1016&&(s||t.get(`OES_texture_half_float_linear`))===null)return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function R(t,n){t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,C),t.__webglTexture=e.createTexture(),o.memory.textures++)}function z(t,r,i){var o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),R(t,r),n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var c=v(r)&&_(r.image)===!1,l=g(r.image,c,!1,u),d=_(l)||s,f=a.convert(r.format),p=a.convert(r.type),m=x(r.internalFormat,f,p);L(o,r,d);var h,S=r.mipmaps;if(r.isDepthTexture)m=6402,s?m=r.type===1015?36012:r.type===1014?33190:r.type===1020?35056:33189:r.type===1015&&console.error(`WebGLRenderer: Floating point depth texture requires WebGL2.`),r.format===1026&&m===6402&&r.type!==1012&&r.type!==1014&&(console.warn(`THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.`),r.type=Xo,p=a.convert(r.type)),r.format===1027&&m===6402&&(m=34041,r.type!==1020&&(console.warn(`THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.`),r.type=Qo,p=a.convert(r.type))),n.texImage2D(3553,0,m,l.width,l.height,0,f,p,null);else if(r.isDataTexture)if(S.length>0&&d){for(var C=0,w=S.length;C<w;C++)h=S[C],n.texImage2D(3553,C,m,h.width,h.height,0,f,p,h.data);r.generateMipmaps=!1,t.__maxMipLevel=S.length-1}else n.texImage2D(3553,0,m,l.width,l.height,0,f,p,l.data),t.__maxMipLevel=0;else if(r.isCompressedTexture){for(var C=0,w=S.length;C<w;C++)h=S[C],r.format!==1023&&r.format!==1022?f===null?console.warn(`THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`):n.compressedTexImage2D(3553,C,m,h.width,h.height,0,h.data):n.texImage2D(3553,C,m,h.width,h.height,0,f,p,h.data);t.__maxMipLevel=S.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,m,l.width,l.height,l.depth,0,f,p,l.data),t.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,m,l.width,l.height,l.depth,0,f,p,l.data),t.__maxMipLevel=0;else if(S.length>0&&d){for(var C=0,w=S.length;C<w;C++)h=S[C],n.texImage2D(3553,C,m,f,p,h);r.generateMipmaps=!1,t.__maxMipLevel=S.length-1}else n.texImage2D(3553,0,m,f,p,l),t.__maxMipLevel=0;y(r,d)&&b(o,r,l.width,l.height),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function ee(t,i,o,s){var c=a.convert(i.texture.format),l=a.convert(i.texture.type),u=x(i.texture.internalFormat,c,l);n.texImage2D(s,0,u,i.width,i.height,0,c,l,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,o,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function te(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){var i=33189;if(r){var o=n.depthTexture;o&&o.isDepthTexture&&(o.type===1015?i=36012:o.type===1014&&(i=33190));var s=U(n);e.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else e.renderbufferStorage(36161,i,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){if(r){var s=U(n);e.renderbufferStorageMultisample(36161,s,35056,n.width,n.height)}else e.renderbufferStorage(36161,34041,n.width,n.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{var c=a.convert(n.texture.format),l=a.convert(n.texture.type),i=x(n.texture.internalFormat,c,l);if(r){var s=U(n);e.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else e.renderbufferStorage(36161,i,n.width,n.height)}e.bindRenderbuffer(36161,null)}function ne(t,n){if(n&&n.isWebGLCubeRenderTarget)throw Error(`Depth Texture with cube render targets is not supported`);if(e.bindFramebuffer(36160,t),!(n.depthTexture&&n.depthTexture.isDepthTexture))throw Error(`renderTarget.depthTexture must be an instance of THREE.DepthTexture`);(!r.get(n.depthTexture).__webglTexture||n.depthTexture.image.width!==n.width||n.depthTexture.image.height!==n.height)&&(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),A(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===1026)e.framebufferTexture2D(36160,36096,3553,i,0);else if(n.depthTexture.format===1027)e.framebufferTexture2D(36160,33306,3553,i,0);else throw Error(`Unknown depthTexture format`)}function B(t){var n=r.get(t),i=t.isWebGLCubeRenderTarget===!0;if(t.depthTexture){if(i)throw Error(`target.depthTexture not supported in Cube render targets`);ne(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),te(n.__webglDepthbuffer[a],t,!1)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),te(n.__webglDepthbuffer,t,!1);e.bindFramebuffer(36160,null)}function V(t){var i=r.get(t),c=r.get(t.texture);t.addEventListener(`dispose`,w),c.__webglTexture=e.createTexture(),o.memory.textures++;var l=t.isWebGLCubeRenderTarget===!0,u=t.isWebGLMultisampleRenderTarget===!0,d=_(t)||s;if(s&&t.texture.format===1022&&(t.texture.type===1015||t.texture.type===1016)&&(t.texture.format=es,console.warn(`THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.`)),l){i.__webglFramebuffer=[];for(var f=0;f<6;f++)i.__webglFramebuffer[f]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),u)if(s){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var p=a.convert(t.texture.format),m=a.convert(t.texture.type),h=x(t.texture.internalFormat,p,m),g=U(t);e.renderbufferStorageMultisample(36161,g,h,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),te(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn(`THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.`);if(l){n.bindTexture(34067,c.__webglTexture),L(34067,t.texture,d);for(var f=0;f<6;f++)ee(i.__webglFramebuffer[f],t,36064,34069+f);y(t.texture,d)&&b(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,c.__webglTexture),L(3553,t.texture,d),ee(i.__webglFramebuffer,t,36064,3553),y(t.texture,d)&&b(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&B(t)}function re(e){var t=e.texture;if(y(t,_(e)||s)){var i=e.isWebGLCubeRenderTarget?34067:3553,a=r.get(t).__webglTexture;n.bindTexture(i,a),b(i,t,e.width,e.height),n.bindTexture(i,null)}}function H(t){if(t.isWebGLMultisampleRenderTarget)if(s){var n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var i=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn(`THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.`)}function U(e){return s&&e.isWebGLMultisampleRenderTarget?Math.min(d,e.samples):0}function ie(e){var t=o.render.frame;f.get(e)!==t&&(f.set(e,t),e.update())}var W=!1,ae=!1;function G(e,t){e&&e.isWebGLRenderTarget&&(W===!1&&(console.warn(`THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead.`),W=!0),e=e.texture),A(e,t)}function oe(e,t){e&&e.isWebGLCubeRenderTarget&&(ae===!1&&(console.warn(`THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead.`),ae=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&e.image.length===6?N(e,t):P(e,t)}this.allocateTextureUnit=k,this.resetTextureUnits=O,this.setTexture2D=A,this.setTexture2DArray=j,this.setTexture3D=M,this.setTextureCube=N,this.setTextureCubeDynamic=P,this.setupRenderTarget=V,this.updateRenderTargetMipmap=re,this.updateMultisampleRenderTarget=H,this.safeSetTexture2D=G,this.safeSetTextureCube=oe}function gn(e,t,n){var r=n.isWebGL2;function i(e){var n;if(e===1009)return 5121;if(e===1017)return 32819;if(e===1018)return 32820;if(e===1019)return 33635;if(e===1010)return 5120;if(e===1011)return 5122;if(e===1012)return 5123;if(e===1013)return 5124;if(e===1014)return 5125;if(e===1015)return 5126;if(e===1016)return r?5131:(n=t.get(`OES_texture_half_float`),n===null?null:n.HALF_FLOAT_OES);if(e===1021)return 6406;if(e===1022)return 6407;if(e===1023)return 6408;if(e===1024)return 6409;if(e===1025)return 6410;if(e===1026)return 6402;if(e===1027)return 34041;if(e===1028)return 6403;if(e===1029)return 36244;if(e===1030)return 33319;if(e===1031)return 33320;if(e===1032)return 36248;if(e===1033)return 36249;if(e===33776||e===33777||e===33778||e===33779)if(n=t.get(`WEBGL_compressed_texture_s3tc`),n!==null){if(e===33776)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===33777)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===33778)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===33779)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(e===35840||e===35841||e===35842||e===35843)if(n=t.get(`WEBGL_compressed_texture_pvrtc`),n!==null){if(e===35840)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===35841)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===35842)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===35843)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(e===36196)return n=t.get(`WEBGL_compressed_texture_etc1`),n===null?null:n.COMPRESSED_RGB_ETC1_WEBGL;if((e===37492||e===37496)&&(n=t.get(`WEBGL_compressed_texture_etc`),n!==null)){if(e===37492)return n.COMPRESSED_RGB8_ETC2;if(e===37496)return n.COMPRESSED_RGBA8_ETC2_EAC}if(e===37808||e===37809||e===37810||e===37811||e===37812||e===37813||e===37814||e===37815||e===37816||e===37817||e===37818||e===37819||e===37820||e===37821||e===37840||e===37841||e===37842||e===37843||e===37844||e===37845||e===37846||e===37847||e===37848||e===37849||e===37850||e===37851||e===37852||e===37853)return n=t.get(`WEBGL_compressed_texture_astc`),n===null?null:e;if(e===36492)return n=t.get(`EXT_texture_compression_bptc`),n===null?null:e;if(e===1020)return r?34042:(n=t.get(`WEBGL_depth_texture`),n===null?null:n.UNSIGNED_INT_24_8_WEBGL)}return{convert:i}}function _n(e){ve.call(this),this.cameras=e||[]}function vn(){j.call(this),this.type=`Group`}function yn(){this._targetRay=null,this._grip=null}function bn(e,t){var n=this,r=null,i=1,a=null,o=`local-floor`,s=null,c=[],l=new Map,u=new ve;u.layers.enable(1),u.viewport=new C;var d=new ve;d.layers.enable(2),d.viewport=new C;var f=[u,d],p=new _n;p.layers.enable(1),p.layers.enable(2);var m=null,h=null;this.enabled=!1,this.isPresenting=!1,this.getController=function(e){var t=c[e];return t===void 0&&(t=new yn,c[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){var t=c[e];return t===void 0&&(t=new yn,c[e]=t),t.getGripSpace()};function g(e){var t=l.get(e.inputSource);t&&t.dispatchEvent({type:e.type})}function _(){l.forEach(function(e,t){e.disconnect(t)}),l.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),O.stop(),n.isPresenting=!1,n.dispatchEvent({type:`sessionend`})}function v(e){a=e,O.setContext(r),O.start(),n.isPresenting=!0,n.dispatchEvent({type:`sessionstart`})}this.setFramebufferScaleFactor=function(e){i=e,n.isPresenting===!0&&console.warn(`THREE.WebXRManager: Cannot change framebuffer scale while presenting.`)},this.setReferenceSpaceType=function(e){o=e,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(e){if(r=e,r!==null){r.addEventListener(`select`,g),r.addEventListener(`selectstart`,g),r.addEventListener(`selectend`,g),r.addEventListener(`squeeze`,g),r.addEventListener(`squeezestart`,g),r.addEventListener(`squeezeend`,g),r.addEventListener(`end`,_);var n=t.getContextAttributes();n.xrCompatible!==!0&&t.makeXRCompatible();var a={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil,framebufferScaleFactor:i},s=new XRWebGLLayer(r,t,a);r.updateRenderState({baseLayer:s}),r.requestReferenceSpace(o).then(v),r.addEventListener(`inputsourceschange`,y)}};function y(e){for(var t=r.inputSources,n=0;n<c.length;n++)l.set(t[n],c[n]);for(var n=0;n<e.removed.length;n++){var i=e.removed[n],a=l.get(i);a&&(a.dispatchEvent({type:`disconnected`,data:i}),l.delete(i))}for(var n=0;n<e.added.length;n++){var i=e.added[n],a=l.get(i);a&&a.dispatchEvent({type:`connected`,data:i})}}var b=new D,x=new D;function S(e,t,n){b.setFromMatrixPosition(t.matrixWorld),x.setFromMatrixPosition(n.matrixWorld);var r=b.distanceTo(x),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var g=o+m,_=s+m,v=f-h,y=p+(r-h),S=c*s/_*g,C=l*s/_*g;e.projectionMatrix.makePerspective(v,y,S,C,g,_)}function w(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}this.getCamera=function(e){p.near=d.near=u.near=e.near,p.far=d.far=u.far=e.far,(m!==p.near||h!==p.far)&&(r.updateRenderState({depthNear:p.near,depthFar:p.far}),m=p.near,h=p.far);var t=e.parent,n=p.cameras;w(p,t);for(var i=0;i<n.length;i++)w(n[i],t);e.matrixWorld.copy(p.matrixWorld);for(var a=e.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return n.length===2?S(p,u,d):p.projectionMatrix.copy(u.projectionMatrix),p};var T=null;function E(t,n){if(s=n.getViewerPose(a),s!==null){var i=s.views,o=r.renderState.baseLayer;e.setFramebuffer(o.framebuffer);var l=!1;i.length!==p.cameras.length&&(p.cameras.length=0,l=!0);for(var u=0;u<i.length;u++){var d=i[u],m=o.getViewport(d),h=f[u];h.matrix.fromArray(d.transform.matrix),h.projectionMatrix.fromArray(d.projectionMatrix),h.viewport.set(m.x,m.y,m.width,m.height),u===0&&p.matrix.copy(h.matrix),l===!0&&p.cameras.push(h)}}for(var g=r.inputSources,u=0;u<c.length;u++){var _=c[u],v=g[u];_.update(v,n,a)}T&&T(t,n)}var O=new Ce;O.setAnimationLoop(E),this.setAnimationLoop=function(e){T=e},this.dispose=function(){}}function xn(e){function t(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}function n(e,t,n,_,v){t.isMeshBasicMaterial?r(e,t):t.isMeshLambertMaterial?(r(e,t),c(e,t)):t.isMeshToonMaterial?(r(e,t),u(e,t)):t.isMeshPhongMaterial?(r(e,t),l(e,t)):t.isMeshStandardMaterial?(r(e,t,n),t.isMeshPhysicalMaterial?f(e,t,n):d(e,t,n)):t.isMeshMatcapMaterial?(r(e,t),p(e,t)):t.isMeshDepthMaterial?(r(e,t),m(e,t)):t.isMeshDistanceMaterial?(r(e,t),h(e,t)):t.isMeshNormalMaterial?(r(e,t),g(e,t)):t.isLineBasicMaterial?(i(e,t),t.isLineDashedMaterial&&a(e,t)):t.isPointsMaterial?o(e,t,_,v):t.isSpriteMaterial?s(e,t):t.isShadowMaterial?(e.color.value.copy(t.color),e.opacity.value=t.opacity):t.isShaderMaterial&&(t.uniformsNeedUpdate=!1)}function r(t,n,r){t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap);var i=n.envMap||r;i&&(t.envMap.value=i,t.flipEnvMap.value=i.isCubeTexture?-1:1,t.reflectivity.value=n.reflectivity,t.refractionRatio.value=n.refractionRatio,t.maxMipLevel.value=e.get(i).__maxMipLevel),n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity);var a;n.map?a=n.map:n.specularMap?a=n.specularMap:n.displacementMap?a=n.displacementMap:n.normalMap?a=n.normalMap:n.bumpMap?a=n.bumpMap:n.roughnessMap?a=n.roughnessMap:n.metalnessMap?a=n.metalnessMap:n.alphaMap?a=n.alphaMap:n.emissiveMap&&(a=n.emissiveMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),t.uvTransform.value.copy(a.matrix));var o;n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),o!==void 0&&(o.isWebGLRenderTarget&&(o=o.texture),o.matrixAutoUpdate===!0&&o.updateMatrix(),t.uv2Transform.value.copy(o.matrix))}function i(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}function a(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function o(e,t,n,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=r*.5,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap);var i;t.map?i=t.map:t.alphaMap&&(i=t.alphaMap),i!==void 0&&(i.matrixAutoUpdate===!0&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}function s(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),n!==void 0&&(n.matrixAutoUpdate===!0&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function c(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}function l(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===1&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===1&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.gradientMap&&(e.gradientMap.value=t.gradientMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===1&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===1&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function d(e,t,n){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===1&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===1&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),(t.envMap||n)&&(e.envMapIntensity.value=t.envMapIntensity)}function f(e,t,n){d(e,t,n),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen),t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===1&&e.clearcoatNormalScale.value.negate()),e.transparency.value=t.transparency}function p(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===1&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===1&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function m(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function h(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}function g(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===1&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===1&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}return{refreshFogUniforms:t,refreshMaterialUniforms:n}}function Sn(e){e=e||{};var t=e.canvas===void 0?document.createElementNS(`http://www.w3.org/1999/xhtml`,`canvas`):e.canvas,n=e.context===void 0?null:e.context,r=e.alpha===void 0?!1:e.alpha,i=e.depth===void 0?!0:e.depth,a=e.stencil===void 0?!0:e.stencil,o=e.antialias===void 0?!1:e.antialias,s=e.premultipliedAlpha===void 0?!0:e.premultipliedAlpha,c=e.preserveDrawingBuffer===void 0?!1:e.preserveDrawingBuffer,l=e.powerPreference===void 0?`default`:e.powerPreference,u=e.failIfMajorPerformanceCaveat===void 0?!1:e.failIfMajorPerformanceCaveat,d=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=$s,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var p=this,m=!1,h=null,g=0,_=0,v=null,y=null,x=-1,S={geometry:null,program:null,wireframe:!1},w=null,T=null,E=new C,k=new C,A=null,j=t.width,N=t.height,P=1,F=null,I=null,L=new C(0,0,j,N),R=new C(0,0,j,N),z=!1,ee=new Se,te=new Ae,ne=!1,B=!1,V=new O,re=new D;function H(){return v===null?P:1}var U;try{var ie={alpha:r,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(t.addEventListener(`webglcontextlost`,Te,!1),t.addEventListener(`webglcontextrestored`,Ee,!1),U=n||t.getContext(`webgl`,ie)||t.getContext(`experimental-webgl`,ie),U===null)throw t.getContext(`webgl`)===null?Error(`Error creating WebGL context.`):Error(`Error creating WebGL context with your selected attributes.`);U.getShaderPrecisionFormat===void 0&&(U.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error(`THREE.WebGLRenderer: `+e.message),e}var W,ae,G,oe,se,K,ce,le,ue,q,de,fe,pe,J,me,he,ge,_e;function ve(){W=new je(U),ae=new ke(U,W,e),ae.isWebGL2===!1&&(W.get(`WEBGL_depth_texture`),W.get(`OES_texture_float`),W.get(`OES_texture_half_float`),W.get(`OES_texture_half_float_linear`),W.get(`OES_standard_derivatives`),W.get(`OES_element_index_uint`),W.get(`ANGLE_instanced_arrays`)),W.get(`OES_texture_float_linear`),_e=new gn(U,W,ae),G=new mn(U,W,ae),G.scissor(k.copy(R).multiplyScalar(P).floor()),G.viewport(E.copy(L).multiplyScalar(P).floor()),oe=new Pe(U),se=new $t,K=new hn(U,W,G,se,ae,_e,oe),ce=new we(U,ae),le=new Me(U,ce,oe),ue=new Le(U,le,ce,oe),me=new Ie(U),q=new Qt(p,W,ae),de=new xn(se),fe=new rn,pe=new un,J=new De(p,G,ue,s),he=new Oe(U,W,oe,ae),ge=new Ne(U,W,oe,ae),oe.programs=q.programs,p.capabilities=ae,p.extensions=W,p.properties=se,p.renderLists=fe,p.state=G,p.info=oe}ve();var ye=new bn(p,U);this.xr=ye;var be=new pn(p,ue,ae.maxTextureSize);this.shadowMap=be,this.getContext=function(){return U},this.getContextAttributes=function(){return U.getContextAttributes()},this.forceContextLoss=function(){var e=W.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){var e=W.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return P},this.setPixelRatio=function(e){e!==void 0&&(P=e,this.setSize(j,N,!1))},this.getSize=function(e){return e===void 0&&(console.warn(`WebGLRenderer: .getsize() now requires a Vector2 as an argument`),e=new b),e.set(j,N)},this.setSize=function(e,n,r){if(ye.isPresenting){console.warn(`THREE.WebGLRenderer: Can't change size while VR device is presenting.`);return}j=e,N=n,t.width=Math.floor(e*P),t.height=Math.floor(n*P),r!==!1&&(t.style.width=e+`px`,t.style.height=n+`px`),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e===void 0&&(console.warn(`WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument`),e=new b),e.set(j*P,N*P).floor()},this.setDrawingBufferSize=function(e,n,r){j=e,N=n,P=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e===void 0&&(console.warn(`WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument`),e=new C),e.copy(E)},this.getViewport=function(e){return e.copy(L)},this.setViewport=function(e,t,n,r){e.isVector4?L.set(e.x,e.y,e.z,e.w):L.set(e,t,n,r),G.viewport(E.copy(L).multiplyScalar(P).floor())},this.getScissor=function(e){return e.copy(R)},this.setScissor=function(e,t,n,r){e.isVector4?R.set(e.x,e.y,e.z,e.w):R.set(e,t,n,r),G.scissor(k.copy(R).multiplyScalar(P).floor())},this.getScissorTest=function(){return z},this.setScissorTest=function(e){G.setScissorTest(z=e)},this.setOpaqueSort=function(e){F=e},this.setTransparentSort=function(e){I=e},this.getClearColor=function(){return J.getClearColor()},this.setClearColor=function(){J.setClearColor.apply(J,arguments)},this.getClearAlpha=function(){return J.getClearAlpha()},this.setClearAlpha=function(){J.setClearAlpha.apply(J,arguments)},this.clear=function(e,t,n){var r=0;(e===void 0||e)&&(r|=16384),(t===void 0||t)&&(r|=256),(n===void 0||n)&&(r|=1024),U.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener(`webglcontextlost`,Te,!1),t.removeEventListener(`webglcontextrestored`,Ee,!1),fe.dispose(),pe.dispose(),se.dispose(),ue.dispose(),ye.dispose(),Ge.stop()};function Te(e){e.preventDefault(),console.log(`THREE.WebGLRenderer: Context Lost.`),m=!0}function Ee(){console.log(`THREE.WebGLRenderer: Context Restored.`),m=!1,ve()}function Fe(e){var t=e.target;t.removeEventListener(`dispose`,Fe),Re(t)}function Re(e){ze(e),se.remove(e)}function ze(e){var t=se.get(e).program;e.program=void 0,t!==void 0&&q.releaseProgram(t)}function Be(e,t){e.render(function(e){p.renderBufferImmediate(e,t)})}this.renderBufferImmediate=function(e,t){G.initAttributes();var n=se.get(e);e.hasPositions&&!n.position&&(n.position=U.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=U.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=U.createBuffer()),e.hasColors&&!n.color&&(n.color=U.createBuffer());var r=t.getAttributes();e.hasPositions&&(U.bindBuffer(34962,n.position),U.bufferData(34962,e.positionArray,35048),G.enableAttribute(r.position),U.vertexAttribPointer(r.position,3,5126,!1,0,0)),e.hasNormals&&(U.bindBuffer(34962,n.normal),U.bufferData(34962,e.normalArray,35048),G.enableAttribute(r.normal),U.vertexAttribPointer(r.normal,3,5126,!1,0,0)),e.hasUvs&&(U.bindBuffer(34962,n.uv),U.bufferData(34962,e.uvArray,35048),G.enableAttribute(r.uv),U.vertexAttribPointer(r.uv,2,5126,!1,0,0)),e.hasColors&&(U.bindBuffer(34962,n.color),U.bufferData(34962,e.colorArray,35048),G.enableAttribute(r.color),U.vertexAttribPointer(r.color,3,5126,!1,0,0)),G.disableUnusedAttributes(),U.drawArrays(4,0,e.count),e.count=0};var Ve=new M;this.renderBufferDirect=function(e,t,n,r,i,a){t===null&&(t=Ve);var o=i.isMesh&&i.matrixWorld.determinant()<0,s=Xe(e,t,r,i);G.setMaterial(r,o);var c=!1;(S.geometry!==n.id||S.program!==s.id||S.wireframe!==(r.wireframe===!0))&&(S.geometry=n.id,S.program=s.id,S.wireframe=r.wireframe===!0,c=!0),(r.morphTargets||r.morphNormals)&&(me.update(i,n,r,s),c=!0),i.isInstancedMesh===!0&&(c=!0);var l=n.index,u=n.attributes.position;if(l===null){if(u===void 0||u.count===0)return}else if(l.count===0)return;var d=1;r.wireframe===!0&&(l=le.getWireframeAttribute(n),d=2);var f,p=he;l!==null&&(f=ce.get(l),p=ge,p.setIndex(f)),c&&(He(i,n,r,s),l!==null&&U.bindBuffer(34963,f.buffer));var m=l===null?u.count:l.count,h=n.drawRange.start*d,g=n.drawRange.count*d,_=a===null?0:a.start*d,v=a===null?1/0:a.count*d,y=Math.max(h,_),b=Math.min(m,h+g,_+v)-1,x=Math.max(0,b-y+1);if(x!==0){if(i.isMesh)r.wireframe===!0?(G.setLineWidth(r.wireframeLinewidth*H()),p.setMode(1)):p.setMode(4);else if(i.isLine){var C=r.linewidth;C===void 0&&(C=1),G.setLineWidth(C*H()),i.isLineSegments?p.setMode(1):i.isLineLoop?p.setMode(2):p.setMode(3)}else i.isPoints?p.setMode(0):i.isSprite&&p.setMode(4);if(i.isInstancedMesh)p.renderInstances(n,y,x,i.count);else if(n.isInstancedBufferGeometry){var w=Math.min(n.instanceCount,n._maxInstanceCount);p.renderInstances(n,y,x,w)}else p.render(y,x)}};function He(e,t,n,r){if(!(ae.isWebGL2===!1&&(e.isInstancedMesh||t.isInstancedBufferGeometry)&&W.get(`ANGLE_instanced_arrays`)===null)){G.initAttributes();var i=t.attributes,a=r.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var l=i[s];if(l!==void 0){var u=l.normalized,d=l.itemSize,f=ce.get(l);if(f===void 0)continue;var p=f.buffer,m=f.type,h=f.bytesPerElement;if(l.isInterleavedBufferAttribute){var g=l.data,_=g.stride,v=l.offset;g&&g.isInstancedInterleavedBuffer?(G.enableAttributeAndDivisor(c,g.meshPerAttribute),t._maxInstanceCount===void 0&&(t._maxInstanceCount=g.meshPerAttribute*g.count)):G.enableAttribute(c),U.bindBuffer(34962,p),G.vertexAttribPointer(c,d,m,u,_*h,v*h)}else l.isInstancedBufferAttribute?(G.enableAttributeAndDivisor(c,l.meshPerAttribute),t._maxInstanceCount===void 0&&(t._maxInstanceCount=l.meshPerAttribute*l.count)):G.enableAttribute(c),U.bindBuffer(34962,p),G.vertexAttribPointer(c,d,m,u,0,0)}else if(s===`instanceMatrix`){var f=ce.get(e.instanceMatrix);if(f===void 0)continue;var p=f.buffer,m=f.type;G.enableAttributeAndDivisor(c+0,1),G.enableAttributeAndDivisor(c+1,1),G.enableAttributeAndDivisor(c+2,1),G.enableAttributeAndDivisor(c+3,1),U.bindBuffer(34962,p),U.vertexAttribPointer(c+0,4,m,!1,64,0),U.vertexAttribPointer(c+1,4,m,!1,64,16),U.vertexAttribPointer(c+2,4,m,!1,64,32),U.vertexAttribPointer(c+3,4,m,!1,64,48)}else if(o!==void 0){var y=o[s];if(y!==void 0)switch(y.length){case 2:U.vertexAttrib2fv(c,y);break;case 3:U.vertexAttrib3fv(c,y);break;case 4:U.vertexAttrib4fv(c,y);break;default:U.vertexAttrib1fv(c,y)}}}}G.disableUnusedAttributes()}}this.compile=function(e,t){f=pe.get(e,t),f.init(),e.traverse(function(e){e.isLight&&(f.pushLight(e),e.castShadow&&f.pushShadow(e))}),f.setupLights(t);let n={};e.traverse(function(t){let r=t.material;if(r)if(Array.isArray(r))for(let i=0;i<r.length;i++){let a=r[i];a.uuid in n||(Ye(a,e,t),n[a.uuid]=!0)}else r.uuid in n||(Ye(r,e,t),n[r.uuid]=!0)})};var Ue=null;function We(e){ye.isPresenting||Ue&&Ue(e)}var Ge=new Ce;Ge.setAnimationLoop(We),typeof window<`u`&&Ge.setContext(window),this.setAnimationLoop=function(e){Ue=e,ye.setAnimationLoop(e),Ge.start()},this.render=function(e,t){var n,r;if(arguments[2]!==void 0&&(console.warn(`THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.`),n=arguments[2]),arguments[3]!==void 0&&(console.warn(`THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead.`),r=arguments[3]),!(t&&t.isCamera)){console.error(`THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(!m){S.geometry=null,S.program=null,S.wireframe=!1,x=-1,w=null,e.autoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.updateMatrixWorld(),ye.enabled&&ye.isPresenting&&(t=ye.getCamera(t)),e.onBeforeRender(p,e,t,n||v),f=pe.get(e,t),f.init(),V.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ee.setFromProjectionMatrix(V),B=this.localClippingEnabled,ne=te.init(this.clippingPlanes,B,t),d=fe.get(e,t),d.init(),Ke(e,t,0,p.sortObjects),d.finish(),p.sortObjects===!0&&d.sort(F,I),ne&&te.beginShadows();var i=f.state.shadowsArray;be.render(i,e,t),f.setupLights(t),ne&&te.endShadows(),this.info.autoReset&&this.info.reset(),n!==void 0&&this.setRenderTarget(n),J.render(d,e,t,r);var a=d.opaque,o=d.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&qe(a,e,t,s),o.length&&qe(o,e,t,s)}else a.length&&qe(a,e,t),o.length&&qe(o,e,t);e.onAfterRender(p,e,t),v!==null&&(K.updateRenderTargetMipmap(v),K.updateMultisampleRenderTarget(v)),G.buffers.depth.setTest(!0),G.buffers.depth.setMask(!0),G.buffers.color.setMask(!0),G.setPolygonOffset(!1),d=null,f=null}};function Ke(e,t,n,r){if(e.visible!==!1){if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLight)f.pushLight(e),e.castShadow&&f.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ee.intersectsSprite(e)){r&&re.setFromMatrixPosition(e.matrixWorld).applyMatrix4(V);var i=ue.update(e),a=e.material;a.visible&&d.push(e,i,a,n,re.z,null)}}else if(e.isImmediateRenderObject)r&&re.setFromMatrixPosition(e.matrixWorld).applyMatrix4(V),d.push(e,null,e.material,n,re.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==oe.render.frame&&(e.skeleton.update(),e.skeleton.frame=oe.render.frame),!e.frustumCulled||ee.intersectsObject(e))){r&&re.setFromMatrixPosition(e.matrixWorld).applyMatrix4(V);var i=ue.update(e),a=e.material;if(Array.isArray(a))for(var o=i.groups,s=0,c=o.length;s<c;s++){var l=o[s],u=a[l.materialIndex];u&&u.visible&&d.push(e,i,u,n,re.z,l)}else a.visible&&d.push(e,i,a,n,re.z,null)}}for(var p=e.children,s=0,c=p.length;s<c;s++)Ke(p[s],t,n,r)}}function qe(e,t,n,r){for(var i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,c=o.geometry,l=r===void 0?o.material:r,u=o.group;if(n.isArrayCamera){T=n;for(var d=n.cameras,p=0,m=d.length;p<m;p++){var h=d[p];s.layers.test(h.layers)&&(G.viewport(E.copy(h.viewport)),f.setupLights(h),Je(s,t,h,c,l,u))}}else T=null,Je(s,t,n,c,l,u)}}function Je(e,t,n,r,i,a){if(e.onBeforeRender(p,t,n,r,i,a),f=pe.get(t,T||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=Xe(n,t,i,e);G.setMaterial(i),S.geometry=null,S.program=null,S.wireframe=!1,Be(e,o)}else p.renderBufferDirect(n,t,r,i,e,a);e.onAfterRender(p,t,n,r,i,a),f=pe.get(t,T||n)}function Ye(e,t,n){var r=se.get(e),i=f.state.lights,a=f.state.shadowsArray,o=i.state.version,s=q.getParameters(e,i.state,a,t,te.numPlanes,te.numIntersection,n),c=q.getProgramCacheKey(s),l=r.program,u=!0;if(l===void 0)e.addEventListener(`dispose`,Fe);else if(l.cacheKey!==c)ze(e);else if(r.lightsStateVersion!==o)r.lightsStateVersion=o,u=!1;else if(s.shaderID!==void 0)return;else u=!1;u&&(l=q.acquireProgram(s,c),r.program=l,r.uniforms=s.uniforms,r.outputEncoding=s.outputEncoding,e.program=l);var d=l.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var m=0;m<p.maxMorphTargets;m++)d[`morphTarget`+m]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(var m=0;m<p.maxMorphNormals;m++)d[`morphNormal`+m]>=0&&e.numSupportedMorphNormals++}var h=r.uniforms;(!e.isShaderMaterial&&!e.isRawShaderMaterial||e.clipping===!0)&&(r.numClippingPlanes=te.numPlanes,r.numIntersection=te.numIntersection,h.clippingPlanes=te.uniform),r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.needsLights=Qe(e),r.lightsStateVersion=o,r.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotShadowMatrix.value=i.state.spotShadowMatrix,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix);var g=r.program.getUniforms();r.uniformsList=Dt.seqWithValue(g.seq,h)}function Xe(e,t,n,r){K.resetTextureUnits();var i=t.fog,a=n.isMeshStandardMaterial?t.environment:null,o=v===null?p.outputEncoding:v.texture.encoding,s=se.get(n),c=f.state.lights;if(ne&&(B||e!==w)){var l=e===w&&n.id===x;te.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,s,l)}n.version===s.__version?s.program===void 0||n.fog&&s.fog!==i?Ye(n,t,r):s.environment===a?(s.needsLights&&s.lightsStateVersion!==c.state.version||s.numClippingPlanes!==void 0&&(s.numClippingPlanes!==te.numPlanes||s.numIntersection!==te.numIntersection)||s.outputEncoding!==o)&&Ye(n,t,r):Ye(n,t,r):(Ye(n,t,r),s.__version=n.version);var u=!1,d=!1,m=!1,h=s.program,g=h.getUniforms(),_=s.uniforms;if(G.useProgram(h.program)&&(u=!0,d=!0,m=!0),n.id!==x&&(x=n.id,d=!0),u||w!==e){if(g.setValue(U,`projectionMatrix`,e.projectionMatrix),ae.logarithmicDepthBuffer&&g.setValue(U,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),w!==e&&(w=e,d=!0,m=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var y=g.map.cameraPosition;y!==void 0&&y.setValue(U,re.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&g.setValue(U,`isOrthographic`,e.isOrthographicCamera===!0),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&g.setValue(U,`viewMatrix`,e.matrixWorldInverse)}if(n.skinning){g.setOptional(U,r,`bindMatrix`),g.setOptional(U,r,`bindMatrixInverse`);var b=r.skeleton;if(b){var S=b.bones;if(ae.floatVertexTextures){if(b.boneTexture===void 0){var C=Math.sqrt(S.length*4);C=X.ceilPowerOfTwo(C),C=Math.max(C,4);var T=new Float32Array(C*C*4);T.set(b.boneMatrices);var E=new xe(T,C,C,es,Zo);b.boneMatrices=T,b.boneTexture=E,b.boneTextureSize=C}g.setValue(U,`boneTexture`,b.boneTexture,K),g.setValue(U,`boneTextureSize`,b.boneTextureSize)}else g.setOptional(U,b,`boneMatrices`)}}return(d||s.receiveShadow!==r.receiveShadow)&&(s.receiveShadow=r.receiveShadow,g.setValue(U,`receiveShadow`,r.receiveShadow)),d&&(g.setValue(U,`toneMappingExposure`,p.toneMappingExposure),g.setValue(U,`toneMappingWhitePoint`,p.toneMappingWhitePoint),s.needsLights&&Ze(_,m),i&&n.fog&&de.refreshFogUniforms(_,i),de.refreshMaterialUniforms(_,n,a,P,N),_.ltc_1!==void 0&&(_.ltc_1.value=Z.LTC_1),_.ltc_2!==void 0&&(_.ltc_2.value=Z.LTC_2),Dt.upload(U,s.uniformsList,_,K)),n.isShaderMaterial&&n.uniformsNeedUpdate===!0&&(Dt.upload(U,s.uniformsList,_,K),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&g.setValue(U,`center`,r.center),g.setValue(U,`modelViewMatrix`,r.modelViewMatrix),g.setValue(U,`normalMatrix`,r.normalMatrix),g.setValue(U,`modelMatrix`,r.matrixWorld),h}function Ze(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function Qe(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&e.lights===!0}this.setFramebuffer=function(e){h!==e&&v===null&&U.bindFramebuffer(36160,e),h=e},this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return _},this.getRenderTarget=function(){return v},this.setRenderTarget=function(e,t,n){v=e,g=t,_=n,e&&se.get(e).__webglFramebuffer===void 0&&K.setupRenderTarget(e);var r=h,i=!1;if(e){var a=se.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=a[t||0],i=!0):r=e.isWebGLMultisampleRenderTarget?se.get(e).__webglMultisampledFramebuffer:a,E.copy(e.viewport),k.copy(e.scissor),A=e.scissorTest}else E.copy(L).multiplyScalar(P).floor(),k.copy(R).multiplyScalar(P).floor(),A=z;if(y!==r&&(U.bindFramebuffer(36160,r),y=r),G.viewport(E),G.scissor(k),G.setScissorTest(A),i){var o=se.get(e.texture);U.framebufferTexture2D(36160,36064,34069+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(!(e&&e.isWebGLRenderTarget)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);return}var s=se.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(s=s[o]),s){var c=!1;s!==y&&(U.bindFramebuffer(36160,s),c=!0);try{var l=e.texture,u=l.format,d=l.type;if(u!==1023&&_e.convert(u)!==U.getParameter(35739)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(d!==1009&&_e.convert(d)!==U.getParameter(35738)&&!(d===1015&&(ae.isWebGL2||W.get(`OES_texture_float`)||W.get(`WEBGL_color_buffer_float`)))&&!(d===1016&&(ae.isWebGL2?W.get(`EXT_color_buffer_float`):W.get(`EXT_color_buffer_half_float`)))){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}U.checkFramebufferStatus(36160)===36053?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&U.readPixels(t,n,r,i,_e.convert(u),_e.convert(d),a):console.error(`THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.`)}finally{c&&U.bindFramebuffer(36160,y)}}},this.copyFramebufferToTexture=function(e,t,n){n===void 0&&(n=0);var r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=_e.convert(t.format);K.setTexture2D(t,0),U.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),G.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r){r===void 0&&(r=0);var i=t.image.width,a=t.image.height,o=_e.convert(n.format),s=_e.convert(n.type);K.setTexture2D(n,0),t.isDataTexture?U.texSubImage2D(3553,r,e.x,e.y,i,a,o,s,t.image.data):t.isCompressedTexture?U.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):U.texSubImage2D(3553,r,e.x,e.y,o,s,t.image),r===0&&n.generateMipmaps&&U.generateMipmap(3553),G.unbindTexture()},this.initTexture=function(e){K.setTexture2D(e,0),G.unbindTexture()},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}function Cn(e,t){this.name=``,this.color=new z(e),this.density=t===void 0?25e-5:t}function wn(e,t,n){this.name=``,this.color=new z(e),this.near=t===void 0?1:t,this.far=n===void 0?1e3:n}function Tn(e,t){this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.usage=uc,this.updateRange={offset:0,count:-1},this.version=0}function En(e,t,n,r){this.name=``,this.data=e,this.itemSize=t,this.offset=n,this.normalized=r===!0}function Dn(e){V.call(this),this.type=`SpriteMaterial`,this.color=new z(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}function On(e){if(j.call(this),this.type=`Sprite`,Ou===void 0){Ou=new q;var t=new Tn(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Ou.setIndex([0,1,2,0,2,3]),Ou.setAttribute(`position`,new En(t,3,0,!1)),Ou.setAttribute(`uv`,new En(t,2,3,!1))}this.geometry=Ou,this.material=e===void 0?new Dn:e,this.center=new b(.5,.5)}function kn(e,t,n,r,i,a){Mu.subVectors(e,n).addScalar(.5).multiply(r),i===void 0?Nu.copy(Mu):(Nu.x=a*Mu.x-i*Mu.y,Nu.y=i*Mu.x+a*Mu.y),e.copy(t),e.x+=Nu.x,e.y+=Nu.y,e.applyMatrix4(Pu)}function An(){j.call(this),this._currentLevel=0,this.type=`LOD`,Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function jn(e,t){e&&e.isGeometry&&console.error(`THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.`),de.call(this,e,t),this.type=`SkinnedMesh`,this.bindMode=`attached`,this.bindMatrix=new O,this.bindMatrixInverse=new O}function Mn(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 O)}}function Nn(){j.call(this),this.type=`Bone`}function Pn(e,t,n){de.call(this,e,t),this.instanceMatrix=new H(new Float32Array(n*16),16),this.count=n,this.frustumCulled=!1}function Fn(e){V.call(this),this.type=`LineBasicMaterial`,this.color=new z(16777215),this.linewidth=1,this.linecap=`round`,this.linejoin=`round`,this.morphTargets=!1,this.setValues(e)}function In(e,t,n){n===1&&console.error(`THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead.`),j.call(this),this.type=`Line`,this.geometry=e===void 0?new q:e,this.material=t===void 0?new Fn:t,this.updateMorphTargets()}function Ln(e,t){In.call(this,e,t),this.type=`LineSegments`}function Rn(e,t){In.call(this,e,t),this.type=`LineLoop`}function zn(e){V.call(this),this.type=`PointsMaterial`,this.color=new z(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}function Bn(e,t){j.call(this),this.type=`Points`,this.geometry=e===void 0?new q:e,this.material=t===void 0?new zn:t,this.updateMorphTargets()}function Vn(e,t,n,r,i,a,o){var s=rd.distanceSqToPoint(e);if(s<n){var c=new D;rd.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 Hn(e,t,n,r,i,a,o,s,c){S.call(this,e,t,n,r,i,a,o,s,c),this.format=o===void 0?$o:o,this.minFilter=a===void 0?Ko:a,this.magFilter=i===void 0?Ko:i,this.generateMipmaps=!1}function Un(e,t,n,r,i,a,o,s,c,l,u,d){S.call(this,null,a,o,s,c,l,r,i,u,d),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Wn(e,t,n,r,i,a,o,s,c){S.call(this,e,t,n,r,i,a,o,s,c),this.needsUpdate=!0}function Gn(e,t,n,r,i,a,o,s,c,l){if(l=l===void 0?ns:l,l!==1026&&l!==1027)throw Error(`DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);n===void 0&&l===1026&&(n=Xo),n===void 0&&l===1027&&(n=Qo),S.call(this,null,r,i,a,o,s,l,n,c),this.image={width:e,height:t},this.magFilter=o===void 0?Uo:o,this.minFilter=s===void 0?Uo:s,this.flipY=!1,this.generateMipmaps=!1}function Kn(e){q.call(this),this.type=`WireframeGeometry`;var t=[],n,r,i,a,o,s=[0,0],c={},l,u,d,f,p=[`a`,`b`,`c`],m;if(e&&e.isGeometry){var h=e.faces;for(n=0,i=h.length;n<i;n++){var g=h[n];for(r=0;r<3;r++)u=g[p[r]],d=g[p[(r+1)%3]],s[0]=Math.min(u,d),s[1]=Math.max(u,d),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 _,v,y,b,x,S,C,w;if(m=new D,e.index!==null){for(_=e.attributes.position,v=e.index,y=e.groups,y.length===0&&(y=[{start:0,count:v.count,materialIndex:0}]),a=0,o=y.length;a<o;++a)for(b=y[a],x=b.start,S=b.count,n=x,i=x+S;n<i;n+=3)for(r=0;r<3;r++)u=v.getX(n+r),d=v.getX(n+(r+1)%3),s[0]=Math.min(u,d),s[1]=Math.max(u,d),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(_,l.index1),t.push(m.x,m.y,m.z),m.fromBufferAttribute(_,l.index2),t.push(m.x,m.y,m.z)}else for(_=e.attributes.position,n=0,i=_.count/3;n<i;n++)for(r=0;r<3;r++)C=3*n+r,m.fromBufferAttribute(_,C),t.push(m.x,m.y,m.z),w=3*n+(r+1)%3,m.fromBufferAttribute(_,w),t.push(m.x,m.y,m.z)}this.setAttribute(`position`,new K(t,3))}function qn(e,t,n){J.call(this),this.type=`ParametricGeometry`,this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new Jn(e,t,n)),this.mergeVertices()}function Jn(e,t,n){q.call(this),this.type=`ParametricBufferGeometry`,this.parameters={func:e,slices:t,stacks:n};var r=[],i=[],a=[],o=[],s=1e-5,c=new D,l=new D,u=new D,d=new D,f=new D,p,m;e.length<3&&console.error(`THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.`);var h=t+1;for(p=0;p<=n;p++){var g=p/n;for(m=0;m<=t;m++){var _=m/t;e(_,g,l),i.push(l.x,l.y,l.z),_-s>=0?(e(_-s,g,u),d.subVectors(l,u)):(e(_+s,g,u),d.subVectors(u,l)),g-s>=0?(e(_,g-s,u),f.subVectors(l,u)):(e(_,g+s,u),f.subVectors(u,l)),c.crossVectors(d,f).normalize(),a.push(c.x,c.y,c.z),o.push(_,g)}}for(p=0;p<n;p++)for(m=0;m<t;m++){var v=p*h+m,y=p*h+m+1,b=(p+1)*h+m+1,x=(p+1)*h+m;r.push(v,y,x),r.push(y,b,x)}this.setIndex(r),this.setAttribute(`position`,new K(i,3)),this.setAttribute(`normal`,new K(a,3)),this.setAttribute(`uv`,new K(o,2))}function Yn(e,t,n,r){J.call(this),this.type=`PolyhedronGeometry`,this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new Xn(e,t,n,r)),this.mergeVertices()}function Xn(e,t,n,r){q.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 K(i,3)),this.setAttribute(`normal`,new K(i.slice(),3)),this.setAttribute(`uv`,new K(a,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(e){for(var n=new D,r=new D,i=new D,a=0;a<t.length;a+=3)f(t[a+0],n),f(t[a+1],r),f(t[a+2],i),s(n,r,i,e)}function s(e,t,n,r){var i=Math.pow(2,r),a=[],o,s;for(o=0;o<=i;o++){a[o]=[];var c=e.clone().lerp(n,o/i),l=t.clone().lerp(n,o/i),u=i-o;for(s=0;s<=u;s++)s===0&&o===i?a[o][s]=c:a[o][s]=c.clone().lerp(l,s/u)}for(o=0;o<i;o++)for(s=0;s<2*(i-o)-1;s++){var f=Math.floor(s/2);s%2==0?(d(a[o][f+1]),d(a[o+1][f]),d(a[o][f])):(d(a[o][f+1]),d(a[o+1][f+1]),d(a[o+1][f]))}}function c(e){for(var t=new D,n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}function l(){for(var e=new D,t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];var n=h(e)/2/Math.PI+.5,r=g(e)/Math.PI+.5;a.push(n,1-r)}p(),u()}function u(){for(var e=0;e<a.length;e+=6){var t=a[e+0],n=a[e+2],r=a[e+4];Math.max(t,n,r)>.9&&Math.min(t,n,r)<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}function d(e){i.push(e.x,e.y,e.z)}function f(t,n){var r=t*3;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function p(){for(var e=new D,t=new D,n=new D,r=new D,o=new b,s=new b,c=new b,l=0,u=0;l<i.length;l+=9,u+=6){e.set(i[l+0],i[l+1],i[l+2]),t.set(i[l+3],i[l+4],i[l+5]),n.set(i[l+6],i[l+7],i[l+8]),o.set(a[u+0],a[u+1]),s.set(a[u+2],a[u+3]),c.set(a[u+4],a[u+5]),r.copy(e).add(t).add(n).divideScalar(3);var d=h(r);m(o,u+0,e,d),m(s,u+2,t,d),m(c,u+4,n,d)}}function m(e,t,n,r){r<0&&e.x===1&&(a[t]=e.x-1),n.x===0&&n.z===0&&(a[t]=r/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}function g(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}}function Zn(e,t){J.call(this),this.type=`TetrahedronGeometry`,this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Qn(e,t)),this.mergeVertices()}function Qn(e,t){Xn.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type=`TetrahedronBufferGeometry`,this.parameters={radius:e,detail:t}}function $n(e,t){J.call(this),this.type=`OctahedronGeometry`,this.parameters={radius:e,detail:t},this.fromBufferGeometry(new er(e,t)),this.mergeVertices()}function er(e,t){Xn.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type=`OctahedronBufferGeometry`,this.parameters={radius:e,detail:t}}function tr(e,t){J.call(this),this.type=`IcosahedronGeometry`,this.parameters={radius:e,detail:t},this.fromBufferGeometry(new nr(e,t)),this.mergeVertices()}function nr(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];Xn.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type=`IcosahedronBufferGeometry`,this.parameters={radius:e,detail:t}}function rr(e,t){J.call(this),this.type=`DodecahedronGeometry`,this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ir(e,t)),this.mergeVertices()}function ir(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];Xn.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type=`DodecahedronBufferGeometry`,this.parameters={radius:e,detail:t}}function ar(e,t,n,r,i,a){J.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 or(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function or(e,t,n,r,i){q.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 D,s=new D,c=new b,l=new D,u,d,f=[],p=[],m=[],h=[];g(),this.setIndex(h),this.setAttribute(`position`,new K(f,3)),this.setAttribute(`normal`,new K(p,3)),this.setAttribute(`uv`,new K(m,2));function g(){for(u=0;u<t;u++)_(u);_(i===!1?t:0),y(),v()}function _(i){l=e.getPointAt(i/t,l);var c=a.normals[i],u=a.binormals[i];for(d=0;d<=r;d++){var m=d/r*Math.PI*2,h=Math.sin(m),g=-Math.cos(m);s.x=g*c.x+h*u.x,s.y=g*c.y+h*u.y,s.z=g*c.z+h*u.z,s.normalize(),p.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(d=1;d<=t;d++)for(u=1;u<=r;u++){var e=(r+1)*(d-1)+(u-1),n=(r+1)*d+(u-1),i=(r+1)*d+u,a=(r+1)*(d-1)+u;h.push(e,n,a),h.push(n,i,a)}}function y(){for(u=0;u<=t;u++)for(d=0;d<=r;d++)c.x=u/t,c.y=d/r,m.push(c.x,c.y)}}function sr(e,t,n,r,i,a,o){J.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 cr(e,t,n,r,i,a)),this.mergeVertices()}function cr(e,t,n,r,i,a){q.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,d,f=new D,p=new D,m=new D,h=new D,g=new D,_=new D,v=new D;for(u=0;u<=n;++u){var y=u/n*i*Math.PI*2;for(O(y,i,a,e,m),O(y+.01,i,a,e,h),_.subVectors(h,m),v.addVectors(h,m),g.crossVectors(_,v),v.crossVectors(g,_),g.normalize(),v.normalize(),d=0;d<=r;++d){var b=d/r*Math.PI*2,x=-t*Math.cos(b),S=t*Math.sin(b);f.x=m.x+(x*v.x+S*g.x),f.y=m.y+(x*v.y+S*g.y),f.z=m.z+(x*v.z+S*g.z),s.push(f.x,f.y,f.z),p.subVectors(f,m).normalize(),c.push(p.x,p.y,p.z),l.push(u/n),l.push(d/r)}}for(d=1;d<=n;d++)for(u=1;u<=r;u++){var C=(r+1)*(d-1)+(u-1),w=(r+1)*d+(u-1),T=(r+1)*d+u,E=(r+1)*(d-1)+u;o.push(C,w,E),o.push(w,T,E)}this.setIndex(o),this.setAttribute(`position`,new K(s,3)),this.setAttribute(`normal`,new K(c,3)),this.setAttribute(`uv`,new K(l,2));function O(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}}function lr(e,t,n,r,i){J.call(this),this.type=`TorusGeometry`,this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new ur(e,t,n,r,i)),this.mergeVertices()}function ur(e,t,n,r,i){q.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 D,u=new D,d=new D,f,p;for(f=0;f<=n;f++)for(p=0;p<=r;p++){var m=p/r*i,h=f/n*Math.PI*2;u.x=(e+t*Math.cos(h))*Math.cos(m),u.y=(e+t*Math.cos(h))*Math.sin(m),u.z=t*Math.sin(h),o.push(u.x,u.y,u.z),l.x=e*Math.cos(m),l.y=e*Math.sin(m),d.subVectors(u,l).normalize(),s.push(d.x,d.y,d.z),c.push(p/r),c.push(f/n)}for(f=1;f<=n;f++)for(p=1;p<=r;p++){var g=(r+1)*f+p-1,_=(r+1)*(f-1)+p-1,v=(r+1)*(f-1)+p,y=(r+1)*f+p;a.push(g,_,y),a.push(_,v,y)}this.setIndex(a),this.setAttribute(`position`,new K(o,3)),this.setAttribute(`normal`,new K(s,3)),this.setAttribute(`uv`,new K(c,2))}function dr(e,t,n,r,i){var a,o;if(i===Vr(e,t,n,r)>0)for(a=t;a<n;a+=r)o=Rr(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=Rr(a,e[a],e[a+1],o);return o&&Ar(o,o.next)&&(zr(o),o=o.next),o}function fr(e,t){if(!e)return e;t||(t=e);var n=e,r;do if(r=!1,!n.steiner&&(Ar(n,n.next)||kr(n.prev,n,n.next)===0)){if(zr(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function pr(e,t,n,r,i,a,o){if(e){!o&&a&&Cr(e,r,i,a);for(var s=e,c,l;e.prev!==e.next;){if(c=e.prev,l=e.next,a?hr(e,r,i,a):mr(e)){t.push(c.i/n),t.push(e.i/n),t.push(l.i/n),zr(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=gr(fr(e),t,n),pr(e,t,n,r,i,a,2)):o===2&&_r(e,t,n,r,i,a):pr(fr(e),t,n,r,i,a,1);break}}}}function mr(e){var t=e.prev,n=e,r=e.next;if(kr(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Dr(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&kr(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function hr(e,t,n,r){var i=e.prev,a=e,o=e.next;if(kr(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,d=Tr(s,c,t,n,r),f=Tr(l,u,t,n,r),p=e.prevZ,m=e.nextZ;p&&p.z>=d&&m&&m.z<=f;){if(p!==e.prev&&p!==e.next&&Dr(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&kr(p.prev,p,p.next)>=0||(p=p.prevZ,m!==e.prev&&m!==e.next&&Dr(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&kr(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&Dr(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&kr(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=f;){if(m!==e.prev&&m!==e.next&&Dr(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&kr(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function gr(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!Ar(i,a)&&jr(i,r,r.next,a)&&Fr(i,a)&&Fr(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),zr(r),zr(r.next),r=e=a),r=r.next}while(r!==e);return fr(r)}function _r(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Or(o,s)){var c=Lr(o,s);o=fr(o,o.next),c=fr(c,c.next),pr(o,t,n,r,i,a),pr(c,t,n,r,i,a);return}s=s.next}o=o.next}while(o!==e)}function vr(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=dr(e,s,c,r,!1),l===l.next&&(l.steiner=!0),i.push(Er(l));for(i.sort(yr),a=0;a<i.length;a++)br(i[a],n),n=fr(n,n.next);return n}function yr(e,t){return e.x-t.x}function br(e,t){if(t=xr(e,t),t){var n=Lr(t,e);fr(t,t.next),fr(n,n.next)}}function xr(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,d=1/0,f;n=o;do r>=n.x&&n.x>=l&&r!==n.x&&Dr(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),Fr(n,e)&&(f<d||f===d&&(n.x>o.x||n.x===o.x&&Sr(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function Sr(e,t){return kr(e.prev,e,t.prev)<0&&kr(t.next,e,e.next)<0}function Cr(e,t,n,r){var i=e;do i.z===null&&(i.z=Tr(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,wr(i)}function wr(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 Tr(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 Er(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 Dr(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 Or(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Pr(e,t)&&(Fr(e,t)&&Fr(t,e)&&Ir(e,t)&&(kr(e.prev,e,t.prev)||kr(e,t.prev,t))||Ar(e,t)&&kr(e.prev,e,e.next)>0&&kr(t.prev,t,t.next)>0)}function kr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Ar(e,t){return e.x===t.x&&e.y===t.y}function jr(e,t,n,r){var i=Nr(kr(e,t,n)),a=Nr(kr(e,t,r)),o=Nr(kr(n,r,e)),s=Nr(kr(n,r,t));return!!(i!==a&&o!==s||i===0&&Mr(e,n,t)||a===0&&Mr(e,r,t)||o===0&&Mr(n,e,r)||s===0&&Mr(n,t,r))}function Mr(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 Nr(e){return e>0?1:e<0?-1:0}function Pr(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&&jr(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Fr(e,t){return kr(e.prev,e,e.next)<0?kr(e,t,e.next)>=0&&kr(e,e.prev,t)>=0:kr(e,t,e.prev)<0||kr(e,e.next,t)<0}function Ir(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 Lr(e,t){var n=new Br(e.i,e.x,e.y),r=new Br(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 Rr(e,t,n,r){var i=new Br(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 zr(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 Br(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 Vr(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}function Hr(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Ur(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function Wr(e,t){J.call(this),this.type=`ExtrudeGeometry`,this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Gr(e,t)),this.mergeVertices()}function Gr(e,t){q.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 K(r,3)),this.setAttribute(`uv`,new K(i,2)),this.computeVertexNormals();function c(e){var a=[],o=t.curveSegments===void 0?12:t.curveSegments,s=t.steps===void 0?1:t.steps,c=t.depth===void 0?100:t.depth,l=t.bevelEnabled===void 0?!0:t.bevelEnabled,u=t.bevelThickness===void 0?6:t.bevelThickness,d=t.bevelSize===void 0?u-2:t.bevelSize,f=t.bevelOffset===void 0?0:t.bevelOffset,p=t.bevelSegments===void 0?3:t.bevelSegments,m=t.extrudePath,h=t.UVGenerator===void 0?cd:t.UVGenerator;t.amount!==void 0&&(console.warn(`THREE.ExtrudeBufferGeometry: amount has been renamed to depth.`),c=t.amount);var g,_=!1,v,y,x,S;m&&(g=m.getSpacedPoints(s),_=!0,l=!1,v=m.computeFrenetFrames(s,!1),y=new D,x=new D,S=new D),l||(p=0,u=0,d=0,f=0);var C,w,T,E=e.extractPoints(o),O=E.shape,k=E.holes;if(!sd.isClockWise(O))for(O=O.reverse(),w=0,T=k.length;w<T;w++)C=k[w],sd.isClockWise(C)&&(k[w]=C.reverse());var A=sd.triangulateShape(O,k),j=O;for(w=0,T=k.length;w<T;w++)C=k[w],O=O.concat(C);function M(e,t,n){return t||console.error(`THREE.ExtrudeGeometry: vec does not exist`),t.clone().multiplyScalar(n).add(e)}var N,P,F,I,L,R=O.length,z,ee=A.length;function te(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,c=n.x-e.x,l=n.y-e.y,u=o*o+s*s,d=o*l-s*c;if(Math.abs(d)>Number.EPSILON){var f=Math.sqrt(u),p=Math.sqrt(c*c+l*l),m=t.x-s/f,h=t.y+o/f,g=n.x-l/p,_=n.y+c/p,v=((g-m)*l-(_-h)*c)/(o*l-s*c);r=m+o*v-e.x,i=h+s*v-e.y;var y=r*r+i*i;if(y<=2)return new b(r,i);a=Math.sqrt(y/2)}else{var x=!1;o>Number.EPSILON?c>Number.EPSILON&&(x=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(x=!0):Math.sign(s)===Math.sign(l)&&(x=!0),x?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new b(r/a,i/a)}for(var ne=[],B=0,V=j.length,re=V-1,H=B+1;B<V;B++,re++,H++)re===V&&(re=0),H===V&&(H=0),ne[B]=te(j[B],j[re],j[H]);var U=[],ie,W=ne.concat();for(w=0,T=k.length;w<T;w++){for(C=k[w],ie=[],B=0,V=C.length,re=V-1,H=B+1;B<V;B++,re++,H++)re===V&&(re=0),H===V&&(H=0),ie[B]=te(C[B],C[re],C[H]);U.push(ie),W=W.concat(ie)}for(N=0;N<p;N++){for(F=N/p,I=u*Math.cos(F*Math.PI/2),P=d*Math.sin(F*Math.PI/2)+f,B=0,V=j.length;B<V;B++)L=M(j[B],ne[B],P),K(L.x,L.y,-I);for(w=0,T=k.length;w<T;w++)for(C=k[w],ie=U[w],B=0,V=C.length;B<V;B++)L=M(C[B],ie[B],P),K(L.x,L.y,-I)}for(P=d+f,B=0;B<R;B++)L=l?M(O[B],W[B],P):O[B],_?(x.copy(v.normals[0]).multiplyScalar(L.x),y.copy(v.binormals[0]).multiplyScalar(L.y),S.copy(g[0]).add(x).add(y),K(S.x,S.y,S.z)):K(L.x,L.y,0);var ae;for(ae=1;ae<=s;ae++)for(B=0;B<R;B++)L=l?M(O[B],W[B],P):O[B],_?(x.copy(v.normals[ae]).multiplyScalar(L.x),y.copy(v.binormals[ae]).multiplyScalar(L.y),S.copy(g[ae]).add(x).add(y),K(S.x,S.y,S.z)):K(L.x,L.y,c/s*ae);for(N=p-1;N>=0;N--){for(F=N/p,I=u*Math.cos(F*Math.PI/2),P=d*Math.sin(F*Math.PI/2)+f,B=0,V=j.length;B<V;B++)L=M(j[B],ne[B],P),K(L.x,L.y,c+I);for(w=0,T=k.length;w<T;w++)for(C=k[w],ie=U[w],B=0,V=C.length;B<V;B++)L=M(C[B],ie[B],P),_?K(L.x,L.y+g[s-1].y,g[s-1].x+I):K(L.x,L.y,c+I)}G(),oe();function G(){var e=r.length/3;if(l){var t=0,i=R*t;for(B=0;B<ee;B++)z=A[B],ce(z[2]+i,z[1]+i,z[0]+i);for(t=s+p*2,i=R*t,B=0;B<ee;B++)z=A[B],ce(z[0]+i,z[1]+i,z[2]+i)}else{for(B=0;B<ee;B++)z=A[B],ce(z[2],z[1],z[0]);for(B=0;B<ee;B++)z=A[B],ce(z[0]+R*s,z[1]+R*s,z[2]+R*s)}n.addGroup(e,r.length/3-e,0)}function oe(){var e=r.length/3,t=0;for(se(j,t),t+=j.length,w=0,T=k.length;w<T;w++)C=k[w],se(C,t),t+=C.length;n.addGroup(e,r.length/3-e,1)}function se(e,t){var n,r;for(B=e.length;--B>=0;){n=B,r=B-1,r<0&&(r=e.length-1);var i=0,a=s+p*2;for(i=0;i<a;i++){var o=R*i,c=R*(i+1);le(t+n+o,t+r+o,t+r+c,t+n+c)}}}function K(e,t,n){a.push(e),a.push(t),a.push(n)}function ce(e,t,i){ue(e),ue(t),ue(i);var a=r.length/3,o=h.generateTopUV(n,r,a-3,a-2,a-1);q(o[0]),q(o[1]),q(o[2])}function le(e,t,i,a){ue(e),ue(t),ue(a),ue(t),ue(i),ue(a);var o=r.length/3,s=h.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);q(s[0]),q(s[1]),q(s[3]),q(s[1]),q(s[2]),q(s[3])}function ue(e){r.push(a[e*3+0]),r.push(a[e*3+1]),r.push(a[e*3+2])}function q(e){i.push(e.x),i.push(e.y)}}}function Kr(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 qr(e,t){J.call(this),this.type=`TextGeometry`,this.parameters={text:e,parameters:t},this.fromBufferGeometry(new Jr(e,t)),this.mergeVertices()}function Jr(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 J;var r=n.generateShapes(e,t.size);t.depth=t.height===void 0?50:t.height,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),Gr.call(this,r,t),this.type=`TextBufferGeometry`}function Yr(e,t,n,r,i,a,o){J.call(this),this.type=`SphereGeometry`,this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Xr(e,t,n,r,i,a,o)),this.mergeVertices()}function Xr(e,t,n,r,i,a,o){q.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?0:r,i=i===void 0?Math.PI*2:i,a=a===void 0?0:a,o=o===void 0?Math.PI:o;var s=Math.min(a+o,Math.PI),c,l,u=0,d=[],f=new D,p=new D,m=[],h=[],g=[],_=[];for(l=0;l<=n;l++){var v=[],y=l/n,b=0;for(l==0&&a==0?b=.5/t:l==n&&s==Math.PI&&(b=-.5/t),c=0;c<=t;c++){var x=c/t;f.x=-e*Math.cos(r+x*i)*Math.sin(a+y*o),f.y=e*Math.cos(a+y*o),f.z=e*Math.sin(r+x*i)*Math.sin(a+y*o),h.push(f.x,f.y,f.z),p.copy(f).normalize(),g.push(p.x,p.y,p.z),_.push(x+b,1-y),v.push(u++)}d.push(v)}for(l=0;l<n;l++)for(c=0;c<t;c++){var S=d[l][c+1],C=d[l][c],w=d[l+1][c],T=d[l+1][c+1];(l!==0||a>0)&&m.push(S,C,T),(l!==n-1||s<Math.PI)&&m.push(C,w,T)}this.setIndex(m),this.setAttribute(`position`,new K(h,3)),this.setAttribute(`normal`,new K(g,3)),this.setAttribute(`uv`,new K(_,2))}function Zr(e,t,n,r,i,a){J.call(this),this.type=`RingGeometry`,this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new Qr(e,t,n,r,i,a)),this.mergeVertices()}function Qr(e,t,n,r,i,a){q.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?0:i,a=a===void 0?Math.PI*2:a,n=n===void 0?8:Math.max(3,n),r=r===void 0?1:Math.max(1,r);var o=[],s=[],c=[],l=[],u,d=e,f=(t-e)/r,p=new D,m=new b,h,g;for(h=0;h<=r;h++){for(g=0;g<=n;g++)u=i+g/n*a,p.x=d*Math.cos(u),p.y=d*Math.sin(u),s.push(p.x,p.y,p.z),c.push(0,0,1),m.x=(p.x/t+1)/2,m.y=(p.y/t+1)/2,l.push(m.x,m.y);d+=f}for(h=0;h<r;h++){var _=h*(n+1);for(g=0;g<n;g++){u=g+_;var v=u,y=u+n+1,x=u+n+2,S=u+1;o.push(v,y,S),o.push(y,x,S)}}this.setIndex(o),this.setAttribute(`position`,new K(s,3)),this.setAttribute(`normal`,new K(c,3)),this.setAttribute(`uv`,new K(l,2))}function $r(e,t,n,r){J.call(this),this.type=`LatheGeometry`,this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new ei(e,t,n,r)),this.mergeVertices()}function ei(e,t,n,r){q.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=X.clamp(r,0,Math.PI*2);var i=[],a=[],o=[],s,c=1/t,l=new D,u=new b,d,f;for(d=0;d<=t;d++){var p=n+d*c*r,m=Math.sin(p),h=Math.cos(p);for(f=0;f<=e.length-1;f++)l.x=e[f].x*m,l.y=e[f].y,l.z=e[f].x*h,a.push(l.x,l.y,l.z),u.x=d/t,u.y=f/(e.length-1),o.push(u.x,u.y)}for(d=0;d<t;d++)for(f=0;f<e.length-1;f++){s=f+d*e.length;var g=s,_=s+e.length,v=s+e.length+1,y=s+1;i.push(g,_,y),i.push(_,v,y)}if(this.setIndex(i),this.setAttribute(`position`,new K(a,3)),this.setAttribute(`uv`,new K(o,2)),this.computeVertexNormals(),r===Math.PI*2){var x=this.attributes.normal.array,S=new D,C=new D,w=new D;for(s=t*e.length*3,d=0,f=0;d<e.length;d++,f+=3)S.x=x[f+0],S.y=x[f+1],S.z=x[f+2],C.x=x[s+f+0],C.y=x[s+f+1],C.z=x[s+f+2],w.addVectors(S,C).normalize(),x[f+0]=x[s+f+0]=w.x,x[f+1]=x[s+f+1]=w.y,x[f+2]=x[s+f+2]=w.z}}function ti(e,t){J.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 ni(e,t)),this.mergeVertices()}function ni(e,t){q.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 K(r,3)),this.setAttribute(`normal`,new K(i,3)),this.setAttribute(`uv`,new K(a,2));function l(e){var o,c,l,u=r.length/3,d=e.extractPoints(t),f=d.shape,p=d.holes;for(sd.isClockWise(f)===!1&&(f=f.reverse()),o=0,c=p.length;o<c;o++)l=p[o],sd.isClockWise(l)===!0&&(p[o]=l.reverse());var m=sd.triangulateShape(f,p);for(o=0,c=p.length;o<c;o++)l=p[o],f=f.concat(l);for(o=0,c=f.length;o<c;o++){var h=f[o];r.push(h.x,h.y,0),i.push(0,0,1),a.push(h.x,h.y)}for(o=0,c=m.length;o<c;o++){var g=m[o],_=g[0]+u,v=g[1]+u,y=g[2]+u;n.push(_,v,y),s+=3}}}function ri(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 ii(e,t){q.call(this),this.type=`EdgesGeometry`,this.parameters={thresholdAngle:t},t=t===void 0?1:t;var n=[],r=Math.cos(X.DEG2RAD*t),i=[0,0],a={},o,s,c,l=[`a`,`b`,`c`],u;e.isBufferGeometry?(u=new J,u.fromBufferGeometry(e)):u=e.clone(),u.mergeVertices(),u.computeFaceNormals();for(var d=u.vertices,f=u.faces,p=0,m=f.length;p<m;p++)for(var h=f[p],g=0;g<3;g++)o=h[l[g]],s=h[l[(g+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:p,face2:void 0}:a[c].face2=p;for(c in a){var _=a[c];if(_.face2===void 0||f[_.face1].normal.dot(f[_.face2].normal)<=r){var v=d[_.index1];n.push(v.x,v.y,v.z),v=d[_.index2],n.push(v.x,v.y,v.z)}}this.setAttribute(`position`,new K(n,3))}function ai(e,t,n,r,i,a,o,s){J.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 oi(e,t,n,r,i,a,o,s)),this.mergeVertices()}function oi(e,t,n,r,i,a,o,s){q.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?1:e,t=t===void 0?1:t,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,a=a===void 0?!1:a,o=o===void 0?0:o,s=s===void 0?Math.PI*2:s;var l=[],u=[],d=[],f=[],p=0,m=[],h=n/2,g=0;_(),a===!1&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new K(u,3)),this.setAttribute(`normal`,new K(d,3)),this.setAttribute(`uv`,new K(f,2));function _(){var a,_,v=new D,y=new D,b=0,x=(t-e)/n;for(_=0;_<=i;_++){var S=[],C=_/i,w=C*(t-e)+e;for(a=0;a<=r;a++){var T=a/r,E=T*s+o,O=Math.sin(E),k=Math.cos(E);y.x=w*O,y.y=-C*n+h,y.z=w*k,u.push(y.x,y.y,y.z),v.set(O,x,k).normalize(),d.push(v.x,v.y,v.z),f.push(T,1-C),S.push(p++)}m.push(S)}for(a=0;a<r;a++)for(_=0;_<i;_++){var A=m[_][a],j=m[_+1][a],M=m[_+1][a+1],N=m[_][a+1];l.push(A,j,N),l.push(j,M,N),b+=6}c.addGroup(g,b,0),g+=b}function v(n){var i,a,m,_=new b,v=new D,y=0,x=n===!0?e:t,S=n===!0?1:-1;for(a=p,i=1;i<=r;i++)u.push(0,h*S,0),d.push(0,S,0),f.push(.5,.5),p++;for(m=p,i=0;i<=r;i++){var C=i/r*s+o,w=Math.cos(C),T=Math.sin(C);v.x=x*T,v.y=h*S,v.z=x*w,u.push(v.x,v.y,v.z),d.push(0,S,0),_.x=w*.5+.5,_.y=T*.5*S+.5,f.push(_.x,_.y),p++}for(i=0;i<r;i++){var E=a+i,O=m+i;n===!0?l.push(O,O+1,E):l.push(O+1,O,E),y+=3}c.addGroup(g,y,n===!0?1:2),g+=y}}function si(e,t,n,r,i,a,o){ai.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}}function ci(e,t,n,r,i,a,o){oi.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}}function li(e,t,n,r){J.call(this),this.type=`CircleGeometry`,this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new ui(e,t,n,r)),this.mergeVertices()}function ui(e,t,n,r){q.call(this),this.type=`CircleBufferGeometry`,this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=t===void 0?8:Math.max(3,t),n=n===void 0?0:n,r=r===void 0?Math.PI*2:r;var i=[],a=[],o=[],s=[],c,l,u=new D,d=new b;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),d.x=(a[c]/e+1)/2,d.y=(a[c+1]/e+1)/2,s.push(d.x,d.y)}for(c=1;c<=t;c++)i.push(c,c+1,0);this.setIndex(i),this.setAttribute(`position`,new K(a,3)),this.setAttribute(`normal`,new K(o,3)),this.setAttribute(`uv`,new K(s,2))}function di(e){V.call(this),this.type=`ShadowMaterial`,this.color=new z(0),this.transparent=!0,this.setValues(e)}function fi(e){ge.call(this,e),this.type=`RawShaderMaterial`}function pi(e){V.call(this),this.defines={STANDARD:``},this.type=`MeshStandardMaterial`,this.color=new z(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 z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new b(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)}function mi(e){pi.call(this),this.defines={STANDARD:``,PHYSICAL:``},this.type=`MeshPhysicalMaterial`,this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new b(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(e)}function hi(e){V.call(this),this.type=`MeshPhongMaterial`,this.color=new z(16777215),this.specular=new z(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function gi(e){V.call(this),this.defines={TOON:``},this.type=`MeshToonMaterial`,this.color=new z(16777215),this.specular=new z(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 z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new b(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)}function _i(e){V.call(this),this.type=`MeshNormalMaterial`,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function vi(e){V.call(this),this.type=`MeshLambertMaterial`,this.color=new z(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function yi(e){V.call(this),this.defines={MATCAP:``},this.type=`MeshMatcapMaterial`,this.color=new z(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function bi(e){Fn.call(this),this.type=`LineDashedMaterial`,this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}function xi(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r===void 0?new t.constructor(n):r,this.sampleValues=t,this.valueSize=n}function Si(e,t,n,r){xi.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Ci(e,t,n,r){xi.call(this,e,t,n,r)}function wi(e,t,n,r){xi.call(this,e,t,n,r)}function Ti(e,t,n,r){if(e===void 0)throw Error(`THREE.KeyframeTrack: track name is undefined`);if(t===void 0||t.length===0)throw Error(`THREE.KeyframeTrack: no keyframes in track named `+e);this.name=e,this.times=dd.convertArray(t,this.TimeBufferType),this.values=dd.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function Ei(e,t,n){Ti.call(this,e,t,n)}function Di(e,t,n,r){Ti.call(this,e,t,n,r)}function Oi(e,t,n,r){Ti.call(this,e,t,n,r)}function ki(e,t,n,r){xi.call(this,e,t,n,r)}function Ai(e,t,n,r){Ti.call(this,e,t,n,r)}function ji(e,t,n,r){Ti.call(this,e,t,n,r)}function Mi(e,t,n,r){Ti.call(this,e,t,n,r)}function Ni(e,t,n,r){this.name=e,this.tracks=n,this.duration=t===void 0?-1:t,this.blendMode=r===void 0?Zs:r,this.uuid=X.generateUUID(),this.duration<0&&this.resetDuration()}function Pi(e){switch(e.toLowerCase()){case`scalar`:case`double`:case`float`:case`number`:case`integer`:return Oi;case`vector`:case`vector2`:case`vector3`:case`vector4`:return Mi;case`color`:return Di;case`quaternion`:return Ai;case`bool`:case`boolean`:return Ei;case`string`:return ji}throw Error(`THREE.KeyframeTrack: Unsupported typeName: `+e)}function Fi(e){if(e.type===void 0)throw Error(`THREE.KeyframeTrack: track type undefined, can not parse`);var t=Pi(e.type);if(e.times===void 0){var n=[],r=[];dd.flattenJSON(e.keys,n,r,`value`),e.times=n,e.values=r}return t.parse===void 0?new t(e.name,e.times,e.values,e.interpolation):t.parse(e)}function Ii(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(e){o++,i===!1&&r.onStart!==void 0&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,r.onProgress!==void 0&&r.onProgress(e,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(e){r.onError!==void 0&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){var t=c.indexOf(e);return t!==-1&&c.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=c.length;t<n;t+=2){var r=c[t],i=c[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null}}function Li(e){this.manager=e===void 0?pd:e,this.crossOrigin=`anonymous`,this.path=``,this.resourcePath=``,this.requestHeader={}}function Ri(e){Li.call(this,e)}function zi(e){Li.call(this,e)}function Bi(e){Li.call(this,e)}function Vi(e){Li.call(this,e)}function Hi(e){Li.call(this,e)}function Ui(e){Li.call(this,e)}function Wi(e){Li.call(this,e)}function Y(){this.type=`Curve`,this.arcLengthDivisions=200}function Gi(e,t,n,r,i,a,o,s){Y.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}function Ki(e,t,n,r,i,a){Gi.call(this,e,t,n,n,r,i,a),this.type=`ArcCurve`}function qi(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;c*=o,l*=o,i(t,n,c,l)},calc:function(i){var a=i*i,o=a*i;return e+t*i+n*a+r*o}}}function Ji(e,t,n,r){Y.call(this),this.type=`CatmullRomCurve3`,this.points=e||[],this.closed=t||!1,this.curveType=n||`centripetal`,this.tension=r||.5}function Yi(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 Xi(e,t){var n=1-e;return n*n*t}function Zi(e,t){return 2*(1-e)*e*t}function Qi(e,t){return e*e*t}function $i(e,t,n,r){return Xi(e,t)+Zi(e,n)+Qi(e,r)}function ea(e,t){var n=1-e;return n*n*n*t}function ta(e,t){var n=1-e;return 3*n*n*e*t}function na(e,t){return 3*(1-e)*e*e*t}function ra(e,t){return e*e*e*t}function ia(e,t,n,r,i){return ea(e,t)+ta(e,n)+na(e,r)+ra(e,i)}function aa(e,t,n,r){Y.call(this),this.type=`CubicBezierCurve`,this.v0=e||new b,this.v1=t||new b,this.v2=n||new b,this.v3=r||new b}function oa(e,t,n,r){Y.call(this),this.type=`CubicBezierCurve3`,this.v0=e||new D,this.v1=t||new D,this.v2=n||new D,this.v3=r||new D}function sa(e,t){Y.call(this),this.type=`LineCurve`,this.v1=e||new b,this.v2=t||new b}function ca(e,t){Y.call(this),this.type=`LineCurve3`,this.v1=e||new D,this.v2=t||new D}function la(e,t,n){Y.call(this),this.type=`QuadraticBezierCurve`,this.v0=e||new b,this.v1=t||new b,this.v2=n||new b}function ua(e,t,n){Y.call(this),this.type=`QuadraticBezierCurve3`,this.v0=e||new D,this.v1=t||new D,this.v2=n||new D}function da(e){Y.call(this),this.type=`SplineCurve`,this.points=e||[]}function fa(){Y.call(this),this.type=`CurvePath`,this.curves=[],this.autoClose=!1}function pa(e){fa.call(this),this.type=`Path`,this.currentPoint=new b,e&&this.setFromPoints(e)}function ma(e){pa.call(this,e),this.uuid=X.generateUUID(),this.type=`Shape`,this.holes=[]}function ha(e,t){j.call(this),this.type=`Light`,this.color=new z(e),this.intensity=t===void 0?1:t,this.receiveShadow=void 0}function ga(e,t,n){ha.call(this,e,n),this.type=`HemisphereLight`,this.castShadow=void 0,this.position.copy(j.DefaultUp),this.updateMatrix(),this.groundColor=new z(t)}function _a(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new b(512,512),this.map=null,this.mapPass=null,this.matrix=new O,this._frustum=new Se,this._frameExtents=new b(1,1),this._viewportCount=1,this._viewports=[new C(0,0,1,1)]}function va(){_a.call(this,new ve(50,1,.5,500))}function ya(e,t,n,r,i,a){ha.call(this,e,t),this.type=`SpotLight`,this.position.copy(j.DefaultUp),this.updateMatrix(),this.target=new j,Object.defineProperty(this,`power`,{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=n===void 0?0:n,this.angle=r===void 0?Math.PI/3:r,this.penumbra=i===void 0?0:i,this.decay=a===void 0?1:a,this.shadow=new va}function ba(){_a.call(this,new ve(90,1,.5,500)),this._frameExtents=new b(4,2),this._viewportCount=6,this._viewports=[new C(2,1,1,1),new C(0,1,1,1),new C(3,1,1,1),new C(1,1,1,1),new C(3,0,1,1),new C(1,0,1,1)],this._cubeDirections=[new D(1,0,0),new D(-1,0,0),new D(0,0,1),new D(0,0,-1),new D(0,1,0),new D(0,-1,0)],this._cubeUps=[new D(0,1,0),new D(0,1,0),new D(0,1,0),new D(0,1,0),new D(0,0,1),new D(0,0,-1)]}function xa(e,t,n,r){ha.call(this,e,t),this.type=`PointLight`,Object.defineProperty(this,`power`,{get:function(){return this.intensity*4*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=n===void 0?0:n,this.decay=r===void 0?1:r,this.shadow=new ba}function Sa(e,t,n,r,i,a){_e.call(this),this.type=`OrthographicCamera`,this.zoom=1,this.view=null,this.left=e===void 0?-1:e,this.right=t===void 0?1:t,this.top=n===void 0?1:n,this.bottom=r===void 0?-1:r,this.near=i===void 0?.1:i,this.far=a===void 0?2e3:a,this.updateProjectionMatrix()}function Ca(){_a.call(this,new Sa(-5,5,5,-5,.5,500))}function wa(e,t){ha.call(this,e,t),this.type=`DirectionalLight`,this.position.copy(j.DefaultUp),this.updateMatrix(),this.target=new j,this.shadow=new Ca}function Ta(e,t){ha.call(this,e,t),this.type=`AmbientLight`,this.castShadow=void 0}function Ea(e,t,n,r){ha.call(this,e,t),this.type=`RectAreaLight`,this.width=n===void 0?10:n,this.height=r===void 0?10:r}function Da(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new D)}function Oa(e,t){ha.call(this,void 0,t),this.type=`LightProbe`,this.sh=e===void 0?new Da:e}function ka(e){Li.call(this,e),this.textures={}}function Aa(){q.call(this),this.type=`InstancedBufferGeometry`,this.instanceCount=1/0}function ja(e,t,n,r){typeof n==`number`&&(r=n,n=!1,console.error(`THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.`)),H.call(this,e,t,n),this.meshPerAttribute=r||1}function Ma(e){Li.call(this,e)}function Na(e){Li.call(this,e)}function Pa(e){typeof createImageBitmap>`u`&&console.warn(`THREE.ImageBitmapLoader: createImageBitmap() not supported.`),typeof fetch>`u`&&console.warn(`THREE.ImageBitmapLoader: fetch() not supported.`),Li.call(this,e),this.options=void 0}function Fa(){this.type=`ShapePath`,this.color=new z,this.subPaths=[],this.currentPath=null}function Ia(e){this.type=`Font`,this.data=e}function La(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===`\n`)s=0,c-=a;else{var d=Ra(u,i,s,c,n);s+=d.offsetX,o.push(d.path)}}return o}function Ra(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 Fa,s,c,l,u,d,f,p,m;if(a.o)for(var h=a._cachedOutline||(a._cachedOutline=a.o.split(` `)),g=0,_=h.length;g<_;)switch(h[g++]){case`m`:s=h[g++]*t+n,c=h[g++]*t+r,o.moveTo(s,c);break;case`l`:s=h[g++]*t+n,c=h[g++]*t+r,o.lineTo(s,c);break;case`q`:l=h[g++]*t+n,u=h[g++]*t+r,d=h[g++]*t+n,f=h[g++]*t+r,o.quadraticCurveTo(d,f,l,u);break;case`b`:l=h[g++]*t+n,u=h[g++]*t+r,d=h[g++]*t+n,f=h[g++]*t+r,p=h[g++]*t+n,m=h[g++]*t+r,o.bezierCurveTo(d,f,p,m,l,u);break}return{offsetX:a.ha*t,path:o}}function za(e){Li.call(this,e)}function Ba(e){Li.call(this,e)}function Va(e,t,n){Oa.call(this,void 0,n);var r=new z().set(e),i=new z().set(t),a=new D(r.r,r.g,r.b),o=new D(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)}function Ha(e,t){Oa.call(this,void 0,t);var n=new z().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}function Ua(){this.type=`StereoCamera`,this.aspect=1,this.eyeSep=.064,this.cameraL=new ve,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ve,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}}function Wa(e){this.autoStart=e===void 0?!0:e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function Ga(){j.call(this),this.type=`AudioListener`,this.context=Ed.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Wa}function Ka(e){j.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=[]}function qa(e){Ka.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel=`HRTF`,this.panner.connect(this.gain)}function Ja(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t===void 0?2048:t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Ya(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=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}function Xa(e,t,n){var r=n||Za.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Za(e,t,n){this.path=t,this.parsedPath=n||Za.parseTrackName(t),this.node=Za.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Qa(){this.uuid=X.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}}}function $a(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=Array(a),s={endingStart:Js,endingEnd:Js},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=Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Us,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function eo(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function to(e){typeof e==`string`&&(console.warn(`THREE.Uniform: Type parameter is no longer needed.`),e=arguments[1]),this.value=e}function no(e,t,n){Tn.call(this,e,t),this.meshPerAttribute=n||1}function ro(e,t,n,r){this.ray=new I(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new A,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 io(e,t){return e.distance-t.distance}function ao(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++)ao(i[a],t,n,!0)}function oo(e,t,n){return this.radius=e===void 0?1:e,this.phi=t===void 0?0:t,this.theta=n===void 0?0:n,this}function so(e,t,n){return this.radius=e===void 0?1:e,this.theta=t===void 0?0:t,this.y=n===void 0?0:n,this}function co(e,t){this.min=e===void 0?new b(1/0,1/0):e,this.max=t===void 0?new b(-1/0,-1/0):t}function lo(e,t){this.start=e===void 0?new D:e,this.end=t===void 0?new D:t}function uo(e){j.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}function fo(e,t){j.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new q,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 K(r,3));var l=new Fn({fog:!1,toneMapped:!1});this.cone=new Ln(n,l),this.add(this.cone),this.update()}function po(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,po(e.children[n]));return t}function mo(e){for(var t=po(e),n=new q,r=[],i=[],a=new z(0,0,1),o=new z(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 K(r,3)),n.setAttribute(`color`,new K(i,3));var l=new Fn({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});Ln.call(this,n,l),this.type=`SkeletonHelper`,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function ho(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new Xr(t,4,2),i=new re({wireframe:!0,fog:!1,toneMapped:!1});de.call(this,r,i),this.type=`PointLightHelper`,this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function go(e,t,n){j.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new er(t);r.rotateY(Math.PI*.5),this.material=new re({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 H(a,3)),this.add(new de(r,this.material)),this.update()}function _o(e,t,n,r){e=e||10,t=t||10,n=new z(n===void 0?4473924:n),r=new z(r===void 0?8947848:r);for(var i=t/2,a=e/t,o=e/2,s=[],c=[],l=0,u=0,d=-o;l<=t;l++,d+=a){s.push(-o,0,d,o,0,d),s.push(d,0,-o,d,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 p=new q;p.setAttribute(`position`,new K(s,3)),p.setAttribute(`color`,new K(c,3));var m=new Fn({vertexColors:!0,toneMapped:!1});Ln.call(this,p,m),this.type=`GridHelper`}function vo(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new z(i===void 0?4473924:i),a=new z(a===void 0?8947848:a);var o=[],s=[],c,l,u,d,f,p,m;for(d=0;d<=t;d++)u=d/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=d&1?i:a,s.push(m.r,m.g,m.b),s.push(m.r,m.g,m.b);for(d=0;d<=n;d++)for(m=d&1?i:a,p=e-e/n*d,f=0;f<r;f++)u=f/r*(Math.PI*2),c=Math.sin(u)*p,l=Math.cos(u)*p,o.push(c,0,l),s.push(m.r,m.g,m.b),u=(f+1)/r*(Math.PI*2),c=Math.sin(u)*p,l=Math.cos(u)*p,o.push(c,0,l),s.push(m.r,m.g,m.b);var h=new q;h.setAttribute(`position`,new K(o,3)),h.setAttribute(`color`,new K(s,3));var g=new Fn({vertexColors:!0,toneMapped:!1});Ln.call(this,h,g),this.type=`PolarGridHelper`}function yo(e,t,n){j.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 q;r.setAttribute(`position`,new K([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new Fn({fog:!1,toneMapped:!1});this.lightPlane=new In(r,i),this.add(this.lightPlane),r=new q,r.setAttribute(`position`,new K([0,0,0,0,0,1],3)),this.targetLine=new In(r,i),this.add(this.targetLine),this.update()}function bo(e){var t=new q,n=new Fn({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],a={},o=new z(16755200),s=new z(16711680),c=new z(43775),l=new z(16777215),u=new z(3355443);d(`n1`,`n2`,o),d(`n2`,`n4`,o),d(`n4`,`n3`,o),d(`n3`,`n1`,o),d(`f1`,`f2`,o),d(`f2`,`f4`,o),d(`f4`,`f3`,o),d(`f3`,`f1`,o),d(`n1`,`f1`,o),d(`n2`,`f2`,o),d(`n3`,`f3`,o),d(`n4`,`f4`,o),d(`p`,`n1`,s),d(`p`,`n2`,s),d(`p`,`n3`,s),d(`p`,`n4`,s),d(`u1`,`u2`,c),d(`u2`,`u3`,c),d(`u3`,`u1`,c),d(`c`,`t`,l),d(`p`,`c`,u),d(`cn1`,`cn2`,u),d(`cn3`,`cn4`,u),d(`cf1`,`cf2`,u),d(`cf3`,`cf4`,u);function d(e,t,n){f(e,n),f(t,n)}function f(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),a[e]===void 0&&(a[e]=[]),a[e].push(r.length/3-1)}t.setAttribute(`position`,new K(r,3)),t.setAttribute(`color`,new K(i,3)),Ln.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()}function xo(e,t,n,r,i,a,o){sf.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],sf.x,sf.y,sf.z)}function So(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(24),i=new q;i.setIndex(new H(n,1)),i.setAttribute(`position`,new H(r,3)),Ln.call(this,i,new Fn({color:t,toneMapped:!1})),this.type=`BoxHelper`,this.matrixAutoUpdate=!1,this.update()}function Co(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 q;i.setIndex(new H(n,1)),i.setAttribute(`position`,new K(r,3)),Ln.call(this,i,new Fn({color:t,toneMapped:!1})),this.type=`Box3Helper`,this.geometry.computeBoundingSphere()}function wo(e,t,n){this.plane=e,this.size=t===void 0?1:t;var r=n===void 0?16776960: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,0,1,0,0,0],a=new q;a.setAttribute(`position`,new K(i,3)),a.computeBoundingSphere(),In.call(this,a,new Fn({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 q;s.setAttribute(`position`,new K(o,3)),s.computeBoundingSphere(),this.add(new de(s,new re({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}function To(e,t,n,r,i,a){j.call(this),this.type=`ArrowHelper`,e===void 0&&(e=new D(0,0,1)),t===void 0&&(t=new D(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),df===void 0&&(df=new q,df.setAttribute(`position`,new K([0,0,0,0,1,0],3)),ff=new oi(0,.5,1,5,1),ff.translate(0,-.5,0)),this.position.copy(t),this.line=new In(df,new Fn({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new de(ff,new re({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}function Eo(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 q;r.setAttribute(`position`,new K(t,3)),r.setAttribute(`color`,new K(n,3));var i=new Fn({vertexColors:!0,toneMapped:!1});Ln.call(this,r,i),this.type=`AxesHelper`}function Do(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=Mo(vf),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}function Oo(e){return e===void 0||e.type!==1009?!1:e.encoding===3e3||e.encoding===3001||e.encoding===3007}function ko(){for(var e=[],t=[],n=[],r=mf,i=0;i<_f;i++){var a=Math.pow(2,r);t.push(a);var o=1/a;i>mf-pf?o=gf[i-mf+pf-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],d=6,f=6,p=3,m=2,h=1,g=new Float32Array(p*f*d),_=new Float32Array(m*f*d),v=new Float32Array(h*f*d),y=0;y<d;y++){var b=y%3*2/3-1,x=y>2?0:-1,S=[b,x,0,b+2/3,x,0,b+2/3,x+1,0,b,x,0,b+2/3,x+1,0,b,x+1,0];g.set(S,p*f*y),_.set(u,m*f*y);var C=[y,y,y,y,y,y];v.set(C,h*f*y)}var w=new q;w.setAttribute(`position`,new H(g,p)),w.setAttribute(`uv`,new H(_,m)),w.setAttribute(`faceIndex`,new H(v,h)),e.push(w),r>pf&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function Ao(e){var t=new w(3*hf,3*hf,e);return t.texture.mapping=306,t.texture.name=`PMREM.cubeUv`,t.scissorTest=!0,t}function jo(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Mo(e){var t=new Float32Array(e),n=new D(0,1,0),r=new fi({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:yf[$s]},outputEncoding:{value:yf[$s]}},vertexShader:Fo(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n${Io()}\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvec3 getSample(float theta, vec3 axis) {\n float cosTheta = cos(theta);\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross(axis, vOutputDirection) * sin(theta)\n + axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n return bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n vec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n if (all(equal(axis, vec3(0.0))))\n axis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n axis = normalize(axis);\n gl_FragColor = vec4(0.0);\n gl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n for (int i = 1; i < n; i++) {\n if (i >= samples)\n break;\n float theta = dTheta * float(i);\n gl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n gl_FragColor.rgb += weights[i] * getSample(theta, axis);\n }\n gl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n `,blending:0,depthTest:!1,depthWrite:!1});return r.type=`SphericalGaussianBlur`,r}function No(){var e=new fi({uniforms:{envMap:{value:null},texelSize:{value:new b(1,1)},inputEncoding:{value:yf[$s]},outputEncoding:{value:yf[$s]}},vertexShader:Fo(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n${Io()}\n\n#include <common>\n\nvoid main() {\n gl_FragColor = vec4(0.0);\n vec3 outputDirection = normalize(vOutputDirection);\n vec2 uv = equirectUv( outputDirection );\n vec2 f = fract(uv / texelSize - 0.5);\n uv -= f * texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize.x;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize.y;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize.x;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n gl_FragColor.rgb = mix(tm, bm, f.y);\n gl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n `,blending:0,depthTest:!1,depthWrite:!1});return e.type=`EquirectangularToCubeUV`,e}function Po(){var e=new fi({uniforms:{envMap:{value:null},inputEncoding:{value:yf[$s]},outputEncoding:{value:yf[$s]}},vertexShader:Fo(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n${Io()}\n\nvoid main() {\n gl_FragColor = vec4(0.0);\n gl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n gl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n `,blending:0,depthTest:!1,depthWrite:!1});return e.type=`CubemapToCubeUV`,e}function Fo(){return`\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n uv = 2.0 * uv - 1.0;\n vec3 direction = vec3(uv, 1.0);\n if (face == 0.0) {\n direction = direction.zyx; // ( 1, v, u ) pos x\n } else if (face == 1.0) {\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n } else if (face == 2.0) {\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n } else if (face == 3.0) {\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n } else if (face == 4.0) {\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n } else if (face == 5.0) {\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n }\n return direction;\n}\n\nvoid main() {\n vOutputDirection = getDirection(uv, faceIndex);\n gl_Position = vec4( position, 1.0 );\n}\n `}function Io(){return`\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n if(inputEncoding == 0){\n return value;\n }else if(inputEncoding == 1){\n return sRGBToLinear(value);\n }else if(inputEncoding == 2){\n return RGBEToLinear(value);\n }else if(inputEncoding == 3){\n return RGBMToLinear(value, 7.0);\n }else if(inputEncoding == 4){\n return RGBMToLinear(value, 16.0);\n }else if(inputEncoding == 5){\n return RGBDToLinear(value, 256.0);\n }else{\n return GammaToLinear(value, 2.2);\n }\n}\n\nvec4 linearToOutputTexel(vec4 value){\n if(outputEncoding == 0){\n return value;\n }else if(outputEncoding == 1){\n return LinearTosRGB(value);\n }else if(outputEncoding == 2){\n return LinearToRGBE(value);\n }else if(outputEncoding == 3){\n return LinearToRGBM(value, 7.0);\n }else if(outputEncoding == 4){\n return LinearToRGBM(value, 16.0);\n }else if(outputEncoding == 5){\n return LinearToRGBD(value, 256.0);\n }else{\n return LinearToGamma(value, 2.2);\n }\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n return inputTexelToLinear(color);\n}\n `}function Lo(e){console.warn(`THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.`),Ji.call(this,e),this.type=`catmullrom`,this.closed=!0}function Ro(e){console.warn(`THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.`),Ji.call(this,e),this.type=`catmullrom`}function zo(e){console.warn(`THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.`),Ji.call(this,e),this.type=`catmullrom`}var Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,as,os,ss,cs,ls,us,ds,fs,ps,ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,X,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,Z,Q,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af,of,sf,cf,lf,uf,df,ff,pf,mf,hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf,Tf,Ef,Df,Of=e((()=>{for(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 TypeError(`Cannot convert undefined or null to object`);let t=Object(e);for(let e=1;e<arguments.length;e++){let n=arguments[e];if(n!=null)for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t}),Bo=1e3,Vo=1001,Ho=1002,Uo=1003,Wo=1004,Go=1005,Ko=1006,qo=1007,Jo=1008,Yo=1009,Xo=1012,Zo=1015,Qo=1020,$o=1022,es=1023,ts=es,ns=1026,rs=33776,is=33777,as=33778,os=33779,ss=35840,cs=35841,ls=35842,us=35843,ds=36196,fs=37492,ps=37496,ms=37808,hs=37809,gs=37810,_s=37811,vs=37812,ys=37813,bs=37814,xs=37815,Ss=37816,Cs=37817,ws=37818,Ts=37819,Es=37820,Ds=37821,Os=36492,ks=37840,As=37841,js=37842,Ms=37843,Ns=37844,Ps=37845,Fs=37846,Is=37847,Ls=37848,Rs=37849,zs=37850,Bs=37851,Vs=37852,Hs=37853,Us=2201,Ws=2202,Gs=2300,Ks=2301,qs=2302,Js=2400,Ys=2401,Xs=2402,Zs=2500,Qs=2501,$s=3e3,ec=3001,tc=3007,nc=3002,rc=3003,ic=3004,ac=3005,oc=3006,sc=3200,cc=3201,lc=7680,uc=35044,dc=35048,Object.assign(y.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[e];if(n!==void 0){var r=n.indexOf(t);r!==-1&&n.splice(r,1)}}},dispatchEvent:function(e){if(this._listeners!==void 0){var t=this._listeners[e.type];if(t!==void 0){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}}),fc=[],pc=0;pc<256;pc++)fc[pc]=(pc<16?`0`:``)+pc.toString(16);X={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;return(fc[e&255]+fc[e>>8&255]+fc[e>>16&255]+fc[e>>24&255]+`-`+fc[t&255]+fc[t>>8&255]+`-`+fc[t>>16&15|64]+fc[t>>24&255]+`-`+fc[n&63|128]+fc[n>>8&255]+`-`+fc[n>>16&255]+fc[n>>24&255]+fc[r&255]+fc[r>>8&255]+fc[r>>16&255]+fc[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,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*X.DEG2RAD},radToDeg:function(e){return e*X.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),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:console.warn(`THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}},Object.defineProperties(b.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(b.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 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 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?(this.x+=e.x,this.y+=e.y,this):(console.warn(`THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.`),this.addVectors(e,t))},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?(this.x-=e.x,this.y-=e.y,this):(console.warn(`THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.`),this.subVectors(e,t))},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(){return Math.atan2(-this.y,-this.x)+Math.PI},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}}),Object.assign(x.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],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,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],d=n[7],f=n[8],p=f*c-l*d,m=l*u-f*s,h=d*s-c*u,g=i*p+a*m+o*h;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);var _=1/g;return r[0]=p*_,r[1]=(o*d-f*a)*_,r[2]=(l*a-o*c)*_,r[3]=m*_,r[4]=(f*i-o*u)*_,r[5]=(o*s-l*i)*_,r[6]=h*_,r[7]=(a*u-d*i)*_,r[8]=(c*i-a*s)*_,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}}),hc={getDataURL:function(e){var t;if(typeof HTMLCanvasElement>`u`)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{mc===void 0&&(mc=document.createElementNS(`http://www.w3.org/1999/xhtml`,`canvas`)),mc.width=e.width,mc.height=e.height;var n=mc.getContext(`2d`);e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=mc}return t.width>2048||t.height>2048?t.toDataURL(`image/jpeg`,.6):t.toDataURL(`image/png`)}},gc=0,S.DEFAULT_IMAGE=void 0,S.DEFAULT_MAPPING=300,S.prototype=Object.assign(Object.create(y.prototype),{constructor:S,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=X.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(hc.getDataURL(r[a]))}else i=hc.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!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Bo:e.x-=Math.floor(e.x);break;case Vo:e.x=e.x<0?0:1;break;case Ho:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Bo:e.y-=Math.floor(e.y);break;case Vo:e.y=e.y<0?0:1;break;case Ho:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(S.prototype,`needsUpdate`,{set:function(e){e===!0&&this.version++}}),Object.defineProperties(C.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(C.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 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 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?1:e.w,this},add:function(e,t){return t===void 0?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this):(console.warn(`THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.`),this.addVectors(e,t))},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?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this):(console.warn(`THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.`),this.subVectors(e,t))},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],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var _=(c+1)/2,v=(f+1)/2,y=(g+1)/2,b=(l+d)/4,x=(u+m)/4,S=(p+h)/4;return _>v&&_>y?_<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(_),r=b/n,i=x/n):v>y?v<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(v),n=b/r,i=S/r):y<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(y),n=x/i,r=S/i),this.set(n,r,i,t),this}var C=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(C)<.001&&(C=1),this.x=(h-p)/C,this.y=(u-m)/C,this.z=(d-l)/C,this.w=Math.acos((c+f+g-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.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}}),w.prototype=Object.assign(Object.create(y.prototype),{constructor:w,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`})}}),T.prototype=Object.assign(Object.create(w.prototype),{constructor:T,isWebGLMultisampleRenderTarget:!0,copy:function(e){return w.prototype.copy.call(this,e),this.samples=e.samples,this}}),Object.assign(E,{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],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){var h=1-o,g=s*d+c*f+l*p+u*m,_=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){var y=Math.sqrt(v),b=Math.atan2(y,g*_);h=Math.sin(h*b)/y,o=Math.sin(o*b)/y}var x=o*_;if(s=s*h+d*x,c=c*h+f*x,l=l*h+p*x,u=u*h+m*x,h===1-o){var S=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=S,c*=S,l*=S,u*=S}}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],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}}),Object.defineProperties(E.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(E.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 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),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;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],d=n+o+u,f;return d>0?(f=.5/Math.sqrt(d+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(X.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*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this},multiply:function(e,t){return t===void 0?this.multiplyQuaternions(this,e):(console.warn(`THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.`),this.multiplyQuaternions(e,t))},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),d=Math.sin((1-t)*u)/l,f=Math.sin(t*u)/l;return this._w=a*d+this._w*f,this._x=n*d+this._x*f,this._y=r*d+this._y*f,this._z=i*d+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(){}}),_c=new D,vc=new E,Object.assign(D.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 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 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?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this):(console.warn(`THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.`),this.addVectors(e,t))},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?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this):(console.warn(`THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.`),this.subVectors(e,t))},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?(this.x*=e.x,this.y*=e.y,this.z*=e.z,this):(console.warn(`THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.`),this.multiplyVectors(e,t))},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(vc.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(vc.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,d=-i*t-a*n-o*r;return this.x=c*s+d*-i+l*-o-u*-a,this.y=l*s+d*-a+u*-i-c*-o,this.z=u*s+d*-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?this.crossVectors(this,e):(console.warn(`THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.`),this.crossVectors(e,t))},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 _c.copy(this).projectOnVector(e),this.sub(_c)},reflect:function(e){return this.sub(_c.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(X.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}}),yc=new D,bc=new O,xc=new D(0,0,0),Sc=new D(1,1,1),Cc=new D,wc=new D,Tc=new D,Object.assign(O.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,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 O().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/yc.setFromMatrixColumn(e,0).length(),i=1/yc.setFromMatrixColumn(e,1).length(),a=1/yc.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 d=a*l,f=a*u,p=o*l,m=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-o*s,t[2]=m-d*c,t[6]=p+f*c,t[10]=a*s}else if(e.order===`YXZ`){var h=s*l,g=s*u,_=c*l,v=c*u;t[0]=h+v*o,t[4]=_*o-g,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=g*o-_,t[6]=v+h*o,t[10]=a*s}else if(e.order===`ZXY`){var h=s*l,g=s*u,_=c*l,v=c*u;t[0]=h-v*o,t[4]=-a*u,t[8]=_+g*o,t[1]=g+_*o,t[5]=a*l,t[9]=v-h*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){var d=a*l,f=a*u,p=o*l,m=o*u;t[0]=s*l,t[4]=p*c-f,t[8]=d*c+m,t[1]=s*u,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){var y=a*s,b=a*c,x=o*s,S=o*c;t[0]=s*l,t[4]=S-y*u,t[8]=x*u+b,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=b*u+x,t[10]=y-S*u}else if(e.order===`XZY`){var y=a*s,b=a*c,x=o*s,S=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=y*u+S,t[5]=a*l,t[9]=b*u-x,t[2]=x*u-b,t[6]=o*l,t[10]=S*u+y}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(xc,e,Sc)},lookAt:function(e,t,n){var r=this.elements;return Tc.subVectors(e,t),Tc.lengthSq()===0&&(Tc.z=1),Tc.normalize(),Cc.crossVectors(n,Tc),Cc.lengthSq()===0&&(Math.abs(n.z)===1?Tc.x+=1e-4:Tc.z+=1e-4,Tc.normalize(),Cc.crossVectors(n,Tc)),Cc.normalize(),wc.crossVectors(Tc,Cc),r[0]=Cc.x,r[4]=wc.x,r[8]=Tc.x,r[1]=Cc.y,r[5]=wc.y,r[9]=Tc.y,r[2]=Cc.z,r[6]=wc.z,r[10]=Tc.z,this},multiply:function(e,t){return t===void 0?this.multiplyMatrices(this,e):(console.warn(`THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.`),this.multiplyMatrices(e,t))},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],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],M=r[14],N=r[3],P=r[7],F=r[11],I=r[15];return i[0]=a*x+o*T+s*k+c*N,i[4]=a*S+o*E+s*A+c*P,i[8]=a*C+o*D+s*j+c*F,i[12]=a*w+o*O+s*M+c*I,i[1]=l*x+u*T+d*k+f*N,i[5]=l*S+u*E+d*A+f*P,i[9]=l*C+u*D+d*j+f*F,i[13]=l*w+u*O+d*M+f*I,i[2]=p*x+m*T+h*k+g*N,i[6]=p*S+m*E+h*A+g*P,i[10]=p*C+m*D+h*j+g*F,i[14]=p*w+m*O+h*M+g*I,i[3]=_*x+v*T+y*k+b*N,i[7]=_*S+v*E+y*A+b*P,i[11]=_*C+v*D+y*j+b*F,i[15]=_*w+v*O+y*M+b*I,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],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15];return p*(+i*s*u-r*c*u-i*o*d+n*c*d+r*o*f-n*s*f)+m*(+t*s*f-t*c*d+i*a*d-r*a*f+r*c*l-i*s*l)+h*(+t*c*u-t*o*f-i*a*u+n*a*f+i*o*l-n*c*l)+g*(-r*o*l-t*s*u+t*o*d+r*a*u-n*a*d+n*s*l)},transpose:function(){var e=this.elements,t=e[1];return 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],d=r[7],f=r[8],p=r[9],m=r[10],h=r[11],g=r[12],_=r[13],v=r[14],y=r[15],b=p*v*d-_*m*d+_*u*h-l*v*h-p*u*y+l*m*y,x=g*m*d-f*v*d-g*u*h+c*v*h+f*u*y-c*m*y,S=f*_*d-g*p*d+g*l*h-c*_*h-f*l*y+c*p*y,C=g*p*u-f*_*u-g*l*m+c*_*m+f*l*v-c*p*v,w=i*b+a*x+o*S+s*C;if(w===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var T=1/w;return n[0]=b*T,n[1]=(_*m*s-p*v*s-_*o*h+a*v*h+p*o*y-a*m*y)*T,n[2]=(l*v*s-_*u*s+_*o*d-a*v*d-l*o*y+a*u*y)*T,n[3]=(p*u*s-l*m*s-p*o*d+a*m*d+l*o*h-a*u*h)*T,n[4]=x*T,n[5]=(f*v*s-g*m*s+g*o*h-i*v*h-f*o*y+i*m*y)*T,n[6]=(g*u*s-c*v*s-g*o*d+i*v*d+c*o*y-i*u*y)*T,n[7]=(c*m*s-f*u*s+f*o*d-i*m*d-c*o*h+i*u*h)*T,n[8]=S*T,n[9]=(g*p*s-f*_*s-g*a*h+i*_*h+f*a*y-i*p*y)*T,n[10]=(c*_*s-g*l*s+g*a*d-i*_*d-c*a*y+i*l*y)*T,n[11]=(f*l*s-c*p*s-f*a*d+i*p*d+c*a*h-i*l*h)*T,n[12]=C*T,n[13]=(f*_*o-g*p*o+g*a*m-i*_*m-f*a*v+i*p*v)*T,n[14]=(g*l*o-c*_*o-g*a*u+i*_*u+c*a*v-i*l*v)*T,n[15]=(c*p*o-f*l*o+f*a*u-i*p*u-c*a*m+i*l*m)*T,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,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,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=yc.set(r[0],r[1],r[2]).length(),a=yc.set(r[4],r[5],r[6]).length(),o=yc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],bc.copy(this);var s=1/i,c=1/a,l=1/o;return bc.elements[0]*=s,bc.elements[1]*=s,bc.elements[2]*=s,bc.elements[4]*=c,bc.elements[5]*=c,bc.elements[6]*=c,bc.elements[8]*=l,bc.elements[9]*=l,bc.elements[10]*=l,t.setFromRotationMatrix(bc),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),d=-(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]=d,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,d=(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]=-d,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}}),Ec=new O,Dc=new E,k.RotationOrders=[`XYZ`,`YZX`,`ZXY`,`XZY`,`YXZ`,`ZYX`],k.DefaultOrder=`XYZ`,Object.defineProperties(k.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(k.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=X.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],c=i[1],l=i[5],u=i[9],d=i[2],f=i[6],p=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,p),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,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-d,a),this._z=0);break;case`ZXY`:this._x=Math.asin(r(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a));break;case`ZYX`:this._y=Math.asin(-r(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),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(-d,a)):(this._x=0,this._y=Math.atan2(s,p));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,p),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 Ec.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ec,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return Dc.setFromEuler(this),this.setFromQuaternion(Dc,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 D(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(A.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}}),Oc=0,kc=new D,Ac=new E,jc=new O,Mc=new D,Nc=new D,Pc=new D,Fc=new E,Ic=new D(1,0,0),Lc=new D(0,1,0),Rc=new D(0,0,1),zc={type:`added`},Bc={type:`removed`},j.DefaultUp=new D(0,1,0),j.DefaultMatrixAutoUpdate=!0,j.prototype=Object.assign(Object.create(y.prototype),{constructor:j,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 Ac.setFromAxisAngle(e,t),this.quaternion.multiply(Ac),this},rotateOnWorldAxis:function(e,t){return Ac.setFromAxisAngle(e,t),this.quaternion.premultiply(Ac),this},rotateX:function(e){return this.rotateOnAxis(Ic,e)},rotateY:function(e){return this.rotateOnAxis(Lc,e)},rotateZ:function(e){return this.rotateOnAxis(Rc,e)},translateOnAxis:function(e,t){return kc.copy(e).applyQuaternion(this.quaternion),this.position.add(kc.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(Ic,e)},translateY:function(e){return this.translateOnAxis(Lc,e)},translateZ:function(e){return this.translateOnAxis(Rc,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(jc.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?Mc.copy(e):Mc.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),Nc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?jc.lookAt(Nc,Mc,this.up):jc.lookAt(Mc,Nc,this.up),this.quaternion.setFromRotationMatrix(jc),r&&(jc.extractRotation(r.matrixWorld),Ac.setFromRotationMatrix(jc),this.quaternion.premultiply(Ac.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(zc)):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(Bc)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),jc.getInverse(this.matrixWorld),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),jc.multiply(e.parent.matrixWorld)),e.applyMatrix4(jc),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].getObjectByProperty(e,t);if(i!==void 0)return i}},getWorldPosition:function(e){return e===void 0&&(console.warn(`THREE.Object3D: .getWorldPosition() target is now required`),e=new D),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 E),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Nc,e,Pc),e},getWorldScale:function(e){return e===void 0&&(console.warn(`THREE.Object3D: .getWorldScale() target is now required`),e=new D),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Nc,Fc,e),e},getWorldDirection:function(e){e===void 0&&(console.warn(`THREE.Object3D: .getWorldDirection() target is now required`),e=new D),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(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.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 d=h(e.geometries),f=h(e.materials),p=h(e.textures),m=h(e.images),o=h(e.shapes);d.length>0&&(n.geometries=d),f.length>0&&(n.materials=f),p.length>0&&(n.textures=p),m.length>0&&(n.images=m),o.length>0&&(n.shapes=o)}return n.object=r,n;function h(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},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}}),M.prototype=Object.assign(Object.create(j.prototype),{constructor:M,isScene:!0,copy:function(e,t){return j.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=j.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`})}}),Vc=[new D,new D,new D,new D,new D,new D,new D,new D],Hc=new D,Uc=new N,Wc=new D,Gc=new D,Kc=new D,qc=new D,Jc=new D,Yc=new D,Xc=new D,Zc=new D,Qc=new D,$c=new D,Object.assign(N.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],d=e[s+2];l<t&&(t=l),u<n&&(n=u),d<r&&(r=d),l>i&&(i=l),u>a&&(a=u),d>o&&(o=d)}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),d=e.getZ(s);l<t&&(t=l),u<n&&(n=u),d<r&&(r=d),l>i&&(i=l),u>a&&(a=u),d>o&&(o=d)}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=Hc.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 D),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 D),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(),Uc.copy(t.boundingBox),Uc.applyMatrix4(e.matrixWorld),this.union(Uc));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 D),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,Hc),Hc.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(Xc),Zc.subVectors(this.max,Xc),Wc.subVectors(e.a,Xc),Gc.subVectors(e.b,Xc),Kc.subVectors(e.c,Xc),qc.subVectors(Gc,Wc),Jc.subVectors(Kc,Gc),Yc.subVectors(Wc,Kc);var t=[0,-qc.z,qc.y,0,-Jc.z,Jc.y,0,-Yc.z,Yc.y,qc.z,0,-qc.x,Jc.z,0,-Jc.x,Yc.z,0,-Yc.x,-qc.y,qc.x,0,-Jc.y,Jc.x,0,-Yc.y,Yc.x,0];return!P(t,Wc,Gc,Kc,Zc)||(t=[1,0,0,0,1,0,0,0,1],!P(t,Wc,Gc,Kc,Zc))?!1:(Qc.crossVectors(qc,Jc),t=[Qc.x,Qc.y,Qc.z],P(t,Wc,Gc,Kc,Zc))},clampPoint:function(e,t){return t===void 0&&(console.warn(`THREE.Box3: .clampPoint() target is now required`),t=new D),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return Hc.copy(e).clamp(this.min,this.max).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(Hc).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:(Vc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Vc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Vc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Vc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Vc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Vc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Vc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Vc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Vc),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)}}),el=new N,Object.assign(F.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?el.setFromPoints(e).getCenter(n):n.copy(t);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 D),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 N),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*=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}}),tl=new D,nl=new D,rl=new D,il=new D,al=new D,ol=new D,sl=new D,Object.assign(I.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 D),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,tl)),this},closestPointToPoint:function(e,t){t===void 0&&(console.warn(`THREE.Ray: .closestPointToPoint() target is now required`),t=new D),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=tl.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(tl.copy(this.direction).multiplyScalar(t).add(this.origin),tl.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,r){nl.copy(e).add(t).multiplyScalar(.5),rl.copy(t).sub(e).normalize(),il.copy(this.origin).sub(nl);var i=e.distanceTo(t)*.5,a=-this.direction.dot(rl),o=il.dot(this.direction),s=-il.dot(rl),c=il.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){var m=1/l;u*=m,d*=m,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(rl).multiplyScalar(d).add(nl),f},intersectSphere:function(e,t){tl.subVectors(e.center,this.origin);var n=tl.dot(this.direction),r=tl.dot(tl)-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);return t===0||e.normal.dot(this.direction)*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,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||n!==n)&&(n=i),(a<r||r!==r)&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.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,tl)!==null},intersectTriangle:function(e,t,n,r,i){al.subVectors(t,e),ol.subVectors(n,e),sl.crossVectors(al,ol);var a=this.direction.dot(sl),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;il.subVectors(this.origin,e);var s=o*this.direction.dot(ol.crossVectors(il,ol));if(s<0)return null;var c=o*this.direction.dot(al.cross(il));if(c<0||s+c>a)return null;var l=-o*il.dot(sl);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)}}),cl=new D,ll=new D,ul=new x,Object.assign(L.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=cl.subVectors(n,t).cross(ll.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 D),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 D);var n=e.delta(cl),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 D),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||ul.getNormalMatrix(e),r=this.coplanarPoint(cl).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}}),dl=new D,fl=new D,pl=new D,ml=new D,hl=new D,gl=new D,_l=new D,vl=new D,yl=new D,bl=new D,Object.assign(R,{getNormal:function(e,t,n,r){r===void 0&&(console.warn(`THREE.Triangle: .getNormal() target is now required`),r=new D),r.subVectors(n,t),dl.subVectors(e,t),r.cross(dl);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){dl.subVectors(r,t),fl.subVectors(n,t),pl.subVectors(e,t);var a=dl.dot(dl),o=dl.dot(fl),s=dl.dot(pl),c=fl.dot(fl),l=fl.dot(pl),u=a*c-o*o;if(i===void 0&&(console.warn(`THREE.Triangle: .getBarycoord() target is now required`),i=new D),u===0)return i.set(-2,-1,-1);var d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)},containsPoint:function(e,t,n,r){return R.getBarycoord(e,t,n,r,ml),ml.x>=0&&ml.y>=0&&ml.x+ml.y<=1},getUV:function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,ml),s.set(0,0),s.addScaledVector(i,ml.x),s.addScaledVector(a,ml.y),s.addScaledVector(o,ml.z),s},isFrontFacing:function(e,t,n,r){return dl.subVectors(n,t),fl.subVectors(e,t),dl.cross(fl).dot(r)<0}}),Object.assign(R.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 dl.subVectors(this.c,this.b),fl.subVectors(this.a,this.b),dl.cross(fl).length()*.5},getMidpoint:function(e){return e===void 0&&(console.warn(`THREE.Triangle: .getMidpoint() target is now required`),e=new D),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return R.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 L),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return R.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,r,i){return R.getUV(e,this.a,this.b,this.c,t,n,r,i)},containsPoint:function(e){return R.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return R.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 D);var n=this.a,r=this.b,i=this.c,a,o;hl.subVectors(r,n),gl.subVectors(i,n),vl.subVectors(e,n);var s=hl.dot(vl),c=gl.dot(vl);if(s<=0&&c<=0)return t.copy(n);yl.subVectors(e,r);var l=hl.dot(yl),u=gl.dot(yl);if(l>=0&&u<=l)return t.copy(r);var d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(hl,a);bl.subVectors(e,i);var f=hl.dot(bl),p=gl.dot(bl);if(p>=0&&f<=p)return t.copy(i);var m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(gl,o);var h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return _l.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(_l,o);var g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(hl,a).addScaledVector(gl,o)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),xl={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},Sl={h:0,s:0,l:0},Cl={h:0,s:0,l:0},Object.assign(z.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=X.euclideanModulo(e,1),t=X.clamp(t,0,1),n=X.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=ee(i,r,e+1/3),this.g=ee(i,r,e),this.b=ee(i,r,e-1/3)}return this},setStyle:function(e){function t(t){t!==void 0&&parseFloat(t)<1&&console.warn(`THREE.Color: Alpha component of `+e+` will be ignored.`)}var n;if(n=/^((?:rgb|hsl)a?)\\(\\s*([^\\)]*)\\)/.exec(e)){var 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=xl[e];return t===void 0?console.warn(`THREE.Color: Unknown color `+e):this.setHex(t),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=te(e.r),this.g=te(e.g),this.b=te(e.b),this},copyLinearToSRGB:function(e){return this.r=ne(e.r),this.g=ne(e.g),this.b=ne(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(Sl),Sl.h+=e,Sl.s+=t,Sl.l+=n,this.setHSL(Sl.h,Sl.s,Sl.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(Sl),e.getHSL(Cl);var n=X.lerp(Sl.h,Cl.h,t),r=X.lerp(Sl.s,Cl.s,t),i=X.lerp(Sl.l,Cl.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()}}),z.NAMES=xl,Object.assign(B.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}}),wl=0,V.prototype=Object.assign(Object.create(y.prototype),{constructor:V,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===1;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!==1&&(n.blending=this.blending),this.flatShading===!0&&(n.flatShading=this.flatShading),this.side!==0&&(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(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}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=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(V.prototype,`needsUpdate`,{set:function(e){e===!0&&this.version++}}),re.prototype=Object.create(V.prototype),re.prototype.constructor=re,re.prototype.isMeshBasicMaterial=!0,re.prototype.copy=function(e){return V.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},Tl=new D,Object.defineProperty(H.prototype,`needsUpdate`,{set:function(e){e===!0&&this.version++}}),Object.assign(H.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 z),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 b),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 D),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 C),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++)Tl.x=this.getX(t),Tl.y=this.getY(t),Tl.z=this.getZ(t),Tl.applyMatrix3(e),this.setXYZ(t,Tl.x,Tl.y,Tl.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)Tl.x=this.getX(t),Tl.y=this.getY(t),Tl.z=this.getZ(t),Tl.applyMatrix4(e),this.setXYZ(t,Tl.x,Tl.y,Tl.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)Tl.x=this.getX(t),Tl.y=this.getY(t),Tl.z=this.getZ(t),Tl.applyNormalMatrix(e),this.setXYZ(t,Tl.x,Tl.y,Tl.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)Tl.x=this.getX(t),Tl.y=this.getY(t),Tl.z=this.getZ(t),Tl.transformDirection(e),this.setXYZ(t,Tl.x,Tl.y,Tl.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}}}),U.prototype=Object.create(H.prototype),U.prototype.constructor=U,ie.prototype=Object.create(H.prototype),ie.prototype.constructor=ie,W.prototype=Object.create(H.prototype),W.prototype.constructor=W,ae.prototype=Object.create(H.prototype),ae.prototype.constructor=ae,G.prototype=Object.create(H.prototype),G.prototype.constructor=G,oe.prototype=Object.create(H.prototype),oe.prototype.constructor=oe,se.prototype=Object.create(H.prototype),se.prototype.constructor=se,K.prototype=Object.create(H.prototype),K.prototype.constructor=K,ce.prototype=Object.create(H.prototype),ce.prototype.constructor=ce,Object.assign(le.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,d=u.length,f;if(d>0){f=[];for(var l=0;l<d;l++)f[l]={name:u[l].name,data:[]};this.morphTargets.normal=f}var p=e.skinIndices,m=e.skinWeights,h=p.length===n.length,g=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 _=t[l];this.vertices.push(n[_.a],n[_.b],n[_.c]);var v=_.vertexNormals;if(v.length===3)this.normals.push(v[0],v[1],v[2]);else{var y=_.normal;this.normals.push(y,y,y)}var x=_.vertexColors;if(x.length===3)this.colors.push(x[0],x[1],x[2]);else{var S=_.color;this.colors.push(S,S,S)}if(i===!0){var C=r[0][l];C===void 0?(console.warn(`THREE.DirectGeometry.fromGeometry(): Undefined vertexUv `,l),this.uvs.push(new b,new b,new b)):this.uvs.push(C[0],C[1],C[2])}if(a===!0){var C=r[1][l];C===void 0?(console.warn(`THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 `,l),this.uvs2.push(new b,new b,new b)):this.uvs2.push(C[0],C[1],C[2])}for(var w=0;w<s;w++){var T=o[w].vertices;c[w].data.push(T[_.a],T[_.b],T[_.c])}for(var w=0;w<d;w++){var E=u[w].vertexNormals[l];f[w].data.push(E.a,E.b,E.c)}h&&this.skinIndices.push(p[_.a],p[_.b],p[_.c]),g&&this.skinWeights.push(m[_.a],m[_.b],m[_.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}}),El=1,Dl=new O,Ol=new j,kl=new D,Al=new N,jl=new N,Ml=new D,q.prototype=Object.assign(Object.create(y.prototype),{constructor:q,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(ue(e)>65535?se:G)(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?0:n})},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 x().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 Dl.makeRotationX(e),this.applyMatrix4(Dl),this},rotateY:function(e){return Dl.makeRotationY(e),this.applyMatrix4(Dl),this},rotateZ:function(e){return Dl.makeRotationZ(e),this.applyMatrix4(Dl),this},translate:function(e,t,n){return Dl.makeTranslation(e,t,n),this.applyMatrix4(Dl),this},scale:function(e,t,n){return Dl.makeScale(e,t,n),this.applyMatrix4(Dl),this},lookAt:function(e){return Ol.lookAt(e),Ol.updateMatrix(),this.applyMatrix4(Ol.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(kl).negate(),this.translate(kl.x,kl.y,kl.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new K(t.vertices.length*3,3),r=new K(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 K(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 K(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 le().fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(e.vertices.length*3);if(this.setAttribute(`position`,new H(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(e.normals.length*3);this.setAttribute(`normal`,new H(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(e.colors.length*3);this.setAttribute(`color`,new H(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(e.uvs.length*2);this.setAttribute(`uv`,new H(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(e.uvs2.length*2);this.setAttribute(`uv2`,new H(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],c=e.morphTargets[o],l=0,u=c.length;l<u;l++){var d=c[l],f=new K(d.data.length*3,3);f.name=d.name,s.push(f.copyVector3sArray(d.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var p=new K(e.skinIndices.length*4,4);this.setAttribute(`skinIndex`,p.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new K(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 N);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];Al.setFromBufferAttribute(i),this.morphTargetsRelative?(Ml.addVectors(this.boundingBox.min,Al.min),this.boundingBox.expandByPoint(Ml),Ml.addVectors(this.boundingBox.max,Al.max),this.boundingBox.expandByPoint(Ml)):(this.boundingBox.expandByPoint(Al.min),this.boundingBox.expandByPoint(Al.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 F);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(Al.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];jl.setFromBufferAttribute(a),this.morphTargetsRelative?(Ml.addVectors(Al.min,jl.min),Al.expandByPoint(Ml),Ml.addVectors(Al.max,jl.max),Al.expandByPoint(Ml)):(Al.expandByPoint(jl.min),Al.expandByPoint(jl.max))}Al.getCenter(n);for(var o=0,r=0,i=e.count;r<i;r++)Ml.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(Ml));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++)Ml.fromBufferAttribute(a,c),s&&(kl.fromBufferAttribute(e,c),Ml.add(kl)),o=Math.max(o,n.distanceToSquared(Ml));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 H(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 D,d=new D,f=new D,p=new D,m=new D;if(e)for(var h=e.array,i=0,a=e.count;i<a;i+=3)s=h[i+0]*3,c=h[i+1]*3,l=h[i+2]*3,u.fromArray(n,s),d.fromArray(n,c),f.fromArray(n,l),p.subVectors(f,d),m.subVectors(u,d),p.cross(m),o[s]+=p.x,o[s+1]+=p.y,o[s+2]+=p.z,o[c]+=p.x,o[c+1]+=p.y,o[c+2]+=p.z,o[l]+=p.x,o[l+1]+=p.y,o[l+2]+=p.z;else for(var i=0,a=n.length;i<a;i+=9)u.fromArray(n,i),d.fromArray(n,i+3),f.fromArray(n,i+6),p.subVectors(f,d),m.subVectors(u,d),p.cross(m),o[i]=p.x,o[i+1]=p.y,o[i+2]=p.z,o[i+3]=p.x,o[i+4]=p.y,o[i+5]=p.z,o[i+6]=p.x,o[i+7]=p.y,o[i+8]=p.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].array,a=e.attributes[r],o=a.array,s=a.itemSize*t,c=Math.min(o.length,i.length-s),l=0,u=s;l<c;l++,u++)i[u]=o[l];return this},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)Ml.x=e.getX(t),Ml.y=e.getY(t),Ml.z=e.getZ(t),Ml.normalize(),e.setXYZ(t,Ml.x,Ml.y,Ml.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0,c=0,l=t.length;c<l;c++){o=t[c]*r;for(var u=0;u<r;u++)a[s++]=n[o++]}return new H(a,r,i)}if(this.index===null)return console.warn(`THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.`),this;var t=new q,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,d=l.length;u<d;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,p=f.length;u<p;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=[],d=0,f=l.length;d<f;d++){var a=l[d],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 p=this.groups;p.length>0&&(e.data.groups=JSON.parse(JSON.stringify(p)));var m=this.boundingSphere;return m!==null&&(e.data.boundingSphere={center:m.center.toArray(),radius:m.radius}),e},clone:function(){return new q().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 d=u[n];this.addGroup(d.start,d.count,d.materialIndex)}var f=e.boundingBox;f!==null&&(this.boundingBox=f.clone());var p=e.boundingSphere;return p!==null&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:`dispose`})}}),Nl=new O,Pl=new I,Fl=new F,Il=new D,Ll=new D,Rl=new D,zl=new D,Bl=new D,Vl=new D,Hl=new D,Ul=new D,Wl=new D,Gl=new b,Kl=new b,ql=new b,Jl=new D,Yl=new D,de.prototype=Object.assign(Object.create(j.prototype),{constructor:de,isMesh:!0,copy:function(e){return j.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(),Fl.copy(n.boundingSphere),Fl.applyMatrix4(i),e.ray.intersectsSphere(Fl)!==!1&&(Nl.getInverse(i),Pl.copy(e.ray).applyMatrix4(Nl),!(n.boundingBox!==null&&Pl.intersectsBox(n.boundingBox)===!1)))){var a;if(n.isBufferGeometry){var o,s,c,l=n.index,u=n.attributes.position,d=n.morphAttributes.position,f=n.morphTargetsRelative,p=n.attributes.uv,m=n.attributes.uv2,h=n.groups,g=n.drawRange,_,v,y,x,S,C,w,T;if(l!==null)if(Array.isArray(r))for(_=0,y=h.length;_<y;_++)for(S=h[_],C=r[S.materialIndex],w=Math.max(S.start,g.start),T=Math.min(S.start+S.count,g.start+g.count),v=w,x=T;v<x;v+=3)o=l.getX(v),s=l.getX(v+1),c=l.getX(v+2),a=pe(this,C,e,Pl,u,d,f,p,m,o,s,c),a&&(a.faceIndex=Math.floor(v/3),a.face.materialIndex=S.materialIndex,t.push(a));else for(w=Math.max(0,g.start),T=Math.min(l.count,g.start+g.count),_=w,y=T;_<y;_+=3)o=l.getX(_),s=l.getX(_+1),c=l.getX(_+2),a=pe(this,r,e,Pl,u,d,f,p,m,o,s,c),a&&(a.faceIndex=Math.floor(_/3),t.push(a));else if(u!==void 0)if(Array.isArray(r))for(_=0,y=h.length;_<y;_++)for(S=h[_],C=r[S.materialIndex],w=Math.max(S.start,g.start),T=Math.min(S.start+S.count,g.start+g.count),v=w,x=T;v<x;v+=3)o=v,s=v+1,c=v+2,a=pe(this,C,e,Pl,u,d,f,p,m,o,s,c),a&&(a.faceIndex=Math.floor(v/3),a.face.materialIndex=S.materialIndex,t.push(a));else for(w=Math.max(0,g.start),T=Math.min(u.count,g.start+g.count),_=w,y=T;_<y;_+=3)o=_,s=_+1,c=_+2,a=pe(this,r,e,Pl,u,d,f,p,m,o,s,c),a&&(a.faceIndex=Math.floor(_/3),t.push(a))}else if(n.isGeometry){var E,D,O,k=Array.isArray(r),A=n.vertices,j=n.faces,M,N=n.faceVertexUvs[0];N.length>0&&(M=N);for(var P=0,F=j.length;P<F;P++){var I=j[P],L=k?r[I.materialIndex]:r;if(L!==void 0&&(E=A[I.a],D=A[I.b],O=A[I.c],a=fe(this,L,e,Pl,E,D,O,Jl),a)){if(M&&M[P]){var z=M[P];Gl.copy(z[0]),Kl.copy(z[1]),ql.copy(z[2]),a.uv=R.getUV(Jl,E,D,O,Gl,Kl,ql,new b)}a.face=I,a.faceIndex=P,t.push(a)}}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Xl=0,Zl=new O,Ql=new j,$l=new D,J.prototype=Object.assign(Object.create(y.prototype),{constructor:J,isGeometry:!0,applyMatrix4:function(e){for(var t=new x().getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++)this.vertices[n].applyMatrix4(e);for(var n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(t).normalize();for(var a=0,o=i.vertexNormals.length;a<o;a++)i.vertexNormals[a].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 Zl.makeRotationX(e),this.applyMatrix4(Zl),this},rotateY:function(e){return Zl.makeRotationY(e),this.applyMatrix4(Zl),this},rotateZ:function(e){return Zl.makeRotationZ(e),this.applyMatrix4(Zl),this},translate:function(e,t,n){return Zl.makeTranslation(e,t,n),this.applyMatrix4(Zl),this},scale:function(e,t,n){return Zl.makeScale(e,t,n),this.applyMatrix4(Zl),this},lookAt:function(e){return Ql.lookAt(e),Ql.updateMatrix(),this.applyMatrix4(Ql.matrix),this},fromBufferGeometry:function(e){var t=this,n=e.index===null?void 0:e.index.array,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?void 0:r.normal.array,o=r.color===void 0?void 0:r.color.array,s=r.uv===void 0?void 0:r.uv.array,c=r.uv2===void 0?void 0:r.uv2.array;c!==void 0&&(this.faceVertexUvs[1]=[]);for(var l=0;l<i.length;l+=3)t.vertices.push(new D().fromArray(i,l)),o!==void 0&&t.colors.push(new z().fromArray(o,l));function u(e,n,r,i){var l=o===void 0?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()],u=new B(e,n,r,a===void 0?[]:[new D().fromArray(a,e*3),new D().fromArray(a,n*3),new D().fromArray(a,r*3)],l,i);t.faces.push(u),s!==void 0&&t.faceVertexUvs[0].push([new b().fromArray(s,e*2),new b().fromArray(s,n*2),new b().fromArray(s,r*2)]),c!==void 0&&t.faceVertexUvs[1].push([new b().fromArray(c,e*2),new b().fromArray(c,n*2),new b().fromArray(c,r*2)])}var d=e.groups;if(d.length>0)for(var l=0;l<d.length;l++)for(var f=d[l],p=f.start,m=f.count,h=p,g=p+m;h<g;h+=3)n===void 0?u(h,h+1,h+2,f.materialIndex):u(n[h],n[h+1],n[h+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($l).negate(),this.translate($l.x,$l.y,$l.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=t===0?1:1/t,r=new O;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 D,t=new D,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=Array(this.vertices.length);for(t=0,n=this.vertices.length;t<n;t++)o[t]=new D;if(e){var s,c,l,u=new D,d=new D;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),d.subVectors(s,c),u.cross(d),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 J;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,c,l;for(n=0,r=this.faces.length;n<r;n++)c=new D,l={a:new D,b:new D,c:new D},o.push(c),s.push(l)}var u=this.morphNormals[e];a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals();var c,l;for(n=0,r=this.faces.length;n<r;n++)i=this.faces[n],c=u.faceNormals[n],l=u.vertexNormals[n],c.copy(i.normal),l.a.copy(i.vertexNormals[0]),l.b.copy(i.vertexNormals[1]),l.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 N),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new F),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 x().getNormalMatrix(t));for(var d=0,f=o.length;d<f;d++){var p=o[d].clone();t!==void 0&&p.applyMatrix4(t),a.push(p)}for(var d=0,f=u.length;d<f;d++)l.push(u[d].clone());for(d=0,f=c.length;d<f;d++){var m=c[d],h,g,_,v=m.vertexNormals,y=m.vertexColors;h=new B(m.a+i,m.b+i,m.c+i),h.normal.copy(m.normal),r!==void 0&&h.normal.applyMatrix3(r).normalize();for(var b=0,S=v.length;b<S;b++)g=v[b].clone(),r!==void 0&&g.applyMatrix3(r).normalize(),h.vertexNormals.push(g);h.color.copy(m.color);for(var b=0,S=y.length;b<S;b++)_=y[b],h.vertexColors.push(_.clone());h.materialIndex=m.materialIndex+n,s.push(h)}for(var d=0,f=e.faceVertexUvs.length;d<f;d++){var C=e.faceVertexUvs[d];this.faceVertexUvs[d]===void 0&&(this.faceVertexUvs[d]=[]);for(var b=0,S=C.length;b<S;b++){for(var w=C[b],T=[],E=0,D=w.length;E<D;E++)T.push(w[E].clone());this.faceVertexUvs[d].push(T)}}},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=Math.pow(10,4),o,s,c,l,u,d;for(o=0,s=this.vertices.length;o<s;o++)r=this.vertices[o],i=Math.round(r.x*a)+`_`+Math.round(r.y*a)+`_`+Math.round(r.z*a),e[i]===void 0?(e[i]=o,t.push(this.vertices[o]),n[o]=t.length-1):n[o]=n[e[i]];var f=[];for(o=0,s=this.faces.length;o<s;o++){c=this.faces[o],c.a=n[c.a],c.b=n[c.b],c.c=n[c.c],l=[c.a,c.b,c.c];for(var p=0;p<3;p++)if(l[p]===l[(p+1)%3]){f.push(o);break}}for(o=f.length-1;o>=0;o--){var m=f[o];for(this.faces.splice(m,1),u=0,d=this.faceVertexUvs.length;u<d;u++)this.faceVertexUvs[u].splice(m,1)}var h=this.vertices.length-t.length;return this.vertices=t,h},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new D(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(e,t){return e.materialIndex-t.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={},d=[],f={},i=0;i<this.faces.length;i++){var p=this.faces[i],m=!0,h=!1,g=this.faceVertexUvs[0][i]!==void 0,_=p.normal.length()>0,v=p.vertexNormals.length>0,y=p.color.r!==1||p.color.g!==1||p.color.b!==1,b=p.vertexColors.length>0,x=0;if(x=T(x,0,0),x=T(x,1,m),x=T(x,2,h),x=T(x,3,g),x=T(x,4,_),x=T(x,5,v),x=T(x,6,y),x=T(x,7,b),o.push(x),o.push(p.a,p.b,p.c),o.push(p.materialIndex),g){var S=this.faceVertexUvs[0][i];o.push(O(S[0]),O(S[1]),O(S[2]))}if(_&&o.push(E(p.normal)),v){var C=p.vertexNormals;o.push(E(C[0]),E(C[1]),E(C[2]))}if(y&&o.push(D(p.color)),b){var w=p.vertexColors;o.push(D(w[0]),D(w[1]),D(w[2]))}}function T(e,t,n){return n?e|1<<t:e&~(1<<t)}function E(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return c[t]===void 0?(c[t]=s.length/3,s.push(e.x,e.y,e.z),c[t]):c[t]}function D(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return u[t]===void 0?(u[t]=l.length,l.push(e.getHex()),u[t]):u[t]}function O(e){var t=e.x.toString()+e.y.toString();return f[t]===void 0?(f[t]=d.length/2,d.push(e.x,e.y),f[t]):f[t]}return e.data={},e.data.vertices=r,e.data.normals=s,l.length>0&&(e.data.colors=l),d.length>0&&(e.data.uvs=[d]),e.data.faces=o,e},clone:function(){return new J().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 d=u[r],f=[];for(a=0,o=d.length;a<o;a++){var p=d[a];f.push(p.clone())}this.faceVertexUvs[t].push(f)}}var m=e.morphTargets;for(t=0,n=m.length;t<n;t++){var h={};if(h.name=m[t].name,m[t].vertices!==void 0)for(h.vertices=[],r=0,i=m[t].vertices.length;r<i;r++)h.vertices.push(m[t].vertices[r].clone());if(m[t].normals!==void 0)for(h.normals=[],r=0,i=m[t].normals.length;r<i;r++)h.normals.push(m[t].normals[r].clone());this.morphTargets.push(h)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var _={};if(g[t].vertexNormals!==void 0)for(_.vertexNormals=[],r=0,i=g[t].vertexNormals.length;r<i;r++){var v=g[t].vertexNormals[r],y={};y.a=v.a.clone(),y.b=v.b.clone(),y.c=v.c.clone(),_.vertexNormals.push(y)}if(g[t].faceNormals!==void 0)for(_.faceNormals=[],r=0,i=g[t].faceNormals.length;r<i;r++)_.faceNormals.push(g[t].faceNormals[r].clone());this.morphNormals.push(_)}var b=e.skinWeights;for(t=0,n=b.length;t<n;t++)this.skinWeights.push(b[t].clone());var x=e.skinIndices;for(t=0,n=x.length;t<n;t++)this.skinIndices.push(x[t].clone());var S=e.lineDistances;for(t=0,n=S.length;t<n;t++)this.lineDistances.push(S[t]);var C=e.boundingBox;C!==null&&(this.boundingBox=C.clone());var w=e.boundingSphere;return w!==null&&(this.boundingSphere=w.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`})}}),eu=class extends J{constructor(e,t,n,r,i,a){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new tu(e,t,n,r,i,a)),this.mergeVertices()}},tu=class extends q{constructor(e,t,n,r,i,a){super(),this.type=`BoxBufferGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;e=e||1,t=t||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,a=Math.floor(a)||1;let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new K(c,3)),this.setAttribute(`normal`,new K(l,3)),this.setAttribute(`uv`,new K(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,O=new D;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)O[e]=(s*v-b)*r,O[t]=o*i,O[n]=S,c.push(O.x,O.y,O.z),O[e]=0,O[t]=0,O[n]=m>0?1:-1,l.push(O.x,O.y,O.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}},nu={clone:me,merge:he},ru=`void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}`,iu=`void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}`,ge.prototype=Object.create(V.prototype),ge.prototype.constructor=ge,ge.prototype.isShaderMaterial=!0,ge.prototype.copy=function(e){return V.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=me(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},ge.prototype.toJSON=function(e){var t=V.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:`t`,value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:`c`,value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:`v2`,value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:`v3`,value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:`v4`,value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:`m3`,value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:`m4`,value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)this.extensions[a]===!0&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t},_e.prototype=Object.assign(Object.create(j.prototype),{constructor:_e,isCamera:!0,copy:function(e,t){return j.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 D),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){j.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){j.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return new this.constructor().copy(this)}}),ve.prototype=Object.assign(Object.create(_e.prototype),{constructor:ve,isPerspectiveCamera:!0,copy:function(e,t){return _e.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=X.RAD2DEG*2*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(X.DEG2RAD*.5*this.fov);return .5*this.getFilmHeight()/e},getEffectiveFOV:function(){return X.RAD2DEG*2*Math.atan(Math.tan(X.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(X.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=j.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}}),au=90,ou=1,ye.prototype=Object.create(j.prototype),ye.prototype.constructor=ye,be.prototype=Object.create(w.prototype),be.prototype.constructor=be,be.prototype.isWebGLCubeRenderTarget=!0,be.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new M,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(`\n`),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(`\n`)},i=new ge({type:`CubemapFromEquirect`,uniforms:me(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;var a=new de(new tu(5,5,5),i);return n.add(a),new ye(1,10,this).update(e,n),a.geometry.dispose(),a.material.dispose(),this},xe.prototype=Object.create(S.prototype),xe.prototype.constructor=xe,xe.prototype.isDataTexture=!0,su=new F,cu=new D,Object.assign(Se.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],d=n[8],f=n[9],p=n[10],m=n[11],h=n[12],g=n[13],_=n[14],v=n[15];return t[0].setComponents(o-r,u-s,m-d,v-h).normalize(),t[1].setComponents(o+r,u+s,m+d,v+h).normalize(),t[2].setComponents(o+i,u+c,m+f,v+g).normalize(),t[3].setComponents(o-i,u-c,m-f,v-g).normalize(),t[4].setComponents(o-a,u-l,m-p,v-_).normalize(),t[5].setComponents(o+a,u+l,m+p,v+_).normalize(),this},intersectsObject:function(e){var t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),su.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(su)},intersectsSprite:function(e){return su.center.set(0,0,0),su.radius=.7071067811865476,su.applyMatrix4(e.matrixWorld),this.intersectsSphere(su)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++)if(t[i].distanceToPoint(n)<r)return!1;return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(cu.x=r.normal.x>0?e.max.x:e.min.x,cu.y=r.normal.y>0?e.max.y:e.min.y,cu.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(cu)<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}}),Z={common:{diffuse:{value:new z(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x},uv2Transform:{value:new x},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 b(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 z(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 z(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}},sprite:{diffuse:{value:new z(15658734)},opacity:{value:1},center:{value:new b(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}}},Te.prototype=Object.create(J.prototype),Te.prototype.constructor=Te,Ee.prototype=Object.create(q.prototype),Ee.prototype.constructor=Ee,Q={alphamap_fragment:`#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif`,alphamap_pars_fragment:`#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif`,alphatest_fragment:`#ifdef ALPHATEST\n if ( diffuseColor.a < ALPHATEST ) discard;\n#endif`,aomap_fragment:`#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n #endif\n#endif`,aomap_pars_fragment:`#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif`,begin_vertex:`vec3 transformed = vec3( position );`,beginnormal_vertex:`vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif`,bsdfs:`vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n return vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n#else\n if( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n }\n return 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n return ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n return Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n return 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( incidentLight.direction + viewDir );\n float dotNL = saturate( dot( normal, incidentLight.direction ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n vec3 F = F_Schlick( specularColor, dotLH );\n float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n return specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n vec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n vec3 FssEss = F * brdf.x + brdf.y;\n float Ess = brdf.x + brdf.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n float dotNH = saturate( dot( geometry.normal, halfDir ) );\n float dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n vec3 F = F_Schlick( specularColor, dotLH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n return sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n float invAlpha = 1.0 / roughness;\n float cos2h = NoH * NoH;\n float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n vec3 N = geometry.normal;\n vec3 V = geometry.viewDir;\n vec3 H = normalize( V + L );\n float dotNH = saturate( dot( N, H ) );\n return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif`,bumpmap_pars_fragment:`#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 );\n fDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif`,clipping_planes_fragment:`#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n#endif`,clipping_planes_pars_fragment:`#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif`,clipping_planes_pars_vertex:`#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif`,clipping_planes_vertex:`#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif`,color_fragment:`#ifdef USE_COLOR\n diffuseColor.rgb *= vColor;\n#endif`,color_pars_fragment:`#ifdef USE_COLOR\n varying vec3 vColor;\n#endif`,color_pars_vertex:`#ifdef USE_COLOR\n varying vec3 vColor;\n#endif`,color_vertex:`#ifdef USE_COLOR\n vColor.xyz = color.xyz;\n#endif`,common:`#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n#ifdef CLEARCOAT\n vec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n float distance = dot( planeNormal, point - pointOnPlane );\n return - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n vec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n return dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}`,cube_uv_reflection_fragment:`#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x); } else if (face == 1.0) {\n uv = vec2(-direction.x, -direction.z) / abs(direction.y); } else if (face == 2.0) {\n uv = vec2(-direction.x, direction.y) / abs(direction.z); } else if (face == 3.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x); } else if (face == 4.0) {\n uv = vec2(-direction.x, direction.z) / abs(direction.y); } else {\n uv = vec2(direction.x, direction.y) / abs(direction.z); }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif`,defaultnormal_vertex:`vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n mat3 m = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n transformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif`,displacementmap_pars_vertex:`#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif`,displacementmap_vertex:`#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif`,emissivemap_fragment:`#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vUv );\n emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif`,emissivemap_pars_fragment:`#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif`,encodings_fragment:`gl_FragColor = linearToOutputTexel( gl_FragColor );`,encodings_pars_fragment:`\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.r, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.r, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract( Le );\n vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n return vec4( max( vRGB, 0.0 ), 1.0 );\n}`,envmap_fragment:`#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n \n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n #elif defined( ENVMAP_TYPE_EQUIREC )\n reflectVec = normalize( reflectVec );\n vec2 sampleUV = equirectUv( reflectVec );\n vec4 envColor = texture2D( envMap, sampleUV );\n #elif defined( ENVMAP_TYPE_SPHERE )\n reflectVec = normalize( reflectVec );\n vec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifndef ENVMAP_TYPE_CUBE_UV\n envColor = envMapTexelToLinear( envColor );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif`,envmap_common_pars_fragment:`#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform int maxMipLevel;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif`,envmap_pars_fragment:`#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif`,envmap_pars_vertex:`#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif`,envmap_physical_pars_fragment:`#if defined( USE_ENVMAP )\n #ifdef ENVMAP_MODE_REFRACTION\n uniform float refractionRatio;\n #endif\n vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n #ifdef ENVMAP_TYPE_CUBE\n vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n #else\n vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n #else\n vec4 envMapColor = vec4( 0.0 );\n #endif\n return PI * envMapColor.rgb * envMapIntensity;\n }\n float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n float maxMIPLevelScalar = float( maxMIPLevel );\n float sigma = PI * roughness * roughness / ( 1.0 + roughness );\n float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n }\n vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( -viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n #else\n vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n #endif\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n #ifdef ENVMAP_TYPE_CUBE\n vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n #else\n vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n #elif defined( ENVMAP_TYPE_EQUIREC )\n vec2 sampleUV = equirectUv( reflectVec );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n #else\n vec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_SPHERE )\n vec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n #else\n vec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #endif\n return envMapColor.rgb * envMapIntensity;\n }\n#endif`,envmap_vertex:`#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) { \n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif`,fog_vertex:`#ifdef USE_FOG\n fogDepth = -mvPosition.z;\n#endif`,fog_pars_vertex:`#ifdef USE_FOG\n varying float fogDepth;\n#endif`,fog_fragment:`#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif`,fog_pars_fragment:`#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float fogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif`,gradientmap_pars_fragment:`#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return texture2D( gradientMap, coord ).rgb;\n #else\n return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n #endif\n}`,lightmap_fragment:`#ifdef USE_LIGHTMAP\n vec4 lightMapTexel= texture2D( lightMap, vUv2 );\n reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif`,lightmap_pars_fragment:`#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif`,lights_lambert_vertex:`vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n vLightBack = vec3( 0.0 );\n vIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n vIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n #ifdef DOUBLE_SIDED\n vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n #endif\n }\n #pragma unroll_loop_end\n#endif`,lights_pars_begin:`uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n return irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n struct DirectionalLightShadow {\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n directLight.color = directionalLight.color;\n directLight.direction = directionalLight.direction;\n directLight.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n struct PointLightShadow {\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = pointLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n directLight.color = pointLight.color;\n directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n directLight.visible = ( directLight.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = spotLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n float angleCos = dot( directLight.direction, spotLight.direction );\n if ( angleCos > spotLight.coneCos ) {\n float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n directLight.color = spotLight.color;\n directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n directLight.visible = true;\n } else {\n directLight.color = vec3( 0.0 );\n directLight.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n float dotNL = dot( geometry.normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n return irradiance;\n }\n#endif`,lights_toon_fragment:`ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;`,lights_toon_pars_fragment:`varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material ) (0)`,lights_phong_fragment:`BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;`,lights_phong_pars_fragment:`varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material ) (0)`,lights_physical_fragment:`PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheen;\n#endif`,lights_physical_pars_fragment:`struct PhysicalMaterial {\n vec3 diffuseColor;\n float specularRoughness;\n vec3 specularColor;\n#ifdef CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n vec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometry.normal;\n vec3 viewDir = geometry.viewDir;\n vec3 position = geometry.position;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.specularRoughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n #ifdef CLEARCOAT\n float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = ccDotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n ccIrradiance *= PI;\n #endif\n float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n #else\n float clearcoatDHR = 0.0;\n #endif\n #ifdef USE_SHEEN\n reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n material.specularRoughness,\n directLight.direction,\n geometry,\n material.sheenColor\n );\n #else\n reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n #endif\n reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef CLEARCOAT\n float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n float ccDotNL = ccDotNV;\n float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n #else\n float clearcoatDHR = 0.0;\n #endif\n float clearcoatInv = 1.0 - clearcoatDHR;\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}`,lights_fragment_begin:`\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n geometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointDirectLightIrradiance( pointLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotDirectLightIrradiance( spotLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n irradiance += getLightProbeIrradiance( lightProbe, geometry );\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif`,lights_fragment_maps:`#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel= texture2D( lightMap, vUv2 );\n vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n lightMapIrradiance *= PI;\n #endif\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n #ifdef CLEARCOAT\n clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n #endif\n#endif`,lights_fragment_end:`#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif`,logdepthbuf_fragment:`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif`,logdepthbuf_pars_fragment:`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif`,logdepthbuf_pars_vertex:`#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n varying float vFragDepth;\n varying float vIsPerspective;\n #else\n uniform float logDepthBufFC;\n #endif\n#endif`,logdepthbuf_vertex:`#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n #else\n if ( isPerspectiveMatrix( projectionMatrix ) ) {\n gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n gl_Position.z *= gl_Position.w;\n }\n #endif\n#endif`,map_fragment:`#ifdef USE_MAP\n vec4 texelColor = texture2D( map, vUv );\n texelColor = mapTexelToLinear( texelColor );\n diffuseColor *= texelColor;\n#endif`,map_pars_fragment:`#ifdef USE_MAP\n uniform sampler2D map;\n#endif`,map_particle_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n vec4 mapTexel = texture2D( map, uv );\n diffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif`,map_particle_pars_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif`,metalnessmap_fragment:`float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vUv );\n metalnessFactor *= texelMetalness.b;\n#endif`,metalnessmap_pars_fragment:`#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif`,morphnormal_vertex:`#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif`,morphtarget_pars_vertex:`#ifdef USE_MORPHTARGETS\n uniform float morphTargetBaseInfluence;\n #ifndef USE_MORPHNORMALS\n uniform float morphTargetInfluences[ 8 ];\n #else\n uniform float morphTargetInfluences[ 4 ];\n #endif\n#endif`,morphtarget_vertex:`#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n transformed += morphTarget0 * morphTargetInfluences[ 0 ];\n transformed += morphTarget1 * morphTargetInfluences[ 1 ];\n transformed += morphTarget2 * morphTargetInfluences[ 2 ];\n transformed += morphTarget3 * morphTargetInfluences[ 3 ];\n #ifndef USE_MORPHNORMALS\n transformed += morphTarget4 * morphTargetInfluences[ 4 ];\n transformed += morphTarget5 * morphTargetInfluences[ 5 ];\n transformed += morphTarget6 * morphTargetInfluences[ 6 ];\n transformed += morphTarget7 * morphTargetInfluences[ 7 ];\n #endif\n#endif`,normal_fragment_begin:`#ifdef FLAT_SHADED\n vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #endif\n #ifdef USE_TANGENT\n vec3 tangent = normalize( vTangent );\n vec3 bitangent = normalize( vBitangent );\n #ifdef DOUBLE_SIDED\n tangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n bitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #endif\n #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n mat3 vTBN = mat3( tangent, bitangent, normal );\n #endif\n #endif\n#endif\nvec3 geometryNormal = normal;`,normal_fragment_maps:`#ifdef OBJECTSPACE_NORMALMAP\n normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n #ifdef USE_TANGENT\n normal = normalize( vTBN * mapN );\n #else\n normal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n #endif\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif`,normalmap_pars_fragment:`#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n float scale = sign( st1.t * st0.s - st0.t * st1.s );\n vec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n vec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n vec3 N = normalize( surf_norm );\n mat3 tsn = mat3( S, T, N );\n mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n return normalize( tsn * mapN );\n }\n#endif`,clearcoat_normal_fragment_begin:`#ifdef CLEARCOAT\n vec3 clearcoatNormal = geometryNormal;\n#endif`,clearcoat_normal_fragment_maps:`#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n #ifdef USE_TANGENT\n clearcoatNormal = normalize( vTBN * clearcoatMapN );\n #else\n clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n #endif\n#endif`,clearcoat_pars_fragment:`#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif`,packing:`vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n vec4 r = vec4( fract( v * PackFactors ), v );\n r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}`,premultiplied_alpha_fragment:`#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif`,project_vertex:`vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;`,dithering_fragment:`#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif`,dithering_pars_fragment:`#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif`,roughnessmap_fragment:`float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vUv );\n roughnessFactor *= texelRoughness.g;\n#endif`,roughnessmap_pars_fragment:`#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif`,shadowmap_pars_fragment:`#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n bool frustumTest = all( frustumTestVec );\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return shadow;\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n vec3 lightToPosition = shadowCoord.xyz;\n float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n return (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n#endif`,shadowmap_pars_vertex:`#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif`,shadowmap_vertex:`#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif`,shadowmask_pars_fragment:`float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}`,skinbase_vertex:`#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif`,skinning_pars_vertex:`#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n #ifdef BONE_TEXTURE\n uniform highp sampler2D boneTexture;\n uniform int boneTextureSize;\n mat4 getBoneMatrix( const in float i ) {\n float j = i * 4.0;\n float x = mod( j, float( boneTextureSize ) );\n float y = floor( j / float( boneTextureSize ) );\n float dx = 1.0 / float( boneTextureSize );\n float dy = 1.0 / float( boneTextureSize );\n y = dy * ( y + 0.5 );\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n mat4 bone = mat4( v1, v2, v3, v4 );\n return bone;\n }\n #else\n uniform mat4 boneMatrices[ MAX_BONES ];\n mat4 getBoneMatrix( const in float i ) {\n mat4 bone = boneMatrices[ int(i) ];\n return bone;\n }\n #endif\n#endif`,skinning_vertex:`#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif`,skinnormal_vertex:`#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif`,specularmap_fragment:`float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif`,specularmap_pars_fragment:`#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif`,tonemapping_fragment:`#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif`,tonemapping_pars_fragment:`#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}`,uv_pars_fragment:`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n varying vec2 vUv;\n#endif`,uv_pars_vertex:`#ifdef USE_UV\n #ifdef UVS_VERTEX_ONLY\n vec2 vUv;\n #else\n varying vec2 vUv;\n #endif\n uniform mat3 uvTransform;\n#endif`,uv_vertex:`#ifdef USE_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif`,uv2_pars_fragment:`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n varying vec2 vUv2;\n#endif`,uv2_pars_vertex:`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n attribute vec2 uv2;\n varying vec2 vUv2;\n uniform mat3 uv2Transform;\n#endif`,uv2_vertex:`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif`,worldpos_vertex:`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif`,background_frag:`uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n gl_FragColor = mapTexelToLinear( texColor );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n}`,background_vert:`varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}`,cube_frag:`#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n vec3 vReflect = vWorldDirection;\n #include <envmap_fragment>\n gl_FragColor = envColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n}`,cube_vert:`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}`,depth_frag:`#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( 1.0 );\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <logdepthbuf_fragment>\n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #endif\n}`,depth_vert:`#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <skinbase_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}`,distanceRGBA_frag:`#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( 1.0 );\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}`,distanceRGBA_vert:`#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <skinbase_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}`,equirect_frag:`uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n vec4 texColor = texture2D( tEquirect, sampleUV );\n gl_FragColor = mapTexelToLinear( texColor );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n}`,equirect_vert:`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}`,linedashed_frag:`uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}`,linedashed_vert:`uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <color_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}`,meshbasic_frag:`uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n \n vec4 lightMapTexel= texture2D( lightMap, vUv2 );\n reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshbasic_vert:`#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <skinbase_vertex>\n #ifdef USE_ENVMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}`,meshlambert_frag:`uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <emissivemap_fragment>\n #ifdef DOUBLE_SIDED\n reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n #else\n reflectedLight.indirectDiffuse += vIndirectFront;\n #endif\n #include <lightmap_fragment>\n reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n #ifdef DOUBLE_SIDED\n reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n #else\n reflectedLight.directDiffuse = vLightFront;\n #endif\n reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshlambert_vert:`#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <lights_lambert_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}`,meshmatcap_frag:`#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n matcapColor = matcapTexelToLinear( matcapColor );\n #else\n vec4 matcapColor = vec4( 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshmatcap_vert:`#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}`,meshtoon_frag:`#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshtoon_vert:`#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n#endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}`,meshphong_frag:`#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshphong_vert:`#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n#endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}`,meshphysical_frag:`#define STANDARD\n#ifdef PHYSICAL\n #define REFLECTIVITY\n #define CLEARCOAT\n #define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n uniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n uniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #ifdef TRANSPARENCY\n diffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n #endif\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}`,meshphysical_vert:`#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}`,normal_frag:`#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n varying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}`,normal_vert:`#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n varying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n vViewPosition = - mvPosition.xyz;\n#endif\n}`,points_frag:`uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n outgoingLight = diffuseColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}`,points_vert:`uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <color_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}`,shadow_frag:`uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}`,shadow_vert:`#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <begin_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}`,sprite_frag:`uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n outgoingLight = diffuseColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}`,sprite_vert:`uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n vec2 scale;\n scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}`},lu={basic:{uniforms:he([Z.common,Z.specularmap,Z.envmap,Z.aomap,Z.lightmap,Z.fog]),vertexShader:Q.meshbasic_vert,fragmentShader:Q.meshbasic_frag},lambert:{uniforms:he([Z.common,Z.specularmap,Z.envmap,Z.aomap,Z.lightmap,Z.emissivemap,Z.fog,Z.lights,{emissive:{value:new z(0)}}]),vertexShader:Q.meshlambert_vert,fragmentShader:Q.meshlambert_frag},phong:{uniforms:he([Z.common,Z.specularmap,Z.envmap,Z.aomap,Z.lightmap,Z.emissivemap,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.fog,Z.lights,{emissive:{value:new z(0)},specular:{value:new z(1118481)},shininess:{value:30}}]),vertexShader:Q.meshphong_vert,fragmentShader:Q.meshphong_frag},standard:{uniforms:he([Z.common,Z.envmap,Z.aomap,Z.lightmap,Z.emissivemap,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.roughnessmap,Z.metalnessmap,Z.fog,Z.lights,{emissive:{value:new z(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Q.meshphysical_vert,fragmentShader:Q.meshphysical_frag},toon:{uniforms:he([Z.common,Z.specularmap,Z.aomap,Z.lightmap,Z.emissivemap,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.gradientmap,Z.fog,Z.lights,{emissive:{value:new z(0)},specular:{value:new z(1118481)},shininess:{value:30}}]),vertexShader:Q.meshtoon_vert,fragmentShader:Q.meshtoon_frag},matcap:{uniforms:he([Z.common,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.fog,{matcap:{value:null}}]),vertexShader:Q.meshmatcap_vert,fragmentShader:Q.meshmatcap_frag},points:{uniforms:he([Z.points,Z.fog]),vertexShader:Q.points_vert,fragmentShader:Q.points_frag},dashed:{uniforms:he([Z.common,Z.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Q.linedashed_vert,fragmentShader:Q.linedashed_frag},depth:{uniforms:he([Z.common,Z.displacementmap]),vertexShader:Q.depth_vert,fragmentShader:Q.depth_frag},normal:{uniforms:he([Z.common,Z.bumpmap,Z.normalmap,Z.displacementmap,{opacity:{value:1}}]),vertexShader:Q.normal_vert,fragmentShader:Q.normal_frag},sprite:{uniforms:he([Z.sprite,Z.fog]),vertexShader:Q.sprite_vert,fragmentShader:Q.sprite_frag},background:{uniforms:{uvTransform:{value:new x},t2D:{value:null}},vertexShader:Q.background_vert,fragmentShader:Q.background_frag},cube:{uniforms:he([Z.envmap,{opacity:{value:1}}]),vertexShader:Q.cube_vert,fragmentShader:Q.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Q.equirect_vert,fragmentShader:Q.equirect_frag},distanceRGBA:{uniforms:he([Z.common,Z.displacementmap,{referencePosition:{value:new D},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Q.distanceRGBA_vert,fragmentShader:Q.distanceRGBA_frag},shadow:{uniforms:he([Z.lights,Z.fog,{color:{value:new z(0)},opacity:{value:1}}]),vertexShader:Q.shadow_vert,fragmentShader:Q.shadow_frag}},lu.physical={uniforms:he([lu.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new b(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new z(0)},transparency:{value:0}}]),vertexShader:Q.meshphysical_vert,fragmentShader:Q.meshphysical_frag},Re.prototype=Object.create(S.prototype),Re.prototype.constructor=Re,Re.prototype.isCubeTexture=!0,Object.defineProperty(Re.prototype,`images`,{get:function(){return this.image},set:function(e){this.image=e}}),ze.prototype=Object.create(S.prototype),ze.prototype.constructor=ze,ze.prototype.isDataTexture2DArray=!0,Be.prototype=Object.create(S.prototype),Be.prototype.constructor=Be,Be.prototype.isDataTexture3D=!0,uu=new S,du=new ze,fu=new Be,pu=new Re,mu=[],hu=[],gu=new Float32Array(16),_u=new Float32Array(9),vu=new Float32Array(4),Ct.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Ue(t,e)},wt.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)}},yu=/([\\w\\d_]+)(\\])?(\\[|\\.)?/g,Dt.prototype.setValue=function(e,t,n,r){var i=this.map[t];i!==void 0&&i.setValue(e,n,r)},Dt.prototype.setOptional=function(e,t,n){var r=t[n];r!==void 0&&this.setValue(e,n,r)},Dt.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)}},Dt.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},bu=0,xu=/^[ \\t]*#include +<([\\w\\d./]+)>/gm,Su=/#pragma unroll_loop[\\s]+?for \\( int i \\= (\\d+)\\; i < (\\d+)\\; i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}/g,Cu=/#pragma unroll_loop_start[\\s]+?for \\( int i \\= (\\d+)\\; i < (\\d+)\\; i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}[\\s]+?#pragma unroll_loop_end/g,wu=0,dn.prototype=Object.create(V.prototype),dn.prototype.constructor=dn,dn.prototype.isMeshDepthMaterial=!0,dn.prototype.copy=function(e){return V.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},fn.prototype=Object.create(V.prototype),fn.prototype.constructor=fn,fn.prototype.isMeshDistanceMaterial=!0,fn.prototype.copy=function(e){return V.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},Tu=`uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}`,Eu=`void main() {\n gl_Position = vec4( position, 1.0 );\n}`,_n.prototype=Object.assign(Object.create(ve.prototype),{constructor:_n,isArrayCamera:!0}),vn.prototype=Object.assign(Object.create(j.prototype),{constructor:vn,isGroup:!0}),Object.assign(yn.prototype,{constructor:yn,getTargetRaySpace:function(){return this._targetRay===null&&(this._targetRay=new vn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return this._grip===null&&(this._grip=new vn,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}}),Object.assign(bn.prototype,y.prototype),Object.assign(Cn.prototype,{isFogExp2:!0,clone:function(){return new Cn(this.color,this.density)},toJSON:function(){return{type:`FogExp2`,color:this.color.getHex(),density:this.density}}}),Object.assign(wn.prototype,{isFog:!0,clone:function(){return new wn(this.color,this.near,this.far)},toJSON:function(){return{type:`Fog`,color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Tn.prototype,`needsUpdate`,{set:function(e){e===!0&&this.version++}}),Object.assign(Tn.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}}),Du=new D,Object.defineProperties(En.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(En.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)Du.x=this.getX(t),Du.y=this.getY(t),Du.z=this.getZ(t),Du.applyMatrix4(e),this.setXYZ(t,Du.x,Du.y,Du.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 H(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}}}),Dn.prototype=Object.create(V.prototype),Dn.prototype.constructor=Dn,Dn.prototype.isSpriteMaterial=!0,Dn.prototype.copy=function(e){return V.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},ku=new D,Au=new D,ju=new D,Mu=new b,Nu=new b,Pu=new O,Fu=new D,Iu=new D,Lu=new D,Ru=new b,zu=new b,Bu=new b,On.prototype=Object.assign(Object.create(j.prototype),{constructor:On,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.`),Au.setFromMatrixScale(this.matrixWorld),Pu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ju.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Au.multiplyScalar(-ju.z);var n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));var a=this.center;kn(Fu.set(-.5,-.5,0),ju,a,Au,r,i),kn(Iu.set(.5,-.5,0),ju,a,Au,r,i),kn(Lu.set(.5,.5,0),ju,a,Au,r,i),Ru.set(0,0),zu.set(1,0),Bu.set(1,1);var o=e.ray.intersectTriangle(Fu,Iu,Lu,!1,ku);if(!(o===null&&(kn(Iu.set(-.5,.5,0),ju,a,Au,r,i),zu.set(0,1),o=e.ray.intersectTriangle(Fu,Lu,Iu,!1,ku),o===null))){var s=e.ray.origin.distanceTo(ku);s<e.near||s>e.far||t.push({distance:s,point:ku.clone(),uv:R.getUV(ku,Fu,Iu,Lu,Ru,zu,Bu,new b),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return j.prototype.copy.call(this,e),e.center!==void 0&&this.center.copy(e.center),this}}),Vu=new D,Hu=new D,An.prototype=Object.assign(Object.create(j.prototype),{constructor:An,isLOD:!0,copy:function(e){j.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){if(this.levels.length>0){Vu.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(Vu);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){Vu.setFromMatrixPosition(e.matrixWorld),Hu.setFromMatrixPosition(this.matrixWorld);var n=Vu.distanceTo(Hu)/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=j.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}}),jn.prototype=Object.assign(Object.create(de.prototype),{constructor:jn,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 C,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.set(1,0,0,0):e.multiplyScalar(i),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){de.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 D,t=new C,n=new C,r=new D,i=new O;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 d=t.getComponent(l);i.multiplyMatrices(s.bones[d].matrixWorld,s.boneInverses[d]),o.addScaledVector(r.copy(e).applyMatrix4(i),u)}}return o.applyMatrix4(this.bindMatrixInverse)}}()}),Uu=new O,Wu=new O,Object.assign(Mn.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new O;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:Wu;Uu.multiplyMatrices(o,t[i]),Uu.toArray(n,i*16)}r!==void 0&&(r.needsUpdate=!0)},clone:function(){return new Mn(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)}}),Nn.prototype=Object.assign(Object.create(j.prototype),{constructor:Nn,isBone:!0}),Gu=new O,Ku=new O,qu=[],Ju=new de,Pn.prototype=Object.assign(Object.create(de.prototype),{constructor:Pn,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(Ju.geometry=this.geometry,Ju.material=this.material,Ju.material!==void 0)for(var i=0;i<r;i++){this.getMatrixAt(i,Gu),Ku.multiplyMatrices(n,Gu),Ju.matrixWorld=Ku,Ju.raycast(e,qu);for(var a=0,o=qu.length;a<o;a++){var s=qu[a];s.instanceId=i,s.object=this,t.push(s)}qu.length=0}},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,e*16)},updateMorphTargets:function(){}}),Fn.prototype=Object.create(V.prototype),Fn.prototype.constructor=Fn,Fn.prototype.isLineBasicMaterial=!0,Fn.prototype.copy=function(e){return V.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},Yu=new D,Xu=new D,Zu=new O,Qu=new I,$u=new F,In.prototype=Object.assign(Object.create(j.prototype),{constructor:In,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++)Yu.fromBufferAttribute(t,r-1),Xu.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=Yu.distanceTo(Xu);e.setAttribute(`lineDistance`,new K(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(),$u.copy(n.boundingSphere),$u.applyMatrix4(r),$u.radius+=i,e.ray.intersectsSphere($u)!==!1){Zu.getInverse(r),Qu.copy(e.ray).applyMatrix4(Zu);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new D,c=new D,l=new D,u=new D,d=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var f=n.index,p=n.attributes.position.array;if(f!==null)for(var m=f.array,h=0,g=m.length-1;h<g;h+=d){var _=m[h],v=m[h+1];s.fromArray(p,_*3),c.fromArray(p,v*3);var y=Qu.distanceSqToSegment(s,c,u,l);if(!(y>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:h,face:null,faceIndex:null,object:this})}}else for(var h=0,g=p.length/3-1;h<g;h+=d){s.fromArray(p,3*h),c.fromArray(p,3*h+3);var y=Qu.distanceSqToSegment(s,c,u,l);if(!(y>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:h,face:null,faceIndex:null,object:this})}}}else if(n.isGeometry)for(var x=n.vertices,S=x.length,h=0;h<S-1;h+=d){var y=Qu.distanceSqToSegment(x[h],x[h+1],u,l);if(!(y>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:h,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)}}),ed=new D,td=new D,Ln.prototype=Object.assign(Object.create(In.prototype),{constructor:Ln,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)ed.fromBufferAttribute(t,r),td.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+ed.distanceTo(td);e.setAttribute(`lineDistance`,new K(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)ed.copy(a[r]),td.copy(a[r+1]),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+ed.distanceTo(td);return this}}),Rn.prototype=Object.assign(Object.create(In.prototype),{constructor:Rn,isLineLoop:!0}),zn.prototype=Object.create(V.prototype),zn.prototype.constructor=zn,zn.prototype.isPointsMaterial=!0,zn.prototype.copy=function(e){return V.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},nd=new O,rd=new I,id=new F,ad=new D,Bn.prototype=Object.assign(Object.create(j.prototype),{constructor:Bn,isPoints:!0,raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(n.boundingSphere===null&&n.computeBoundingSphere(),id.copy(n.boundingSphere),id.applyMatrix4(r),id.radius+=i,e.ray.intersectsSphere(id)!==!1){nd.getInverse(r),rd.copy(e.ray).applyMatrix4(nd);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.position.array;if(s!==null)for(var l=s.array,u=0,d=l.length;u<d;u++){var f=l[u];ad.fromArray(c,f*3),Vn(ad,f,o,r,e,t,this)}else for(var u=0,p=c.length/3;u<p;u++)ad.fromArray(c,u*3),Vn(ad,u,o,r,e,t,this)}else for(var m=n.vertices,u=0,p=m.length;u<p;u++)Vn(m[u],u,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)}}),Hn.prototype=Object.assign(Object.create(S.prototype),{constructor:Hn,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Un.prototype=Object.create(S.prototype),Un.prototype.constructor=Un,Un.prototype.isCompressedTexture=!0,Wn.prototype=Object.create(S.prototype),Wn.prototype.constructor=Wn,Wn.prototype.isCanvasTexture=!0,Gn.prototype=Object.create(S.prototype),Gn.prototype.constructor=Gn,Gn.prototype.isDepthTexture=!0,Kn.prototype=Object.create(q.prototype),Kn.prototype.constructor=Kn,qn.prototype=Object.create(J.prototype),qn.prototype.constructor=qn,Jn.prototype=Object.create(q.prototype),Jn.prototype.constructor=Jn,Yn.prototype=Object.create(J.prototype),Yn.prototype.constructor=Yn,Xn.prototype=Object.create(q.prototype),Xn.prototype.constructor=Xn,Zn.prototype=Object.create(J.prototype),Zn.prototype.constructor=Zn,Qn.prototype=Object.create(Xn.prototype),Qn.prototype.constructor=Qn,$n.prototype=Object.create(J.prototype),$n.prototype.constructor=$n,er.prototype=Object.create(Xn.prototype),er.prototype.constructor=er,tr.prototype=Object.create(J.prototype),tr.prototype.constructor=tr,nr.prototype=Object.create(Xn.prototype),nr.prototype.constructor=nr,rr.prototype=Object.create(J.prototype),rr.prototype.constructor=rr,ir.prototype=Object.create(Xn.prototype),ir.prototype.constructor=ir,ar.prototype=Object.create(J.prototype),ar.prototype.constructor=ar,or.prototype=Object.create(q.prototype),or.prototype.constructor=or,or.prototype.toJSON=function(){var e=q.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},sr.prototype=Object.create(J.prototype),sr.prototype.constructor=sr,cr.prototype=Object.create(q.prototype),cr.prototype.constructor=cr,lr.prototype=Object.create(J.prototype),lr.prototype.constructor=lr,ur.prototype=Object.create(q.prototype),ur.prototype.constructor=ur,od={triangulate:function(e,t,n){n=n||2;var r=t&&t.length,i=r?t[0]*n:e.length,a=dr(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;var s,c,l,u,d,f,p;if(r&&(a=vr(e,t,a,n)),e.length>80*n){s=l=e[0],c=u=e[1];for(var m=n;m<i;m+=n)d=e[m],f=e[m+1],d<s&&(s=d),f<c&&(c=f),d>l&&(l=d),f>u&&(u=f);p=Math.max(l-s,u-c),p=p===0?0:1/p}return pr(a,o,n,s,c,p),o}},sd={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 sd.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];Hr(e),Ur(n,e);var a=e.length;t.forEach(Hr);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,Ur(n,t[o]);for(var s=od.triangulate(n,r),o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}},Wr.prototype=Object.create(J.prototype),Wr.prototype.constructor=Wr,Wr.prototype.toJSON=function(){var e=J.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return Kr(t,n,e)},Gr.prototype=Object.create(q.prototype),Gr.prototype.constructor=Gr,Gr.prototype.toJSON=function(){var e=q.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return Kr(t,n,e)},cd={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 b(a,o),new b(s,c),new b(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],d=t[r*3+2],f=t[i*3],p=t[i*3+1],m=t[i*3+2],h=t[a*3],g=t[a*3+1],_=t[a*3+2];return Math.abs(s-u)<.01?[new b(o,1-c),new b(l,1-d),new b(f,1-m),new b(h,1-_)]:[new b(s,1-c),new b(u,1-d),new b(p,1-m),new b(g,1-_)]}},qr.prototype=Object.create(J.prototype),qr.prototype.constructor=qr,Jr.prototype=Object.create(Gr.prototype),Jr.prototype.constructor=Jr,Yr.prototype=Object.create(J.prototype),Yr.prototype.constructor=Yr,Xr.prototype=Object.create(q.prototype),Xr.prototype.constructor=Xr,Zr.prototype=Object.create(J.prototype),Zr.prototype.constructor=Zr,Qr.prototype=Object.create(q.prototype),Qr.prototype.constructor=Qr,$r.prototype=Object.create(J.prototype),$r.prototype.constructor=$r,ei.prototype=Object.create(q.prototype),ei.prototype.constructor=ei,ti.prototype=Object.create(J.prototype),ti.prototype.constructor=ti,ti.prototype.toJSON=function(){var e=J.prototype.toJSON.call(this),t=this.parameters.shapes;return ri(t,e)},ni.prototype=Object.create(q.prototype),ni.prototype.constructor=ni,ni.prototype.toJSON=function(){var e=q.prototype.toJSON.call(this),t=this.parameters.shapes;return ri(t,e)},ii.prototype=Object.create(q.prototype),ii.prototype.constructor=ii,ai.prototype=Object.create(J.prototype),ai.prototype.constructor=ai,oi.prototype=Object.create(q.prototype),oi.prototype.constructor=oi,si.prototype=Object.create(ai.prototype),si.prototype.constructor=si,ci.prototype=Object.create(oi.prototype),ci.prototype.constructor=ci,li.prototype=Object.create(J.prototype),li.prototype.constructor=li,ui.prototype=Object.create(q.prototype),ui.prototype.constructor=ui,ld=Object.freeze({__proto__:null,WireframeGeometry:Kn,ParametricGeometry:qn,ParametricBufferGeometry:Jn,TetrahedronGeometry:Zn,TetrahedronBufferGeometry:Qn,OctahedronGeometry:$n,OctahedronBufferGeometry:er,IcosahedronGeometry:tr,IcosahedronBufferGeometry:nr,DodecahedronGeometry:rr,DodecahedronBufferGeometry:ir,PolyhedronGeometry:Yn,PolyhedronBufferGeometry:Xn,TubeGeometry:ar,TubeBufferGeometry:or,TorusKnotGeometry:sr,TorusKnotBufferGeometry:cr,TorusGeometry:lr,TorusBufferGeometry:ur,TextGeometry:qr,TextBufferGeometry:Jr,SphereGeometry:Yr,SphereBufferGeometry:Xr,RingGeometry:Zr,RingBufferGeometry:Qr,PlaneGeometry:Te,PlaneBufferGeometry:Ee,LatheGeometry:$r,LatheBufferGeometry:ei,ShapeGeometry:ti,ShapeBufferGeometry:ni,ExtrudeGeometry:Wr,ExtrudeBufferGeometry:Gr,EdgesGeometry:ii,ConeGeometry:si,ConeBufferGeometry:ci,CylinderGeometry:ai,CylinderBufferGeometry:oi,CircleGeometry:li,CircleBufferGeometry:ui,BoxGeometry:eu,BoxBufferGeometry:tu}),di.prototype=Object.create(V.prototype),di.prototype.constructor=di,di.prototype.isShadowMaterial=!0,di.prototype.copy=function(e){return V.prototype.copy.call(this,e),this.color.copy(e.color),this},fi.prototype=Object.create(ge.prototype),fi.prototype.constructor=fi,fi.prototype.isRawShaderMaterial=!0,pi.prototype=Object.create(V.prototype),pi.prototype.constructor=pi,pi.prototype.isMeshStandardMaterial=!0,pi.prototype.copy=function(e){return V.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},mi.prototype=Object.create(pi.prototype),mi.prototype.constructor=mi,mi.prototype.isMeshPhysicalMaterial=!0,mi.prototype.copy=function(e){return pi.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 z).copy(e.sheen):this.sheen=null,this.transparency=e.transparency,this},hi.prototype=Object.create(V.prototype),hi.prototype.constructor=hi,hi.prototype.isMeshPhongMaterial=!0,hi.prototype.copy=function(e){return V.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},gi.prototype=Object.create(V.prototype),gi.prototype.constructor=gi,gi.prototype.isMeshToonMaterial=!0,gi.prototype.copy=function(e){return V.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},_i.prototype=Object.create(V.prototype),_i.prototype.constructor=_i,_i.prototype.isMeshNormalMaterial=!0,_i.prototype.copy=function(e){return V.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},vi.prototype=Object.create(V.prototype),vi.prototype.constructor=vi,vi.prototype.isMeshLambertMaterial=!0,vi.prototype.copy=function(e){return V.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},yi.prototype=Object.create(V.prototype),yi.prototype.constructor=yi,yi.prototype.isMeshMatcapMaterial=!0,yi.prototype.copy=function(e){return V.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},bi.prototype=Object.create(Fn.prototype),bi.prototype.constructor=bi,bi.prototype.isLineDashedMaterial=!0,bi.prototype.copy=function(e){return Fn.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this},ud=Object.freeze({__proto__:null,ShadowMaterial:di,SpriteMaterial:Dn,RawShaderMaterial:fi,ShaderMaterial:ge,PointsMaterial:zn,MeshPhysicalMaterial:mi,MeshStandardMaterial:pi,MeshPhongMaterial:hi,MeshToonMaterial:gi,MeshNormalMaterial:_i,MeshLambertMaterial:vi,MeshDepthMaterial:dn,MeshDistanceMaterial:fn,MeshBasicMaterial:re,MeshMatcapMaterial:yi,LineDashedMaterial:bi,LineBasicMaterial:Fn,Material:V}),dd={arraySlice:function(e,t,n){return dd.isTypedArray(e)?new e.constructor(e.subarray(t,n===void 0?e.length:n)):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(t,n){return e[t]-e[n]}for(var n=e.length,r=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=[],d=[],f=0;f<c.times.length;++f){var p=c.times[f]*i;if(!(p<n||p>=r)){u.push(c.times[f]);for(var m=0;m<l;++m)d.push(c.values[f*l+m])}}u.length!==0&&(c.times=dd.convertArray(u,c.times.constructor),c.values=dd.convertArray(d,c.values.constructor),o.push(c))}a.tracks=o;for(var h=1/0,s=0;s<a.tracks.length;++s)h>a.tracks[s].times[0]&&(h=a.tracks[s].times[0]);for(var s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*h);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(e){return e.name===s.name&&e.ValueTypeName===c});if(l!==void 0){var u=s.getValueSize(),d=s.times.length-1,f;if(a<=s.times[0])f=dd.arraySlice(s.values,0,s.valueSize);else if(a>=s.times[d]){var p=d*u;f=dd.arraySlice(s.values,p)}else{var m=s.createInterpolant();m.evaluate(a),f=m.resultBuffer}c===`quaternion`&&new E(f[0],f[1],f[2],f[3]).normalize().conjugate().toArray(f);for(var h=l.times.length,g=0;g<h;++g){var _=g*u;if(c===`quaternion`)E.multiplyQuaternionsFlat(l.values,_,f,0,l.values,_);else for(var v=0;v<u;++v)l.values[_+v]-=f[v]}}}}return e.blendMode=Qs,e}},Object.assign(xi.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];validate_interval:{seek:{var a;linear_scan:{forward_scan:if(!(e<r)){for(var o=n+2;;){if(r===void 0){if(e<i)break forward_scan;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 seek}a=t.length;break linear_scan}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 seek}a=n,n=0;break linear_scan}break validate_interval}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 Error(`call to abstract method`)},intervalChanged_:function(){}}),Object.assign(xi.prototype,{beforeStart_:xi.prototype.copySampleValue_,afterEnd_:xi.prototype.copySampleValue_}),Si.prototype=Object.assign(Object.create(xi.prototype),{constructor:Si,DefaultSettings_:{endingStart:Js,endingEnd:Js},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 Ys:i=e,o=2*t-n;break;case Xs: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 Ys:a=e,s=2*n-t;break;case Xs: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,d=this._weightPrev,f=this._weightNext,p=(n-t)/(r-t),m=p*p,h=m*p,g=-d*h+2*d*m-d*p,_=(1+d)*h+(-1.5-2*d)*m+(-.5+d)*p+1,v=(-1-f)*h+(1.5+f)*m+.5*p,y=f*h-f*m,b=0;b!==o;++b)i[b]=g*a[l+b]+_*a[c+b]+v*a[s+b]+y*a[u+b];return i}}),Ci.prototype=Object.assign(Object.create(xi.prototype),{constructor:Ci,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,d=0;d!==o;++d)i[d]=a[c+d]*u+a[s+d]*l;return i}}),wi.prototype=Object.assign(Object.create(xi.prototype),{constructor:wi,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(Ti,{toJSON:function(e){var t=e.constructor,n;if(t.toJSON!==void 0)n=t.toJSON(e);else{n={name:e.name,times:dd.convertArray(e.times,Array),values:dd.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(n.interpolation=r)}return n.type=e.ValueTypeName,n}}),Object.assign(Ti.prototype,{constructor:Ti,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Ks,InterpolantFactoryMethodDiscrete:function(e){return new wi(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Ci(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Si(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case Gs:t=this.InterpolantFactoryMethodDiscrete;break;case Ks:t=this.InterpolantFactoryMethodLinear;break;case qs: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 Error(n);return console.warn(`THREE.KeyframeTrack:`,n),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Gs;case this.InterpolantFactoryMethodLinear:return Ks;case this.InterpolantFactoryMethodSmooth:return qs}},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=dd.arraySlice(n,i,a),this.values=dd.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&&dd.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=dd.arraySlice(this.times),t=dd.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===qs,i=1,a=e.length-1,o=1;o<a;++o){var s=!1,c=e[o];if(c!==e[o+1]&&(o!==1||c!==c[0]))if(r)s=!0;else for(var l=o*n,u=l-n,d=l+n,f=0;f!==n;++f){var p=t[l+f];if(p!==t[u+f]||p!==t[d+f]){s=!0;break}}if(s){if(o!==i){e[i]=e[o];for(var m=o*n,h=i*n,f=0;f!==n;++f)t[h+f]=t[m+f]}++i}}if(a>0){e[i]=e[a];for(var m=a*n,h=i*n,f=0;f!==n;++f)t[h+f]=t[m+f];++i}return i===e.length?(this.times=e,this.values=t):(this.times=dd.arraySlice(e,0,i),this.values=dd.arraySlice(t,0,i*n)),this},clone:function(){var e=dd.arraySlice(this.times,0),t=dd.arraySlice(this.values,0),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}),Ei.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Ei,ValueTypeName:`bool`,ValueBufferType:Array,DefaultInterpolation:Gs,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Di.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Di,ValueTypeName:`color`}),Oi.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Oi,ValueTypeName:`number`}),ki.prototype=Object.assign(Object.create(xi.prototype),{constructor:ki,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)E.slerpFlat(i,0,a,s-o,a,s,c);return i}}),Ai.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Ai,ValueTypeName:`quaternion`,DefaultInterpolation:Ks,InterpolantFactoryMethodLinear:function(e){return new ki(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),ji.prototype=Object.assign(Object.create(Ti.prototype),{constructor:ji,ValueTypeName:`string`,ValueBufferType:Array,DefaultInterpolation:Gs,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Mi.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Mi,ValueTypeName:`vector`}),Object.assign(Ni,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(Fi(n[i]).scale(r));return new Ni(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(Ti.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=dd.getKeyframeOrder(s);s=dd.sortedArray(s,1,l),c=dd.sortedArray(c,1,l),!r&&s[0]===0&&(s.push(i),c.push(c[0])),a.push(new Oi(`.morphTargetInfluences[`+t[o].name+`]`,s,c).scale(1/n))}return new Ni(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 d=[];for(var l in r)d.push(Ni.CreateFromMorphTargetSequence(l,r[l],t,n));return d},parseAnimation:function(e,t){if(!e)return console.error(`THREE.AnimationClip: No animation in JSONLoader data.`),null;for(var n=function(e,t,n,r,i){if(n.length!==0){var a=[],o=[];dd.flattenJSON(n,a,o,r),a.length!==0&&i.push(new e(t,a,o))}},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 d={},f=0;f<u.length;f++)if(u[f].morphTargets)for(var p=0;p<u[f].morphTargets.length;p++)d[u[f].morphTargets[p]]=-1;for(var m in d){for(var h=[],g=[],p=0;p!==u[f].morphTargets.length;++p){var _=u[f];h.push(_.time),g.push(+(_.morphTarget===m))}r.push(new Oi(`.morphTargetInfluence[`+m+`]`,h,g))}a=d.length*(o||1)}else{var v=`.bones[`+t[l].name+`]`;n(Mi,v+`.position`,u,`pos`,r),n(Ai,v+`.quaternion`,u,`rot`,r),n(Mi,v+`.scale`,u,`scl`,r)}}return r.length===0?null:new Ni(i,a,r,s)}}),Object.assign(Ni.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 Ni(this.name,this.duration,e,this.blendMode)}}),fd={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={}}},pd=new Ii,Object.assign(Li.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}}),md={},Ri.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ri,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=fd.get(e);if(a!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;if(md[e]!==void 0){md[e].push({onLoad:t,onProgress:n,onError:r});return}var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],c=!!o[2],l=o[3];l=decodeURIComponent(l),c&&(l=atob(l));try{var u,d=(this.responseType||``).toLowerCase();switch(d){case`arraybuffer`:case`blob`:for(var f=new Uint8Array(l.length),p=0;p<l.length;p++)f[p]=l.charCodeAt(p);u=d===`blob`?new Blob([f.buffer],{type:s}):f.buffer;break;case`document`:u=new DOMParser().parseFromString(l,s);break;case`json`:u=JSON.parse(l);break;default:u=l;break}setTimeout(function(){t&&t(u),i.manager.itemEnd(e)},0)}catch(t){setTimeout(function(){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)},0)}}else{md[e]=[],md[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var h in m.open(`GET`,e,!0),m.addEventListener(`load`,function(t){var n=this.response,r=md[e];if(delete md[e],this.status===200||this.status===0){this.status===0&&console.warn(`THREE.FileLoader: HTTP Status 0 received.`),fd.add(e,n);for(var a=0,o=r.length;a<o;a++){var s=r[a];s.onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(var a=0,o=r.length;a<o;a++){var s=r[a];s.onError&&s.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}},!1),m.addEventListener(`progress`,function(t){for(var n=md[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}},!1),m.addEventListener(`error`,function(t){var n=md[e];delete md[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),m.addEventListener(`abort`,function(t){var n=md[e];delete md[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),this.responseType!==void 0&&(m.responseType=this.responseType),this.withCredentials!==void 0&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(this.mimeType===void 0?`text/plain`:this.mimeType),this.requestHeader)m.setRequestHeader(h,this.requestHeader[h]);m.send(null)}return i.manager.itemStart(e),m},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this}}),zi.prototype=Object.assign(Object.create(Li.prototype),{constructor:zi,load:function(e,t,n,r){var i=this,a=new Ri(i.manager);a.setPath(i.path),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=Ni.parse(e[n]);t.push(r)}return t}}),Bi.prototype=Object.assign(Object.create(Li.prototype),{constructor:Bi,load:function(e,t,n,r){var i=this,a=[],o=new Un;o.image=a;var s=new Ri(this.manager);s.setPath(this.path),s.setResponseType(`arraybuffer`);function c(c){s.load(e[c],function(e){var n=i.parse(e,!0);a[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,l===6&&(n.mipmapCount===1&&(o.minFilter=Ko),o.format=n.format,o.needsUpdate=!0,t&&t(o))},n,r)}if(Array.isArray(e))for(var l=0,u=0,d=e.length;u<d;++u)c(u);else s.load(e,function(e){var n=i.parse(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){a[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;n.mipmapCount===1&&(o.minFilter=Ko),o.format=n.format,o.needsUpdate=!0,t&&t(o)},n,r);return o}}),Vi.prototype=Object.assign(Object.create(Li.prototype),{constructor:Vi,load:function(e,t,n,r){var i=this,a=new xe,o=new Ri(this.manager);return o.setResponseType(`arraybuffer`),o.setPath(this.path),o.load(e,function(e){var n=i.parse(e);n&&(n.image===void 0?n.data!==void 0&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data):a.image=n.image,a.wrapS=n.wrapS===void 0?Vo:n.wrapS,a.wrapT=n.wrapT===void 0?Vo:n.wrapT,a.magFilter=n.magFilter===void 0?Ko:n.magFilter,a.minFilter=n.minFilter===void 0?Ko:n.minFilter,a.anisotropy=n.anisotropy===void 0?1:n.anisotropy,n.format!==void 0&&(a.format=n.format),n.type!==void 0&&(a.type=n.type),n.mipmaps!==void 0&&(a.mipmaps=n.mipmaps,a.minFilter=Jo),n.mipmapCount===1&&(a.minFilter=Ko),a.needsUpdate=!0,t&&t(a,n))},n,r),a}}),Hi.prototype=Object.assign(Object.create(Li.prototype),{constructor:Hi,load:function(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=fd.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),fd.add(e,this),t&&t(this),i.manager.itemEnd(e)}function c(t){o.removeEventListener(`load`,s,!1),o.removeEventListener(`error`,c,!1),r&&r(t),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}}),Ui.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ui,load:function(e,t,n,r){var i=new Re,a=new Hi(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],function(e){i.images[n]=e,o++,o===6&&(i.needsUpdate=!0,t&&t(i))},void 0,r)}for(var c=0;c<e.length;++c)s(c);return i}}),Wi.prototype=Object.assign(Object.create(Li.prototype),{constructor:Wi,load:function(e,t,n,r){var i=new S,a=new Hi(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(n){i.image=n,i.format=e.search(/\\.jpe?g($|\\?)/i)>0||e.search(/^data\\:image\\/jpeg/)===0?$o:es,i.needsUpdate=!0,t!==void 0&&t(i)},n,r),i}}),Object.assign(Y.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){for(var n=this.getLengths(),r=0,i=n.length,a=t||e*n[i-1],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]-l,d=(a-l)/u;return(r+d)/(i-1)},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 b:new D);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 D,r=[],i=[],a=[],o=new D,s=new O,c,l,u;for(c=0;c<=e;c++)l=c/e,r[c]=this.getTangentAt(l,new D),r[c].normalize();i[0]=new D,a[0]=new D;var d=Number.MAX_VALUE,f=Math.abs(r[0].x),p=Math.abs(r[0].y),m=Math.abs(r[0].z);for(f<=d&&(d=f,n.set(1,0,0)),p<=d&&(d=p,n.set(0,1,0)),m<=d&&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(X.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(X.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}}),Gi.prototype=Object.create(Y.prototype),Gi.prototype.constructor=Gi,Gi.prototype.isEllipseCurve=!0,Gi.prototype.getPoint=function(e,t){for(var n=t||new b,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&&(i=a?0:r),this.aClockwise===!0&&!a&&(i===r?i=-r: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),d=s-this.aX,f=c-this.aY;s=d*l-f*u+this.aX,c=d*u+f*l+this.aY}return n.set(s,c)},Gi.prototype.copy=function(e){return Y.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},Gi.prototype.toJSON=function(){var e=Y.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},Gi.prototype.fromJSON=function(e){return Y.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},Ki.prototype=Object.create(Gi.prototype),Ki.prototype.constructor=Ki,Ki.prototype.isArcCurve=!0,hd=new D,gd=new qi,_d=new qi,vd=new qi,Ji.prototype=Object.create(Y.prototype),Ji.prototype.constructor=Ji,Ji.prototype.isCatmullRomCurve3=!0,Ji.prototype.getPoint=function(e,t){var n=t||new D,r=this.points,i=r.length,a=(i-+!this.closed)*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,d;if(this.closed||o>0?c=r[(o-1)%i]:(hd.subVectors(r[0],r[1]).add(r[0]),c=hd),l=r[o%i],u=r[(o+1)%i],this.closed||o+2<i?d=r[(o+2)%i]:(hd.subVectors(r[i-1],r[i-2]).add(r[i-1]),d=hd),this.curveType===`centripetal`||this.curveType===`chordal`){var f=this.curveType===`chordal`?.5:.25,p=Math.pow(c.distanceToSquared(l),f),m=Math.pow(l.distanceToSquared(u),f),h=Math.pow(u.distanceToSquared(d),f);m<1e-4&&(m=1),p<1e-4&&(p=m),h<1e-4&&(h=m),gd.initNonuniformCatmullRom(c.x,l.x,u.x,d.x,p,m,h),_d.initNonuniformCatmullRom(c.y,l.y,u.y,d.y,p,m,h),vd.initNonuniformCatmullRom(c.z,l.z,u.z,d.z,p,m,h)}else this.curveType===`catmullrom`&&(gd.initCatmullRom(c.x,l.x,u.x,d.x,this.tension),_d.initCatmullRom(c.y,l.y,u.y,d.y,this.tension),vd.initCatmullRom(c.z,l.z,u.z,d.z,this.tension));return n.set(gd.calc(s),_d.calc(s),vd.calc(s)),n},Ji.prototype.copy=function(e){Y.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},Ji.prototype.toJSON=function(){var e=Y.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},Ji.prototype.fromJSON=function(e){Y.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 D().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},aa.prototype=Object.create(Y.prototype),aa.prototype.constructor=aa,aa.prototype.isCubicBezierCurve=!0,aa.prototype.getPoint=function(e,t){var n=t||new b,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},aa.prototype.copy=function(e){return Y.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},aa.prototype.toJSON=function(){var e=Y.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},aa.prototype.fromJSON=function(e){return Y.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},oa.prototype=Object.create(Y.prototype),oa.prototype.constructor=oa,oa.prototype.isCubicBezierCurve3=!0,oa.prototype.getPoint=function(e,t){var n=t||new D,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},oa.prototype.copy=function(e){return Y.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},oa.prototype.toJSON=function(){var e=Y.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},oa.prototype.fromJSON=function(e){return Y.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},sa.prototype=Object.create(Y.prototype),sa.prototype.constructor=sa,sa.prototype.isLineCurve=!0,sa.prototype.getPoint=function(e,t){var n=t||new b;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},sa.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},sa.prototype.getTangent=function(e,t){var n=t||new b,n=n.copy(this.v2).sub(this.v1).normalize();return n},sa.prototype.copy=function(e){return Y.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},sa.prototype.toJSON=function(){var e=Y.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},sa.prototype.fromJSON=function(e){return Y.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},ca.prototype=Object.create(Y.prototype),ca.prototype.constructor=ca,ca.prototype.isLineCurve3=!0,ca.prototype.getPoint=function(e,t){var n=t||new D;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},ca.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},ca.prototype.copy=function(e){return Y.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},ca.prototype.toJSON=function(){var e=Y.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},ca.prototype.fromJSON=function(e){return Y.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},la.prototype=Object.create(Y.prototype),la.prototype.constructor=la,la.prototype.isQuadraticBezierCurve=!0,la.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,a=this.v2;return n.set($i(e,r.x,i.x,a.x),$i(e,r.y,i.y,a.y)),n},la.prototype.copy=function(e){return Y.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},la.prototype.toJSON=function(){var e=Y.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},la.prototype.fromJSON=function(e){return Y.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},ua.prototype=Object.create(Y.prototype),ua.prototype.constructor=ua,ua.prototype.isQuadraticBezierCurve3=!0,ua.prototype.getPoint=function(e,t){var n=t||new D,r=this.v0,i=this.v1,a=this.v2;return n.set($i(e,r.x,i.x,a.x),$i(e,r.y,i.y,a.y),$i(e,r.z,i.z,a.z)),n},ua.prototype.copy=function(e){return Y.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},ua.prototype.toJSON=function(){var e=Y.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},ua.prototype.fromJSON=function(e){return Y.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},da.prototype=Object.create(Y.prototype),da.prototype.constructor=da,da.prototype.isSplineCurve=!0,da.prototype.getPoint=function(e,t){var n=t||new b,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(Yi(o,s.x,c.x,l.x,u.x),Yi(o,s.y,c.y,l.y,u.y)),n},da.prototype.copy=function(e){Y.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},da.prototype.toJSON=function(){var e=Y.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},da.prototype.fromJSON=function(e){Y.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 b().fromArray(r))}return this},yd=Object.freeze({__proto__:null,ArcCurve:Ki,CatmullRomCurve3:Ji,CubicBezierCurve:aa,CubicBezierCurve3:oa,EllipseCurve:Gi,LineCurve:sa,LineCurve3:ca,QuadraticBezierCurve:la,QuadraticBezierCurve3:ua,SplineCurve:da}),fa.prototype=Object.assign(Object.create(Y.prototype),{constructor:fa,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 sa(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){Y.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=Y.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){Y.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 yd[r.type]().fromJSON(r))}return this}}),pa.prototype=Object.assign(Object.create(fa.prototype),{constructor:pa,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 sa(this.currentPoint.clone(),new b(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,r){var i=new la(this.currentPoint.clone(),new b(e,t),new b(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(e,t,n,r,i,a){var o=new aa(this.currentPoint.clone(),new b(e,t),new b(n,r),new b(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this},splineThru:function(e){var t=new da([this.currentPoint.clone()].concat(e));return this.curves.push(t),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 Gi(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 fa.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=fa.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return fa.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),ma.prototype=Object.assign(Object.create(pa.prototype),{constructor:ma,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){pa.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=pa.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){pa.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 pa().fromJSON(r))}return this}}),ha.prototype=Object.assign(Object.create(j.prototype),{constructor:ha,isLight:!0,copy:function(e){return j.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=j.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}}),ga.prototype=Object.assign(Object.create(ha.prototype),{constructor:ga,isHemisphereLight:!0,copy:function(e){return ha.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(_a.prototype,{_projScreenMatrix:new O,_lightPositionWorld:new D,_lookTarget:new D,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}}),va.prototype=Object.assign(Object.create(_a.prototype),{constructor:va,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=X.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()),_a.prototype.updateMatrices.call(this,e)}}),ya.prototype=Object.assign(Object.create(ha.prototype),{constructor:ya,isSpotLight:!0,copy:function(e){return ha.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}}),ba.prototype=Object.assign(Object.create(_a.prototype),{constructor:ba,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)}}),xa.prototype=Object.assign(Object.create(ha.prototype),{constructor:xa,isPointLight:!0,copy:function(e){return ha.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Sa.prototype=Object.assign(Object.create(_e.prototype),{constructor:Sa,isOrthographicCamera:!0,copy:function(e,t){return _e.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=j.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}}),Ca.prototype=Object.assign(Object.create(_a.prototype),{constructor:Ca,isDirectionalLightShadow:!0,updateMatrices:function(e){_a.prototype.updateMatrices.call(this,e)}}),wa.prototype=Object.assign(Object.create(ha.prototype),{constructor:wa,isDirectionalLight:!0,copy:function(e){return ha.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Ta.prototype=Object.assign(Object.create(ha.prototype),{constructor:Ta,isAmbientLight:!0}),Ea.prototype=Object.assign(Object.create(ha.prototype),{constructor:Ea,isRectAreaLight:!0,copy:function(e){return ha.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=ha.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Object.assign(Da.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],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t},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(Da,{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)}}),Oa.prototype=Object.assign(Object.create(ha.prototype),{constructor:Oa,isLightProbe:!0,copy:function(e){return ha.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=ha.prototype.toJSON.call(this,e);return t.object.sh=this.sh.toArray(),t}}),ka.prototype=Object.assign(Object.create(Li.prototype),{constructor:ka,load:function(e,t,n,r){var i=this,a=new Ri(i.manager);a.setPath(i.path),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)},parse:function(e){var t=this.textures;function n(e){return t[e]===void 0&&console.warn(`THREE.MaterialLoader: Undefined texture`,e),t[e]}var r=new ud[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 z().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 z().setHex(a.value);break;case`v2`:r.uniforms[i].value=new b().fromArray(a.value);break;case`v3`:r.uniforms[i].value=new D().fromArray(a.value);break;case`v4`:r.uniforms[i].value=new C().fromArray(a.value);break;case`m3`:r.uniforms[i].value=new x().fromArray(a.value);case`m4`:r.uniforms[i].value=new O().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 b().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 b().fromArray(e.clearcoatNormalScale)),r},setTextures:function(e){return this.textures=e,this}}),bd={decodeText:function(e){if(typeof TextDecoder<`u`)return new TextDecoder().decode(e);for(var t=``,n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf(`/`);return t===-1?`./`:e.substr(0,t+1)}},Aa.prototype=Object.assign(Object.create(q.prototype),{constructor:Aa,isInstancedBufferGeometry:!0,copy:function(e){return q.prototype.copy.call(this,e),this.instanceCount=e.instanceCount,this},clone:function(){return new this.constructor().copy(this)},toJSON:function(){var e=q.prototype.toJSON.call(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}),ja.prototype=Object.assign(Object.create(H.prototype),{constructor:ja,isInstancedBufferAttribute:!0,copy:function(e){return H.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=H.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),Ma.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ma,load:function(e,t,n,r){var i=this,a=new Ri(i.manager);a.setPath(i.path),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)},parse:function(e){var t=e.isInstancedBufferGeometry?new Aa:new q,n=e.data.index;if(n!==void 0){var r=new xd[n.type](n.array);t.setIndex(new H(r,1))}var i=e.data.attributes;for(var a in i){var o=i[a],r=new xd[o.type](o.array),s=new(o.isInstancedBufferAttribute?ja:H)(r,o.itemSize,o.normalized);o.name!==void 0&&(s.name=o.name),t.setAttribute(a,s)}var c=e.data.morphAttributes;if(c)for(var a in c){for(var l=c[a],u=[],d=0,f=l.length;d<f;d++){var o=l[d],r=new xd[o.type](o.array),s=new H(r,o.itemSize,o.normalized);o.name!==void 0&&(s.name=o.name),u.push(s)}t.morphAttributes[a]=u}e.data.morphTargetsRelative&&(t.morphTargetsRelative=!0);var p=e.data.groups||e.data.drawcalls||e.data.offsets;if(p!==void 0)for(var d=0,m=p.length;d!==m;++d){var h=p[d];t.addGroup(h.start,h.count,h.materialIndex)}var g=e.data.boundingSphere;if(g!==void 0){var _=new D;g.center!==void 0&&_.fromArray(g.center),t.boundingSphere=new F(_,g.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}}),xd={Int8Array,Uint8Array,Uint8ClampedArray:typeof Uint8ClampedArray<`u`?Uint8ClampedArray:Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array},Na.prototype=Object.assign(Object.create(Li.prototype),{constructor:Na,load:function(e,t,n,r){var i=this,a=this.path===``?bd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new Ri(i.manager);o.setPath(this.path),o.load(e,function(n){var a=null;try{a=JSON.parse(n)}catch(t){r!==void 0&&r(t),console.error(`THREE:ObjectLoader: Can't parse `+e+`.`,t.message);return}var o=a.metadata;if(o===void 0||o.type===void 0||o.type.toLowerCase()===`geometry`){console.error(`THREE.ObjectLoader: Can't load `+e);return}i.parse(a,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 ma().fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(e!==void 0)for(var r=new Ma,i=0,a=e.length;i<a;i++){var o,s=e[i];switch(s.type){case`PlaneGeometry`:case`PlaneBufferGeometry`:o=new ld[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case`BoxGeometry`:case`BoxBufferGeometry`:case`CubeGeometry`:o=new ld[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case`CircleGeometry`:case`CircleBufferGeometry`:o=new ld[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case`CylinderGeometry`:case`CylinderBufferGeometry`:o=new ld[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 ld[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case`SphereGeometry`:case`SphereBufferGeometry`:o=new ld[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 ld[s.type](s.radius,s.detail);break;case`RingGeometry`:case`RingBufferGeometry`:o=new ld[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case`TorusGeometry`:case`TorusBufferGeometry`:o=new ld[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case`TorusKnotGeometry`:case`TorusKnotBufferGeometry`:o=new ld[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case`TubeGeometry`:case`TubeBufferGeometry`:o=new ld[s.type](new yd[s.path.type]().fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case`LatheGeometry`:case`LatheBufferGeometry`:o=new ld[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case`PolyhedronGeometry`:case`PolyhedronBufferGeometry`:o=new ld[s.type](s.vertices,s.indices,s.radius,s.details);break;case`ShapeGeometry`:case`ShapeBufferGeometry`:for(var c=[],l=0,u=s.shapes.length;l<u;l++){var d=t[s.shapes[l]];c.push(d)}o=new ld[s.type](c,s.curveSegments);break;case`ExtrudeGeometry`:case`ExtrudeBufferGeometry`:for(var c=[],l=0,u=s.shapes.length;l<u;l++){var d=t[s.shapes[l]];c.push(d)}var f=s.options.extrudePath;f!==void 0&&(s.options.extrudePath=new yd[f.type]().fromJSON(f)),o=new ld[s.type](c,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 ka;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=Ni.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(e){return n.manager.itemStart(e),a.load(e,function(){n.manager.itemEnd(e)},void 0,function(){n.manager.itemError(e),n.manager.itemEnd(e)})}if(e!==void 0&&e.length>0){var a=new Hi(new Ii(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var c=e[o],l=c.url;if(Array.isArray(l)){r[c.uuid]=[];for(var u=0,d=l.length;u<d;u++){var f=l[u],p=/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(f)?f:n.resourcePath+f;r[c.uuid].push(i(p))}}else{var p=/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(c.url)?c.url:n.resourcePath+c.url;r[c.uuid]=i(p)}}}return r},parseTextures:function(e,t){function n(e,t){return typeof e==`number`?e:(console.warn(`THREE.ObjectLoader.parseTexture: Constant should be in numeric form.`,e),t[e])}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])?new Re(t[o.image]):new S(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,Sd)),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],Cd),s.wrapT=n(o.wrap[1],Cd)),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,wd)),o.magFilter!==void 0&&(s.magFilter=n(o.magFilter,wd)),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(e){return t[e]===void 0&&console.warn(`THREE.ObjectLoader: Undefined geometry`,e),t[e]}function a(e){if(e!==void 0){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];n[a]===void 0&&console.warn(`THREE.ObjectLoader: Undefined material`,a),t.push(n[a])}return t}return n[e]===void 0&&console.warn(`THREE.ObjectLoader: Undefined material`,e),n[e]}}switch(e.type){case`Scene`:r=new M,e.background!==void 0&&Number.isInteger(e.background)&&(r.background=new z(e.background)),e.fog!==void 0&&(e.fog.type===`Fog`?r.fog=new wn(e.fog.color,e.fog.near,e.fog.far):e.fog.type===`FogExp2`&&(r.fog=new Cn(e.fog.color,e.fog.density)));break;case`PerspectiveCamera`:r=new ve(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 Sa(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 Ta(e.color,e.intensity);break;case`DirectionalLight`:r=new wa(e.color,e.intensity);break;case`PointLight`:r=new xa(e.color,e.intensity,e.distance,e.decay);break;case`RectAreaLight`:r=new Ea(e.color,e.intensity,e.width,e.height);break;case`SpotLight`:r=new ya(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case`HemisphereLight`:r=new ga(e.color,e.groundColor,e.intensity);break;case`LightProbe`:r=new Oa().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 de(o,s);break;case`InstancedMesh`:var o=i(e.geometry),s=a(e.material),c=e.count,l=e.instanceMatrix;r=new Pn(o,s,c),r.instanceMatrix=new H(new Float32Array(l.array),16);break;case`LOD`:r=new An;break;case`Line`:r=new In(i(e.geometry),a(e.material),e.mode);break;case`LineLoop`:r=new Rn(i(e.geometry),a(e.material));break;case`LineSegments`:r=new Ln(i(e.geometry),a(e.material));break;case`PointCloud`:case`Points`:r=new Bn(i(e.geometry),a(e.material));break;case`Sprite`:r=new On(a(e.material));break;case`Group`:r=new vn;break;default:r=new j}if(r.uuid=e.uuid,e.name!==void 0&&(r.name=e.name),e.matrix===void 0?(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)):(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.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,d=0;d<u.length;d++)r.add(this.parseObject(u[d],t,n));if(e.type===`LOD`){e.autoUpdate!==void 0&&(r.autoUpdate=e.autoUpdate);for(var f=e.levels,p=0;p<f.length;p++){var m=f[p],h=r.getObjectByProperty(`uuid`,m.object);h!==void 0&&r.addLevel(h,m.distance)}}return r}}),Sd={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},Cd={RepeatWrapping:Bo,ClampToEdgeWrapping:Vo,MirroredRepeatWrapping:Ho},wd={NearestFilter:Uo,NearestMipmapNearestFilter:Wo,NearestMipmapLinearFilter:Go,LinearFilter:Ko,LinearMipmapNearestFilter:qo,LinearMipmapLinearFilter:Jo},Pa.prototype=Object.assign(Object.create(Li.prototype),{constructor:Pa,setOptions:function(e){return this.options=e,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=fd.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(e){return e.blob()}).then(function(e){return i.options===void 0?createImageBitmap(e):createImageBitmap(e,i.options)}).then(function(n){fd.add(e,n),t&&t(n),i.manager.itemEnd(e)}).catch(function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}),i.manager.itemStart(e)}}),Object.assign(Fa.prototype,{moveTo:function(e,t){return this.currentPath=new pa,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(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=new ma;a.curves=i.curves,t.push(a)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=t[i],s=t[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=t[a],c=-c,s=t[i],l=-l),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var u=l*(e.x-o.x)-c*(e.y-o.y);if(u===0)return!0;if(u<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var i=sd.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 ma,c.curves=s.curves,l.push(c),l;var u=!i(a[0].getPoints());u=e?!u:u;var d=[],f=[],p=[],m=0,h;f[m]=void 0,p[m]=[];for(var g=0,_=a.length;g<_;g++)s=a[g],h=s.getPoints(),o=i(h),o=e?!o:o,o?(!u&&f[m]&&m++,f[m]={s:new ma,p:h},f[m].s.curves=s.curves,u&&m++,p[m]=[]):p[m].push({h:s,p:h[0]});if(!f[0])return n(a);if(f.length>1){for(var v=!1,y=[],b=0,x=f.length;b<x;b++)d[b]=[];for(var b=0,x=f.length;b<x;b++)for(var S=p[b],C=0;C<S.length;C++){for(var w=S[C],T=!0,E=0;E<f.length;E++)r(w.p,f[E].p)&&(b!==E&&y.push({froms:b,tos:E,hole:C}),T?(T=!1,d[E].push(w)):v=!0);T&&d[b].push(w)}y.length>0&&(v||(p=d))}for(var D,g=0,O=f.length;g<O;g++){c=f[g].s,l.push(c),D=p[g];for(var k=0,A=D.length;k<A;k++)c.holes.push(D[k].h)}return l}}),Object.assign(Ia.prototype,{isFont:!0,generateShapes:function(e,t){t===void 0&&(t=100);for(var n=[],r=La(e,t,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),za.prototype=Object.assign(Object.create(Li.prototype),{constructor:za,load:function(e,t,n,r){var i=this,a=new Ri(this.manager);a.setPath(this.path),a.load(e,function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn(`THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.`),n=JSON.parse(e.substring(65,e.length-2))}var r=i.parse(n);t&&t(r)},n,r)},parse:function(e){return new Ia(e)}}),Ed={getContext:function(){return Td===void 0&&(Td=new(window.AudioContext||window.webkitAudioContext)),Td},setContext:function(e){Td=e}},Ba.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ba,load:function(e,t,n,r){var i=this,a=new Ri(i.manager);a.setResponseType(`arraybuffer`),a.setPath(i.path),a.load(e,function(n){try{var a=n.slice(0);Ed.getContext().decodeAudioData(a,function(e){t(e)})}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}}),Va.prototype=Object.assign(Object.create(Oa.prototype),{constructor:Va,isHemisphereLightProbe:!0,copy:function(e){return Oa.prototype.copy.call(this,e),this},toJSON:function(e){return Oa.prototype.toJSON.call(this,e)}}),Ha.prototype=Object.assign(Object.create(Oa.prototype),{constructor:Ha,isAmbientLightProbe:!0,copy:function(e){return Oa.prototype.copy.call(this,e),this},toJSON:function(e){return Oa.prototype.toJSON.call(this,e)}}),Dd=new O,Od=new O,Object.assign(Ua.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n=e.projectionMatrix.clone(),r=t.eyeSep/2,i=r*t.near/t.focus,a=t.near*Math.tan(X.DEG2RAD*t.fov*.5)/t.zoom,o,s;Od.elements[12]=-r,Dd.elements[12]=r,o=-a*t.aspect+i,s=a*t.aspect+i,n.elements[0]=2*t.near/(s-o),n.elements[8]=(s+o)/(s-o),this.cameraL.projectionMatrix.copy(n),o=-a*t.aspect-i,s=a*t.aspect-i,n.elements[0]=2*t.near/(s-o),n.elements[8]=(s+o)/(s-o),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Od),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Dd)}}),Object.assign(Wa.prototype,{start:function(){this.startTime=(typeof performance>`u`?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>`u`?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}),kd=new D,Ad=new E,jd=new D,Md=new D,Ga.prototype=Object.assign(Object.create(j.prototype),{constructor:Ga,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.context.destination):(this.gain.disconnect(this.filter),this.filter.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){j.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(kd,Ad,jd),Md.set(0,0,-1).applyQuaternion(Ad),t.positionX){var r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(kd.x,r),t.positionY.linearRampToValueAtTime(kd.y,r),t.positionZ.linearRampToValueAtTime(kd.z,r),t.forwardX.linearRampToValueAtTime(Md.x,r),t.forwardY.linearRampToValueAtTime(Md.y,r),t.forwardZ.linearRampToValueAtTime(Md.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(kd.x,kd.y,kd.z),t.setOrientation(Md.x,Md.y,Md.z,n.x,n.y,n.z)}}),Ka.prototype=Object.assign(Object.create(j.prototype),{constructor:Ka,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.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}}),Nd=new D,Pd=new E,Fd=new D,Id=new D,qa.prototype=Object.assign(Object.create(Ka.prototype),{constructor:qa,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(j.prototype.updateMatrixWorld.call(this,e),!(this.hasPlaybackControl===!0&&this.isPlaying===!1)){this.matrixWorld.decompose(Nd,Pd,Fd),Id.set(0,0,1).applyQuaternion(Pd);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Nd.x,n),t.positionY.linearRampToValueAtTime(Nd.y,n),t.positionZ.linearRampToValueAtTime(Nd.z,n),t.orientationX.linearRampToValueAtTime(Id.x,n),t.orientationY.linearRampToValueAtTime(Id.y,n),t.orientationZ.linearRampToValueAtTime(Id.z,n)}else t.setPosition(Nd.x,Nd.y,Nd.z),t.setOrientation(Id.x,Id.y,Id.z)}}}),Object.assign(Ja.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(Ya.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){E.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){var a=this._workIndex*i;E.multiplyQuaternionsFlat(e,a,e,t,e,n),E.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}}}),Ld=`\\\\[\\\\]\\\\.:\\\\/`,Rd=RegExp(`[`+Ld+`]`,`g`),zd=`[^`+Ld+`]`,Bd=`[^`+Ld.replace(`\\\\.`,``)+`]`,Vd=`((?:WC+[\\\\/:])*)`.replace(`WC`,zd),Hd=`(WCOD+)?`.replace(`WCOD`,Bd),Ud=`(?:\\\\.(WC+)(?:\\\\[(.+)\\\\])?)?`.replace(`WC`,zd),Wd=`\\\\.(WC+)(?:\\\\[(.+)\\\\])?`.replace(`WC`,zd),Gd=RegExp(`^`+Vd+Hd+Ud+Wd+`$`),Kd=[`material`,`materials`,`bones`],Object.assign(Xa.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()}}),Object.assign(Za,{Composite:Xa,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Za.Composite(e,t,n):new Za(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\\s/g,`_`).replace(Rd,``)},parseTrackName:function(e){var t=Gd.exec(e);if(!t)throw 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);Kd.indexOf(i)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(n.propertyName===null||n.propertyName.length===0)throw 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(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===t||i.uuid===t)return i;var a=r(i.children);if(a)return a}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(Za.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=Za.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?e.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate):l=this.Versioning.NeedsUpdate;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(Za.prototype,{_getValue_unbound:Za.prototype.getValue,_setValue_unbound:Za.prototype.setValue}),Object.assign(Qa.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 d=arguments[l],f=d.uuid,p=r[f];if(p===void 0){p=t++,r[f]=p,e.push(d);for(var m=0,h=s;m!==h;++m)o[m].push(new Za(d,i[m],a[m]))}else if(p<n){c=e[p];var g=--n,_=e[g];r[_.uuid]=p,e[p]=_,r[f]=g,e[g]=d;for(var m=0,h=s;m!==h;++m){var v=o[m],y=v[g],b=v[p];v[p]=y,b===void 0&&(b=new Za(d,i[m],a[m])),v[g]=b}}else e[p]!==c&&console.error(`THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.`)}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,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++,d=e[u];n[d.uuid]=l,e[l]=d,n[c]=u,e[u]=s;for(var f=0,p=i;f!==p;++f){var m=r[f],h=m[u],g=m[l];m[l]=h,m[u]=g}}}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].uuid,l=r[c];if(l!==void 0)if(delete r[c],l<n){var u=--n,d=e[u],f=--t,p=e[f];r[d.uuid]=l,e[l]=d,r[p.uuid]=u,e[u]=p,e.pop();for(var m=0,h=a;m!==h;++m){var g=i[m],_=g[u],v=g[f];g[l]=_,g[u]=v,g.pop()}}else{var f=--t,p=e[f];r[p.uuid]=l,e[l]=p,e.pop();for(var m=0,h=a;m!==h;++m){var g=i[m];g[l]=g[f],g.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=Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(var d=l,f=s.length;d!==f;++d){var p=s[d];u[d]=new Za(p,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()}}}),Object.assign($a.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 Qs:for(var u=0,d=c.length;u!==d;++u)c[u].evaluate(o),l[u].accumulateAdditive(s);break;case Zs:default:for(var u=0,d=c.length;u!==d;++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===Ws;if(e===0)return i===-1?t:a&&(i&1)==1?n-t:t;if(r===2200){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));handle_stop:{if(t>=n)t=n;else if(t<0)t=0;else{this.time=t;break handle_stop}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=Ys,r.endingEnd=Ys):(e?r.endingStart=this.zeroSlopeAtStart?Ys:Js:r.endingStart=Xs,t?r.endingEnd=this.zeroSlopeAtEnd?Ys:Js:r.endingEnd=Xs)},_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}}),eo.prototype=Object.assign(Object.create(y.prototype),{constructor:eo,_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 d=r[u],f=d.name,p=l[f];if(p!==void 0)a[u]=p;else{if(p=a[u],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,s,f));continue}var m=t&&t._propertyBindings[u].binding.parsedPath;p=new Ya(Za.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,s,f),a[u]=p}o[u].resultBuffer=p.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,d=(e._localRoot||this._root).uuid;delete u[d],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 Ci(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`?Ni.findByName(r,e):e,o=a===null?e:a.uuid,s=this._actionsByClip[o],c=null;if(n===void 0&&(n=a===null?Zs:a.blendMode),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 $a(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`?Ni.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return o===void 0?null:o.actionByRoot[r]||null},stopAllAction:function(){for(var e=this._actions,t=this._nActiveActions-1;t>=0;--t)e[t].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)t[o]._update(r,e,i,a);for(var s=this._bindings,c=this._nActiveBindings,o=0;o!==c;++o)s[o].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,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[t];i!==void 0&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[t];if(a!==void 0)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),to.prototype.clone=function(){return new to(this.value.clone===void 0?this.value:this.value.clone())},no.prototype=Object.assign(Object.create(Tn.prototype),{constructor:no,isInstancedInterleavedBuffer:!0,copy:function(e){return Tn.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(ro.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 ao(e,this,r,t),r.sort(io),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++)ao(e[i],this,r,t);return r.sort(io),r}}),Object.assign(oo.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(X.clamp(t/this.radius,-1,1))),this}}),Object.assign(so.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}}),qd=new b,Object.assign(co.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=qd.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 b),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 b),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 b),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 b),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return qd.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Jd=new D,Yd=new D,Object.assign(lo.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 D),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 D),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 D),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){Jd.subVectors(e,this.start),Yd.subVectors(this.end,this.start);var n=Yd.dot(Yd),r=Yd.dot(Jd)/n;return t&&(r=X.clamp(r,0,1)),r},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 D),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)}}),uo.prototype=Object.create(j.prototype),uo.prototype.constructor=uo,uo.prototype.isImmediateRenderObject=!0,Xd=new D,fo.prototype=Object.create(j.prototype),fo.prototype.constructor=fo,fo.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},fo.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),Xd.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Xd),this.color===void 0?this.cone.material.color.copy(this.light.color):this.cone.material.color.set(this.color)},Zd=new D,Qd=new O,$d=new O,mo.prototype=Object.create(Ln.prototype),mo.prototype.constructor=mo,mo.prototype.isSkeletonHelper=!0,mo.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,r=n.getAttribute(`position`);$d.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<t.length;i++){var o=t[i];o.parent&&o.parent.isBone&&(Qd.multiplyMatrices($d,o.matrixWorld),Zd.setFromMatrixPosition(Qd),r.setXYZ(a,Zd.x,Zd.y,Zd.z),Qd.multiplyMatrices($d,o.parent.matrixWorld),Zd.setFromMatrixPosition(Qd),r.setXYZ(a+1,Zd.x,Zd.y,Zd.z),a+=2)}n.getAttribute(`position`).needsUpdate=!0,j.prototype.updateMatrixWorld.call(this,e)},ho.prototype=Object.create(de.prototype),ho.prototype.constructor=ho,ho.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},ho.prototype.update=function(){this.color===void 0?this.material.color.copy(this.light.color):this.material.color.set(this.color)},ef=new D,tf=new z,nf=new z,go.prototype=Object.create(j.prototype),go.prototype.constructor=go,go.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},go.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`);tf.copy(this.light.color),nf.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?tf:nf;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(ef.setFromMatrixPosition(this.light.matrixWorld).negate())},_o.prototype=Object.assign(Object.create(Ln.prototype),{constructor:_o,copy:function(e){return Ln.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return new this.constructor().copy(this)}}),vo.prototype=Object.create(Ln.prototype),vo.prototype.constructor=vo,rf=new D,af=new D,of=new D,yo.prototype=Object.create(j.prototype),yo.prototype.constructor=yo,yo.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},yo.prototype.update=function(){rf.setFromMatrixPosition(this.light.matrixWorld),af.setFromMatrixPosition(this.light.target.matrixWorld),of.subVectors(af,rf),this.lightPlane.lookAt(af),this.color===void 0?(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)):(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)),this.targetLine.lookAt(af),this.targetLine.scale.z=of.length()},sf=new D,cf=new _e,bo.prototype=Object.create(Ln.prototype),bo.prototype.constructor=bo,bo.prototype.update=function(){var e=this.geometry,t=this.pointMap,n=1,r=1;cf.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),xo(`c`,t,e,cf,0,0,-1),xo(`t`,t,e,cf,0,0,1),xo(`n1`,t,e,cf,-n,-r,-1),xo(`n2`,t,e,cf,n,-r,-1),xo(`n3`,t,e,cf,-n,r,-1),xo(`n4`,t,e,cf,n,r,-1),xo(`f1`,t,e,cf,-n,-r,1),xo(`f2`,t,e,cf,n,-r,1),xo(`f3`,t,e,cf,-n,r,1),xo(`f4`,t,e,cf,n,r,1),xo(`u1`,t,e,cf,n*.7,r*1.1,-1),xo(`u2`,t,e,cf,-n*.7,r*1.1,-1),xo(`u3`,t,e,cf,0,r*2,-1),xo(`cf1`,t,e,cf,-n,0,1),xo(`cf2`,t,e,cf,n,0,1),xo(`cf3`,t,e,cf,0,-r,1),xo(`cf4`,t,e,cf,0,r,1),xo(`cn1`,t,e,cf,-n,0,-1),xo(`cn2`,t,e,cf,n,0,-1),xo(`cn3`,t,e,cf,0,-r,-1),xo(`cn4`,t,e,cf,0,r,-1),e.getAttribute(`position`).needsUpdate=!0},lf=new N,So.prototype=Object.create(Ln.prototype),So.prototype.constructor=So,So.prototype.update=function(e){if(e!==void 0&&console.warn(`THREE.BoxHelper: .update() has no longer arguments.`),this.object!==void 0&&lf.setFromObject(this.object),!lf.isEmpty()){var t=lf.min,n=lf.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()}},So.prototype.setFromObject=function(e){return this.object=e,this.update(),this},So.prototype.copy=function(e){return Ln.prototype.copy.call(this,e),this.object=e.object,this},So.prototype.clone=function(){return new this.constructor().copy(this)},Co.prototype=Object.create(Ln.prototype),Co.prototype.constructor=Co,Co.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),j.prototype.updateMatrixWorld.call(this,e))},wo.prototype=Object.create(In.prototype),wo.prototype.constructor=wo,wo.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),this.lookAt(this.plane.normal),j.prototype.updateMatrixWorld.call(this,e)},uf=new D,To.prototype=Object.create(j.prototype),To.prototype.constructor=To,To.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{uf.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(uf,t)}},To.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()},To.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},To.prototype.copy=function(e){return j.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},To.prototype.clone=function(){return new this.constructor().copy(this)},Eo.prototype=Object.create(Ln.prototype),Eo.prototype.constructor=Eo,pf=4,mf=8,hf=Math.pow(2,mf),gf=[.125,.215,.35,.446,.526,.582],_f=mf-pf+1+gf.length,vf=20,yf={[$s]:0,[ec]:1,[nc]:2,[ic]:3,[ac]:4,[oc]:5,[tc]:6},bf=new Sa,{_lodPlanes:xf,_sizeLods:Sf,_sigmas:Cf}=ko(),wf=null,Tf=(1+Math.sqrt(5))/2,Ef=1/Tf,Df=[new D(1,1,1),new D(-1,1,1),new D(1,1,-1),new D(-1,1,-1),new D(0,Tf,Ef),new D(0,Tf,-Ef),new D(Ef,0,Tf),new D(-Ef,0,Tf),new D(Tf,Ef,0),new D(-Tf,Ef,0)],Do.prototype={constructor:Do,fromScene:function(e,t=0,n=.1,r=100){wf=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=Uo,e.minFilter=Uo,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){wf=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=Po(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){this._equirectShader===null&&(this._equirectShader=No(),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<xf.length;e++)xf[e].dispose()},_cleanup:function(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(wf),e.scissorTest=!1,e.setSize(e.width,e.height)},_allocateTargets:function(e){var t={magFilter:Uo,minFilter:Uo,generateMipmaps:!1,type:Yo,format:ts,encoding:Oo(e)?e.encoding:nc,depthBuffer:!1,stencilBuffer:!1},n=Ao(t);return n.depthBuffer=!e,this._pingPongRenderTarget=Ao(t),n},_compileMaterial:function(e){var t=new de(xf[0],e);this._renderer.compile(t,bf)},_sceneToCubeUV:function(e,t,n,r){var i=new ve(90,1,t,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,c=s.outputEncoding,l=s.toneMapping,u=s.toneMappingExposure,d=s.getClearColor(),f=s.getClearAlpha();s.toneMapping=1,s.toneMappingExposure=1,s.outputEncoding=$s;var p=e.background;if(p&&p.isColor){p.convertSRGBToLinear();var m=Math.max(p.r,p.g,p.b),h=Math.min(Math.max(Math.ceil(Math.log2(m)),-128),127);p=p.multiplyScalar(Math.pow(2,-h));var g=(h+128)/255;s.setClearColor(p,g),e.background=null}for(var _=0;_<6;_++){var v=_%3;v==0?(i.up.set(0,a[_],0),i.lookAt(o[_],0,0)):v==1?(i.up.set(0,0,a[_]),i.lookAt(0,o[_],0)):(i.up.set(0,a[_],0),i.lookAt(0,0,o[_])),jo(r,v*hf,_>2?hf:0,hf,hf),s.setRenderTarget(r),s.render(e,i)}s.toneMapping=l,s.toneMappingExposure=u,s.outputEncoding=c,s.setClearColor(d,f)},_textureToCubeUV:function(e,t){var n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Po()):this._equirectShader==null&&(this._equirectShader=No());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new de(xf[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=yf[e.encoding],a.outputEncoding.value=yf[t.texture.encoding],jo(t,0,0,3*hf,2*hf),n.setRenderTarget(t),n.render(i,bf)},_applyPMREM:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;r<_f;r++){var i=Math.sqrt(Cf[r]*Cf[r]-Cf[r-1]*Cf[r-1]),a=Df[(r-1)%Df.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 de(xf[r],c),d=c.uniforms,f=Sf[n]-1,p=isFinite(i)?Math.PI/(2*f):2*Math.PI/(2*vf-1),m=i/p,h=isFinite(i)?1+Math.floor(l*m):vf;h>vf&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${h} samples when the maximum is set to ${vf}`);for(var g=[],_=0,v=0;v<vf;++v){var y=v/m,b=Math.exp(-y*y/2);g.push(b),v==0?_+=b:v<h&&(_+=2*b)}for(var v=0;v<g.length;v++)g[v]=g[v]/_;d.envMap.value=e.texture,d.samples.value=h,d.weights.value=g,d.latitudinal.value=a===`latitudinal`,o&&(d.poleAxis.value=o),d.dTheta.value=p,d.mipInt.value=mf-n,d.inputEncoding.value=yf[e.texture.encoding],d.outputEncoding.value=yf[e.texture.encoding];var x=Sf[r],y=3*Math.max(0,hf-2*x);jo(t,y,(r===0?0:2*hf)+2*x*(r>mf-pf?r-mf+pf:0),3*x,2*x),s.setRenderTarget(t),s.render(u,bf)}},Y.create=function(e,t){return console.log(`THREE.Curve.create() has been deprecated`),e.prototype=Object.create(Y.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(fa.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 J,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new D(i.x,i.y,i.z||0))}return t}}),Object.assign(pa.prototype,{fromPoints:function(e){return console.warn(`THREE.Path: .fromPoints() has been renamed to .setFromPoints().`),this.setFromPoints(e)}}),Lo.prototype=Object.create(Ji.prototype),Ro.prototype=Object.create(Ji.prototype),zo.prototype=Object.create(Ji.prototype),Object.assign(zo.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.`)}}),_o.prototype.setColors=function(){console.error(`THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.`)},mo.prototype.update=function(){console.error(`THREE.SkeletonHelper: update() no longer needs to be called.`)},Object.assign(Li.prototype,{extractUrlBase:function(e){return console.warn(`THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.`),bd.extractUrlBase(e)}}),Li.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(Na.prototype,{setTexturePath:function(e){return console.warn(`THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().`),this.setResourcePath(e)}}),Object.assign(co.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(N.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(F.prototype,{empty:function(){return console.warn(`THREE.Sphere: .empty() has been renamed to .isEmpty().`),this.isEmpty()}}),Se.prototype.setFromMatrix=function(e){return console.warn(`THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix().`),this.setFromProjectionMatrix(e)},lo.prototype.center=function(e){return console.warn(`THREE.Line3: .center() has been renamed to .getCenter().`),this.getCenter(e)},Object.assign(X,{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().`),X.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn(`THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo().`),X.ceilPowerOfTwo(e)}}),Object.assign(x.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(O.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 D().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)}}),L.prototype.isIntersectionLine=function(e){return console.warn(`THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().`),this.intersectsLine(e)},E.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(I.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(R.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(R,{barycoordFromPoint:function(e,t,n,r,i){return console.warn(`THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().`),R.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn(`THREE.Triangle: .normal() has been renamed to .getNormal().`),R.getNormal(e,t,n,r)}}),Object.assign(ma.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 Wr(this,e)},makeGeometry:function(e){return console.warn(`THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.`),new ti(this,e)}}),Object.assign(b.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(D.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(C.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(J.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(j.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(j.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(de.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(de.prototype,{drawMode:{get:function(){return console.error(`THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode.`),0},set:function(){console.error(`THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.`)}}}),Object.defineProperties(An.prototype,{objects:{get:function(){return console.warn(`THREE.LOD: .objects has been renamed to .levels.`),this.levels}}}),Object.defineProperty(Mn.prototype,`useVertexTexture`,{get:function(){console.warn(`THREE.Skeleton: useVertexTexture has been removed.`)},set:function(){console.warn(`THREE.Skeleton: useVertexTexture has been removed.`)}}),jn.prototype.initBones=function(){console.error(`THREE.SkinnedMesh: initBones() has been removed.`)},Object.defineProperty(Y.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}}),ve.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(ha.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(H.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===dc},set:function(){console.warn(`THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.`),this.setUsage(dc)}}}),Object.assign(H.prototype,{setDynamic:function(e){return console.warn(`THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.`),this.setUsage(e===!0?dc:uc),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(q.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 H(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(q.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(Aa.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(ro.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(Tn.prototype,{dynamic:{get:function(){return console.warn(`THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.`),this.usage===dc},set:function(e){console.warn(`THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.`),this.setUsage(e)}}}),Object.assign(Tn.prototype,{setDynamic:function(e){return console.warn(`THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.`),this.setUsage(e===!0?dc:uc),this},setArray:function(){console.error(`THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers`)}}),Object.assign(Gr.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(to.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(V.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 z}},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===1}},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(hi.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(ge.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(Sn.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(Sn.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?ec:$s}}}),Object.defineProperties(pn.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(w.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(Ka.prototype,{load:{value:function(e){console.warn(`THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.`);var t=this;return new Ba().load(e,function(e){t.setBuffer(e)}),this}},startTime:{set:function(){console.warn(`THREE.Audio: .startTime is now .play( delay ).`)}}}),Ja.prototype.getData=function(){return console.warn(`THREE.AudioAnalyser: .getData() is now .getFrequencyData().`),this.getFrequencyData()},ye.prototype.updateCubeMap=function(e,t){return console.warn(`THREE.CubeCamera: .updateCubeMap() is now .update().`),this.update(e,t)},hc.crossOrigin=void 0,hc.loadTexture=function(e,t,n,r){console.warn(`THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.`);var i=new Wi;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},hc.loadTextureCube=function(e,t,n,r){console.warn(`THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.`);var i=new Ui;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},hc.loadCompressedTexture=function(){console.error(`THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.`)},hc.loadCompressedTextureCube=function(){console.error(`THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.`)},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`register`,{detail:{revision:`117`}}))})),kf=e((()=>{Of()}));Of(),kf();function $(e,t,n){return function(r,i,a){return((r+e-1)/e|0)*((i+t-1)/t|0)*n*a}}function Af(e,t,n){return function(r,i,a){return(Math.max(r,e)*Math.max(i,t)/n|0)*a}}new Map([[rs,$(4,4,8)],[is,$(4,4,8)],[as,$(4,4,16)],[os,$(4,4,16)],[ds,$(4,4,8)],[ss,Af(8,8,2)],[ls,Af(8,8,2)],[cs,Af(16,8,4)],[us,Af(16,8,4)],[fs,$(4,4,8)],[ps,$(4,4,16)],[ms,$(4,4,16)],[ks,$(4,4,16)],[hs,$(5,4,16)],[As,$(5,4,16)],[gs,$(5,5,16)],[js,$(5,5,16)],[_s,$(6,5,16)],[Ms,$(6,5,16)],[vs,$(6,6,16)],[Ns,$(6,6,16)],[ys,$(8,5,16)],[Ps,$(8,5,16)],[bs,$(8,6,16)],[Fs,$(8,6,16)],[xs,$(8,8,16)],[Is,$(8,8,16)],[Ss,$(10,5,16)],[Ls,$(10,5,16)],[Cs,$(10,6,16)],[Rs,$(10,6,16)],[ws,$(10,8,16)],[zs,$(10,8,16)],[Ts,$(10,10,16)],[Bs,$(10,10,16)],[Es,$(12,10,16)],[Vs,$(12,10,16)],[Ds,$(12,12,16)],[Hs,$(12,12,16)],[Os,$(4,4,16)]]),Of();let jf=new O().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);new O().getInverse(jf);function Mf(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Nf(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Mf(a,r,i,o,s,`next`,e)}function s(e){Mf(a,r,i,o,s,`throw`,e)}o(void 0)})}}function Pf(){return Ff.apply(this,arguments)}function Ff(){return Ff=Nf(function*(e={}){var t,n=e,r=!1,i=!0,a=self.location.href;if(r||i){try{new URL(`.`,a).href}catch(e){}(function(){var e=Nf(function*(e){var t=yield fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});return function(t){return e.apply(this,arguments)}})()}console.log.bind(console),console.error.bind(console);var o=!1;function s(e){for(var t=0,n=e.length,r=new Uint8Array(n),i;t<n;++t)i=e.charCodeAt(t),r[t]=~i>>8&i;return r}var c,l,u=!1;function d(){var e=M.buffer;new Int8Array(e),new Int16Array(e),n.HEAPU8=l=new Uint8Array(e),new Uint16Array(e),new Int32Array(e),n.HEAPU32=new Uint32Array(e),n.HEAPF32=new Float32Array(e),new Float64Array(e),new BigInt64Array(e),new BigUint64Array(e)}function f(){if(n.preRun)for(typeof n.preRun==`function`&&(n.preRun=[n.preRun]);n.preRun.length;)T(n.preRun.shift());x(w)}function p(){u=!0,I.c()}function m(){if(n.postRun)for(typeof n.postRun==`function`&&(n.postRun=[n.postRun]);n.postRun.length;)C(n.postRun.shift());x(S)}var h;function g(){return s(`\\0asm\\0\\0\\0&\\`\\`}}\\`}\\`\\0\\`\\v\\0\\`\\0\\0\\x07aa\\0\\0\\b\\x07\\0\\0\\x07‚€€\\bA€Œ\\v\\x07b\\0c\\0\\x07d\\0e\\0f\\0\\f\n‘;\\x07T~@A€\\b(\\0\"­ \\0­B\\x07|Bøÿÿÿƒ|\"BÿÿÿÿX@ §\"\\0?\\0AtM\\r \\0\\0\\r\\vA„\\bA06\\0A\\vA€\\b \\x006\\0 \\v\\0 \\0 Atr\\vr \\0¼\"Aÿÿÿq!@ AvAÿq\"E\\r\\0 Að\\0M@ A€€€rAñ\\0 kv!\\f\\v AK@A€ø!A\\0!\\f\\v A\ntA€€\\x07k!\\v  AvA€€qr A\\rvr\\vß\\v\\b@ \\0E\\r\\0 \\0A\\bk\" \\0Ak(\\0\"Axq\"\\0j!@ Aq\\r\\0 AqE\\r  (\\0\"k\"A˜\\b(\\0I\\r \\0 j!\\0@@@Aœ\\b(\\0 G@ (\\f! AÿM@  (\\b\"G\\rAˆ\\bAˆ\\b(\\0A~ Avwq6\\0\\f\\v (!\\x07  G@ (\\b\" 6\\f  6\\b\\f\\v (\" Aj (\"E\\r Aj\\v!@ ! \"Aj! (\"\\r\\0 Aj! (\"\\r\\0\\v A\\x006\\0\\f\\v (\"AqAG\\rA\\b \\x006\\0  A~q6  \\0Ar6  \\x006\\0\\v  6\\f  6\\b\\f\\vA\\0!\\v \\x07E\\r\\0@ (\"At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ wq6\\0\\f\\v@  \\x07(F@ \\x07 6\\f\\v \\x07 6\\v E\\r\\v  \\x076 (\"@  6  6\\v (\"E\\r\\0  6  6\\v  O\\r\\0 (\"AqE\\r\\0@@@@ AqE@A\\xA0\\b(\\0 F@A\\xA0\\b 6\\0A”\\bA”\\b(\\0 \\0j\"\\x006\\0  \\0Ar6 Aœ\\b(\\0G\\rA\\bA\\x006\\0Aœ\\bA\\x006\\0\\vAœ\\b(\\0\"\\x07 F@Aœ\\b 6\\0A\\bA\\b(\\0 \\0j\"\\x006\\0  \\0Ar6 \\0 j \\x006\\0\\v Axq \\0j!\\0 (\\f! AÿM@ (\\b\" F@Aˆ\\bAˆ\\b(\\0A~ Avwq6\\0\\f\\v  6\\f  6\\b\\f\\v (!\\b  G@ (\\b\" 6\\f  6\\b\\f\\v (\" Aj (\"E\\r Aj\\v!@ ! \"Aj! (\"\\r\\0 Aj! (\"\\r\\0\\v A\\x006\\0\\f\\v  A~q6  \\0Ar6 \\0 j \\x006\\0\\f\\vA\\0!\\v \\bE\\r\\0@ (\"At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ wq6\\0\\f\\v@  \\b(F@ \\b 6\\f\\v \\b 6\\v E\\r\\v  \\b6 (\"@  6  6\\v (\"E\\r\\0  6  6\\v  \\0Ar6 \\0 j \\x006\\0  \\x07G\\r\\0A\\b \\x006\\0\\v \\0AÿM@ \\0AøqA°\\bj!Aˆ\\b(\\0\"A \\0Avt\"\\0qE@Aˆ\\b \\0 r6\\0 \\f\\v (\\b\\v!\\0  6\\b \\0 6\\f  6\\f  \\x006\\b\\vA! \\0Aÿÿÿ\\x07M@ \\0A& \\0A\\bvg\"kvAq AtrA>s!\\v  6 B\\x007 AtA¸\nj!@AŒ\\b(\\0\"A t\"qE@AŒ\\b  r6\\0  6\\0A!A\\b\\f\\v \\0A AvkA\\0 AG\\x1Bt! (\\0!@ \"(Axq \\0F\\r Av! At!  Aqj\"(\"\\r\\0\\v  6A! !A\\b\\v!\\0 \"\\f\\v (\\b\" 6\\f  6\\bA!\\0A\\b!A\\0\\v!  j 6\\0  6\\f \\0 j 6\\0A¨\\bA¨\\b(\\0Ak\"\\0A \\0\\x1B6\\0\\v\\v¸'\\v#\\0Ak\"\n$\\0@@@@@@@@@@ \\0AôM@Aˆ\\b(\\0\"A \\0A\\vjAøq \\0A\\vI\\x1B\"Av\"\\0v\"Aq@@ AsAq \\0j\"At\"A°\\bj\"\\0 (¸\\b\"(\\b\"F@Aˆ\\b A~ wq6\\0\\f\\v  \\x006\\f \\0 6\\b\\v A\\bj!\\0  Ar6  j\" (Ar6\\f\\v\\v A\\b(\\0\"\\bM\\r @@A \\0t\"A\\0 kr  \\0tqh\"At\"A°\\bj\" (¸\\b\"\\0(\\b\"F@Aˆ\\b A~ wq\"6\\0\\f\\v  6\\f  6\\b\\v \\0 Ar6 \\0 j\"\\x07  k\"Ar6 \\0 j 6\\0 \\b@ \\bAxqA°\\bj!Aœ\\b(\\0! A \\bAvt\"qE@Aˆ\\b  r6\\0 \\f\\v (\\b\\v!  6\\b  6\\f  6\\f  6\\b\\v \\0A\\bj!\\0Aœ\\b \\x076\\0A\\b 6\\0\\f\\v\\vAŒ\\b(\\0\"\\vE\\r \\vhAt(¸\n\"(Axq k! !@@ (\"\\0E@ (\"\\0E\\r\\v \\0(Axq k\"   I\"\\x1B! \\0  \\x1B! \\0!\\f\\v\\v (!  (\\f\"\\0G@ (\\b\" \\x006\\f \\0 6\\b\\f\n\\v (\" Aj (\"E\\r Aj\\v!@ !\\x07 \"\\0Aj! \\0(\"\\r\\0 \\0Aj! \\0(\"\\r\\0\\v \\x07A\\x006\\0\\f \\vA! \\0A¿K\\r\\0 \\0A\\vj\"Axq!AŒ\\b(\\0\"\\x07E\\r\\0A!\\bA\\0 k! \\0Aôÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtkA>j!\\b\\v@@@ \\bAt(¸\n\"E@A\\0!\\0\\f\\vA\\0!\\0 A \\bAvkA\\0 \\bAG\\x1Bt!@@ (Axq k\" O\\r\\0 ! \"\\r\\0A\\0! !\\0\\f\\v \\0 (\"   AvAqj(\"F\\x1B \\0 \\x1B!\\0 At! \\r\\0\\v\\v \\0 rE@A\\0!A \\bt\"\\0A\\0 \\0kr \\x07q\"\\0E\\r \\0hAt(¸\n!\\0\\v \\0E\\r\\v@ \\0(Axq k\" I!   \\x1B! \\0  \\x1B! \\0(\"  \\0(\\v\"\\0\\r\\0\\v\\v E\\r\\0 A\\b(\\0 kO\\r\\0 (!\\b  (\\f\"\\0G@ (\\b\" \\x006\\f \\0 6\\b\\f\\b\\v (\" Aj (\"E\\r Aj\\v!@ ! \"\\0Aj! \\0(\"\\r\\0 \\0Aj! \\0(\"\\r\\0\\v A\\x006\\0\\f\\x07\\v A\\b(\\0\"M@Aœ\\b(\\0!\\0@  k\"AO@ \\0 j\" Ar6 \\0 j 6\\0 \\0 Ar6\\f\\v \\0 Ar6 \\0 j\" (Ar6A\\0!A\\0!\\vA\\b 6\\0Aœ\\b 6\\0 \\0A\\bj!\\0\\f \\v A”\\b(\\0\"I@A”\\b  k\"6\\0A\\xA0\\bA\\xA0\\b(\\0\"\\0 j\"6\\0  Ar6 \\0 Ar6 \\0A\\bj!\\0\\f \\vA\\0!\\0 A/j\"Aà\\v(\\0@Aè\\v(\\0\\f\\vAì\\vB7\\0Aä\\vB€\\xA0€€€€7\\0Aà\\v \nA\\fjApqAتժs6\\0Aô\\vA\\x006\\0AÄ\\vA\\x006\\0A€ \\v\"j\"A\\0 k\"\\x07q\" M\\r\\bAÀ\\v(\\0\"@A¸\\v(\\0\"\\b j\" \\bM  Ir\\r \\v@AÄ\\v-\\0\\0AqE@@@@@A\\xA0\\b(\\0\"@AÈ\\v!\\0@ \\0(\\0\"\\b M@  \\b \\0(jI\\r\\v \\0(\\b\"\\0\\r\\0\\v\\vA\\0\"AF\\r !Aä\\v(\\0\"\\0Ak\" q@  k  jA\\0 \\0kqj!\\v  M\\rAÀ\\v(\\0\"\\0@A¸\\v(\\0\" j\"\\x07 M \\0 \\x07Ir\\r\\v \"\\0 G\\r\\f\\v  k \\x07q\"\" \\0(\\0 \\0(jF\\r !\\0\\v \\0AF\\r A0j M@ \\0!\\f\\vAè\\v(\\0\"  kjA\\0 kq\"AF\\r  j! \\0!\\f\\v AG\\r\\vAÄ\\vAÄ\\v(\\0Ar6\\0\\v \"AFA\\0\"\\0AFr \\0 Mr\\r \\0 k\" A(jM\\r\\vA¸\\vA¸\\v(\\0 j\"\\x006\\0A¼\\v(\\0 \\0I@A¼\\v \\x006\\0\\v@A\\xA0\\b(\\0\"@AÈ\\v!\\0@  \\0(\\0\" \\0(\"jF\\r \\0(\\b\"\\0\\r\\0\\v\\f\\vA˜\\b(\\0\"\\0A\\0 \\0 M\\x1BE@A˜\\b 6\\0\\vA\\0!\\0AÌ\\v 6\\0AÈ\\v 6\\0A¨\\bA6\\0A¬\\bAà\\v(\\x006\\0AÔ\\vA\\x006\\0@ \\0At\" A°\\bj\"6¸\\b  6¼\\b \\0Aj\"\\0A G\\r\\0\\vA”\\b A(k\"\\0Ax kA\\x07q\"k\"6\\0A\\xA0\\b  j\"6\\0  Ar6 \\0 jA(6A¤\\bAð\\v(\\x006\\0\\f\\v  M  Kr\\r \\0(\\fA\\bq\\r \\0  j6A\\xA0\\b Ax kA\\x07q\"\\0j\"6\\0A”\\bA”\\b(\\0 j\" \\0k\"\\x006\\0  \\0Ar6  jA(6A¤\\bAð\\v(\\x006\\0\\f\\vA\\0!\\0\\f\\vA\\0!\\0\\f\\vA˜\\b(\\0 K@A˜\\b 6\\0\\v  j!AÈ\\v!\\0@@  \\0(\\0\"G@ \\0(\\b\"\\0\\r\\f\\v\\v \\0-\\0\\fA\\bqE\\r\\vAÈ\\v!\\0@@ \\0(\\0\" M@   \\0(j\"I\\r\\v \\0(\\b!\\0\\f\\v\\vA”\\b A(k\"\\0Ax kA\\x07q\"k\"\\x076\\0A\\xA0\\b  j\"6\\0  \\x07Ar6 \\0 jA(6A¤\\bAð\\v(\\x006\\0  A' kA\\x07qjA/k\"\\0 \\0 AjI\\x1B\"A\\x1B6 AÐ\\v)\\x007 AÈ\\v)\\x007\\bAÐ\\v A\\bj6\\0AÌ\\v 6\\0AÈ\\v 6\\0AÔ\\vA\\x006\\0 Aj!\\0@ \\0A\\x076 \\0A\\bj \\0Aj!\\0 I\\r\\0\\v  F\\r\\0  (A~q6   k\"Ar6  6\\0 AÿM@ AøqA°\\bj!\\0Aˆ\\b(\\0\"A Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\fA\\f!A\\b\\f\\vA!\\0 Aÿÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtrA>s!\\0\\v  \\x006 B\\x007 \\0AtA¸\nj!@@AŒ\\b(\\0\"A \\0t\"qE@AŒ\\b  r6\\0  6\\0\\f\\v A \\0AvkA\\0 \\0AG\\x1Bt!\\0 (\\0!@ \"(Axq F\\r \\0Av! \\0At!\\0  Aqj\"(\"\\r\\0\\v  6\\v  6A\\b! \"!\\0A\\f\\f\\v (\\b\"\\0 6\\f  6\\b  \\x006\\bA\\0!\\0A!A\\f\\v j 6\\0  j \\x006\\0\\vA”\\b(\\0\"\\0 M\\r\\0A”\\b \\0 k\"6\\0A\\xA0\\bA\\xA0\\b(\\0\"\\0 j\"6\\0  Ar6 \\0 Ar6 \\0A\\bj!\\0\\f\\vA„\\bA06\\0A\\0!\\0\\f\\v \\0 6\\0 \\0 \\0( j6 Ax kA\\x07qj\"\\b Ar6 Ax kA\\x07qj\"  \\bj\"k!\\x07@A\\xA0\\b(\\0 F@A\\xA0\\b 6\\0A”\\bA”\\b(\\0 \\x07j\"\\x006\\0  \\0Ar6\\f\\vAœ\\b(\\0 F@Aœ\\b 6\\0A\\bA\\b(\\0 \\x07j\"\\x006\\0  \\0Ar6 \\0 j \\x006\\0\\f\\v (\"\\0AqAF@ \\0Axq! (\\f!@ \\0AÿM@ (\\b\" F@Aˆ\\bAˆ\\b(\\0A~ \\0Avwq6\\0\\f\\v  6\\f  6\\b\\f\\v (!@  G@ (\\b\"\\0 6\\f  \\x006\\b\\f\\v@ (\"\\0 Aj (\"\\0E\\r Aj\\v!@ ! \\0\"Aj! \\0(\"\\0\\r\\0 Aj! (\"\\0\\r\\0\\v A\\x006\\0\\f\\vA\\0!\\v E\\r\\0@ (\"\\0At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ \\0wq6\\0\\f\\v@  (F@  6\\f\\v  6\\v E\\r\\v  6 (\"\\0@  \\x006 \\0 6\\v (\"\\0E\\r\\0  \\x006 \\0 6\\v \\x07 j!\\x07  j\"(!\\0\\v  \\0A~q6  \\x07Ar6  \\x07j \\x076\\0 \\x07AÿM@ \\x07AøqA°\\bj!\\0Aˆ\\b(\\0\"A \\x07Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\f\\vA! \\x07Aÿÿÿ\\x07M@ \\x07A& \\x07A\\bvg\"\\0kvAq \\0AtrA>s!\\v  6 B\\x007 AtA¸\nj!\\0@@AŒ\\b(\\0\"A t\"qE@AŒ\\b  r6\\0 \\0 6\\0\\f\\v \\x07A AvkA\\0 AG\\x1Bt! \\0(\\0!@ \"\\0(Axq \\x07F\\r Av! At! \\0 Aqj\"(\"\\r\\0\\v  6\\v  \\x006  6\\f  6\\b\\f\\v \\0(\\b\" 6\\f \\0 6\\b A\\x006  \\x006\\f  6\\b\\v \\bA\\bj!\\0\\f\\v@ \\bE\\r\\0@ (\"At\"(¸\n F@ A¸\nj \\x006\\0 \\0\\rAŒ\\b \\x07A~ wq\"\\x076\\0\\f\\v@  \\b(F@ \\b \\x006\\f\\v \\b \\x006\\v \\0E\\r\\v \\0 \\b6 (\"@ \\0 6  \\x006\\v (\"E\\r\\0 \\0 6  \\x006\\v@ AM@   j\"\\0Ar6 \\0 j\"\\0 \\0(Ar6\\f\\v  Ar6  j\" Ar6  j 6\\0 AÿM@ AøqA°\\bj!\\0Aˆ\\b(\\0\"A Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\f\\vA!\\0 Aÿÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtrA>s!\\0\\v  \\x006 B\\x007 \\0AtA¸\nj!@@ \\x07A \\0t\"qE@AŒ\\b  \\x07r6\\0  6\\0  6\\f\\v A \\0AvkA\\0 \\0AG\\x1Bt!\\0 (\\0!@ \"(Axq F\\r \\0Av! \\0At!\\0  Aqj\"\\x07(\"\\r\\0\\v \\x07 6  6\\v  6\\f  6\\b\\f\\v (\\b\"\\0 6\\f  6\\b A\\x006  6\\f  \\x006\\b\\v A\\bj!\\0\\f\\v@ E\\r\\0@ (\"At\"(¸\n F@ A¸\nj \\x006\\0 \\0\\rAŒ\\b \\vA~ wq6\\0\\f\\v@  (F@ \\x006\\f\\v \\x006\\v \\0E\\r\\v \\0 6 (\"@ \\0 6  \\x006\\v (\"E\\r\\0 \\0 6  \\x006\\v@ AM@   j\"\\0Ar6 \\0 j\"\\0 \\0(Ar6\\f\\v  Ar6  j\" Ar6  j 6\\0 \\b@ \\bAxqA°\\bj!\\0Aœ\\b(\\0!A \\bAvt\"\\x07 qE@Aˆ\\b  \\x07r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\vAœ\\b 6\\0A\\b 6\\0\\v A\\bj!\\0\\v \nAj$\\0 \\0\\v™}\\vA\\0!\\0@ \\0 FE@  \\0A\\fl\"Aj\"j*\\0!\\f  A\\bj\"j*\\0!\\v  \\bj  j*\\0\"\\r8\\0 \\b j \\v8\\0 \\b j \\f8\\0 \\0At\"j  j\"#*\\x008\\0 \\0At\"Ar\"$At\" j  j\" *\\x008\\0 Ar\"%At\"!j  !j\"!*\\x008\\0 Ar\"&At\"\"j  \"j\"\"*\\x008\\0  \nj  j\"'*\\x008\\0 \n j  j\"*\\x008\\0 \n j  j*\\0\"8\\0 \\x07 \\0Atj\" \\v8\\b  \\f8  \\r8\\0   j-\\0\\0  $j-\\0\\0A\\btr  %j-\\0\\0Atr  &j-\\0\\0Atr6\\f *\\0! '*\\0! \"*\\0\"\\f \\f” !*\\0\"\\v \\v” #*\\0\" ” *\\0\"\\r \\r”’’’\"C\\0\\0\\0\\0^@ \\f ‘\"•!\\f \\r •!\\r  •! \\v •!\\v\\v   \\r \\f”\" \\v ”\"’\" ’”\" ” C\\0\\0€? \\v \\v”\" \\f \\f”\"’\" ’“”\" ”  \\r \\v”\" \\f ”\"“\" ’”\" ”’’C\\0\\0€@”   \\v \\f”\"\\x1B \\r ”\"“\"\\f \\f’”\"\\f”    ’\"\\v \\v’”\"\\v” C\\0\\0€? \\r \\r”\" ’\"\\r \\r’“”\"\\r ”’’C\\0\\0€@”6   C\\0\\0€?  ’\" ’“”\"”    “\" ’”\"”   \\x1B ’\" ’”\"”’’C\\0\\0€@” \\f \\f” \\v \\v” \\r \\r”’’C\\0\\0€@”6 A\\x006  \\f ” \\v ” \\r ”’’C\\0\\0€@”  ”  ”  ”’’C\\0\\0€@”6 \\0Aj!\\0\\f\\v\\v\\v\\0\\v\\v \\0A\\b\\v`)}function _(e){return e}function v(e,t){var n,r=_(e);return n=new WebAssembly.Module(r),[new WebAssembly.Instance(n,t),n]}function y(){return{a:P}}function b(){function e(e,t){return I=e.exports,N(I),d(),I}var t=y();return n.instantiateWasm?new Promise((r,i)=>{n.instantiateWasm(t,(t,n)=>{r(e(t,n))})}):(h!=null||(h=g()),e(v(h,t)[0]))}for(var x=e=>{for(;e.length>0;)e.shift()(n)},S=[],C=e=>S.push(e),w=[],T=e=>w.push(e),E=()=>2147483648,D=(e,t)=>Math.ceil(e/t)*t,O=e=>{var t=(e-M.buffer.byteLength+65535)/65536|0;try{return M.grow(t),d(),1}catch(e){}},k=e=>{var t=l.length;e>>>=0;var n=E();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),O(Math.min(n,D(Math.max(e,i),65536))))return!0}return!1},A=new Uint8Array(123),j=25;j>=0;--j)A[48+j]=52+j,A[65+j]=j,A[97+j]=26+j;if(A[43]=62,A[47]=63,n.noExitRuntime&&n.noExitRuntime,n.print&&n.print,n.printErr&&n.printErr,n.wasmBinary&&n.wasmBinary,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram,n.preInit)for(typeof n.preInit==`function`&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.shift()();var M;function N(e){n._pack=e.d,n._malloc=e.e,n._free=e.f,M=e.b,e.__indirect_function_table}var P={a:k};function F(){f();function e(){var e;n.calledRun=!0,!o&&(p(),c==null||c(n),(e=n.onRuntimeInitialized)==null||e.call(n),m())}n.setStatus?(n.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>n.setStatus(``),1),e()},1)):e()}var I=b();return F(),t=u?n:new Promise((e,t)=>{c=e}),t}),Ff.apply(this,arguments)}let If=new Float32Array(1),Lf=new Uint32Array(If.buffer),Rf=typeof Float16Array<`u`,zf=Rf?new Float16Array(1):null,Bf=Rf?new Uint16Array(zf.buffer):new Uint16Array(1);function Vf(e){if(Rf&&zf)return Bf[0]=e,zf[0];let t=e>>15&1,n=e>>10&31,r=e&1023,i;if(n===0)if(r===0)i=t<<31;else{let e=r,n=-14;for(;!(e&1024);)e<<=1,n--;e&=1023;let a=n+127,o=e<<13;i=t<<31|a<<23|o}else if(n===31)i=r===0?t<<31|2139095040:t<<31|2143289344;else{let e=n-15+127,a=r<<13;i=t<<31|e<<23|a}return Lf[0]=i,If[0]}var Hf=class{constructor({fileBytes:e}){this.fileBytes=e,this.chunks=[],this.totalBytes=0;let t=new DecompressionStream(`gzip`),n=new Blob([e]).stream().pipeThrough(t);this.reader=n.getReader()}read(e){return t(this,void 0,void 0,function*(){for(;this.totalBytes<e;){let{value:e,done:t}=yield this.reader.read();if(t)break;this.chunks.push(e),this.totalBytes+=e.length}if(this.totalBytes<e)throw Error(`Unexpected EOF: needed ${e}, got ${this.totalBytes}`);let t=new Uint8Array(this.totalBytes),n=0;for(let e of this.chunks)t.set(e,n),n+=e.length;let r=t.subarray(0,e);return this.chunks=[t.subarray(e)],this.totalBytes-=e,r})}},Uf=class{constructor({fileBytes:e}){this.version=-1,this.numSplats=0,this.shDegree=0,this.fractionalBits=0,this.flags=0,this.flagAntiAlias=!1,this.reserved=0,this.headerParsed=!1,this.parsed=!1,this.fileBytes=e instanceof ArrayBuffer?new Uint8Array(e):e,this.reader=new Hf({fileBytes:this.fileBytes})}parseHeader(){return t(this,void 0,void 0,function*(){if(this.headerParsed)throw Error(`SPZ file header already parsed`);let e=new DataView((yield this.reader.read(16)).buffer);if(e.getUint32(0,!0)!==1347635022)throw Error(`Invalid SPZ file`);if(this.version=e.getUint32(4,!0),this.version<1||this.version>3)throw Error(`Unsupported SPZ version: ${this.version}`);this.numSplats=e.getUint32(8,!0),this.shDegree=e.getUint8(12),this.fractionalBits=e.getUint8(13),this.flags=e.getUint8(14),this.flagAntiAlias=(this.flags&1)!=0,this.reserved=e.getUint8(15),this.headerParsed=!0,this.parsed=!1})}parseSplats(e,n,r,i,a,o){return t(this,void 0,void 0,function*(){if(!this.headerParsed)throw Error(`SPZ file header must be parsed first`);if(this.parsed)throw Error(`SPZ file already parsed`);if(this.parsed=!0,this.version===1){let t=yield this.reader.read(this.numSplats*3*2),n=new Uint16Array(t.buffer);for(let t=0;t<this.numSplats;t++){let r=t*3;e==null||e(t,Vf(n[r]),Vf(n[r+1]),Vf(n[r+2]))}}else if(this.version===2||this.version===3){let t=1<<this.fractionalBits,n=yield this.reader.read(this.numSplats*3*3);for(let r=0;r<this.numSplats;r++){let i=r*9,a=((n[i+2]<<24|n[i+1]<<16|n[i]<<8)>>8)/t,o=((n[i+5]<<24|n[i+4]<<16|n[i+3]<<8)>>8)/t,s=((n[i+8]<<24|n[i+7]<<16|n[i+6]<<8)>>8)/t;e==null||e(r,a,o,s)}}{let e=yield this.reader.read(this.numSplats);for(let t=0;t<this.numSplats;t++)n==null||n(t,e[t]/255)}{let e=yield this.reader.read(this.numSplats*3),t=.28209479177387814/.15;for(let n=0;n<this.numSplats;n++){let i=n*3;r==null||r(n,(e[i]/255-.5)*t+.5,(e[i+1]/255-.5)*t+.5,(e[i+2]/255-.5)*t+.5)}}{let e=yield this.reader.read(this.numSplats*3);for(let t=0;t<this.numSplats;t++){let n=t*3;i==null||i(t,Math.exp(e[n]/16-10),Math.exp(e[n+1]/16-10),Math.exp(e[n+2]/16-10))}}if(this.version===3){let e=1/Math.sqrt(2),t=yield this.reader.read(this.numSplats*4);for(let n=0;n<this.numSplats;n++){let r=n*4,i=[0,0,0,0],o=[t[r],t[r+1],t[r+2],t[r+3]],s=o[0]+(o[1]<<8)+(o[2]<<16)+(o[3]<<24),c=s>>>30,l=s,u=0;for(let t=3;t>=0;--t)if(t!==c){let n=l&511,r=l>>>9&1;l>>>=10,i[t]=n/511*e,i[t]=r===0?i[t]:-i[t],u+=i[t]*i[t]}i[c]=Math.sqrt(Math.max(1-u,0)),a==null||a(n,i[0],i[1],i[2],i[3])}}else{let e=yield this.reader.read(this.numSplats*3);for(let t=0;t<this.numSplats;t++){let n=t*3,r=e[n]/127.5-1,i=e[n+1]/127.5-1,o=e[n+2]/127.5-1,s=Math.sqrt(Math.max(0,1-r*r-i*i-o*o));a==null||a(t,r,i,o,s)}}if(o&&this.shDegree>=1){let e={1:3,2:8,3:15}[this.shDegree]||0,t=yield this.reader.read(this.numSplats*e*3),n=new Float32Array(9),r=this.shDegree>=2?new Float32Array(15):void 0,i=this.shDegree>=3?new Float32Array(21):void 0,a=0;for(let e=0;e<this.numSplats;e++){for(let e=0;e<9;++e)n[e]=(t[a+e]-128)/128;if(a+=9,r){for(let e=0;e<15;++e)r[e]=(t[a+e]-128)/128;a+=15}if(i){for(let e=0;e<21;++e)i[e]=(t[a+e]-128)/128;a+=21}o==null||o(e,new Float32Array(n),r?new Float32Array(r):void 0,i?new Float32Array(i):void 0)}}})}};function Wf(e){return t(this,void 0,void 0,function*(){let t=new Uf({fileBytes:e});yield t.parseHeader();let n=t.numSplats,r=new Float32Array(n*3),i=new Uint8Array(n*4),a=new Float32Array(n*3),o=new Float32Array(n*4),s,c,l;return t.shDegree>=1&&(s=new Float32Array(n*9)),t.shDegree>=2&&(c=new Float32Array(n*15)),t.shDegree>=3&&(l=new Float32Array(n*21)),yield t.parseSplats((e,t,n,i)=>{r[e*3]=t,r[e*3+1]=n,r[e*3+2]=i},(e,t)=>{i[e*4+3]=Math.round(t*255)},(e,t,n,r)=>{i[e*4]=Math.round(Math.max(0,Math.min(1,t))*255),i[e*4+1]=Math.round(Math.max(0,Math.min(1,n))*255),i[e*4+2]=Math.round(Math.max(0,Math.min(1,r))*255)},(e,t,n,r)=>{a[e*3]=t,a[e*3+1]=n,a[e*3+2]=r},(e,t,n,r,i)=>{o[e*4]=i,o[e*4+1]=t,o[e*4+2]=n,o[e*4+3]=r},(e,t,n,r)=>{s&&t&&s.set(t,e*9),c&&n&&c.set(n,e*15),l&&r&&l.set(r,e*21)}),{numPoints:n,shDegree:t.shDegree,flagAntiAlias:t.flagAntiAlias,positions:r,colors:i,scales:a,rotations:o,sh1:s,sh2:c,sh3:l}})}let Gf,Kf=!1;function qf(){return t(this,void 0,void 0,function*(){if(!Gf){for(;Kf;)yield new Promise(e=>setTimeout(e,0));Gf||(Kf=!0,Gf=yield Pf(),Kf=!1)}})}let Jf=0,Yf=0,Xf=0,Zf=0,Qf=0,$f=0,ep=0,tp=0,np=0,rp=0;function ip(e){let t=Math.pow(2,Math.ceil(Math.log2(Math.max(1,e))));t<=Jf||(Jf>0&&(Gf._free(Yf),Gf._free(Xf),Gf._free(Zf),Gf._free(Qf),Gf._free($f),Gf._free(ep),Gf._free(tp),Gf._free(np),Gf._free(rp)),Jf=t,Yf=Gf._malloc(3*t*4),Xf=Gf._malloc(4*t*4),Zf=Gf._malloc(3*t*4),Qf=Gf._malloc(4*t),$f=Gf._malloc(t),ep=Gf._malloc(8*t*4),tp=Gf._malloc(3*t*4),np=Gf._malloc(4*t*4),rp=Gf._malloc(3*t*4))}function ap(e,t,n,r,i){ip(e);let a=new Uint8Array(e);Gf.HEAPF32.set(t,Yf/4),Gf.HEAPF32.set(n,Xf/4),Gf.HEAPF32.set(r,Zf/4),Gf.HEAPU8.set(i,Qf),Gf.HEAPU8.set(a,$f),Gf._pack(!1,e,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp);let o=new Uint32Array(Gf.HEAPU32.buffer,ep,e*8);return new Uint32Array(o.slice().buffer)}typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope&&(self.onmessage=e=>t(void 0,void 0,void 0,function*(){var t;let{requestId:n,fileBytes:r}=e.data;if(!(r===void 0||n===void 0))try{let e=yield Wf(new Uint8Array(r));yield qf();let t=ap(e.numPoints,e.positions,e.rotations,e.scales,e.colors),i=Object.assign(Object.assign({},e),{packedData:t}),a=[t.buffer,e.positions.buffer,e.colors.buffer,e.scales.buffer,e.rotations.buffer];e.sh1&&a.push(e.sh1.buffer),e.sh2&&a.push(e.sh2.buffer),e.sh3&&a.push(e.sh3.buffer),self.postMessage({requestId:n,decoded:i},a)}catch(e){self.postMessage({requestId:n,error:(t=e==null?void 0:e.message)==null?String(e):t})}}))})();", cs = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", ss], { type: "text/javascript;charset=utf-8" });
8744
8744
  function ls(e) {
8745
8745
  let t;
8746
8746
  try {
@@ -8911,6 +8911,7 @@ function ys(e) {
8911
8911
  }), {
8912
8912
  numPoints: n,
8913
8913
  shDegree: t.shDegree,
8914
+ flagAntiAlias: t.flagAntiAlias,
8914
8915
  positions: r,
8915
8916
  colors: i,
8916
8917
  scales: a,
@@ -8988,14 +8989,15 @@ function Rs(e) {
8988
8989
  }
8989
8990
  function zs(e) {
8990
8991
  return es(this, void 0, void 0, function* () {
8991
- let t = yield Rs(e instanceof ArrayBuffer ? new Uint8Array(e) : e), { PBMGaussianSplattingObject: n } = yield import("../pbmGaussianSplattingObject-CaE6q4r-.js").then((e) => e.n);
8992
+ let t = yield Rs(e instanceof ArrayBuffer ? new Uint8Array(e) : e), { PBMGaussianSplattingObject: n } = yield import("../pbmGaussianSplattingObject-BwsrwWs6.js").then((e) => e.n);
8992
8993
  return new n({
8993
8994
  numPoints: t.numPoints,
8994
8995
  packedData: t.packedData,
8995
8996
  sh1: t.sh1,
8996
8997
  sh2: t.sh2,
8997
8998
  sh3: t.sh3,
8998
- shDegree: t.shDegree
8999
+ shDegree: t.shDegree,
9000
+ antiAliased: t.flagAntiAlias
8999
9001
  });
9000
9002
  });
9001
9003
  }
@@ -24656,7 +24658,7 @@ Object.assign(hy.prototype, { isLineGeometry: !0 });
24656
24658
  //#region build/line/index.js
24657
24659
  var gy = 14467195, _y = 8, vy = 2, yy = 20, by = null, xy = class extends t.Object3D {
24658
24660
  static get version() {
24659
- return "6.9.0-alpha.2";
24661
+ return "6.9.0-alpha.3";
24660
24662
  }
24661
24663
  constructor(e = new t.Vector3(), n = new t.Vector3()) {
24662
24664
  super(), this.type = "FiveLine", this.needsRender = !0;
@@ -26467,7 +26469,41 @@ var _b = 5, vb = _b * 4, yb = class {
26467
26469
  dispose() {
26468
26470
  this.texture && (this.texture.dispose(), this.texture = null);
26469
26471
  }
26470
- }, bb = class {
26472
+ }, bb = 1, xb = bb * 4, Sb = class {
26473
+ constructor() {
26474
+ this.texture = null, this.width = bb, this.data = new Float32Array(), this.indexMap = /* @__PURE__ */ new Map(), this.count = 0;
26475
+ }
26476
+ get objectCount() {
26477
+ return this.count;
26478
+ }
26479
+ sync(e, t) {
26480
+ this.indexMap.clear(), this.count = e.length;
26481
+ let n = Math.max(1, this.count) * xb;
26482
+ this.data.length < n && (this.data = new Float32Array(n));
26483
+ for (let n of e) {
26484
+ let e = t(n);
26485
+ e === void 0 || e < 0 || e >= this.count || (this.indexMap.set(n, e), this.write(n, e));
26486
+ }
26487
+ this.rebuildTexture();
26488
+ }
26489
+ updateOne(e) {
26490
+ let t = this.indexMap.get(e);
26491
+ t !== void 0 && (this.write(e, t), this.texture && (this.texture.needsUpdate = !0));
26492
+ }
26493
+ write(e, t) {
26494
+ let n = t * xb;
26495
+ this.data[n + 0] = e.preBlurAmount, this.data[n + 1] = e.blurAmount, this.data[n + 2] = 0, this.data[n + 3] = 0;
26496
+ }
26497
+ rebuildTexture() {
26498
+ let e = Math.max(1, this.count);
26499
+ this.texture && this.texture.dispose();
26500
+ let n = new t.DataTexture(this.data, this.width, e, t.RGBAFormat, t.FloatType);
26501
+ n.internalFormat = "RGBA32F", n.minFilter = t.NearestFilter, n.magFilter = t.NearestFilter, n.generateMipmaps = !1, n.needsUpdate = !0, this.texture = n;
26502
+ }
26503
+ dispose() {
26504
+ this.texture && (this.texture.dispose(), this.texture = null), this.indexMap.clear(), this.count = 0;
26505
+ }
26506
+ }, Cb = class {
26471
26507
  constructor() {
26472
26508
  this.layerKeys = [], this.layerKeyToIndex = /* @__PURE__ */ new Map(), this.objectLayerIndex = /* @__PURE__ */ new Map();
26473
26509
  }
@@ -26485,7 +26521,7 @@ var _b = 5, vb = _b * 4, yb = class {
26485
26521
  get layerCount() {
26486
26522
  return this.layerKeys.length;
26487
26523
  }
26488
- }, xb = 2048, Sb = 4, Cb = class {
26524
+ }, wb = 2048, Tb = 4, Eb = class {
26489
26525
  constructor() {
26490
26526
  this.texture = null, this.textureSize = new t.Vector2(), this.dataMaxDegree = 0, this.appliedDegree = 0;
26491
26527
  }
@@ -26498,23 +26534,23 @@ var _b = 5, vb = _b * 4, yb = class {
26498
26534
  let o = 0;
26499
26535
  a >= 1 && (o += 9), a >= 2 && (o += 15), a >= 3 && (o += 21);
26500
26536
  let s = o;
26501
- s % Sb !== 0 && (s = Math.ceil(s / Sb) * Sb);
26502
- let c = s / Sb, l = i * c, u = xb, d = Math.ceil(l / u), f = new Float32Array(u * d * Sb), p = 0;
26537
+ s % Tb !== 0 && (s = Math.ceil(s / Tb) * Tb);
26538
+ let c = s / Tb, l = i * c, u = wb, d = Math.ceil(l / u), f = new Float32Array(u * d * Tb), p = 0;
26503
26539
  for (let t of e) {
26504
26540
  let e = t.sh1, n = t.sh2, r = t.sh3;
26505
26541
  for (let i = 0; i < t.numPoints; i++) {
26506
26542
  let t = (p + i) * c, o = 0;
26507
26543
  if (e && a >= 1) for (let n = 0; n < 9; n++) {
26508
- let r = t + Math.floor(o / Sb), a = o % Sb;
26509
- f[r * Sb + a] = e[i * 9 + n], o++;
26544
+ let r = t + Math.floor(o / Tb), a = o % Tb;
26545
+ f[r * Tb + a] = e[i * 9 + n], o++;
26510
26546
  }
26511
26547
  if (n && a >= 2) for (let e = 0; e < 15; e++) {
26512
- let r = t + Math.floor(o / Sb), a = o % Sb;
26513
- f[r * Sb + a] = n[i * 15 + e], o++;
26548
+ let r = t + Math.floor(o / Tb), a = o % Tb;
26549
+ f[r * Tb + a] = n[i * 15 + e], o++;
26514
26550
  }
26515
26551
  if (r && a >= 3) for (let e = 0; e < 21; e++) {
26516
- let n = t + Math.floor(o / Sb), a = o % Sb;
26517
- f[n * Sb + a] = r[i * 21 + e], o++;
26552
+ let n = t + Math.floor(o / Tb), a = o % Tb;
26553
+ f[n * Tb + a] = r[i * 21 + e], o++;
26518
26554
  }
26519
26555
  }
26520
26556
  p += t.numPoints;
@@ -26526,7 +26562,7 @@ var _b = 5, vb = _b * 4, yb = class {
26526
26562
  dispose() {
26527
26563
  this.texture && (this.texture.dispose(), this.texture = null);
26528
26564
  }
26529
- }, wb = 4294967295, Tb = class e {
26565
+ }, Db = 4294967295, Ob = class e {
26530
26566
  constructor(n = 64) {
26531
26567
  this.maxSeg = n, this.segStart = Array(n).fill(0), this.segEnd = Array(n).fill(0), this.segDelta = Array(n).fill(0), this.segRemoved = Array(n).fill(0), this.material = new t.RawShaderMaterial({
26532
26568
  vertexShader: e.VERTEX,
@@ -26603,31 +26639,31 @@ void main() {
26603
26639
  `;
26604
26640
  }
26605
26641
  };
26606
- Tb.SENTINEL = wb, Tb.VERTEX = "#version 300 es\nin vec3 position;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n}\n";
26642
+ Ob.SENTINEL = Db, Ob.VERTEX = "#version 300 es\nin vec3 position;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n}\n";
26607
26643
  //#endregion
26608
26644
  //#region build/five/gaussian-splatting/worker/sortWorker.js?worker&inline
26609
- var Eb = "(function(){function e(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,`next`,e)}function c(e){t(o,i,a,s,c,`throw`,e)}s(void 0)})}}function r(){return i.apply(this,arguments)}function i(){return i=n(function*(e={}){var t,r=e,i=!1,a=!0,o=self.location.href;if(i||a){try{new URL(`.`,o).href}catch(e){}(function(){var e=n(function*(e){var t=yield fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});return function(t){return e.apply(this,arguments)}})()}console.log.bind(console),console.error.bind(console);var s=!1;function c(e){for(var t=0,n=e.length,r=new Uint8Array(n),i;t<n;++t)i=e.charCodeAt(t),r[t]=~i>>8&i;return r}var l,u,d=!1;function f(){var e=N.buffer;new Int8Array(e),new Int16Array(e),r.HEAPU8=u=new Uint8Array(e),new Uint16Array(e),new Int32Array(e),r.HEAPU32=new Uint32Array(e),r.HEAPF32=new Float32Array(e),new Float64Array(e),new BigInt64Array(e),new BigUint64Array(e)}function p(){if(r.preRun)for(typeof r.preRun==`function`&&(r.preRun=[r.preRun]);r.preRun.length;)E(r.preRun.shift());S(T)}function m(){d=!0,L.c()}function h(){if(r.postRun)for(typeof r.postRun==`function`&&(r.postRun=[r.postRun]);r.postRun.length;)w(r.postRun.shift());S(C)}var g;function _(){return c(`\\0asm\\0\\0\\0\\`\\`\\0\\`\n\\0\\`\\0\\0\\x07aa\\0\\0\\0\\0\\x07‚€€\\bA€Œ\\v\\x07b\\0c\\0d\\0e\\0f\\0\\f\nü8T~@A€\\b(\\0\"­ \\0­B\\x07|Bøÿÿÿƒ|\"BÿÿÿÿX@ §\"\\0?\\0AtM\\r \\0\\0\\r\\vA„\\bA06\\0A\\vA€\\b \\x006\\0 \\vß\\v\\b@ \\0E\\r\\0 \\0A\\bk\" \\0Ak(\\0\"Axq\"\\0j!@ Aq\\r\\0 AqE\\r  (\\0\"k\"A˜\\b(\\0I\\r \\0 j!\\0@@@Aœ\\b(\\0 G@ (\\f! AÿM@  (\\b\"G\\rAˆ\\bAˆ\\b(\\0A~ Avwq6\\0\\f\\v (!\\x07  G@ (\\b\" 6\\f  6\\b\\f\\v (\" Aj (\"E\\r Aj\\v!@ ! \"Aj! (\"\\r\\0 Aj! (\"\\r\\0\\v A\\x006\\0\\f\\v (\"AqAG\\rA\\b \\x006\\0  A~q6  \\0Ar6  \\x006\\0\\v  6\\f  6\\b\\f\\vA\\0!\\v \\x07E\\r\\0@ (\"At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ wq6\\0\\f\\v@  \\x07(F@ \\x07 6\\f\\v \\x07 6\\v E\\r\\v  \\x076 (\"@  6  6\\v (\"E\\r\\0  6  6\\v  O\\r\\0 (\"AqE\\r\\0@@@@ AqE@A\\xA0\\b(\\0 F@A\\xA0\\b 6\\0A”\\bA”\\b(\\0 \\0j\"\\x006\\0  \\0Ar6 Aœ\\b(\\0G\\rA\\bA\\x006\\0Aœ\\bA\\x006\\0\\vAœ\\b(\\0\"\\x07 F@Aœ\\b 6\\0A\\bA\\b(\\0 \\0j\"\\x006\\0  \\0Ar6 \\0 j \\x006\\0\\v Axq \\0j!\\0 (\\f! AÿM@ (\\b\" F@Aˆ\\bAˆ\\b(\\0A~ Avwq6\\0\\f\\v  6\\f  6\\b\\f\\v (!\\b  G@ (\\b\" 6\\f  6\\b\\f\\v (\" Aj (\"E\\r Aj\\v!@ ! \"Aj! (\"\\r\\0 Aj! (\"\\r\\0\\v A\\x006\\0\\f\\v  A~q6  \\0Ar6 \\0 j \\x006\\0\\f\\vA\\0!\\v \\bE\\r\\0@ (\"At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ wq6\\0\\f\\v@  \\b(F@ \\b 6\\f\\v \\b 6\\v E\\r\\v  \\b6 (\"@  6  6\\v (\"E\\r\\0  6  6\\v  \\0Ar6 \\0 j \\x006\\0  \\x07G\\r\\0A\\b \\x006\\0\\v \\0AÿM@ \\0AøqA°\\bj!Aˆ\\b(\\0\"A \\0Avt\"\\0qE@Aˆ\\b \\0 r6\\0 \\f\\v (\\b\\v!\\0  6\\b \\0 6\\f  6\\f  \\x006\\b\\vA! \\0Aÿÿÿ\\x07M@ \\0A& \\0A\\bvg\"kvAq AtrA>s!\\v  6 B\\x007 AtA¸\nj!@AŒ\\b(\\0\"A t\"qE@AŒ\\b  r6\\0  6\\0A!A\\b\\f\\v \\0A AvkA\\0 AG\\x1Bt! (\\0!@ \"(Axq \\0F\\r Av! At!  Aqj\"(\"\\r\\0\\v  6A! !A\\b\\v!\\0 \"\\f\\v (\\b\" 6\\f  6\\bA!\\0A\\b!A\\0\\v!  j 6\\0  6\\f \\0 j 6\\0A¨\\bA¨\\b(\\0Ak\"\\0A \\0\\x1B6\\0\\v\\v¸'\\v#\\0Ak\"\n$\\0@@@@@@@@@@ \\0AôM@Aˆ\\b(\\0\"A \\0A\\vjAøq \\0A\\vI\\x1B\"Av\"\\0v\"Aq@@ AsAq \\0j\"At\"A°\\bj\"\\0 (¸\\b\"(\\b\"F@Aˆ\\b A~ wq6\\0\\f\\v  \\x006\\f \\0 6\\b\\v A\\bj!\\0  Ar6  j\" (Ar6\\f\\v\\v A\\b(\\0\"\\bM\\r @@A \\0t\"A\\0 kr  \\0tqh\"At\"A°\\bj\" (¸\\b\"\\0(\\b\"F@Aˆ\\b A~ wq\"6\\0\\f\\v  6\\f  6\\b\\v \\0 Ar6 \\0 j\"\\x07  k\"Ar6 \\0 j 6\\0 \\b@ \\bAxqA°\\bj!Aœ\\b(\\0! A \\bAvt\"qE@Aˆ\\b  r6\\0 \\f\\v (\\b\\v!  6\\b  6\\f  6\\f  6\\b\\v \\0A\\bj!\\0Aœ\\b \\x076\\0A\\b 6\\0\\f\\v\\vAŒ\\b(\\0\"\\vE\\r \\vhAt(¸\n\"(Axq k! !@@ (\"\\0E@ (\"\\0E\\r\\v \\0(Axq k\"   I\"\\x1B! \\0  \\x1B! \\0!\\f\\v\\v (!  (\\f\"\\0G@ (\\b\" \\x006\\f \\0 6\\b\\f\n\\v (\" Aj (\"E\\r Aj\\v!@ !\\x07 \"\\0Aj! \\0(\"\\r\\0 \\0Aj! \\0(\"\\r\\0\\v \\x07A\\x006\\0\\f \\vA! \\0A¿K\\r\\0 \\0A\\vj\"Axq!AŒ\\b(\\0\"\\x07E\\r\\0A!\\bA\\0 k! \\0Aôÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtkA>j!\\b\\v@@@ \\bAt(¸\n\"E@A\\0!\\0\\f\\vA\\0!\\0 A \\bAvkA\\0 \\bAG\\x1Bt!@@ (Axq k\" O\\r\\0 ! \"\\r\\0A\\0! !\\0\\f\\v \\0 (\"   AvAqj(\"F\\x1B \\0 \\x1B!\\0 At! \\r\\0\\v\\v \\0 rE@A\\0!A \\bt\"\\0A\\0 \\0kr \\x07q\"\\0E\\r \\0hAt(¸\n!\\0\\v \\0E\\r\\v@ \\0(Axq k\" I!   \\x1B! \\0  \\x1B! \\0(\"  \\0(\\v\"\\0\\r\\0\\v\\v E\\r\\0 A\\b(\\0 kO\\r\\0 (!\\b  (\\f\"\\0G@ (\\b\" \\x006\\f \\0 6\\b\\f\\b\\v (\" Aj (\"E\\r Aj\\v!@ ! \"\\0Aj! \\0(\"\\r\\0 \\0Aj! \\0(\"\\r\\0\\v A\\x006\\0\\f\\x07\\v A\\b(\\0\"M@Aœ\\b(\\0!\\0@  k\"AO@ \\0 j\" Ar6 \\0 j 6\\0 \\0 Ar6\\f\\v \\0 Ar6 \\0 j\" (Ar6A\\0!A\\0!\\vA\\b 6\\0Aœ\\b 6\\0 \\0A\\bj!\\0\\f \\v A”\\b(\\0\"I@A”\\b  k\"6\\0A\\xA0\\bA\\xA0\\b(\\0\"\\0 j\"6\\0  Ar6 \\0 Ar6 \\0A\\bj!\\0\\f \\vA\\0!\\0 A/j\"Aà\\v(\\0@Aè\\v(\\0\\f\\vAì\\vB7\\0Aä\\vB€\\xA0€€€€7\\0Aà\\v \nA\\fjApqAتժs6\\0Aô\\vA\\x006\\0AÄ\\vA\\x006\\0A€ \\v\"j\"A\\0 k\"\\x07q\" M\\r\\bAÀ\\v(\\0\"@A¸\\v(\\0\"\\b j\" \\bM  Ir\\r \\v@AÄ\\v-\\0\\0AqE@@@@@A\\xA0\\b(\\0\"@AÈ\\v!\\0@ \\0(\\0\"\\b M@  \\b \\0(jI\\r\\v \\0(\\b\"\\0\\r\\0\\v\\vA\\0\"AF\\r !Aä\\v(\\0\"\\0Ak\" q@  k  jA\\0 \\0kqj!\\v  M\\rAÀ\\v(\\0\"\\0@A¸\\v(\\0\" j\"\\x07 M \\0 \\x07Ir\\r\\v \"\\0 G\\r\\f\\v  k \\x07q\"\" \\0(\\0 \\0(jF\\r !\\0\\v \\0AF\\r A0j M@ \\0!\\f\\vAè\\v(\\0\"  kjA\\0 kq\"AF\\r  j! \\0!\\f\\v AG\\r\\vAÄ\\vAÄ\\v(\\0Ar6\\0\\v \"AFA\\0\"\\0AFr \\0 Mr\\r \\0 k\" A(jM\\r\\vA¸\\vA¸\\v(\\0 j\"\\x006\\0A¼\\v(\\0 \\0I@A¼\\v \\x006\\0\\v@A\\xA0\\b(\\0\"@AÈ\\v!\\0@  \\0(\\0\" \\0(\"jF\\r \\0(\\b\"\\0\\r\\0\\v\\f\\vA˜\\b(\\0\"\\0A\\0 \\0 M\\x1BE@A˜\\b 6\\0\\vA\\0!\\0AÌ\\v 6\\0AÈ\\v 6\\0A¨\\bA6\\0A¬\\bAà\\v(\\x006\\0AÔ\\vA\\x006\\0@ \\0At\" A°\\bj\"6¸\\b  6¼\\b \\0Aj\"\\0A G\\r\\0\\vA”\\b A(k\"\\0Ax kA\\x07q\"k\"6\\0A\\xA0\\b  j\"6\\0  Ar6 \\0 jA(6A¤\\bAð\\v(\\x006\\0\\f\\v  M  Kr\\r \\0(\\fA\\bq\\r \\0  j6A\\xA0\\b Ax kA\\x07q\"\\0j\"6\\0A”\\bA”\\b(\\0 j\" \\0k\"\\x006\\0  \\0Ar6  jA(6A¤\\bAð\\v(\\x006\\0\\f\\vA\\0!\\0\\f\\vA\\0!\\0\\f\\vA˜\\b(\\0 K@A˜\\b 6\\0\\v  j!AÈ\\v!\\0@@  \\0(\\0\"G@ \\0(\\b\"\\0\\r\\f\\v\\v \\0-\\0\\fA\\bqE\\r\\vAÈ\\v!\\0@@ \\0(\\0\" M@   \\0(j\"I\\r\\v \\0(\\b!\\0\\f\\v\\vA”\\b A(k\"\\0Ax kA\\x07q\"k\"\\x076\\0A\\xA0\\b  j\"6\\0  \\x07Ar6 \\0 jA(6A¤\\bAð\\v(\\x006\\0  A' kA\\x07qjA/k\"\\0 \\0 AjI\\x1B\"A\\x1B6 AÐ\\v)\\x007 AÈ\\v)\\x007\\bAÐ\\v A\\bj6\\0AÌ\\v 6\\0AÈ\\v 6\\0AÔ\\vA\\x006\\0 Aj!\\0@ \\0A\\x076 \\0A\\bj \\0Aj!\\0 I\\r\\0\\v  F\\r\\0  (A~q6   k\"Ar6  6\\0 AÿM@ AøqA°\\bj!\\0Aˆ\\b(\\0\"A Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\fA\\f!A\\b\\f\\vA!\\0 Aÿÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtrA>s!\\0\\v  \\x006 B\\x007 \\0AtA¸\nj!@@AŒ\\b(\\0\"A \\0t\"qE@AŒ\\b  r6\\0  6\\0\\f\\v A \\0AvkA\\0 \\0AG\\x1Bt!\\0 (\\0!@ \"(Axq F\\r \\0Av! \\0At!\\0  Aqj\"(\"\\r\\0\\v  6\\v  6A\\b! \"!\\0A\\f\\f\\v (\\b\"\\0 6\\f  6\\b  \\x006\\bA\\0!\\0A!A\\f\\v j 6\\0  j \\x006\\0\\vA”\\b(\\0\"\\0 M\\r\\0A”\\b \\0 k\"6\\0A\\xA0\\bA\\xA0\\b(\\0\"\\0 j\"6\\0  Ar6 \\0 Ar6 \\0A\\bj!\\0\\f\\vA„\\bA06\\0A\\0!\\0\\f\\v \\0 6\\0 \\0 \\0( j6 Ax kA\\x07qj\"\\b Ar6 Ax kA\\x07qj\"  \\bj\"k!\\x07@A\\xA0\\b(\\0 F@A\\xA0\\b 6\\0A”\\bA”\\b(\\0 \\x07j\"\\x006\\0  \\0Ar6\\f\\vAœ\\b(\\0 F@Aœ\\b 6\\0A\\bA\\b(\\0 \\x07j\"\\x006\\0  \\0Ar6 \\0 j \\x006\\0\\f\\v (\"\\0AqAF@ \\0Axq! (\\f!@ \\0AÿM@ (\\b\" F@Aˆ\\bAˆ\\b(\\0A~ \\0Avwq6\\0\\f\\v  6\\f  6\\b\\f\\v (!@  G@ (\\b\"\\0 6\\f  \\x006\\b\\f\\v@ (\"\\0 Aj (\"\\0E\\r Aj\\v!@ ! \\0\"Aj! \\0(\"\\0\\r\\0 Aj! (\"\\0\\r\\0\\v A\\x006\\0\\f\\vA\\0!\\v E\\r\\0@ (\"\\0At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ \\0wq6\\0\\f\\v@  (F@  6\\f\\v  6\\v E\\r\\v  6 (\"\\0@  \\x006 \\0 6\\v (\"\\0E\\r\\0  \\x006 \\0 6\\v \\x07 j!\\x07  j\"(!\\0\\v  \\0A~q6  \\x07Ar6  \\x07j \\x076\\0 \\x07AÿM@ \\x07AøqA°\\bj!\\0Aˆ\\b(\\0\"A \\x07Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\f\\vA! \\x07Aÿÿÿ\\x07M@ \\x07A& \\x07A\\bvg\"\\0kvAq \\0AtrA>s!\\v  6 B\\x007 AtA¸\nj!\\0@@AŒ\\b(\\0\"A t\"qE@AŒ\\b  r6\\0 \\0 6\\0\\f\\v \\x07A AvkA\\0 AG\\x1Bt! \\0(\\0!@ \"\\0(Axq \\x07F\\r Av! At! \\0 Aqj\"(\"\\r\\0\\v  6\\v  \\x006  6\\f  6\\b\\f\\v \\0(\\b\" 6\\f \\0 6\\b A\\x006  \\x006\\f  6\\b\\v \\bA\\bj!\\0\\f\\v@ \\bE\\r\\0@ (\"At\"(¸\n F@ A¸\nj \\x006\\0 \\0\\rAŒ\\b \\x07A~ wq\"\\x076\\0\\f\\v@  \\b(F@ \\b \\x006\\f\\v \\b \\x006\\v \\0E\\r\\v \\0 \\b6 (\"@ \\0 6  \\x006\\v (\"E\\r\\0 \\0 6  \\x006\\v@ AM@   j\"\\0Ar6 \\0 j\"\\0 \\0(Ar6\\f\\v  Ar6  j\" Ar6  j 6\\0 AÿM@ AøqA°\\bj!\\0Aˆ\\b(\\0\"A Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\f\\vA!\\0 Aÿÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtrA>s!\\0\\v  \\x006 B\\x007 \\0AtA¸\nj!@@ \\x07A \\0t\"qE@AŒ\\b  \\x07r6\\0  6\\0  6\\f\\v A \\0AvkA\\0 \\0AG\\x1Bt!\\0 (\\0!@ \"(Axq F\\r \\0Av! \\0At!\\0  Aqj\"\\x07(\"\\r\\0\\v \\x07 6  6\\v  6\\f  6\\b\\f\\v (\\b\"\\0 6\\f  6\\b A\\x006  6\\f  \\x006\\b\\v A\\bj!\\0\\f\\v@ E\\r\\0@ (\"At\"(¸\n F@ A¸\nj \\x006\\0 \\0\\rAŒ\\b \\vA~ wq6\\0\\f\\v@  (F@ \\x006\\f\\v \\x006\\v \\0E\\r\\v \\0 6 (\"@ \\0 6  \\x006\\v (\"E\\r\\0 \\0 6  \\x006\\v@ AM@   j\"\\0Ar6 \\0 j\"\\0 \\0(Ar6\\f\\v  Ar6  j\" Ar6  j 6\\0 \\b@ \\bAxqA°\\bj!\\0Aœ\\b(\\0!A \\bAvt\"\\x07 qE@Aˆ\\b  \\x07r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\vAœ\\b 6\\0A\\b 6\\0\\v A\\bj!\\0\\v \nAj$\\0 \\0\\v†\n} \\bA\\0A€€ü\\v\\0 A\\0A€€ü\\v\\0A!\n@  \\fF@A\\0!\\0@ \\0A€€F@A\\0!\\0@ \\0 F@A\\0!\\fA\\0!\\0@ \\0A€€F@A\\0!\\0 \\0Atj\"(\\0  \\f6\\0 \\0Aj!\\0 \\fj!\\f\\f\\v\\v@ \\0 FE@  \\x07 \\0Atj(\\0\"Atj/Atj\" (\\0\"Aj6\\0  Atj 6\\0 \\0Aj!\\0\\f\\v\\v \\b  \\0Atj/\\0Atj\" (\\0\"Aj6\\0 \\x07 Atj \\x006\\0 \\0Aj!\\0\\f\\v\\v \\b \\0Atj\"(\\0  \\r6\\0 \\0Aj!\\0 \\rj!\\r\\f\\v\\v  \\fA\\flj\"\\v*\\0! \\v*\\b! \\v*! \n  \\fAt\"j(\\0\"\\vG@  \\vAÐ\\0lj\"\n*< \\0*8\"” \n*8 \\0*(\"” \n*0 \\0*\\b\"” \\0*\" \n*4”’’’! \n*, ” \n*( ” \n* ”  \n*$”’’’! \n* ” \n* ” \n* ”  \n*”’’’! \n*\\f ” \n*\\b ” \n*\\0 ” \n* ”’’’! \\v!\n\\v  j   ”  ”  ”’’’¼\"\\v \\vAsAÿÿÿÿ\\x07q \\vA\\0H\\x1B\"\\v6\\0 \\b \\vAÿÿqAtj\" (\\0Aj6\\0 \\vAvAüÿqj\"\\v \\v(\\0Aj6\\0 \\fAj!\\f\\f\\v\\v\\v\\0\\v\\v \\0A\\b\\v`)}function v(e){return e}function y(e,t){var n,r=v(e);return n=new WebAssembly.Module(r),[new WebAssembly.Instance(n,t),n]}function b(){return{a:F}}function x(){function e(e,t){return L=e.exports,P(L),f(),L}var t=b();return r.instantiateWasm?new Promise((n,i)=>{r.instantiateWasm(t,(t,r)=>{n(e(t,r))})}):(g!=null||(g=_()),e(y(g,t)[0]))}for(var S=e=>{for(;e.length>0;)e.shift()(r)},C=[],w=e=>C.push(e),T=[],E=e=>T.push(e),D=()=>2147483648,O=(e,t)=>Math.ceil(e/t)*t,k=e=>{var t=(e-N.buffer.byteLength+65535)/65536|0;try{return N.grow(t),f(),1}catch(e){}},A=e=>{var t=u.length;e>>>=0;var n=D();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),k(Math.min(n,O(Math.max(e,i),65536))))return!0}return!1},j=new Uint8Array(123),M=25;M>=0;--M)j[48+M]=52+M,j[65+M]=M,j[97+M]=26+M;if(j[43]=62,j[47]=63,r.noExitRuntime&&r.noExitRuntime,r.print&&r.print,r.printErr&&r.printErr,r.wasmBinary&&r.wasmBinary,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.preInit)for(typeof r.preInit==`function`&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.shift()();var N;function P(e){r._sort=e.d,r._malloc=e.e,r._free=e.f,N=e.b,e.__indirect_function_table}var F={a:A};function I(){p();function e(){var e;r.calledRun=!0,!s&&(m(),l==null||l(r),(e=r.onRuntimeInitialized)==null||e.call(r),h())}r.setStatus?(r.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>r.setStatus(``),1),e()},1)):e()}var L=x();return I(),t=d?r:new Promise((e,t)=>{l=e}),t}),i.apply(this,arguments)}let a;function o(){return e(this,void 0,void 0,function*(){a=yield r()})}let s,c,l,u,d,f,p,m,h,g,_=0,v=0,y=!1,b=[],x=!0,S=!0,C=!1,w=!1,T=!1;function E(e,t){if(t.length!==16)return!0;for(let n=0;n<16;n++)if(Math.abs(e[n]-t[n])>1e-7)return!0;return!1}let D=[],O=65536,k=()=>e(void 0,void 0,void 0,function*(){if(C){w=!0;return}C=!0,w=!1,a||(yield o());let e=Math.pow(2,Math.ceil(Math.log2(s.vertexCount)));_<e&&(_>0&&(a._free(c),a._free(u),a._free(d),a._free(f),a._free(p),a._free(m)),_=e,c=a._malloc(64),u=a._malloc(_*4),d=a._malloc(3*_*4),f=a._malloc(_*4),p=a._malloc(_*4),m=a._malloc(_*4)),y||(h=a._malloc(O*4),g=a._malloc(O*4),y=!0),v<s.transforms.length&&(v>0&&a._free(l),v=s.transforms.length,l=a._malloc(v*4)),C=!1,w&&(w=!1,yield k())}),A=()=>{if(C||w||!a)return;C=!0,S&&(a.HEAPF32.set(s.positions,d/4),a.HEAPF32.set(s.transforms,l/4),a.HEAPU32.set(s.transformIndices,u/4),S=!1),a.HEAPF32.set(new Float32Array(b),c/4),a._sort(c,l,u,s.vertexCount,d,f,p,m,h,g);let e=s.vertexCount,t=new Uint32Array(a.HEAPU32.buffer,p,e),n=e*4,r=D.pop();(!r||r.byteLength<n)&&(r=new ArrayBuffer(n));let i=new Uint32Array(r,0,e);i.set(t),self.postMessage({depthIndex:i,generation:s.generation},[r]),C=!1,x=!1},j=()=>{T||(T=!0,x&&A(),setTimeout(()=>{T=!1,j()}))};self.onmessage=t=>new Promise(n=>e(void 0,void 0,void 0,function*(){var e;if(t.data.warmup){yield o(),n(!0);return}if(t.data.returnBuffer){D.length<3&&D.push(t.data.returnBuffer),n(!0);return}let r=!1,i=!!t.data.sortData;if(t.data.sortData&&(s={positions:t.data.sortData.positions,transforms:t.data.sortData.transforms,transformIndices:t.data.sortData.transformIndices,vertexCount:t.data.sortData.vertexCount,generation:(e=t.data.sortData.generation)==null?0:e},x=!0,S=!0,yield k(),r=!0),t.data.viewProj){let e=t.data.viewProj;(E(e,b)||i)&&(b=e,x=!0,r=!0)}r&&x&&j(),n(!0)}))})();", Db = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Eb], { type: "text/javascript;charset=utf-8" });
26610
- function Ob(e) {
26645
+ var kb = "(function(){function e(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,`next`,e)}function c(e){t(o,i,a,s,c,`throw`,e)}s(void 0)})}}function r(){return i.apply(this,arguments)}function i(){return i=n(function*(e={}){var t,r=e,i=!1,a=!0,o=self.location.href;if(i||a){try{new URL(`.`,o).href}catch(e){}(function(){var e=n(function*(e){var t=yield fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});return function(t){return e.apply(this,arguments)}})()}console.log.bind(console),console.error.bind(console);var s=!1;function c(e){for(var t=0,n=e.length,r=new Uint8Array(n),i;t<n;++t)i=e.charCodeAt(t),r[t]=~i>>8&i;return r}var l,u,d=!1;function f(){var e=N.buffer;new Int8Array(e),new Int16Array(e),r.HEAPU8=u=new Uint8Array(e),new Uint16Array(e),new Int32Array(e),r.HEAPU32=new Uint32Array(e),r.HEAPF32=new Float32Array(e),new Float64Array(e),new BigInt64Array(e),new BigUint64Array(e)}function p(){if(r.preRun)for(typeof r.preRun==`function`&&(r.preRun=[r.preRun]);r.preRun.length;)E(r.preRun.shift());S(T)}function m(){d=!0,L.c()}function h(){if(r.postRun)for(typeof r.postRun==`function`&&(r.postRun=[r.postRun]);r.postRun.length;)w(r.postRun.shift());S(C)}var g;function _(){return c(`\\0asm\\0\\0\\0\\`\\`\\0\\`\n\\0\\`\\0\\0\\x07aa\\0\\0\\0\\0\\x07‚€€\\bA€Œ\\v\\x07b\\0c\\0d\\0e\\0f\\0\\f\nü8T~@A€\\b(\\0\"­ \\0­B\\x07|Bøÿÿÿƒ|\"BÿÿÿÿX@ §\"\\0?\\0AtM\\r \\0\\0\\r\\vA„\\bA06\\0A\\vA€\\b \\x006\\0 \\vß\\v\\b@ \\0E\\r\\0 \\0A\\bk\" \\0Ak(\\0\"Axq\"\\0j!@ Aq\\r\\0 AqE\\r  (\\0\"k\"A˜\\b(\\0I\\r \\0 j!\\0@@@Aœ\\b(\\0 G@ (\\f! AÿM@  (\\b\"G\\rAˆ\\bAˆ\\b(\\0A~ Avwq6\\0\\f\\v (!\\x07  G@ (\\b\" 6\\f  6\\b\\f\\v (\" Aj (\"E\\r Aj\\v!@ ! \"Aj! (\"\\r\\0 Aj! (\"\\r\\0\\v A\\x006\\0\\f\\v (\"AqAG\\rA\\b \\x006\\0  A~q6  \\0Ar6  \\x006\\0\\v  6\\f  6\\b\\f\\vA\\0!\\v \\x07E\\r\\0@ (\"At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ wq6\\0\\f\\v@  \\x07(F@ \\x07 6\\f\\v \\x07 6\\v E\\r\\v  \\x076 (\"@  6  6\\v (\"E\\r\\0  6  6\\v  O\\r\\0 (\"AqE\\r\\0@@@@ AqE@A\\xA0\\b(\\0 F@A\\xA0\\b 6\\0A”\\bA”\\b(\\0 \\0j\"\\x006\\0  \\0Ar6 Aœ\\b(\\0G\\rA\\bA\\x006\\0Aœ\\bA\\x006\\0\\vAœ\\b(\\0\"\\x07 F@Aœ\\b 6\\0A\\bA\\b(\\0 \\0j\"\\x006\\0  \\0Ar6 \\0 j \\x006\\0\\v Axq \\0j!\\0 (\\f! AÿM@ (\\b\" F@Aˆ\\bAˆ\\b(\\0A~ Avwq6\\0\\f\\v  6\\f  6\\b\\f\\v (!\\b  G@ (\\b\" 6\\f  6\\b\\f\\v (\" Aj (\"E\\r Aj\\v!@ ! \"Aj! (\"\\r\\0 Aj! (\"\\r\\0\\v A\\x006\\0\\f\\v  A~q6  \\0Ar6 \\0 j \\x006\\0\\f\\vA\\0!\\v \\bE\\r\\0@ (\"At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ wq6\\0\\f\\v@  \\b(F@ \\b 6\\f\\v \\b 6\\v E\\r\\v  \\b6 (\"@  6  6\\v (\"E\\r\\0  6  6\\v  \\0Ar6 \\0 j \\x006\\0  \\x07G\\r\\0A\\b \\x006\\0\\v \\0AÿM@ \\0AøqA°\\bj!Aˆ\\b(\\0\"A \\0Avt\"\\0qE@Aˆ\\b \\0 r6\\0 \\f\\v (\\b\\v!\\0  6\\b \\0 6\\f  6\\f  \\x006\\b\\vA! \\0Aÿÿÿ\\x07M@ \\0A& \\0A\\bvg\"kvAq AtrA>s!\\v  6 B\\x007 AtA¸\nj!@AŒ\\b(\\0\"A t\"qE@AŒ\\b  r6\\0  6\\0A!A\\b\\f\\v \\0A AvkA\\0 AG\\x1Bt! (\\0!@ \"(Axq \\0F\\r Av! At!  Aqj\"(\"\\r\\0\\v  6A! !A\\b\\v!\\0 \"\\f\\v (\\b\" 6\\f  6\\bA!\\0A\\b!A\\0\\v!  j 6\\0  6\\f \\0 j 6\\0A¨\\bA¨\\b(\\0Ak\"\\0A \\0\\x1B6\\0\\v\\v¸'\\v#\\0Ak\"\n$\\0@@@@@@@@@@ \\0AôM@Aˆ\\b(\\0\"A \\0A\\vjAøq \\0A\\vI\\x1B\"Av\"\\0v\"Aq@@ AsAq \\0j\"At\"A°\\bj\"\\0 (¸\\b\"(\\b\"F@Aˆ\\b A~ wq6\\0\\f\\v  \\x006\\f \\0 6\\b\\v A\\bj!\\0  Ar6  j\" (Ar6\\f\\v\\v A\\b(\\0\"\\bM\\r @@A \\0t\"A\\0 kr  \\0tqh\"At\"A°\\bj\" (¸\\b\"\\0(\\b\"F@Aˆ\\b A~ wq\"6\\0\\f\\v  6\\f  6\\b\\v \\0 Ar6 \\0 j\"\\x07  k\"Ar6 \\0 j 6\\0 \\b@ \\bAxqA°\\bj!Aœ\\b(\\0! A \\bAvt\"qE@Aˆ\\b  r6\\0 \\f\\v (\\b\\v!  6\\b  6\\f  6\\f  6\\b\\v \\0A\\bj!\\0Aœ\\b \\x076\\0A\\b 6\\0\\f\\v\\vAŒ\\b(\\0\"\\vE\\r \\vhAt(¸\n\"(Axq k! !@@ (\"\\0E@ (\"\\0E\\r\\v \\0(Axq k\"   I\"\\x1B! \\0  \\x1B! \\0!\\f\\v\\v (!  (\\f\"\\0G@ (\\b\" \\x006\\f \\0 6\\b\\f\n\\v (\" Aj (\"E\\r Aj\\v!@ !\\x07 \"\\0Aj! \\0(\"\\r\\0 \\0Aj! \\0(\"\\r\\0\\v \\x07A\\x006\\0\\f \\vA! \\0A¿K\\r\\0 \\0A\\vj\"Axq!AŒ\\b(\\0\"\\x07E\\r\\0A!\\bA\\0 k! \\0Aôÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtkA>j!\\b\\v@@@ \\bAt(¸\n\"E@A\\0!\\0\\f\\vA\\0!\\0 A \\bAvkA\\0 \\bAG\\x1Bt!@@ (Axq k\" O\\r\\0 ! \"\\r\\0A\\0! !\\0\\f\\v \\0 (\"   AvAqj(\"F\\x1B \\0 \\x1B!\\0 At! \\r\\0\\v\\v \\0 rE@A\\0!A \\bt\"\\0A\\0 \\0kr \\x07q\"\\0E\\r \\0hAt(¸\n!\\0\\v \\0E\\r\\v@ \\0(Axq k\" I!   \\x1B! \\0  \\x1B! \\0(\"  \\0(\\v\"\\0\\r\\0\\v\\v E\\r\\0 A\\b(\\0 kO\\r\\0 (!\\b  (\\f\"\\0G@ (\\b\" \\x006\\f \\0 6\\b\\f\\b\\v (\" Aj (\"E\\r Aj\\v!@ ! \"\\0Aj! \\0(\"\\r\\0 \\0Aj! \\0(\"\\r\\0\\v A\\x006\\0\\f\\x07\\v A\\b(\\0\"M@Aœ\\b(\\0!\\0@  k\"AO@ \\0 j\" Ar6 \\0 j 6\\0 \\0 Ar6\\f\\v \\0 Ar6 \\0 j\" (Ar6A\\0!A\\0!\\vA\\b 6\\0Aœ\\b 6\\0 \\0A\\bj!\\0\\f \\v A”\\b(\\0\"I@A”\\b  k\"6\\0A\\xA0\\bA\\xA0\\b(\\0\"\\0 j\"6\\0  Ar6 \\0 Ar6 \\0A\\bj!\\0\\f \\vA\\0!\\0 A/j\"Aà\\v(\\0@Aè\\v(\\0\\f\\vAì\\vB7\\0Aä\\vB€\\xA0€€€€7\\0Aà\\v \nA\\fjApqAتժs6\\0Aô\\vA\\x006\\0AÄ\\vA\\x006\\0A€ \\v\"j\"A\\0 k\"\\x07q\" M\\r\\bAÀ\\v(\\0\"@A¸\\v(\\0\"\\b j\" \\bM  Ir\\r \\v@AÄ\\v-\\0\\0AqE@@@@@A\\xA0\\b(\\0\"@AÈ\\v!\\0@ \\0(\\0\"\\b M@  \\b \\0(jI\\r\\v \\0(\\b\"\\0\\r\\0\\v\\vA\\0\"AF\\r !Aä\\v(\\0\"\\0Ak\" q@  k  jA\\0 \\0kqj!\\v  M\\rAÀ\\v(\\0\"\\0@A¸\\v(\\0\" j\"\\x07 M \\0 \\x07Ir\\r\\v \"\\0 G\\r\\f\\v  k \\x07q\"\" \\0(\\0 \\0(jF\\r !\\0\\v \\0AF\\r A0j M@ \\0!\\f\\vAè\\v(\\0\"  kjA\\0 kq\"AF\\r  j! \\0!\\f\\v AG\\r\\vAÄ\\vAÄ\\v(\\0Ar6\\0\\v \"AFA\\0\"\\0AFr \\0 Mr\\r \\0 k\" A(jM\\r\\vA¸\\vA¸\\v(\\0 j\"\\x006\\0A¼\\v(\\0 \\0I@A¼\\v \\x006\\0\\v@A\\xA0\\b(\\0\"@AÈ\\v!\\0@  \\0(\\0\" \\0(\"jF\\r \\0(\\b\"\\0\\r\\0\\v\\f\\vA˜\\b(\\0\"\\0A\\0 \\0 M\\x1BE@A˜\\b 6\\0\\vA\\0!\\0AÌ\\v 6\\0AÈ\\v 6\\0A¨\\bA6\\0A¬\\bAà\\v(\\x006\\0AÔ\\vA\\x006\\0@ \\0At\" A°\\bj\"6¸\\b  6¼\\b \\0Aj\"\\0A G\\r\\0\\vA”\\b A(k\"\\0Ax kA\\x07q\"k\"6\\0A\\xA0\\b  j\"6\\0  Ar6 \\0 jA(6A¤\\bAð\\v(\\x006\\0\\f\\v  M  Kr\\r \\0(\\fA\\bq\\r \\0  j6A\\xA0\\b Ax kA\\x07q\"\\0j\"6\\0A”\\bA”\\b(\\0 j\" \\0k\"\\x006\\0  \\0Ar6  jA(6A¤\\bAð\\v(\\x006\\0\\f\\vA\\0!\\0\\f\\vA\\0!\\0\\f\\vA˜\\b(\\0 K@A˜\\b 6\\0\\v  j!AÈ\\v!\\0@@  \\0(\\0\"G@ \\0(\\b\"\\0\\r\\f\\v\\v \\0-\\0\\fA\\bqE\\r\\vAÈ\\v!\\0@@ \\0(\\0\" M@   \\0(j\"I\\r\\v \\0(\\b!\\0\\f\\v\\vA”\\b A(k\"\\0Ax kA\\x07q\"k\"\\x076\\0A\\xA0\\b  j\"6\\0  \\x07Ar6 \\0 jA(6A¤\\bAð\\v(\\x006\\0  A' kA\\x07qjA/k\"\\0 \\0 AjI\\x1B\"A\\x1B6 AÐ\\v)\\x007 AÈ\\v)\\x007\\bAÐ\\v A\\bj6\\0AÌ\\v 6\\0AÈ\\v 6\\0AÔ\\vA\\x006\\0 Aj!\\0@ \\0A\\x076 \\0A\\bj \\0Aj!\\0 I\\r\\0\\v  F\\r\\0  (A~q6   k\"Ar6  6\\0 AÿM@ AøqA°\\bj!\\0Aˆ\\b(\\0\"A Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\fA\\f!A\\b\\f\\vA!\\0 Aÿÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtrA>s!\\0\\v  \\x006 B\\x007 \\0AtA¸\nj!@@AŒ\\b(\\0\"A \\0t\"qE@AŒ\\b  r6\\0  6\\0\\f\\v A \\0AvkA\\0 \\0AG\\x1Bt!\\0 (\\0!@ \"(Axq F\\r \\0Av! \\0At!\\0  Aqj\"(\"\\r\\0\\v  6\\v  6A\\b! \"!\\0A\\f\\f\\v (\\b\"\\0 6\\f  6\\b  \\x006\\bA\\0!\\0A!A\\f\\v j 6\\0  j \\x006\\0\\vA”\\b(\\0\"\\0 M\\r\\0A”\\b \\0 k\"6\\0A\\xA0\\bA\\xA0\\b(\\0\"\\0 j\"6\\0  Ar6 \\0 Ar6 \\0A\\bj!\\0\\f\\vA„\\bA06\\0A\\0!\\0\\f\\v \\0 6\\0 \\0 \\0( j6 Ax kA\\x07qj\"\\b Ar6 Ax kA\\x07qj\"  \\bj\"k!\\x07@A\\xA0\\b(\\0 F@A\\xA0\\b 6\\0A”\\bA”\\b(\\0 \\x07j\"\\x006\\0  \\0Ar6\\f\\vAœ\\b(\\0 F@Aœ\\b 6\\0A\\bA\\b(\\0 \\x07j\"\\x006\\0  \\0Ar6 \\0 j \\x006\\0\\f\\v (\"\\0AqAF@ \\0Axq! (\\f!@ \\0AÿM@ (\\b\" F@Aˆ\\bAˆ\\b(\\0A~ \\0Avwq6\\0\\f\\v  6\\f  6\\b\\f\\v (!@  G@ (\\b\"\\0 6\\f  \\x006\\b\\f\\v@ (\"\\0 Aj (\"\\0E\\r Aj\\v!@ ! \\0\"Aj! \\0(\"\\0\\r\\0 Aj! (\"\\0\\r\\0\\v A\\x006\\0\\f\\vA\\0!\\v E\\r\\0@ (\"\\0At\"(¸\n F@ A¸\nj 6\\0 \\rAŒ\\bAŒ\\b(\\0A~ \\0wq6\\0\\f\\v@  (F@  6\\f\\v  6\\v E\\r\\v  6 (\"\\0@  \\x006 \\0 6\\v (\"\\0E\\r\\0  \\x006 \\0 6\\v \\x07 j!\\x07  j\"(!\\0\\v  \\0A~q6  \\x07Ar6  \\x07j \\x076\\0 \\x07AÿM@ \\x07AøqA°\\bj!\\0Aˆ\\b(\\0\"A \\x07Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\f\\vA! \\x07Aÿÿÿ\\x07M@ \\x07A& \\x07A\\bvg\"\\0kvAq \\0AtrA>s!\\v  6 B\\x007 AtA¸\nj!\\0@@AŒ\\b(\\0\"A t\"qE@AŒ\\b  r6\\0 \\0 6\\0\\f\\v \\x07A AvkA\\0 AG\\x1Bt! \\0(\\0!@ \"\\0(Axq \\x07F\\r Av! At! \\0 Aqj\"(\"\\r\\0\\v  6\\v  \\x006  6\\f  6\\b\\f\\v \\0(\\b\" 6\\f \\0 6\\b A\\x006  \\x006\\f  6\\b\\v \\bA\\bj!\\0\\f\\v@ \\bE\\r\\0@ (\"At\"(¸\n F@ A¸\nj \\x006\\0 \\0\\rAŒ\\b \\x07A~ wq\"\\x076\\0\\f\\v@  \\b(F@ \\b \\x006\\f\\v \\b \\x006\\v \\0E\\r\\v \\0 \\b6 (\"@ \\0 6  \\x006\\v (\"E\\r\\0 \\0 6  \\x006\\v@ AM@   j\"\\0Ar6 \\0 j\"\\0 \\0(Ar6\\f\\v  Ar6  j\" Ar6  j 6\\0 AÿM@ AøqA°\\bj!\\0Aˆ\\b(\\0\"A Avt\"qE@Aˆ\\b  r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\f\\vA!\\0 Aÿÿÿ\\x07M@ A& A\\bvg\"\\0kvAq \\0AtrA>s!\\0\\v  \\x006 B\\x007 \\0AtA¸\nj!@@ \\x07A \\0t\"qE@AŒ\\b  \\x07r6\\0  6\\0  6\\f\\v A \\0AvkA\\0 \\0AG\\x1Bt!\\0 (\\0!@ \"(Axq F\\r \\0Av! \\0At!\\0  Aqj\"\\x07(\"\\r\\0\\v \\x07 6  6\\v  6\\f  6\\b\\f\\v (\\b\"\\0 6\\f  6\\b A\\x006  6\\f  \\x006\\b\\v A\\bj!\\0\\f\\v@ E\\r\\0@ (\"At\"(¸\n F@ A¸\nj \\x006\\0 \\0\\rAŒ\\b \\vA~ wq6\\0\\f\\v@  (F@ \\x006\\f\\v \\x006\\v \\0E\\r\\v \\0 6 (\"@ \\0 6  \\x006\\v (\"E\\r\\0 \\0 6  \\x006\\v@ AM@   j\"\\0Ar6 \\0 j\"\\0 \\0(Ar6\\f\\v  Ar6  j\" Ar6  j 6\\0 \\b@ \\bAxqA°\\bj!\\0Aœ\\b(\\0!A \\bAvt\"\\x07 qE@Aˆ\\b  \\x07r6\\0 \\0\\f\\v \\0(\\b\\v! \\0 6\\b  6\\f  \\x006\\f  6\\b\\vAœ\\b 6\\0A\\b 6\\0\\v A\\bj!\\0\\v \nAj$\\0 \\0\\v†\n} \\bA\\0A€€ü\\v\\0 A\\0A€€ü\\v\\0A!\n@  \\fF@A\\0!\\0@ \\0A€€F@A\\0!\\0@ \\0 F@A\\0!\\fA\\0!\\0@ \\0A€€F@A\\0!\\0 \\0Atj\"(\\0  \\f6\\0 \\0Aj!\\0 \\fj!\\f\\f\\v\\v@ \\0 FE@  \\x07 \\0Atj(\\0\"Atj/Atj\" (\\0\"Aj6\\0  Atj 6\\0 \\0Aj!\\0\\f\\v\\v \\b  \\0Atj/\\0Atj\" (\\0\"Aj6\\0 \\x07 Atj \\x006\\0 \\0Aj!\\0\\f\\v\\v \\b \\0Atj\"(\\0  \\r6\\0 \\0Aj!\\0 \\rj!\\r\\f\\v\\v  \\fA\\flj\"\\v*\\0! \\v*\\b! \\v*! \n  \\fAt\"j(\\0\"\\vG@  \\vAÐ\\0lj\"\n*< \\0*8\"” \n*8 \\0*(\"” \n*0 \\0*\\b\"” \\0*\" \n*4”’’’! \n*, ” \n*( ” \n* ”  \n*$”’’’! \n* ” \n* ” \n* ”  \n*”’’’! \n*\\f ” \n*\\b ” \n*\\0 ” \n* ”’’’! \\v!\n\\v  j   ”  ”  ”’’’¼\"\\v \\vAsAÿÿÿÿ\\x07q \\vA\\0H\\x1B\"\\v6\\0 \\b \\vAÿÿqAtj\" (\\0Aj6\\0 \\vAvAüÿqj\"\\v \\v(\\0Aj6\\0 \\fAj!\\f\\f\\v\\v\\v\\0\\v\\v \\0A\\b\\v`)}function v(e){return e}function y(e,t){var n,r=v(e);return n=new WebAssembly.Module(r),[new WebAssembly.Instance(n,t),n]}function b(){return{a:F}}function x(){function e(e,t){return L=e.exports,P(L),f(),L}var t=b();return r.instantiateWasm?new Promise((n,i)=>{r.instantiateWasm(t,(t,r)=>{n(e(t,r))})}):(g!=null||(g=_()),e(y(g,t)[0]))}for(var S=e=>{for(;e.length>0;)e.shift()(r)},C=[],w=e=>C.push(e),T=[],E=e=>T.push(e),D=()=>2147483648,O=(e,t)=>Math.ceil(e/t)*t,k=e=>{var t=(e-N.buffer.byteLength+65535)/65536|0;try{return N.grow(t),f(),1}catch(e){}},A=e=>{var t=u.length;e>>>=0;var n=D();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),k(Math.min(n,O(Math.max(e,i),65536))))return!0}return!1},j=new Uint8Array(123),M=25;M>=0;--M)j[48+M]=52+M,j[65+M]=M,j[97+M]=26+M;if(j[43]=62,j[47]=63,r.noExitRuntime&&r.noExitRuntime,r.print&&r.print,r.printErr&&r.printErr,r.wasmBinary&&r.wasmBinary,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.preInit)for(typeof r.preInit==`function`&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.shift()();var N;function P(e){r._sort=e.d,r._malloc=e.e,r._free=e.f,N=e.b,e.__indirect_function_table}var F={a:A};function I(){p();function e(){var e;r.calledRun=!0,!s&&(m(),l==null||l(r),(e=r.onRuntimeInitialized)==null||e.call(r),h())}r.setStatus?(r.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>r.setStatus(``),1),e()},1)):e()}var L=x();return I(),t=d?r:new Promise((e,t)=>{l=e}),t}),i.apply(this,arguments)}let a;function o(){return e(this,void 0,void 0,function*(){a=yield r()})}let s,c,l,u,d,f,p,m,h,g,_=0,v=0,y=!1,b=[],x=!0,S=!0,C=!1,w=!1,T=!1;function E(e,t){if(t.length!==16)return!0;for(let n=0;n<16;n++)if(Math.abs(e[n]-t[n])>1e-7)return!0;return!1}let D=[],O=65536,k=()=>e(void 0,void 0,void 0,function*(){if(C){w=!0;return}C=!0,w=!1,a||(yield o());let e=Math.pow(2,Math.ceil(Math.log2(s.vertexCount)));_<e&&(_>0&&(a._free(c),a._free(u),a._free(d),a._free(f),a._free(p),a._free(m)),_=e,c=a._malloc(64),u=a._malloc(_*4),d=a._malloc(3*_*4),f=a._malloc(_*4),p=a._malloc(_*4),m=a._malloc(_*4)),y||(h=a._malloc(O*4),g=a._malloc(O*4),y=!0),v<s.transforms.length&&(v>0&&a._free(l),v=s.transforms.length,l=a._malloc(v*4)),C=!1,w&&(w=!1,yield k())}),A=()=>{if(C||w||!a)return;C=!0,S&&(a.HEAPF32.set(s.positions,d/4),a.HEAPF32.set(s.transforms,l/4),a.HEAPU32.set(s.transformIndices,u/4),S=!1),a.HEAPF32.set(new Float32Array(b),c/4),a._sort(c,l,u,s.vertexCount,d,f,p,m,h,g);let e=s.vertexCount,t=new Uint32Array(a.HEAPU32.buffer,p,e),n=e*4,r=D.pop();(!r||r.byteLength<n)&&(r=new ArrayBuffer(n));let i=new Uint32Array(r,0,e);i.set(t),self.postMessage({depthIndex:i,generation:s.generation},[r]),C=!1,x=!1},j=()=>{T||(T=!0,x&&A(),setTimeout(()=>{T=!1,j()}))};self.onmessage=t=>new Promise(n=>e(void 0,void 0,void 0,function*(){var e;if(t.data.warmup){yield o(),n(!0);return}if(t.data.returnBuffer){D.length<3&&D.push(t.data.returnBuffer),n(!0);return}let r=!1,i=!!t.data.sortData;if(t.data.sortData&&(s={positions:t.data.sortData.positions,transforms:t.data.sortData.transforms,transformIndices:t.data.sortData.transformIndices,vertexCount:t.data.sortData.vertexCount,generation:(e=t.data.sortData.generation)==null?0:e},x=!0,S=!0,yield k(),r=!0),t.data.viewProj){let e=t.data.viewProj;(E(e,b)||i)&&(b=e,x=!0,r=!0)}r&&x&&j(),n(!0)}))})();", Ab = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", kb], { type: "text/javascript;charset=utf-8" });
26646
+ function jb(e) {
26611
26647
  let t;
26612
26648
  try {
26613
- if (t = Db && (self.URL || self.webkitURL).createObjectURL(Db), !t) throw "";
26649
+ if (t = Ab && (self.URL || self.webkitURL).createObjectURL(Ab), !t) throw "";
26614
26650
  let n = new Worker(t, { name: e == null ? void 0 : e.name });
26615
26651
  return n.addEventListener("error", () => {
26616
26652
  (self.URL || self.webkitURL).revokeObjectURL(t);
26617
26653
  }), n;
26618
26654
  } catch (t) {
26619
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Eb), { name: e == null ? void 0 : e.name });
26655
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(kb), { name: e == null ? void 0 : e.name });
26620
26656
  }
26621
26657
  }
26622
26658
  //#endregion
26623
26659
  //#region build/five/model/shaders/pbm_gaussian_splatting/vertex.js
26624
- var kb = function(...e) {
26660
+ var Mb = function(...e) {
26625
26661
  return e[0].split("").map((e) => e.charCodeAt(0) > 126 ? e : String.fromCharCode((e.charCodeAt(0) + 113) % 126)).join("");
26626
- }("}rpvv|{-uvtu}-sy|nH}rpvv|{-uvtu}-v{H0vsqrs-b`Rl\\_QR_laReab_R{vs|z-uvtu}-nz}yr?Q-l|qrar\x07rH{vs|z-v{-l|qrdvquH{vs|z-v{-l{z]|v{H0ryrnvor-sy|n-}ynV{qr\x07H0r{qvs{vs|z-uvtu}-nz}yr?Q-lr\x07rH{vs|z-uvtu}-nz}yr?Q-ln{s|zH{vs|z-uvtu}-nz}yr?Q-luar\x07rH{vs|z-rp?-luar\x07r`v rH{vs|z-v{-lzn\x07`uQrtrrH0vs-[bZlT`lPYV]]R_`-K-=----{vs|z-rp?-lyn\brPyv}}r_n{trh[bZlT`lYNfR_`jH----{vs|z-znA-lpyv}}rZnvprV{rrh[bZlT`lPYV]]R_`jH0r{qvs{vs|z-rp?-r|yv|{H0vs-R[NOYRlT`lV[ValN[VZNaV\\[{vs|z-sy|n-lnttrtnv|{]|trH{vs|z-sy|n-lnttrtnv|{]|v{Qnv|{H{vs|z-rp@-lnttrtnv|{O|{qZv{H{vs|z-rp@-lnttrtnv|{O|{qZn\x07H0r{qvsn\bv{t-rpA-P|y|Hn\bv{t-rp?-]|vv|{Hn\bv{t-rp?-bHp|{-sy|n-xr{ry?Q`v r-J-=;@Hp|{-sy|n-zn\x07`prr{`}npr`}yn`v r-J-?=AE;=Hp|{-sy|n-`UlP>-J-=;AEEC=?B>>F=?F>FFHp|{-sy|n-`UlP?l=-J->;=F?BAEAHp|{-sy|n-`UlP?l>-J-:>;=F?BAEAHp|{-sy|n-`UlP?l?-J-=;@>B@F>CHp|{-sy|n-`UlP?l@-J-:>;=F?BAEAHp|{-sy|n-`UlP?lA-J-=;BAC?DA?Hrp?-tr`UQnnbc5v{-}ynVq\x079-v{-p|z}|{r{\\ssr9-rp?-r\x07r`v r6-\n----v{-uP|z}|{r{P|{-J-=H----vs-5lzn\x07`uQrtrr-KJ->6-uP|z}|{r{P|{-8J-FH----vs-5lzn\x07`uQrtrr-KJ-?6-uP|z}|{r{P|{-8J->BH----vs-5lzn\x07`uQrtrr-KJ-@6-uP|z}|{r{P|{-8J-?>H----v{-}nqqrqP|z}|{r{P|{-J-uP|z}|{r{P|{H----vs-5}nqqrqP|z}|{r{P|{-2-A-.J-=6-\n--------}nqqrqP|z}|{r{P|{-J-55}nqqrqP|z}|{r{P|{-<-A6-8->6-7-AH----\f----sy|n-yv{rnP|z}|{r{V{qr\x07-J-sy|n5}ynVq\x07-7-}nqqrqP|z}|{r{P|{-8-p|z}|{r{\\ssr6H----sy|n-r\x07ryV{qr\x07-J-yv{rnP|z}|{r{V{qr\x07-<-A;=H----sy|n-q-J-r\x07ryV{qr\x07-<-r\x07r`v r;\x07H----sy|n-\b-J-sy||5q6-<-r\x07r`v r;\bH----sy|n-\x07-J-snp5q6H----r{-rp?5\x079-\b6H\f|vq-znv{-56-\n0vsqrs-b`Rl\\_QR_laReab_R----<<-|qr-走纹理:用实例号从-|qrar\x07r-取本实例要画的全局点索引----vrp?-|qrP||q-J-vrp?5tylV{n{prVQ-2-l|qrdvqu9-tylV{n{prVQ-<-l|qrdvqu6H----v{-}ynV{qr\x07b-J-r\x07rySrpu5l|qrar\x07r9-|qrP||q9-=6;H----<<-r|qr-标记为-`R[aV[RY5KJ-{z]|v{6-的实例被剔除----vs-5}ynV{qr\x07b-KJ-v{5l{z]|v{66-\n--------tyl]|vv|{-J-rpA5=;=9-=;=9-?;=9->;=6H--------r{H----\f0ryr----v{-}ynV{qr\x07b-J-v{5}ynV{qr\x07-8-=;B6H0r{qvs----v{-}ynV{qr\x07V-J-v{5}ynV{qr\x07b6H----<<-每-}yn-?-r\x07ry-5_TON@?bV6G----<<-r\x07ry-=G-h}|els@?ov9-}|fls@?ov9-}|gls@?ov9-_TONl}npxrqj----<<-r\x07ry->G-hp|==\vp|=>5unys?69-p|=?\vp|>>5unys?69-p|>?\vp|??5unys?69-n{s|zV{qr\x07II>C\vyn\brV{qr\x07j----v{-onrar\x07ry-J-}ynV{qr\x07b-7-?H----v{-r\x07dvqu-J-v{5r\x07r`v r5lr\x07r9-=6;\x076H----vrp?-p||q=-J-vrp?5onrar\x07ry-2-r\x07dvqu9-onrar\x07ry-<-r\x07dvqu6H----vrp?-p||q>-J-vrp?55onrar\x07ry-8->6-2-r\x07dvqu9-5onrar\x07ry-8->6-<-r\x07dvqu6H----rpA-=-J-r\x07rySrpu5lr\x07r9-p||q=9-=6H----rpA->-J-r\x07rySrpu5lr\x07r9-p||q>9-=6H----<<-全精度位置-5|owrp-}npr6----rp@-}ynPr{r-J-rp@5--------v{Ova|Sy|n5=;69--------v{Ova|Sy|n5=;t69--------v{Ova|Sy|n5=;o6----6H----<<-颜色----rpA-p|y|-J-rpA5--------sy|n5=;n-3-=\x07SS69--------sy|n55=;n-KK-E6-3-=\x07SS69--------sy|n55=;n-KK->C6-3-=\x07SS69--------sy|n55=;n-KK-?A6-3-=\x07SS6----6-<-?BB;=H----<<-预计算的-@Q-协方差(|owrp-}npr),对称矩阵-C-分量-5unys:}rpvv|{6----rp?-p|ln-J-{}npxUnys?\x07>C5>;6H--<<-5p|==9-p|=>6----rp?-p|lo-J-{}npxUnys?\x07>C5>;t6H--<<-5p|=?9-p|>>6----rp?-p|lp-J-{}npxUnys?\x07>C5>;o6H--<<-5p|>?9-p|??6----zn@-cx-J-zn@5--------p|ln;\x079-p|ln;\b9-p|lo;\x079--------p|ln;\b9-p|lo;\b9-p|lp;\x079--------p|lo;\x079-p|lp;\x079-p|lp;\b----6H----<<-n{s|zV{qr\x07-和-yn\brV{qr\x07-从->;n-解包----v{-n{s|zV{qr\x07-J->;n-KK->CH----v{-yn\brV{qr\x07-J->;n-3-=\x07SSSSH----znA-n{s|z-J-znA5--------r\x07rySrpu5ln{s|z9-vrp?5=9-n{s|zV{qr\x0769-=69--------r\x07rySrpu5ln{s|z9-vrp?5>9-n{s|zV{qr\x0769-=69--------r\x07rySrpu5ln{s|z9-vrp?5?9-n{s|zV{qr\x0769-=69--------r\x07rySrpu5ln{s|z9-vrp?5@9-n{s|zV{qr\x0769-=6----6H----znA-n{s|zZ|qrycvrZnv\x07-J-vrZnv\x07-7-n{s|zH----rpA-|yqPr{r-J-n{s|z-7-rpA5}ynPr{r9->;=6H0vs-R[NOYRlT`lV[ValN[VZNaV\\[----sy|n-y|pny]|tr-J-lnttrtnv|{]|trH----sy|n-pnyr]|tr-J-=;=H----o||y-v{O|{qS|Nttrtnv|{-J-snyrH----vs-5lnttrtnv|{]|tr-I->;=6-\n--------o||y-v{O|{q-J-|yqPr{r;\x07-KJ-lnttrtnv|{O|{qZv{;\x07---------------------33-|yqPr{r;\x07-IJ-lnttrtnv|{O|{qZn\x07;\x07---------------------33-|yqPr{r; -KJ-lnttrtnv|{O|{qZv{; ---------------------33-|yqPr{r; -IJ-lnttrtnv|{O|{qZn\x07; H--------vs-5v{O|{q6-\n------------v{O|{qS|Nttrtnv|{-J-rH------------sy|n-urvtu_n{tr-J-lnttrtnv|{O|{qZn\x07;\b-:-lnttrtnv|{O|{qZv{;\bH------------sy|n-{|znyv rqUrvtu-J-urvtu_n{tr-K-=;==>----------------L-pynz}55|yqPr{r;\b-:-lnttrtnv|{O|{qZv{;\b6-<-urvtu_n{tr9-=;=9->;=6----------------G-=;BH------------sy|n-}|v{Q-J-pynz}5lnttrtnv|{]|v{Qnv|{9-=;=>9->;=6H------------sy|n-navzr-J-5>;=-:-{|znyv rqUrvtu6-7-5>;=-:-}|v{Q6H------------y|pny]|tr-J-pynz}55lnttrtnv|{]|tr-:-navzr6-<-}|v{Q9-=;=9->;=6H------------sy|n-|ssr]|tr-J-z||ur}5=;=9->;=9-y|pny]|tr6H------------pnyr]|tr-J-y|pny]|tr-7-y|pny]|tr-7-y|pny]|trH------------rp@-nttrtnv|{Pr{r-J-5lnttrtnv|{O|{qZv{-8-lnttrtnv|{O|{qZn\x076-<-?;=H------------rp@-qv-J-|yqPr{r;\x07\b -:-nttrtnv|{Pr{rH------------sy|n-qv-J-yr{tu5qv6H------------sy|n-n{q`rrq-J-q|5}ynPr{r9-rp@5>?;FEFE9-DE;?@@9-AB;>CA66H------------sy|n-n{qQv-J-snp5v{5n{q`rrq6-7-A@DBE;BAB@6H------------sy|n-n{tyr-J-n{q`rrq-7->=;=H------------rp@-pnrQv-J-{|znyv r5rp@5----------------p|5n{tyr69----------------zv\x075:=;D9-=;>9-snp5v{5n{q`rrq-7->;D6-7-A@DBE;BAB@669----------------v{5n{tyr6------------66H------------sy|n-r\x07}y|v|{Snp|-J-5>;=-:-|ssr]|tr6-7-5>;=-8->;=-7-n{qQv6H------------rp@-|ssr-J-pnrQv-7-qv-7-r\x07}y|v|{Snp|H------------|yqPr{r;\x07\b -8J-|ssrH------------}ynPr{r-J-5v{rr5n{s|z6-7-|yqPr{r6;\x07\b H--------\f----\f0r{qvs----0vs-[bZlT`lPYV]]R_`-K-=----vs-5yn\brV{qr\x07-I-v{5[bZlT`lYNfR_`66-\n--------rp?-pyv}_n{tr-J-lyn\brPyv}}r_n{trhyn\brV{qr\x07jH--------v{-pyv}`n-J-v{5pyv}_n{tr;\x07-8-=;B6H--------v{-pyv}P|{-J-v{5pyv}_n{tr;\b-8-=;B6H--------v{-pyv}R{q-J-pyv}`n-8-pyv}P|{H--------s|-5v{-v-J-=H-v-I-[bZlT`lPYV]]R_`H-v886-\n----------------vs-5v-I-pyv}`n-\v\v-v-KJ-pyv}R{q6-\n--------------------p|{v{rH----------------\f----------------rpA-pyv}}r]|vv|{-J-lpyv}}rZnvprV{rrhvj-7-|yqPr{rH----------------o||y-pyv}}rq-J-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH----------------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH----------------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH----------------vs-5pyv}}rq6-\n--------------------tyl]|vv|{-J-rpA5=;=9-=;=9-?;=9->;=6H--------------------r{H----------------\f--------\f----\f----0r{qvs----rpA-vrPr{r-J-n{s|zZ|qrycvrZnv\x07-7-rpA5}ynPr{r9->;=6H----rpA-pyv}Pr{r-J-}|wrpv|{Znv\x07-7-vrPr{rH----sy|n-pyv}-J->;?-7-pyv}Pr{r;H----vs-5pyv}Pr{r; -I-:pyv}Pr{r;-\v\v-pyv}Pr{r; -K-pyv}Pr{r;-\v\v--------pyv}Pr{r;\x07-I-:pyv}-\v\v-pyv}Pr{r;\x07-K-pyv}-\v\v--------pyv}Pr{r;\b-I-:pyv}-\v\v-pyv}Pr{r;\b-K-pyv}6-\n--------tyl]|vv|{-J-rpA5=;=9-=;=9-?;=9->;=6H--------r{H----\f----rp@-{qpPr{r-J-pyv}Pr{r;\x07\b -<-pyv}Pr{r;H----]|vv|{-J-}|vv|{;\x07\bH----rp?-s|pny-J-rp?5--------}|wrpv|{Znv\x07h=jh=j-7-r|yv|{;\x07-7-=;B9--------}|wrpv|{Znv\x07h>jh>j-7-r|yv|{;\b-7-=;B----6H----o||y-v\\u|tn}uvp-J-}|wrpv|{Znv\x07h@jh@j-K-=;DH----zn@-WH----vs-5v\\u|tn}uvp6-\n--------W-J-n{}|r5zn@5------------s|pny;\x079-=;=9-=;=9------------=;=9-s|pny;\b9-=;=9------------=;=9-=;=9-=;=--------66H----\f-ryr-\n--------sy|n--J->;=-<-5vrPr{r; -7-vrPr{r; 6H--------W-J-zn@5------------s|pny;\x07-<-vrPr{r; 9-=;=9-:5s|pny;\x07-7-vrPr{r;\x076-7-9------------=;=9-s|pny;\b-<-vrPr{r; 9-:5s|pny;\b-7-vrPr{r;\b6-7-9------------=;=9-=;=9-=;=--------6H----\f----zn@-d-J-n{}|r5zn@5n{s|zZ|qrycvrZnv\x0766H----zn@-a-J-d-7-WH----<<-@Q-→-?Q-协方差投影-5nyvt{rq-vu-t}yn-_r{qr]|tnz6----zn@-p|?Qz-J-n{}|r5a6-7-cx-7-aH----p|?Qzh=jh=j-8J-xr{ry?Q`v rH----p|?Qzh>jh>j-8J-xr{ry?Q`v rH----sy|n-zvq-J-5p|?Qzh=jh=j-8-p|?Qzh>jh>j6-<-?;=H----sy|n-nqv-J-yr{tu5rp?55p|?Qzh=jh=j-:-p|?Qzh>jh>j6-<-?;=9-p|?Qzh=jh>j66H----sy|n-ynzoqn>-J-zvq-8-nqvH----sy|n-ynzoqn?-J-zvq-:-nqvH----vs-5ynzoqn?-I-=;=6-\n--------r{H----\f----rp?-qvnt|{nycrp|-J-{|znyv r5rp?5p|?Qzh=jh>j9-ynzoqn>-:-p|?Qzh=jh=j66H----<<-协方差已在-}npx-阶段-×A(与-t}yn-对齐),故用-\05?7ynzoqn6-而非-\05E7ynzoqn6----rp?-znw|N\x07v-J-zv{5\05?;=-7-ynzoqn>69-zn\x07`prr{`}npr`}yn`v r6-7-qvnt|{nycrp|H----rp?-zv{|N\x07v-J-zv{5\05?;=-7-ynzoqn?69-zn\x07`prr{`}npr`}yn`v r6-7-rp?5qvnt|{nycrp|;\b9-:qvnt|{nycrp|;\x076H----<<-\0nq-顶点为-h:?9?j,等价于-t}yn-的-}|vv|{-7-n\x07v-<-vr}|----rp?-onvcvr}|-J-rp?5>;=-<-r|yv|{;\x079->;=-<-r|yv|{;\b6H----rp?-{qp\\ssr-J-5]|vv|{;\x07-7-znw|N\x07v-8-]|vv|{;\b-7-zv{|N\x07v6-7-onvcvr}|H0vs-R[NOYRlT`lV[ValN[VZNaV\\[----sy|n-sv{ny`pnyr]|tr-J-v{O|{qS|Nttrtnv|{-L-pnyr]|tr-G-5lnttrtnv|{]|tr-7-lnttrtnv|{]|tr-7-lnttrtnv|{]|tr6H----{qp\\ssr-7J-zv\x075=;>9->;=9-sv{ny`pnyr]|tr6H0r{qvs----rpA-\0nq]|-J-rpA5{qpPr{r;\x07\b-8-{qp\\ssr9-{qpPr{r; 9->;=6H----tyl]|vv|{-J-\0nq]|H----vs-5lzn\x07`uQrtrr-KJ->6-\n--------rp@-pnzrn]|V{\\owrp-J-rp@5v{rr5n{s|z6-7-rpA5pnzrn]|vv|{9->;=66H--------rp@-|owrpcvrQv-J-{|znyv r5}ynPr{r-:-pnzrn]|V{\\owrp6H--------rpA-u=>?@-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-=9-luar\x07r`v r66H--------rpA-uABCD-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-A9-luar\x07r`v r66H--------rpA-uEF>=>>-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-E9-luar\x07r`v r66H--------rp@-u>-J-u=>?@;toH--------rp@-u?-J-rp@5u=>?@;n9-uABCD;t6H--------rp@-u@-J-rp@5uABCD;on9-uEF>=>>;6H--------sy|n-\x07-J-|owrpcvrQv;\x07H--------sy|n-\b-J-|owrpcvrQv;\bH--------sy|n- -J-|owrpcvrQv; H--------rp@-uP|y|-J-u>-7-5:=;AEEC=?B-7-\b6-8-u?-7-5=;AEEC=?B-7- 6-8-u@-7-5:=;AEEC=?B-7-\x076H--------p|y|;to-8J-uP|y|H--------vs-5lzn\x07`uQrtrr-KJ-?6-\n------------rpA-u>?>@>A>B-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9->?9-luar\x07r`v r66H------------rpA-u>C>D>E>F-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9->C9-luar\x07r`v r66H------------rpA-u?=?>???@-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-?=9-luar\x07r`v r66H------------rp@-uA-J-uEF>=>>;tonH------------rp@-uB-J-u>?>@>A>B;toH------------rp@-uC-J-rp@5u>?>@>A>B;n9-u>C>D>E>F;t6H------------rp@-uD-J-rp@5u>C>D>E>F;on9-u?=?>???@;6H------------rp@-uElqrt?-J-u?=?>???@;tonH------------sy|n-\x07\x07-J-\x07-7-\x07H------------sy|n-\b\b-J-\b-7-\bH------------sy|n- -J- -7- H------------sy|n-\x07\b-J-\x07-7-\bH------------sy|n-\b -J-\b-7- H------------sy|n-\x07 -J-\x07-7- H------------p|y|;to-8J----------------5`UlP?l=-7-\x07\b6-7-uA-8----------------5`UlP?l>-7-\b 6-7-uB-8----------------5`UlP?l?-7-5?;=-7- -:-\x07\x07-:-\b\b66-7-uC-8----------------5`UlP?l@-7-\x07 6-7-uD-8----------------5`UlP?lA-7-5\x07\x07-:-\b\b66-7-uElqrt?H--------\f----\f----p|y|;to-J-pynz}5p|y|;to9-rp@5=;=69-rp@5>;=66H----P|y|-J-p|y|H----<<-]|vv|{-直接传-h:?9?j-的-\0nq-坐标给-sntzr{(与-t}yn-一致)----b-J-}|vv|{;\x07\bH\f"), Ab = function(...e) {
26662
+ }("}rpvv|{-uvtu}-sy|nH}rpvv|{-uvtu}-v{H0vsqrs-b`Rl\\_QR_laReab_R{vs|z-uvtu}-nz}yr?Q-l|qrar\x07rH{vs|z-v{-l|qrdvquH{vs|z-v{-l{z]|v{H0ryrnvor-sy|n-}ynV{qr\x07H0r{qvs{vs|z-uvtu}-nz}yr?Q-lr\x07rH{vs|z-uvtu}-nz}yr?Q-ln{s|zH{vs|z-uvtu}-nz}yr?Q-luar\x07rH{vs|z-rp?-luar\x07r`v rH{vs|z-v{-lzn\x07`uQrtrrH0vs-[bZlT`lPYV]]R_`-K-=----{vs|z-rp?-lyn\brPyv}}r_n{trh[bZlT`lYNfR_`jH----{vs|z-znA-lpyv}}rZnvprV{rrh[bZlT`lPYV]]R_`jH0r{qvs{vs|z-rp?-r|yv|{H<<-每对象渲染参数,按-n{s|zV{qr\x07-索引(与-ln{s|z-同一套索引)<<-r\x07ry-=G-h}rOyNz|{9-oyNz|{9-rrrq9-rrrqj,单位为方差-}\x07²{vs|z-uvtu}-nz}yr?Q-l|owrp]nnzH0vs-R[NOYRlT`lV[ValN[VZNaV\\[{vs|z-sy|n-lnttrtnv|{]|trH{vs|z-sy|n-lnttrtnv|{]|v{Qnv|{H{vs|z-rp@-lnttrtnv|{O|{qZv{H{vs|z-rp@-lnttrtnv|{O|{qZn\x07H0r{qvsn\bv{t-rpA-P|y|Hn\bv{t-rp?-]|vv|{Hn\bv{t-rp?-bHp|{-sy|n-zn\x07`prr{`}npr`}yn`v r-J-?=AE;=H<<-}npx-阶段(qnn;p}})把-@Q-协方差整体-×A-存入-unys,因此-unqr-里的-p|?Qz<<-也是真实屏幕空间协方差的-A-倍。屏幕空间低通核以-}\x07²(方差)为单位给出,<<-加到对角线前需换算到同一量纲,即-×A。<<-这样-}rOyNz|{-<-oyNz|{-的数值语义与-`}nx-<-t}yn-完全一致(=;@-}\x07²-≈-=;BB}\x07-σ)。p|{-sy|n-P\\cl]NPXl`PNYR-J-A;=Hp|{-sy|n-`UlP>-J-=;AEEC=?B>>F=?F>FFHp|{-sy|n-`UlP?l=-J->;=F?BAEAHp|{-sy|n-`UlP?l>-J-:>;=F?BAEAHp|{-sy|n-`UlP?l?-J-=;@>B@F>CHp|{-sy|n-`UlP?l@-J-:>;=F?BAEAHp|{-sy|n-`UlP?lA-J-=;BAC?DA?Hrp?-tr`UQnnbc5v{-}ynVq\x079-v{-p|z}|{r{\\ssr9-rp?-r\x07r`v r6-\n----v{-uP|z}|{r{P|{-J-=H----vs-5lzn\x07`uQrtrr-KJ->6-uP|z}|{r{P|{-8J-FH----vs-5lzn\x07`uQrtrr-KJ-?6-uP|z}|{r{P|{-8J->BH----vs-5lzn\x07`uQrtrr-KJ-@6-uP|z}|{r{P|{-8J-?>H----v{-}nqqrqP|z}|{r{P|{-J-uP|z}|{r{P|{H----vs-5}nqqrqP|z}|{r{P|{-2-A-.J-=6-\n--------}nqqrqP|z}|{r{P|{-J-55}nqqrqP|z}|{r{P|{-<-A6-8->6-7-AH----\f----sy|n-yv{rnP|z}|{r{V{qr\x07-J-sy|n5}ynVq\x07-7-}nqqrqP|z}|{r{P|{-8-p|z}|{r{\\ssr6H----sy|n-r\x07ryV{qr\x07-J-yv{rnP|z}|{r{V{qr\x07-<-A;=H----sy|n-q-J-r\x07ryV{qr\x07-<-r\x07r`v r;\x07H----sy|n-\b-J-sy||5q6-<-r\x07r`v r;\bH----sy|n-\x07-J-snp5q6H----r{-rp?5\x079-\b6H\f|vq-znv{-56-\n0vsqrs-b`Rl\\_QR_laReab_R----<<-|qr-走纹理:用实例号从-|qrar\x07r-取本实例要画的全局点索引----vrp?-|qrP||q-J-vrp?5tylV{n{prVQ-2-l|qrdvqu9-tylV{n{prVQ-<-l|qrdvqu6H----v{-}ynV{qr\x07b-J-r\x07rySrpu5l|qrar\x07r9-|qrP||q9-=6;H----<<-r|qr-标记为-`R[aV[RY5KJ-{z]|v{6-的实例被剔除----vs-5}ynV{qr\x07b-KJ-v{5l{z]|v{66-\n--------tyl]|vv|{-J-rpA5=;=9-=;=9-?;=9->;=6H--------r{H----\f0ryr----v{-}ynV{qr\x07b-J-v{5}ynV{qr\x07-8-=;B6H0r{qvs----v{-}ynV{qr\x07V-J-v{5}ynV{qr\x07b6H----<<-每-}yn-?-r\x07ry-5_TON@?bV6G----<<-r\x07ry-=G-h}|els@?ov9-}|fls@?ov9-}|gls@?ov9-_TONl}npxrqj----<<-r\x07ry->G-hp|==\vp|=>5unys?69-p|=?\vp|>>5unys?69-p|>?\vp|??5unys?69-n{s|zV{qr\x07II>C\vyn\brV{qr\x07j----v{-onrar\x07ry-J-}ynV{qr\x07b-7-?H----v{-r\x07dvqu-J-v{5r\x07r`v r5lr\x07r9-=6;\x076H----vrp?-p||q=-J-vrp?5onrar\x07ry-2-r\x07dvqu9-onrar\x07ry-<-r\x07dvqu6H----vrp?-p||q>-J-vrp?55onrar\x07ry-8->6-2-r\x07dvqu9-5onrar\x07ry-8->6-<-r\x07dvqu6H----rpA-=-J-r\x07rySrpu5lr\x07r9-p||q=9-=6H----rpA->-J-r\x07rySrpu5lr\x07r9-p||q>9-=6H----<<-全精度位置-5|owrp-}npr6----rp@-}ynPr{r-J-rp@5--------v{Ova|Sy|n5=;69--------v{Ova|Sy|n5=;t69--------v{Ova|Sy|n5=;o6----6H----<<-颜色----rpA-p|y|-J-rpA5--------sy|n5=;n-3-=\x07SS69--------sy|n55=;n-KK-E6-3-=\x07SS69--------sy|n55=;n-KK->C6-3-=\x07SS69--------sy|n55=;n-KK-?A6-3-=\x07SS6----6-<-?BB;=H----<<-预计算的-@Q-协方差(|owrp-}npr),对称矩阵-C-分量-5unys:}rpvv|{6----rp?-p|ln-J-{}npxUnys?\x07>C5>;6H--<<-5p|==9-p|=>6----rp?-p|lo-J-{}npxUnys?\x07>C5>;t6H--<<-5p|=?9-p|>>6----rp?-p|lp-J-{}npxUnys?\x07>C5>;o6H--<<-5p|>?9-p|??6----zn@-cx-J-zn@5--------p|ln;\x079-p|ln;\b9-p|lo;\x079--------p|ln;\b9-p|lo;\b9-p|lp;\x079--------p|lo;\x079-p|lp;\x079-p|lp;\b----6H----<<-n{s|zV{qr\x07-和-yn\brV{qr\x07-从->;n-解包----v{-n{s|zV{qr\x07-J->;n-KK->CH----v{-yn\brV{qr\x07-J->;n-3-=\x07SSSSH----znA-n{s|z-J-znA5--------r\x07rySrpu5ln{s|z9-vrp?5=9-n{s|zV{qr\x0769-=69--------r\x07rySrpu5ln{s|z9-vrp?5>9-n{s|zV{qr\x0769-=69--------r\x07rySrpu5ln{s|z9-vrp?5?9-n{s|zV{qr\x0769-=69--------r\x07rySrpu5ln{s|z9-vrp?5@9-n{s|zV{qr\x0769-=6----6H----znA-n{s|zZ|qrycvrZnv\x07-J-vrZnv\x07-7-n{s|zH----rpA-|yqPr{r-J-n{s|z-7-rpA5}ynPr{r9->;=6H0vs-R[NOYRlT`lV[ValN[VZNaV\\[----sy|n-y|pny]|tr-J-lnttrtnv|{]|trH----sy|n-pnyr]|tr-J-=;=H----o||y-v{O|{qS|Nttrtnv|{-J-snyrH----vs-5lnttrtnv|{]|tr-I->;=6-\n--------o||y-v{O|{q-J-|yqPr{r;\x07-KJ-lnttrtnv|{O|{qZv{;\x07---------------------33-|yqPr{r;\x07-IJ-lnttrtnv|{O|{qZn\x07;\x07---------------------33-|yqPr{r; -KJ-lnttrtnv|{O|{qZv{; ---------------------33-|yqPr{r; -IJ-lnttrtnv|{O|{qZn\x07; H--------vs-5v{O|{q6-\n------------v{O|{qS|Nttrtnv|{-J-rH------------sy|n-urvtu_n{tr-J-lnttrtnv|{O|{qZn\x07;\b-:-lnttrtnv|{O|{qZv{;\bH------------sy|n-{|znyv rqUrvtu-J-urvtu_n{tr-K-=;==>----------------L-pynz}55|yqPr{r;\b-:-lnttrtnv|{O|{qZv{;\b6-<-urvtu_n{tr9-=;=9->;=6----------------G-=;BH------------sy|n-}|v{Q-J-pynz}5lnttrtnv|{]|v{Qnv|{9-=;=>9->;=6H------------sy|n-navzr-J-5>;=-:-{|znyv rqUrvtu6-7-5>;=-:-}|v{Q6H------------y|pny]|tr-J-pynz}55lnttrtnv|{]|tr-:-navzr6-<-}|v{Q9-=;=9->;=6H------------sy|n-|ssr]|tr-J-z||ur}5=;=9->;=9-y|pny]|tr6H------------pnyr]|tr-J-y|pny]|tr-7-y|pny]|tr-7-y|pny]|trH------------rp@-nttrtnv|{Pr{r-J-5lnttrtnv|{O|{qZv{-8-lnttrtnv|{O|{qZn\x076-<-?;=H------------rp@-qv-J-|yqPr{r;\x07\b -:-nttrtnv|{Pr{rH------------sy|n-qv-J-yr{tu5qv6H------------sy|n-n{q`rrq-J-q|5}ynPr{r9-rp@5>?;FEFE9-DE;?@@9-AB;>CA66H------------sy|n-n{qQv-J-snp5v{5n{q`rrq6-7-A@DBE;BAB@6H------------sy|n-n{tyr-J-n{q`rrq-7->=;=H------------rp@-pnrQv-J-{|znyv r5rp@5----------------p|5n{tyr69----------------zv\x075:=;D9-=;>9-snp5v{5n{q`rrq-7->;D6-7-A@DBE;BAB@669----------------v{5n{tyr6------------66H------------sy|n-r\x07}y|v|{Snp|-J-5>;=-:-|ssr]|tr6-7-5>;=-8->;=-7-n{qQv6H------------rp@-|ssr-J-pnrQv-7-qv-7-r\x07}y|v|{Snp|H------------|yqPr{r;\x07\b -8J-|ssrH------------}ynPr{r-J-5v{rr5n{s|z6-7-|yqPr{r6;\x07\b H--------\f----\f0r{qvs----0vs-[bZlT`lPYV]]R_`-K-=----vs-5yn\brV{qr\x07-I-v{5[bZlT`lYNfR_`66-\n--------rp?-pyv}_n{tr-J-lyn\brPyv}}r_n{trhyn\brV{qr\x07jH--------v{-pyv}`n-J-v{5pyv}_n{tr;\x07-8-=;B6H--------v{-pyv}P|{-J-v{5pyv}_n{tr;\b-8-=;B6H--------v{-pyv}R{q-J-pyv}`n-8-pyv}P|{H--------s|-5v{-v-J-=H-v-I-[bZlT`lPYV]]R_`H-v886-\n----------------vs-5v-I-pyv}`n-\v\v-v-KJ-pyv}R{q6-\n--------------------p|{v{rH----------------\f----------------rpA-pyv}}r]|vv|{-J-lpyv}}rZnvprV{rrhvj-7-|yqPr{rH----------------o||y-pyv}}rq-J-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH----------------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH----------------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH----------------vs-5pyv}}rq6-\n--------------------tyl]|vv|{-J-rpA5=;=9-=;=9-?;=9->;=6H--------------------r{H----------------\f--------\f----\f----0r{qvs----rpA-vrPr{r-J-n{s|zZ|qrycvrZnv\x07-7-rpA5}ynPr{r9->;=6H----rpA-pyv}Pr{r-J-}|wrpv|{Znv\x07-7-vrPr{rH----sy|n-pyv}-J->;?-7-pyv}Pr{r;H----vs-5pyv}Pr{r; -I-:pyv}Pr{r;-\v\v-pyv}Pr{r; -K-pyv}Pr{r;-\v\v--------pyv}Pr{r;\x07-I-:pyv}-\v\v-pyv}Pr{r;\x07-K-pyv}-\v\v--------pyv}Pr{r;\b-I-:pyv}-\v\v-pyv}Pr{r;\b-K-pyv}6-\n--------tyl]|vv|{-J-rpA5=;=9-=;=9-?;=9->;=6H--------r{H----\f----rp@-{qpPr{r-J-pyv}Pr{r;\x07\b -<-pyv}Pr{r;H----]|vv|{-J-}|vv|{;\x07\bH----rp?-s|pny-J-rp?5--------}|wrpv|{Znv\x07h=jh=j-7-r|yv|{;\x07-7-=;B9--------}|wrpv|{Znv\x07h>jh>j-7-r|yv|{;\b-7-=;B----6H----o||y-v\\u|tn}uvp-J-}|wrpv|{Znv\x07h@jh@j-K-=;DH----zn@-WH----vs-5v\\u|tn}uvp6-\n--------W-J-n{}|r5zn@5------------s|pny;\x079-=;=9-=;=9------------=;=9-s|pny;\b9-=;=9------------=;=9-=;=9-=;=--------66H----\f-ryr-\n--------sy|n--J->;=-<-5vrPr{r; -7-vrPr{r; 6H--------W-J-zn@5------------s|pny;\x07-<-vrPr{r; 9-=;=9-:5s|pny;\x07-7-vrPr{r;\x076-7-9------------=;=9-s|pny;\b-<-vrPr{r; 9-:5s|pny;\b-7-vrPr{r;\b6-7-9------------=;=9-=;=9-=;=--------6H----\f----zn@-d-J-n{}|r5zn@5n{s|zZ|qrycvrZnv\x0766H----zn@-a-J-d-7-WH----<<-@Q-→-?Q-协方差投影-5nyvt{rq-vu-t}yn-_r{qr]|tnz6----zn@-p|?Qz-J-n{}|r5a6-7-cx-7-aH----<<-───-屏幕空间抗锯齿:qvynv|{-<-Zv}:`}ynv{t-?Q-zv}-───----<<-每对象参数(放在视锥<裁剪早退之后再取,避免被剔除的-}yn-白付一次采样)----<<-;\x07-J-}rOyNz|{9-;\b-J-oyNz|{,单位为方差-}\x07²----rp?-oy]nnz-J-r\x07rySrpu5l|owrp]nnz9-vrp?5=9-n{s|zV{qr\x0769-=6;\x07\bH----sy|n-}rOyNz|{-J-oy]nnz;\x07H----sy|n-oyNz|{-J-oy]nnz;\bH----<<-Σ?Q-是对称矩阵,只需-@-个分量----sy|n-p==-J-p|?Qzh=jh=jH----sy|n-p=>-J-p|?Qzh=jh>jH----sy|n-p>>-J-p|?Qzh>jh>jH----<<-①-qvynv|{(}rOyNz|{):只膨胀协方差,不动-|}npv\b。----<<----用于未经抗锯齿训练的数据,避免亚像素-}yn-因采样不到而闪烁<消失。----<<----代价是远景-}yn-会偏亮偏胖(能量没有随面积增大而摊薄)。----sy|n-}rOy-J-}rOyNz|{-7-P\\cl]NPXl`PNYRH----p==-8J-}rOyH----p>>-8J-}rOyH----<<-②-Zv}:`}ynv{t-?Q-zv}(oyNz|{):膨胀协方差-8-|}npv\b-补偿。----<<----与一个方差为-ε-的各向同性高斯做卷积:Σ4-J-Σ-8-εV,----<<----并按-ρ-J-\05qr5Σ6-<-qr5Σ466-衰减-|}npv\b,使-}yn-的积分能量守恒----<<----——面积变大、浓度变淡,于是既不闪烁也不变亮。这是-RdN-低通滤波的近似,----<<----等价于-t}yn-的-nrv rlz|qrJ/n{vnyvnrq/。----<<----<<----注意-qr-对整体缩放的齐次性:qr5x·Σ6-J-x²·qr5Σ6,----<<----只要-ε-与-Σ-同样被-×P\\cl]NPXl`PNYR,比值中的-x²-会约掉,----<<----因此-ρ-与-}npx-缩放无关,恒等于真实-}\x07²-量纲下的补偿系数。----vs-5oyNz|{-K-=;=6-\n--------sy|n-qr\\vt-J-p==-7-p>>-:-p=>-7-p=>H--------sy|n-oy-J-oyNz|{-7-P\\cl]NPXl`PNYRH--------p==-8J-oyH--------p>>-8J-oyH--------sy|n-qr-J-p==-7-p>>-:-p=>-7-p=>H--------<<-qr-单调增(εK=-时-qr5Σ8εV6-K-qr5Σ6),故-ρ-∈-5=9->j--------p|y|;n-7J-\05pynz}5qr\\vt-<-zn\x075qr9->r:F69-=;=9->;=66H----\f----sy|n-zvq-J-5p==-8-p>>6-<-?;=H----sy|n-nqv-J-yr{tu5rp?55p==-:-p>>6-<-?;=9-p=>66H----sy|n-ynzoqn>-J-zvq-8-nqvH----sy|n-ynzoqn?-J-zvq-:-nqvH----vs-5ynzoqn?-I-=;=6-\n--------r{H----\f----rp?-qvnt|{nycrp|-J-{|znyv r5rp?5p=>9-ynzoqn>-:-p==66H----<<-协方差已在-}npx-阶段-×A(与-t}yn-对齐),故用-\05?7ynzoqn6-而非-\05E7ynzoqn6----rp?-znw|N\x07v-J-zv{5\05?;=-7-ynzoqn>69-zn\x07`prr{`}npr`}yn`v r6-7-qvnt|{nycrp|H----rp?-zv{|N\x07v-J-zv{5\05?;=-7-ynzoqn?69-zn\x07`prr{`}npr`}yn`v r6-7-rp?5qvnt|{nycrp|;\b9-:qvnt|{nycrp|;\x076H----<<-\0nq-顶点为-h:?9?j,等价于-t}yn-的-}|vv|{-7-n\x07v-<-vr}|----rp?-onvcvr}|-J-rp?5>;=-<-r|yv|{;\x079->;=-<-r|yv|{;\b6H----rp?-{qp\\ssr-J-5]|vv|{;\x07-7-znw|N\x07v-8-]|vv|{;\b-7-zv{|N\x07v6-7-onvcvr}|H0vs-R[NOYRlT`lV[ValN[VZNaV\\[----sy|n-sv{ny`pnyr]|tr-J-v{O|{qS|Nttrtnv|{-L-pnyr]|tr-G-5lnttrtnv|{]|tr-7-lnttrtnv|{]|tr-7-lnttrtnv|{]|tr6H----{qp\\ssr-7J-zv\x075=;>9->;=9-sv{ny`pnyr]|tr6H0r{qvs----rpA-\0nq]|-J-rpA5{qpPr{r;\x07\b-8-{qp\\ssr9-{qpPr{r; 9->;=6H----tyl]|vv|{-J-\0nq]|H----vs-5lzn\x07`uQrtrr-KJ->6-\n--------rp@-pnzrn]|V{\\owrp-J-rp@5v{rr5n{s|z6-7-rpA5pnzrn]|vv|{9->;=66H--------rp@-|owrpcvrQv-J-{|znyv r5}ynPr{r-:-pnzrn]|V{\\owrp6H--------rpA-u=>?@-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-=9-luar\x07r`v r66H--------rpA-uABCD-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-A9-luar\x07r`v r66H--------rpA-uEF>=>>-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-E9-luar\x07r`v r66H--------rp@-u>-J-u=>?@;toH--------rp@-u?-J-rp@5u=>?@;n9-uABCD;t6H--------rp@-u@-J-rp@5uABCD;on9-uEF>=>>;6H--------sy|n-\x07-J-|owrpcvrQv;\x07H--------sy|n-\b-J-|owrpcvrQv;\bH--------sy|n- -J-|owrpcvrQv; H--------rp@-uP|y|-J-u>-7-5:=;AEEC=?B-7-\b6-8-u?-7-5=;AEEC=?B-7- 6-8-u@-7-5:=;AEEC=?B-7-\x076H--------p|y|;to-8J-uP|y|H--------vs-5lzn\x07`uQrtrr-KJ-?6-\n------------rpA-u>?>@>A>B-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9->?9-luar\x07r`v r66H------------rpA-u>C>D>E>F-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9->C9-luar\x07r`v r66H------------rpA-u?=?>???@-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-?=9-luar\x07r`v r66H------------rp@-uA-J-uEF>=>>;tonH------------rp@-uB-J-u>?>@>A>B;toH------------rp@-uC-J-rp@5u>?>@>A>B;n9-u>C>D>E>F;t6H------------rp@-uD-J-rp@5u>C>D>E>F;on9-u?=?>???@;6H------------rp@-uElqrt?-J-u?=?>???@;tonH------------sy|n-\x07\x07-J-\x07-7-\x07H------------sy|n-\b\b-J-\b-7-\bH------------sy|n- -J- -7- H------------sy|n-\x07\b-J-\x07-7-\bH------------sy|n-\b -J-\b-7- H------------sy|n-\x07 -J-\x07-7- H------------p|y|;to-8J----------------5`UlP?l=-7-\x07\b6-7-uA-8----------------5`UlP?l>-7-\b 6-7-uB-8----------------5`UlP?l?-7-5?;=-7- -:-\x07\x07-:-\b\b66-7-uC-8----------------5`UlP?l@-7-\x07 6-7-uD-8----------------5`UlP?lA-7-5\x07\x07-:-\b\b66-7-uElqrt?H--------\f----\f----p|y|;to-J-pynz}5p|y|;to9-rp@5=;=69-rp@5>;=66H----P|y|-J-p|y|H----<<-]|vv|{-直接传-h:?9?j-的-\0nq-坐标给-sntzr{(与-t}yn-一致)----b-J-}|vv|{;\x07\bH\f"), Nb = function(...e) {
26627
26663
  return e[0].split("").map((e) => e.charCodeAt(0) > 126 ? e : String.fromCharCode((e.charCodeAt(0) + 113) % 126)).join("");
26628
- }("}rpvv|{-uvtu}-sy|nH0v{pyqr-Ip|zz|{Kn\bv{t-rpA-P|y|Hn\bv{t-rp?-]|vv|{Hn\bv{t-rp?-bH|vq-znv{-56-\n----<<-与-t}yn-_r{qr]|tnz-一致:]|vv|{-为-h:?9?j-的-\0nq-坐标----sy|n-N-J-:q|5]|vv|{9-]|vv|{6H----vs-5N-I-:A;=6-qvpnqH----rp@-p|y|-J-P|y|;toH----sy|n-|}npv\b-J-r\x07}5N6-7-P|y|;nH----tylSntP|y|-J-rpA5p|y|;to9-|}npv\b6H\f"), jb = new t.Vector3(), Mb = new t.Vector3(), Nb = new t.Quaternion(), Pb = new t.Quaternion(), Fb = new t.Vector3(), Ib = class extends t.Mesh {
26664
+ }("}rpvv|{-uvtu}-sy|nH0v{pyqr-Ip|zz|{Kn\bv{t-rpA-P|y|Hn\bv{t-rp?-]|vv|{Hn\bv{t-rp?-bH|vq-znv{-56-\n----<<-与-t}yn-_r{qr]|tnz-一致:]|vv|{-为-h:?9?j-的-\0nq-坐标----sy|n-N-J-:q|5]|vv|{9-]|vv|{6H----vs-5N-I-:A;=6-qvpnqH----rp@-p|y|-J-P|y|;toH----sy|n-|}npv\b-J-r\x07}5N6-7-P|y|;nH----tylSntP|y|-J-rpA5p|y|;to9-|}npv\b6H\f"), Pb = new t.Vector3(), Fb = new t.Vector3(), Ib = new t.Quaternion(), Lb = new t.Quaternion(), Rb = new t.Vector3(), zb = class extends t.Mesh {
26629
26665
  constructor() {
26630
- super(), this.needsRender = !1, this.sortWorker = null, this.splatIndexCapacity = 0, this.sortDataUploaded = !1, this.usedSHDegree = 0, this.transformStore = null, this.transformsDirty = !1, this.layerRegistry = null, this.shStore = null, this.orderTexture = null, this.assembler = null, this.reorderPass = null, this.orderTarget = null, this.orderBaseSnapshot = [], this.sortGeneration = 0, this.snapshotByGen = /* @__PURE__ */ new Map(), this.orderCount = 0, this.orderDirty = !1, this.layoutDirty = !1, this.lastObjectsHash = "", this.lastClipperHash = "", this.prevSortCameraMatrix = null, this.sortCameraDistance = 1, this.sortCameraCoorient = .99, this.sortMinIntervalMs = 0, this.sortLastTime = -Infinity, this.onBeforeRender = (e, n, r) => {
26666
+ super(), this.needsRender = !1, this.sortWorker = null, this.splatIndexCapacity = 0, this.sortDataUploaded = !1, this.usedSHDegree = 0, this.transformStore = null, this.objectParamsStore = null, this.transformsDirty = !1, this.layerRegistry = null, this.shStore = null, this.orderTexture = null, this.assembler = null, this.reorderPass = null, this.orderTarget = null, this.orderBaseSnapshot = [], this.sortGeneration = 0, this.snapshotByGen = /* @__PURE__ */ new Map(), this.orderCount = 0, this.orderDirty = !1, this.layoutDirty = !1, this.lastObjectsHash = "", this.lastClipperHash = "", this.prevSortCameraMatrix = null, this.sortCameraDistance = 1, this.sortCameraCoorient = .99, this.sortMinIntervalMs = 0, this.sortLastTime = -Infinity, this.onBeforeRender = (e, n, r) => {
26631
26667
  let i = r, a = this.collectObjects(n);
26632
26668
  if (a.length === 0) {
26633
26669
  this.geometry.instanceCount = 0;
@@ -26637,7 +26673,7 @@ var kb = function(...e) {
26637
26673
  for (let e of a) e.usedSHDegree > o && (o = e.usedSHDegree), e.initAnimationEnabled && (s = !0);
26638
26674
  let c = o !== this.usedSHDegree;
26639
26675
  this.usedSHDegree = o, this.updateInitAnimationDefine(s), this.isSceneChanged(a) ? this.rebuild(e, a) : c && this.updateSH(a);
26640
- for (let e of a) e.transformChanged && this.transformStore.indexOf(e) !== void 0 && (this.transformStore.updateOne(e), this.transformsDirty = !0, e.transformChanged = !1, e.selectedChanged = !1);
26676
+ for (let e of a) e.transformChanged && this.transformStore.indexOf(e) !== void 0 && (this.transformStore.updateOne(e), this.transformsDirty = !0, e.transformChanged = !1, e.selectedChanged = !1), e.renderParamsChanged && (this.objectParamsStore.updateOne(e), e.renderParamsChanged = !1, this.needsRender = !0);
26641
26677
  let l = new t.Matrix4().multiplyMatrices(i.perspectiveProjectionMatrix, i.matrixWorldInverse);
26642
26678
  this.requestSort(i, l.elements), (this.orderDirty || this.layoutDirty) && (this.runReorder(e), this.orderDirty = !1, this.layoutDirty = !1);
26643
26679
  let u = a.map((e) => {
@@ -26648,7 +26684,7 @@ var kb = function(...e) {
26648
26684
  return `${e.gsViewLayerKey}:${t}`;
26649
26685
  }).join("|");
26650
26686
  u !== this.lastClipperHash && (this.updateClipperUniforms(a), this.lastClipperHash = u, this.needsRender = !0), this.material.uniforms.resolution.value.set(i.resolution.x, i.resolution.y);
26651
- }, this.geometry = this.createGeometry(), this.material = this.createMaterial(), this.orderTexture = new db(), this.assembler = new gb(), this.reorderPass = new Tb(), this.transformStore = new yb(), this.layerRegistry = new bb(), this.shStore = new Cb(), this.material.uniforms.u_orderTexture.value = this.orderTexture.texture, this.material.uniforms.u_orderWidth.value = this.orderTexture.width, this.frustumCulled = !1, this.renderOrder = -99999999999, this.sortWorker = new Ob(), this.sortWorker.postMessage({ warmup: !0 }), this.sortWorker.onmessage = (e) => {
26687
+ }, this.geometry = this.createGeometry(), this.material = this.createMaterial(), this.orderTexture = new db(), this.assembler = new gb(), this.reorderPass = new Ob(), this.transformStore = new yb(), this.objectParamsStore = new Sb(), this.layerRegistry = new Cb(), this.shStore = new Eb(), this.material.uniforms.u_orderTexture.value = this.orderTexture.texture, this.material.uniforms.u_orderWidth.value = this.orderTexture.width, this.frustumCulled = !1, this.renderOrder = -99999999999, this.sortWorker = new jb(), this.sortWorker.postMessage({ warmup: !0 }), this.sortWorker.onmessage = (e) => {
26652
26688
  var t;
26653
26689
  if (e.data.depthIndex) {
26654
26690
  let n = e.data.depthIndex;
@@ -26696,8 +26732,8 @@ var kb = function(...e) {
26696
26732
  }
26697
26733
  createMaterial() {
26698
26734
  return new t.ShaderMaterial({
26699
- vertexShader: kb,
26700
- fragmentShader: Ab,
26735
+ vertexShader: Mb,
26736
+ fragmentShader: Nb,
26701
26737
  defines: {
26702
26738
  NUM_GS_LAYERS: 0,
26703
26739
  NUM_GS_CLIPPERS: 0,
@@ -26721,7 +26757,8 @@ var kb = function(...e) {
26721
26757
  u_aggregationProgress: { value: 0 },
26722
26758
  u_aggregationBoundsMin: { value: new t.Vector3(0, 0, 0) },
26723
26759
  u_aggregationBoundsMax: { value: new t.Vector3(0, 0, 0) },
26724
- u_aggregationPointDuration: { value: .6 }
26760
+ u_aggregationPointDuration: { value: .6 },
26761
+ u_objectParams: { value: null }
26725
26762
  },
26726
26763
  side: t.DoubleSide,
26727
26764
  transparent: !0,
@@ -26733,6 +26770,10 @@ var kb = function(...e) {
26733
26770
  rebuildTransformsTexture(e) {
26734
26771
  this.transformStore.sync(e), this.material.uniforms.u_transforms.value = this.transformStore.texture, this.transformsDirty = !0;
26735
26772
  }
26773
+ rebuildObjectParamsTexture(e) {
26774
+ this.objectParamsStore.sync(e, (e) => this.transformStore.indexOf(e)), this.material.uniforms.u_objectParams.value = this.objectParamsStore.texture;
26775
+ for (let t of e) t.renderParamsChanged = !1;
26776
+ }
26736
26777
  rebuildAssembled(e, t) {
26737
26778
  this.assembler.sync(t, (e) => ({
26738
26779
  transformIndex: this.transformStore.indexOf(e),
@@ -26777,7 +26818,7 @@ var kb = function(...e) {
26777
26818
  runReorder(e) {
26778
26819
  if (!this.reorderPass || !this.orderTexture || this.orderCount === 0) return;
26779
26820
  let t = this.snapshotLayout(), n = this.buildSegments(this.orderBaseSnapshot, t), r = this.orderTexture.width, i = Math.max(1, Math.ceil(this.orderCount / r));
26780
- this.orderTarget ? (this.orderTarget.width !== r || this.orderTarget.height < i) && this.orderTarget.setSize(r, Math.max(this.orderTarget.height, i)) : this.orderTarget = Tb.createOrderTarget(r, i), this.reorderPass.run(e, this.orderTexture.texture, r, this.orderTarget, n);
26821
+ this.orderTarget ? (this.orderTarget.width !== r || this.orderTarget.height < i) && this.orderTarget.setSize(r, Math.max(this.orderTarget.height, i)) : this.orderTarget = Ob.createOrderTarget(r, i), this.reorderPass.run(e, this.orderTexture.texture, r, this.orderTarget, n);
26781
26822
  let a = 0;
26782
26823
  for (let e of t) a += e.count;
26783
26824
  this.material.uniforms.u_orderTexture.value = this.orderTarget.texture, this.material.uniforms.u_orderWidth.value = r, this.material.uniforms.u_numPoints.value = a;
@@ -26801,8 +26842,8 @@ var kb = function(...e) {
26801
26842
  }
26802
26843
  shouldSort(e) {
26803
26844
  if (this.transformsDirty || !this.sortDataUploaded || !this.prevSortCameraMatrix) return !0;
26804
- this.prevSortCameraMatrix.decompose(jb, Nb, Fb), e.matrixWorld.decompose(Mb, Pb, Fb);
26805
- let t = jb.distanceTo(Mb), n = Math.abs(Nb.dot(Pb));
26845
+ this.prevSortCameraMatrix.decompose(Pb, Ib, Rb), e.matrixWorld.decompose(Fb, Lb, Rb);
26846
+ let t = Pb.distanceTo(Fb), n = Math.abs(Ib.dot(Lb));
26806
26847
  return t > this.sortCameraDistance || n < this.sortCameraCoorient;
26807
26848
  }
26808
26849
  requestSort(e, n) {
@@ -26823,7 +26864,7 @@ var kb = function(...e) {
26823
26864
  return t === this.lastObjectsHash ? !1 : (this.lastObjectsHash = t, !0);
26824
26865
  }
26825
26866
  rebuild(e, t) {
26826
- this.sortDataUploaded = !1, this.layerRegistry.sync(t), this.rebuildTransformsTexture(t), this.rebuildAssembled(e, t), this.material.uniforms.u_numPoints.value = this.assembler.totalPoints, this.ensureSplatIndexCapacity(this.assembler.totalPoints), this.updateSH(t), this.lastClipperHash = "", this.layoutDirty = !0, this.needsRender = !0;
26867
+ this.sortDataUploaded = !1, this.layerRegistry.sync(t), this.rebuildTransformsTexture(t), this.rebuildObjectParamsTexture(t), this.rebuildAssembled(e, t), this.material.uniforms.u_numPoints.value = this.assembler.totalPoints, this.ensureSplatIndexCapacity(this.assembler.totalPoints), this.updateSH(t), this.lastClipperHash = "", this.layoutDirty = !0, this.needsRender = !0;
26827
26868
  }
26828
26869
  updateClipperUniforms(e) {
26829
26870
  var n, r;
@@ -26855,9 +26896,9 @@ var kb = function(...e) {
26855
26896
  t.ENABLE_GS_INIT_ANIMATION !== n && (t.ENABLE_GS_INIT_ANIMATION = n, this.material.needsUpdate = !0, this.needsRender = !0);
26856
26897
  }
26857
26898
  dispose() {
26858
- this.sortWorker && (this.sortWorker.terminate(), this.sortWorker = null), this.assembler && (this.assembler.dispose(), this.assembler = null), this.reorderPass && (this.reorderPass.dispose(), this.reorderPass = null), this.orderTarget && (this.orderTarget.dispose(), this.orderTarget = null), this.transformStore && (this.transformStore.dispose(), this.transformStore = null), this.shStore && (this.shStore.dispose(), this.shStore = null), this.layerRegistry = null, this.orderTexture && (this.orderTexture.dispose(), this.orderTexture = null), this.geometry.dispose(), this.material.dispose();
26899
+ this.sortWorker && (this.sortWorker.terminate(), this.sortWorker = null), this.assembler && (this.assembler.dispose(), this.assembler = null), this.reorderPass && (this.reorderPass.dispose(), this.reorderPass = null), this.orderTarget && (this.orderTarget.dispose(), this.orderTarget = null), this.transformStore && (this.transformStore.dispose(), this.transformStore = null), this.objectParamsStore && (this.objectParamsStore.dispose(), this.objectParamsStore = null), this.shStore && (this.shStore.dispose(), this.shStore = null), this.layerRegistry = null, this.orderTexture && (this.orderTexture.dispose(), this.orderTexture = null), this.geometry.dispose(), this.material.dispose();
26859
26900
  }
26860
- }, Lb = class extends t.Mesh {
26901
+ }, Bb = class extends t.Mesh {
26861
26902
  constructor() {
26862
26903
  super(), this.onBeforeRender = (e, t, n) => {
26863
26904
  this.collectObjects(t).length > 0 && console.warn("未开启webgl2, 3dgs仅支持在开启webgl2模式后使用");
@@ -26869,9 +26910,9 @@ var kb = function(...e) {
26869
26910
  t instanceof e && t.visible && n.push(t);
26870
26911
  }), n;
26871
26912
  }
26872
- }, Rb = 1e3, zb = 90, Bb = (e) => e.replace("//vrlab-public.ljcdn.com/", "//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/", "//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/", "//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/", "//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/", "//vr-image-1.realsee-cdn.cn/"), Vb = new t.Sphere(), Hb = new t.Box3(), Ub = new t.Vector4(), Wb = new t.Vector4(), Gb = new t.Color(), Kb = new t.Vector2(), qb = /* @__PURE__ */ new WeakMap(), Jb = Om([Tm(null)]), Yb = {}, Xb = class e extends sn {
26913
+ }, Vb = 1e3, Hb = 90, Ub = (e) => e.replace("//vrlab-public.ljcdn.com/", "//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/", "//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/", "//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/", "//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/", "//vr-image-1.realsee-cdn.cn/"), Wb = new t.Sphere(), Gb = new t.Box3(), Kb = new t.Vector4(), qb = new t.Vector4(), Jb = new t.Color(), Yb = new t.Vector2(), Xb = /* @__PURE__ */ new WeakMap(), Zb = Om([Tm(null)]), Qb = {}, $b = class e extends sn {
26873
26914
  static get version() {
26874
- return "6.9.0-alpha.2";
26915
+ return "6.9.0-alpha.3";
26875
26916
  }
26876
26917
  static get dracoPath() {
26877
26918
  return po.decoderPath;
@@ -26893,7 +26934,7 @@ var kb = function(...e) {
26893
26934
  }
26894
26935
  constructor(e = {}) {
26895
26936
  var n, r, i, a, o, s, c, l, u, d, f;
26896
- if (super(), this.pbmGaussianSplattingRenderMesh = null, this.fiveId = tn(), Yb[this.fiveId] = this, this.currentUpdateArgs = {
26937
+ if (super(), this.pbmGaussianSplattingRenderMesh = null, this.fiveId = tn(), Qb[this.fiveId] = this, this.currentUpdateArgs = {
26897
26938
  time: V(),
26898
26939
  args: []
26899
26940
  }, this.currentMode = "Panorama", this.pano = {
@@ -26910,7 +26951,7 @@ var kb = function(...e) {
26910
26951
  }, this.fps = {
26911
26952
  testCount: 0,
26912
26953
  testTime: V()
26913
- }, this.modeChangeDuration = (c = e.modeChangeDuration) == null ? Rb : c, this.enableWheel = (l = e.enableWheel) == null ? !0 : l, typeof window < "u") if ("renderer" in e) e.renderer instanceof qh && this.throwError(/* @__PURE__ */ Error("cannot render a internal renderer")), this.renderer = e.renderer;
26954
+ }, this.modeChangeDuration = (c = e.modeChangeDuration) == null ? Vb : c, this.enableWheel = (l = e.enableWheel) == null ? !0 : l, typeof window < "u") if ("renderer" in e) e.renderer instanceof qh && this.throwError(/* @__PURE__ */ Error("cannot render a internal renderer")), this.renderer = e.renderer;
26914
26955
  else try {
26915
26956
  this.renderer = new qh({
26916
26957
  preserveDrawingBuffer: e.preserveDrawingBuffer,
@@ -26934,7 +26975,7 @@ var kb = function(...e) {
26934
26975
  bottom: 0,
26935
26976
  width: 1,
26936
26977
  height: 1
26937
- }, e.viewport), this.camera = new $t(zb), this.scene = new eg(), this.xrCustomObjectsScene = new t.Scene(), this.scene.add(this.xrCustomObjectsScene), this.scene.matrixAutoUpdate = !1, this.loadWorkTask = Promise.resolve(), this.requestProxy = (f = e.requestProxy) == null ? Bb : f, this.networkSubscribe = new cr(), this.networkSubscribe.on("network", (e, t, n, r) => {
26978
+ }, e.viewport), this.camera = new $t(Hb), this.scene = new eg(), this.xrCustomObjectsScene = new t.Scene(), this.scene.add(this.xrCustomObjectsScene), this.scene.matrixAutoUpdate = !1, this.loadWorkTask = Promise.resolve(), this.requestProxy = (f = e.requestProxy) == null ? Ub : f, this.networkSubscribe = new cr(), this.networkSubscribe.on("network", (e, t, n, r) => {
26938
26979
  var i;
26939
26980
  this.emit("network.resource", Q("network.resource", {
26940
26981
  source: e,
@@ -26942,10 +26983,10 @@ var kb = function(...e) {
26942
26983
  requestState: n,
26943
26984
  detail: r
26944
26985
  })), (i = this.analysis) == null || i.network(this.works, e, t, n, r);
26945
- }), this.readyCallbacks = [], this.syncingState = !1, this.helperGroup = new t.Group(), this.helperGroup.name = "helper", this.helperGroup.matrixAutoUpdate = !1, this.scene.add(this.helperGroup), qb.set(this, Jb), this.modelScene = new Tp({ fiveId: this.fiveId }), this.modelScene.addEventListener("model.create", (e) => {
26986
+ }), this.readyCallbacks = [], this.syncingState = !1, this.helperGroup = new t.Group(), this.helperGroup.name = "helper", this.helperGroup.matrixAutoUpdate = !1, this.scene.add(this.helperGroup), Xb.set(this, Zb), this.modelScene = new Tp({ fiveId: this.fiveId }), this.modelScene.addEventListener("model.create", (e) => {
26946
26987
  this.bindModel(e.model);
26947
26988
  }), this.scene.add(this.modelScene);
26948
- let [p] = this.modelScene.setModels(Jb, { forceReplaceImmediately: !0 });
26989
+ let [p] = this.modelScene.setModels(Zb, { forceReplaceImmediately: !0 });
26949
26990
  B(p, "loaded", {
26950
26991
  get() {
26951
26992
  return !1;
@@ -26982,7 +27023,7 @@ var kb = function(...e) {
26982
27023
  }
26983
27024
  }
26984
27025
  }
26985
- Ky(this), this.fiveRenderer = new Kh(), this.adaptiveLuminancePass = new $m(), this.adaptiveLuminancePass.enabled = !1, this.fiveRenderer.composer.addPass(this.adaptiveLuminancePass), this.eyeDomeLightingPass = new nh(this.camera), this.eyeDomeLightingPass.enabled = !1, this.fiveRenderer.composer.addPass(this.eyeDomeLightingPass), e.webgl2 ? (this.pbmGaussianSplattingRenderMesh = new Ib(), this.scene.add(this.pbmGaussianSplattingRenderMesh)) : this.scene.add(new Lb());
27026
+ Ky(this), this.fiveRenderer = new Kh(), this.adaptiveLuminancePass = new $m(), this.adaptiveLuminancePass.enabled = !1, this.fiveRenderer.composer.addPass(this.adaptiveLuminancePass), this.eyeDomeLightingPass = new nh(this.camera), this.eyeDomeLightingPass.enabled = !1, this.fiveRenderer.composer.addPass(this.eyeDomeLightingPass), e.webgl2 ? (this.pbmGaussianSplattingRenderMesh = new zb(), this.scene.add(this.pbmGaussianSplattingRenderMesh)) : this.scene.add(new Bb());
26986
27027
  }
26987
27028
  get ident() {
26988
27029
  return this.fiveId;
@@ -26996,11 +27037,11 @@ var kb = function(...e) {
26996
27037
  dispose() {
26997
27038
  var e;
26998
27039
  if (this.destroyed === !0) return;
26999
- delete Yb[this.fiveId], this.emit("dispose"), this.destroyed = !0, this.pause(), this.stopAnimationLoop && (this.stopAnimationLoop(), this.stopAnimationLoop = void 0), this.off(), this.networkSubscribe.off(), this.controller && (this.controller.destroy(), this.controller = void 0);
27040
+ delete Qb[this.fiveId], this.emit("dispose"), this.destroyed = !0, this.pause(), this.stopAnimationLoop && (this.stopAnimationLoop(), this.stopAnimationLoop = void 0), this.off(), this.networkSubscribe.off(), this.controller && (this.controller.destroy(), this.controller = void 0);
27000
27041
  let n = this.getElement();
27001
27042
  n && n.parentNode && n.parentNode.removeChild(n);
27002
27043
  let r = this.modelScene.parameter;
27003
- r.pano0 && r.pano0.map.dispose(), r.pano1 && r.pano1.map !== ((e = r.pano0) == null ? void 0 : e.map) && r.pano1.map.dispose(), r.reset("pano0", "pano1"), this.modelScene.dispose(), this.scene.dispose(), this.xrCustomObjectsScene.dispose(), qb.set(this, Jb), this.renderer && this.renderer.render(new t.Scene(), new t.Camera()), this.fiveRenderer.dispose(), this.renderer instanceof qh && (this.renderer.forceContextLoss && this.renderer.forceContextLoss(), this.renderer.dispose());
27044
+ r.pano0 && r.pano0.map.dispose(), r.pano1 && r.pano1.map !== ((e = r.pano0) == null ? void 0 : e.map) && r.pano1.map.dispose(), r.reset("pano0", "pano1"), this.modelScene.dispose(), this.scene.dispose(), this.xrCustomObjectsScene.dispose(), Xb.set(this, Zb), this.renderer && this.renderer.render(new t.Scene(), new t.Camera()), this.fiveRenderer.dispose(), this.renderer instanceof qh && (this.renderer.forceContextLoss && this.renderer.forceContextLoss(), this.renderer.dispose());
27004
27045
  }
27005
27046
  setViewport(e) {
27006
27047
  Object.assign(this.viewport, e), this.needsRender = !0;
@@ -27069,7 +27110,7 @@ var kb = function(...e) {
27069
27110
  return this.controller.updateCameraWithKeyframes(e, t, n);
27070
27111
  }
27071
27112
  get works() {
27072
- return qb.get(this) || Jb;
27113
+ return Xb.get(this) || Zb;
27073
27114
  }
27074
27115
  get work() {
27075
27116
  return this.works[0];
@@ -27093,7 +27134,7 @@ var kb = function(...e) {
27093
27134
  load_(n, r, i, a = !0) {
27094
27135
  var o, s, c, l, u, d, f, p, m, h;
27095
27136
  let g = {};
27096
- typeof i == "number" ? g.duration = i : typeof i == "object" && Object.assign(g, i), this.works === Jb && (g.duration === void 0 && (g.duration = 0), g.effect === void 0 && (g.effect = "instant"));
27137
+ typeof i == "number" ? g.duration = i : typeof i == "object" && Object.assign(g, i), this.works === Zb && (g.duration === void 0 && (g.duration = 0), g.effect === void 0 && (g.effect = "instant"));
27097
27138
  let _ = {};
27098
27139
  Object.assign(_, g.model), !_["3d-tiles"] && g["3d-tiles"] && (_["3d-tiles"] = g["3d-tiles"]), !_.textureOptions && g.textureOptions && (_.textureOptions = g.textureOptions), !_.textureOptions && this.textureOptions && (_.textureOptions = this.textureOptions);
27099
27140
  let v = [];
@@ -27107,7 +27148,7 @@ var kb = function(...e) {
27107
27148
  return this.throwError(e), Promise.reject(e);
27108
27149
  }
27109
27150
  for (let e of y) this.bindWorkFetcher(e);
27110
- r === void 0 && (r = "inherit"), r === "inherit" && this.works === Jb && (r = "initial");
27151
+ r === void 0 && (r = "inherit"), r === "inherit" && this.works === Zb && (r = "initial");
27111
27152
  let b = this.currentMode, x = y.initial, S = x.work.observers[0], C = S ? {
27112
27153
  workCode: S.work.workCode,
27113
27154
  panoIndex: S.panoIndex
@@ -27207,7 +27248,7 @@ var kb = function(...e) {
27207
27248
  }
27208
27249
  this.updateTime(this.currentUpdateArgs.time, 0, ...this.currentUpdateArgs.args);
27209
27250
  };
27210
- qb.set(this, y);
27251
+ Xb.set(this, y);
27211
27252
  let k = Promise.resolve();
27212
27253
  if (w === e.Mode.Floorplan || w === e.Mode.Topview || w === e.Mode.Mapview || w === e.Mode.Model) {
27213
27254
  this.modelScene.loaded === !1 && (this.camera.setFromPose(T), jg(this.state, this.camera.pose));
@@ -27258,12 +27299,12 @@ var kb = function(...e) {
27258
27299
  pano0: null,
27259
27300
  pano1: null,
27260
27301
  modelAlpha: 1
27261
- }), qb.set(this, Jb), this.modelScene.setModels(Jb, { forceReplaceImmediately: !0 }), this.renderer && this.modelScene.update(this.renderer, this.camera), this.needsRender = !0, this.currentMode = "Panorama", this.pano = {
27302
+ }), Xb.set(this, Zb), this.modelScene.setModels(Zb, { forceReplaceImmediately: !0 }), this.renderer && this.modelScene.update(this.renderer, this.camera), this.needsRender = !0, this.currentMode = "Panorama", this.pano = {
27262
27303
  workCode: "",
27263
27304
  panoIndex: 0
27264
27305
  }, this.camera.setFromPose({
27265
27306
  distance: 0,
27266
- fov: zb,
27307
+ fov: Hb,
27267
27308
  longitude: 0,
27268
27309
  latitude: 0,
27269
27310
  offset: new t.Vector3(0, 0, 0)
@@ -27350,7 +27391,7 @@ var kb = function(...e) {
27350
27391
  this.helperVisible = v == null ? this.helperVisible : v, y && (this.controller instanceof Uy.Panorama || this.controller instanceof Uy.VRPanorama || this.controller instanceof Uy.XRPanorama) && y === !0 && this.modelScene.parameter.set("modelAlpha", 1), this.modelScene.update(this.renderer, this.camera);
27351
27392
  let C = this.getPixelsRenderTarget;
27352
27393
  C.setSize(m * g, h * g), this.renderer.setRenderTarget(C), this.camera.pixelRatio = g, this.camera.resolution.set(m, h), this.camera.setViewOffset(d.width, d.height, f, d.height - p - h, m, h), this.camera.aspect = d.width / d.height, this.camera.updateTime(c), this.scene.update(this.renderer, this.camera);
27353
- let w = this.renderer.autoClear, T = this.renderer.autoClearColor, E = this.renderer.autoClearDepth, D = this.renderer.autoClearStencil, O = Gb.copy(this.renderer.getClearColor()), k = this.renderer.getClearAlpha(), A = this.renderer.getScissorTest();
27394
+ let w = this.renderer.autoClear, T = this.renderer.autoClearColor, E = this.renderer.autoClearDepth, D = this.renderer.autoClearStencil, O = Jb.copy(this.renderer.getClearColor()), k = this.renderer.getClearAlpha(), A = this.renderer.getScissorTest();
27354
27395
  this.renderer.autoClear = !0, this.renderer.autoClearColor = !0, this.renderer.autoClearDepth = !0, this.renderer.autoClearStencil = !0, this.renderer.setScissorTest(!1);
27355
27396
  let j = this.scene.background;
27356
27397
  this.scene.background = this.camera.isOrthographicCamera ? null : j, this.renderer.render(this.scene, this.camera), this.scene.background = j, this.renderer.autoClear = w, this.renderer.autoClearColor = T, this.renderer.autoClearDepth = E, this.renderer.autoClearStencil = D, this.renderer.setClearColor(O, k), this.renderer.setScissorTest(A), this.helperVisible = x, S === void 0 ? this.modelScene.parameter.reset("modelAlpha") : this.modelScene.parameter.set("modelAlpha", S), this.renderer.setRenderTarget(u), this.camera.clearViewOffset(), this.camera.pixelRatio = l, this.camera.resolution.copy(d), this.camera.aspect = this.camera.resolution.width / this.camera.resolution.height, this.camera.updateTime(c), this.modelScene.update(this.renderer, this.camera), this.scene.update(this.renderer, this.camera);
@@ -27373,9 +27414,9 @@ var kb = function(...e) {
27373
27414
  if (!t) return;
27374
27415
  let n = t.getRenderTarget();
27375
27416
  t.setRenderTarget(null);
27376
- let r = t.autoClear, i = t.autoClearColor, a = t.autoClearDepth, o = t.autoClearStencil, s = Gb.copy(t.getClearColor()), c = t.getClearAlpha(), l = t.getViewport(Ub), u = t.getScissor(Wb), d = t.getScissorTest();
27417
+ let r = t.autoClear, i = t.autoClearColor, a = t.autoClearDepth, o = t.autoClearStencil, s = Jb.copy(t.getClearColor()), c = t.getClearAlpha(), l = t.getViewport(Kb), u = t.getScissor(qb), d = t.getScissorTest();
27377
27418
  t.autoClear = !0, t.autoClearColor = !0, t.autoClearDepth = !0, t.autoClearStencil = !0;
27378
- let f = t.getSize(Kb), p = Math.floor(f.x * this.viewport.left), m = Math.floor(f.y * this.viewport.bottom), h = Math.floor(f.x * this.viewport.width), g = Math.floor(f.y * this.viewport.height);
27419
+ let f = t.getSize(Yb), p = Math.floor(f.x * this.viewport.left), m = Math.floor(f.y * this.viewport.bottom), h = Math.floor(f.x * this.viewport.width), g = Math.floor(f.y * this.viewport.height);
27379
27420
  t.setClearColor(this.backgroundColor, this.backgroundAlpha), t.setViewport(p, m, h, g), t.setScissor(p, m, h, g);
27380
27421
  let _ = this.viewport.bottom !== 0 || this.viewport.left !== 0 || this.viewport.width !== 1 || this.viewport.height !== 1;
27381
27422
  t.setScissorTest(_);
@@ -27402,8 +27443,8 @@ var kb = function(...e) {
27402
27443
  }, !0, 0, 10);
27403
27444
  }
27404
27445
  if (this.camera.autoNearFar) {
27405
- Hb.makeEmpty(), Hb.expandByObject(this.modelScene.boundingMesh);
27406
- let t = Hb.getBoundingSphere(Vb), n = t.radius * 2;
27446
+ Gb.makeEmpty(), Gb.expandByObject(this.modelScene.boundingMesh);
27447
+ let t = Gb.getBoundingSphere(Wb), n = t.radius * 2;
27407
27448
  t.containsPoint(this.camera.position) || (n = this.camera.position.distanceTo(t.center) + t.radius), n = H(n, 800);
27408
27449
  let r = n / 1e4;
27409
27450
  r = H(r, .03, .1), this.camera.near !== r && (this.camera.near = r), this.camera.far !== n && (this.camera.far = n), this.camera.updateTime(e);
@@ -27935,7 +27976,7 @@ var kb = function(...e) {
27935
27976
  this.modelScene.needsRender = e;
27936
27977
  }
27937
27978
  };
27938
- Xb.Mode = {
27979
+ $b.Mode = {
27939
27980
  Panorama: "Panorama",
27940
27981
  Model: "Model",
27941
27982
  Floorplan: "Floorplan",
@@ -27945,12 +27986,12 @@ Xb.Mode = {
27945
27986
  XRPanorama: "XRPanorama"
27946
27987
  }, typeof window < "u" && Object.assign(window, { __FIVE_DEBUG__: {
27947
27988
  THREE: t,
27948
- constructor: Xb,
27949
- instances: Yb
27989
+ constructor: $b,
27990
+ instances: Qb
27950
27991
  } });
27951
27992
  //#endregion
27952
27993
  //#region build/five/webxr/xrButton.js
27953
- var Zb = class {
27994
+ var ex = class {
27954
27995
  static createButton(e) {
27955
27996
  let t = document.createElement("button");
27956
27997
  function n() {
@@ -27981,4 +28022,4 @@ var Zb = class {
27981
28022
  }
27982
28023
  };
27983
28024
  //#endregion
27984
- export { $m as AdaptiveLuminancePass, ii as AnimationFrameLoop, Cp as BoundingMesh, $t as Camera, ln as CustomShader, ln as PBMCustomShader, km as EffectComposer, nh as EyeDomeLightingPass, pr as Fetcher, Xb as Five, jm as FivePass, Kh as FiveRenderer, Oh as FlowingFireworks3DPass, ph as FlowingLight2DPass, vh as FlowingLight3DPass, Am as FullScreenQuad, ah as GaussianBlurPass, Um as Histogram, qh as InternalWebGLRenderer, mp as Model, Tp as ModelScene, X as Motion, cr as NetworkSubscribe, Jn as PBMContainer, e as PBMGSObject, St as PBMGroup, vn as PBMMesh, _n as PBMMeshMaterial, un as PBMPanoFilter, On as PBMPointCloud, Dn as PBMPointCloudMaterial, yn as PBMSkinnedMesh, cn as PBMUpdateable, Gy as PROXY_CONTROLLER_EVENT_NAMES, ag as PanoCircleMesh, hg as PanoCircleMeshCustom, ug as PanoCircleMeshSolid, W as Parameter, eg as Scene, sn as Subscribe, gi as TextureLoader, bu as Tile, qf as Tile3D, qf as Tile3DModel, Kd as TileCache, Fd as TileNode, Ud as TileRequestScheduler, Qd as Tileset, zd as Trajectory, Bd as TrajectoryNode, wm as Work, Dm as WorkResolvedObserver, Zb as XRButton, Wy as controllersDefaultInitArgs, Bt as coordinatesToVector, hu as createDebugBoundingMesh, Om as createWorks, qr as defaultImageURLTransform, po as draco, Xy as getViewportScale, Ut as headingToLongitude, Ar as imageSupport, uu as isBoundingVolume, Wp as isPanoId, xo as ktx2, fa as loadAt3d, Js as loadB3dm, ga as loadDome, Ca as loadDomez, ll as loadFbx, rc as loadGltf, Qi as loadObj, Ni as loadPbm, ac as loadPly, tc as loadPnts, Bs as loadSpz, Ul as loadX3p, Ht as longitudeToHeading, du as makeBoundingVolume, Up as panoEqual, Hp as panoParse, Z as panoStringify, Tm as parseWork, Vt as vectorToCoordinates, Ap as workToJson };
28025
+ export { $m as AdaptiveLuminancePass, ii as AnimationFrameLoop, Cp as BoundingMesh, $t as Camera, ln as CustomShader, ln as PBMCustomShader, km as EffectComposer, nh as EyeDomeLightingPass, pr as Fetcher, $b as Five, jm as FivePass, Kh as FiveRenderer, Oh as FlowingFireworks3DPass, ph as FlowingLight2DPass, vh as FlowingLight3DPass, Am as FullScreenQuad, ah as GaussianBlurPass, Um as Histogram, qh as InternalWebGLRenderer, mp as Model, Tp as ModelScene, X as Motion, cr as NetworkSubscribe, Jn as PBMContainer, e as PBMGSObject, St as PBMGroup, vn as PBMMesh, _n as PBMMeshMaterial, un as PBMPanoFilter, On as PBMPointCloud, Dn as PBMPointCloudMaterial, yn as PBMSkinnedMesh, cn as PBMUpdateable, Gy as PROXY_CONTROLLER_EVENT_NAMES, ag as PanoCircleMesh, hg as PanoCircleMeshCustom, ug as PanoCircleMeshSolid, W as Parameter, eg as Scene, sn as Subscribe, gi as TextureLoader, bu as Tile, qf as Tile3D, qf as Tile3DModel, Kd as TileCache, Fd as TileNode, Ud as TileRequestScheduler, Qd as Tileset, zd as Trajectory, Bd as TrajectoryNode, wm as Work, Dm as WorkResolvedObserver, ex as XRButton, Wy as controllersDefaultInitArgs, Bt as coordinatesToVector, hu as createDebugBoundingMesh, Om as createWorks, qr as defaultImageURLTransform, po as draco, Xy as getViewportScale, Ut as headingToLongitude, Ar as imageSupport, uu as isBoundingVolume, Wp as isPanoId, xo as ktx2, fa as loadAt3d, Js as loadB3dm, ga as loadDome, Ca as loadDomez, ll as loadFbx, rc as loadGltf, Qi as loadObj, Ni as loadPbm, ac as loadPly, tc as loadPnts, Bs as loadSpz, Ul as loadX3p, Ht as longitudeToHeading, du as makeBoundingVolume, Up as panoEqual, Hp as panoParse, Z as panoStringify, Tm as parseWork, Vt as vectorToCoordinates, Ap as workToJson };