feffery_utils_components 0.2.0-rc11 → 0.2.0-rc13

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 (52) hide show
  1. package/DESCRIPTION +1 -1
  2. package/NAMESPACE +2 -0
  3. package/Project.toml +1 -1
  4. package/README.md +1 -1
  5. package/assets/demo.jpg +0 -0
  6. package/feffery_utils_components/FefferySetFavicon.py +45 -0
  7. package/feffery_utils_components/FefferySetTitle.py +7 -4
  8. package/feffery_utils_components/FefferySliderCaptcha.py +109 -0
  9. package/feffery_utils_components/__init__.py +2 -1
  10. package/feffery_utils_components/_imports_.py +4 -0
  11. package/feffery_utils_components/async-feffery_animated_3d_background_p5.js +1 -1
  12. package/feffery_utils_components/async-feffery_animated_3d_background_three.js +2 -2
  13. package/feffery_utils_components/async-feffery_animated_image.js +1 -1
  14. package/feffery_utils_components/async-feffery_aplayer.js +1 -1
  15. package/feffery_utils_components/async-feffery_auto_animate.js +1 -1
  16. package/feffery_utils_components/async-feffery_auto_fit.js +1 -1
  17. package/feffery_utils_components/async-feffery_captcha.js +1 -1
  18. package/feffery_utils_components/async-feffery_color_pickers.js +1 -1
  19. package/feffery_utils_components/async-feffery_dom2image.js +1 -1
  20. package/feffery_utils_components/async-feffery_dplayer.js +1 -1
  21. package/feffery_utils_components/async-feffery_emoji_picker.js +1 -1
  22. package/feffery_utils_components/async-feffery_excel_preview.js +1 -1
  23. package/feffery_utils_components/async-feffery_extra_spinner.js +1 -1
  24. package/feffery_utils_components/async-feffery_fancy_button.js +1 -1
  25. package/feffery_utils_components/async-feffery_grid.js +1 -1
  26. package/feffery_utils_components/async-feffery_image_cropper.js +1 -1
  27. package/feffery_utils_components/async-feffery_json_viewer.js +1 -1
  28. package/feffery_utils_components/async-feffery_local_large_storage.js +1 -1
  29. package/feffery_utils_components/async-feffery_markdown_editor.js +2 -2
  30. package/feffery_utils_components/async-feffery_motion.js +1 -1
  31. package/feffery_utils_components/async-feffery_music_player.js +1 -1
  32. package/feffery_utils_components/async-feffery_photo_sphere_viewer.js +1 -1
  33. package/feffery_utils_components/async-feffery_resizable.js +1 -1
  34. package/feffery_utils_components/async-feffery_rich_text_editor.js +2 -2
  35. package/feffery_utils_components/async-feffery_rnd.js +1 -1
  36. package/feffery_utils_components/async-feffery_seamless_scroll.js +1 -1
  37. package/feffery_utils_components/async-feffery_shortcut_panel.js +1 -1
  38. package/feffery_utils_components/async-feffery_slider_captcha.js +1 -0
  39. package/feffery_utils_components/async-feffery_slider_captcha.js.LICENSE.txt +1 -0
  40. package/feffery_utils_components/async-feffery_sortable.js +1 -1
  41. package/feffery_utils_components/async-feffery_word_preview.js +1 -1
  42. package/feffery_utils_components/async-fuc-shared.js +2 -2
  43. package/feffery_utils_components/feffery_utils_components.min.js +2 -2
  44. package/feffery_utils_components/metadata.json +298 -1
  45. package/feffery_utils_components/package-info.json +3 -1
  46. package/package.json +3 -1
  47. package/src/lib/components/FefferySetFavicon.react.js +58 -0
  48. package/src/lib/components/FefferySetTitle.react.js +21 -6
  49. package/src/lib/components/FefferySliderCaptcha.react.js +160 -0
  50. package/src/lib/fragments/FefferySliderCaptcha.react.js +102 -0
  51. package/src/lib/index.js +5 -1
  52. package/usage.py +20 -48
@@ -1,4 +1,4 @@
1
- (window.webpackJsonpfeffery_utils_components=window.webpackJsonpfeffery_utils_components||[]).push([[2],{512:function(e,t,i){"use strict";i.r(t);var L=i(1),P=i.n(L),n=i(857),z=i.n(n),D=i(552),I=i(60),O=i(22),n=i(214);function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.scaleMobile,m=e.backgroundColor,f=e.backgroundAlpha,g=e.color1,v=e.color2,y=e.colorMode,x=e.quantity,w=e.birdSize,b=e.wingSpan,M=e.speedLimit,_=e.separation,S=e.alignment,T=e.cohesion,e=(e.setProps,e.loading_state),E=(E=Object(L.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(E)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(E,t)||function(e,t){var i;if(e)return"string"==typeof e?N(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?N(e,t):void 0}(E,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),A=E[0],C=E[1],R=Object(L.useRef)(null);return Object(L.useEffect)(function(){return A||C(z()({el:R.current,THREE:D,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,scaleMobile:p,backgroundColor:m,backgroundAlpha:f,color1:g,color2:v,colorMode:y,quantity:x,birdSize:w,wingSpan:b,speedLimit:M,separation:_,alignment:S,cohesion:T})),function(){A&&A.destroy()}},[A]),P.a.createElement("div",{id:i,children:n,className:Object(O.isString)(r)?r:r?Object(I.a)(r):void 0,style:s,key:o,ref:R,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},513:function(e,t,i){"use strict";i.r(t);var _=i(1),S=i.n(_),n=i(858),T=i.n(n),E=i(552),A=i(60),C=i(22),n=i(215);function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.highlightColor,p=e.midtoneColor,m=e.lowlightColor,f=e.baseColor,g=e.blurFactor,v=e.zoom,y=e.speed,e=(e.setProps,e.loading_state),x=(x=Object(_.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(x)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(x,t)||function(e,t){var i;if(e)return"string"==typeof e?R(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?R(e,t):void 0}(x,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=x[0],b=x[1],M=Object(_.useRef)(null);return Object(_.useEffect)(function(){return w||b(T()({el:M.current,THREE:E,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,highlightColor:d,midtoneColor:p,lowlightColor:m,baseColor:f,blurFactor:g,zoom:v,speed:y})),function(){w&&w.destroy()}},[w]),S.a.createElement("div",{id:i,children:n,className:Object(C.isString)(r)?r:r?Object(A.a)(r):void 0,style:s,key:o,ref:M,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},514:function(e,t,i){"use strict";i.r(t);var _=i(1),S=i.n(_),n=i(859),T=i.n(n),E=i(552),A=i(60),C=i(22),n=i(216);function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.scaleMobile,m=e.color,f=e.shininess,g=e.waveHeight,v=e.waveSpeed,y=e.zoom,e=(e.setProps,e.loading_state),x=(x=Object(_.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(x)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(x,t)||function(e,t){var i;if(e)return"string"==typeof e?R(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?R(e,t):void 0}(x,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=x[0],b=x[1],M=Object(_.useRef)(null);return Object(_.useEffect)(function(){return w||b(T()({el:M.current,THREE:E,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,scaleMobile:p,color:m,shininess:f,waveHeight:g,waveSpeed:v,zoom:y})),function(){w&&w.destroy()}},[w]),S.a.createElement("div",{id:i,children:n,className:Object(C.isString)(r)?r:r?Object(A.a)(r):void 0,style:s,key:o,ref:M,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},515:function(e,t,i){"use strict";i.r(t);var S=i(1),T=i.n(S),n=i(860),E=i.n(n),A=i(552),C=i(60),R=i(22),n=i(217);function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.backgroundColor,p=e.skyColor,m=e.cloudColor,f=e.cloudShadowColor,g=e.sunColor,v=e.sunGlareColor,y=e.sunlightColor,x=e.speed,e=(e.setProps,e.loading_state),w=(w=Object(S.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(w)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(w,t)||function(e,t){var i;if(e)return"string"==typeof e?L(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?L(e,t):void 0}(w,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=w[0],M=w[1],_=Object(S.useRef)(null);return Object(S.useEffect)(function(){return b||M(E()({el:_.current,THREE:A,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,backgroundColor:d,skyColor:p,cloudColor:m,cloudShadowColor:f,sunColor:g,sunGlareColor:v,sunlightColor:y,speed:x})),function(){b&&b.destroy()}},[b]),T.a.createElement("div",{id:i,children:n,className:Object(R.isString)(r)?r:r?Object(C.a)(r):void 0,style:s,key:o,ref:_,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},516:function(e,t,i){"use strict";i.r(t);var _=i(1),S=i.n(_),n=i(861),T=i.n(n),E=i(552),A=i(60),C=i(22),n=i(218);function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.texturePath,m=e.backgroundColor,f=e.skyColor,g=e.cloudColor,v=e.lightColor,y=e.speed,e=(e.setProps,e.loading_state),x=(x=Object(_.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(x)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(x,t)||function(e,t){var i;if(e)return"string"==typeof e?R(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?R(e,t):void 0}(x,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=x[0],b=x[1],M=Object(_.useRef)(null);return Object(_.useEffect)(function(){return w||b(T()({el:M.current,THREE:E,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,texturePath:p,backgroundColor:m,skyColor:f,cloudColor:g,lightColor:v,speed:y})),function(){w&&w.destroy()}},[w]),S.a.createElement("div",{id:i,children:n,className:Object(C.isString)(r)?r:r?Object(A.a)(r):void 0,style:s,key:o,ref:M,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},517:function(e,t,i){"use strict";i.r(t);var M=i(1),_=i.n(M),n=i(862),S=i.n(n),T=i(552),E=i(60),A=i(22),n=i(219);function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.scaleMobile,m=e.backgroundColor,f=e.color,g=e.color2,v=e.size,e=(e.setProps,e.loading_state),y=(y=Object(M.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(y)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(y,t)||function(e,t){var i;if(e)return"string"==typeof e?C(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?C(e,t):void 0}(y,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),x=y[0],w=y[1],b=Object(M.useRef)(null);return Object(M.useEffect)(function(){return x||w(S()({el:b.current,THREE:T,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,scaleMobile:p,backgroundColor:m,color:f,color2:g,size:v})),function(){x&&x.destroy()}},[x]),_.a.createElement("div",{id:i,children:n,className:Object(A.isString)(r)?r:r?Object(E.a)(r):void 0,style:s,key:o,ref:b,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},518:function(e,t,i){"use strict";i.r(t);var S=i(1),T=i.n(S),n=i(863),E=i.n(n),A=i(552),C=i(60),R=i(22),n=i(220);function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.scaleMobile,m=e.color,f=e.backgroundColor,g=e.points,v=e.maxDistance,y=e.spacing,x=e.showDots,e=(e.setProps,e.loading_state),w=(w=Object(S.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(w)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(w,t)||function(e,t){var i;if(e)return"string"==typeof e?L(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?L(e,t):void 0}(w,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=w[0],M=w[1],_=Object(S.useRef)(null);return Object(S.useEffect)(function(){return b||M(E()({el:_.current,THREE:A,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,scaleMobile:p,color:m,backgroundColor:f,points:g,maxDistance:v,spacing:y,showDots:x})),function(){b&&b.destroy()}},[b]),T.a.createElement("div",{id:i,children:n,className:Object(R.isString)(r)?r:r?Object(C.a)(r):void 0,style:s,key:o,ref:_,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},519:function(e,t,i){"use strict";i.r(t);var b=i(1),M=i.n(b),n=i(864),_=i.n(n),S=i(552),T=i(60),E=i(22),n=i(221);function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.color1,m=e.color2,f=e.size,g=e.speed,e=(e.setProps,e.loading_state),v=(v=Object(b.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(v)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(v,t)||function(e,t){var i;if(e)return"string"==typeof e?A(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?A(e,t):void 0}(v,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=v[0],x=v[1],w=Object(b.useRef)(null);return Object(b.useEffect)(function(){return y||x(_()({el:w.current,THREE:S,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,color1:p,color2:m,size:f,speed:g})),function(){y&&y.destroy()}},[y]),M.a.createElement("div",{id:i,children:n,className:Object(E.isString)(r)?r:r?Object(T.a)(r):void 0,style:s,key:o,ref:w,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},520:function(e,t,i){"use strict";i.r(t);var b=i(1),M=i.n(b),n=i(865),_=i.n(n),S=i(552),T=i(60),E=i(22),n=i(222);function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.scaleMobile,m=e.color,f=e.backgroundColor,g=e.backgroundAlpha,e=(e.setProps,e.loading_state),v=(v=Object(b.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(v)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(v,t)||function(e,t){var i;if(e)return"string"==typeof e?A(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?A(e,t):void 0}(v,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=v[0],x=v[1],w=Object(b.useRef)(null);return Object(b.useEffect)(function(){return y||x(_()({el:w.current,THREE:S,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,scaleMobile:p,color:m,backgroundColor:f,backgroundAlpha:g})),function(){y&&y.destroy()}},[y]),M.a.createElement("div",{id:i,children:n,className:Object(E.isString)(r)?r:r?Object(T.a)(r):void 0,style:s,key:o,ref:w,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},521:function(e,t,i){"use strict";i.r(t);var M=i(1),_=i.n(M),n=i(866),S=i.n(n),T=i(552),E=i(60),A=i(22),n=i(223);function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.backgroundColor,p=e.baseColor,m=e.size,f=e.amplitudeFactor,g=e.xOffset,v=e.yOffset,e=(e.setProps,e.loading_state),y=(y=Object(M.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(y)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(y,t)||function(e,t){var i;if(e)return"string"==typeof e?C(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?C(e,t):void 0}(y,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),x=y[0],w=y[1],b=Object(M.useRef)(null);return Object(M.useEffect)(function(){return x||w(S()({el:b.current,THREE:T,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,backgroundColor:d,baseColor:p,size:m,amplitudeFactor:f,xOffset:g,yOffset:v})),function(){x&&x.destroy()}},[x]),_.a.createElement("div",{id:i,children:n,className:Object(A.isString)(r)?r:r?Object(E.a)(r):void 0,style:s,key:o,ref:b,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},552:function(d,e,t){"use strict";t.r(e),t.d(e,"ACESFilmicToneMapping",function(){return Se}),t.d(e,"AddEquation",function(){return ee}),t.d(e,"AddOperation",function(){return H}),t.d(e,"AdditiveAnimationBlendMode",function(){return bi}),t.d(e,"AdditiveBlending",function(){return Z}),t.d(e,"AlphaFormat",function(){return dt}),t.d(e,"AlwaysDepth",function(){return ve}),t.d(e,"AlwaysStencilFunc",function(){return Qi}),t.d(e,"AmbientLight",function(){return Yu}),t.d(e,"AmbientLightProbe",function(){return ud}),t.d(e,"AnimationClip",function(){return wu}),t.d(e,"AnimationLoader",function(){return Au}),t.d(e,"AnimationMixer",function(){return Ud}),t.d(e,"AnimationObjectGroup",function(){return Fd}),t.d(e,"AnimationUtils",function(){return m}),t.d(e,"ArcCurve",function(){return Qh}),t.d(e,"ArrayCamera",function(){return Sl}),t.d(e,"ArrowHelper",function(){return Ep}),t.d(e,"Audio",function(){return Md}),t.d(e,"AudioAnalyser",function(){return Cd}),t.d(e,"AudioContext",function(){return ld}),t.d(e,"AudioListener",function(){return bd}),t.d(e,"AudioLoader",function(){return hd}),t.d(e,"AxesHelper",function(){return Ap}),t.d(e,"AxisHelper",function(){return im}),t.d(e,"BackSide",function(){return Ae}),t.d(e,"BasicDepthPacking",function(){return zi}),t.d(e,"BasicShadowMap",function(){return R}),t.d(e,"BinaryTextureLoader",function(){return am}),t.d(e,"Bone",function(){return ah}),t.d(e,"BooleanKeyframeTrack",function(){return pu}),t.d(e,"BoundingBoxHelper",function(){return nm}),t.d(e,"Box2",function(){return Zd}),t.d(e,"Box3",function(){return Fn}),t.d(e,"Box3Helper",function(){return bp}),t.d(e,"BoxBufferGeometry",function(){return Is}),t.d(e,"BoxGeometry",function(){return Is}),t.d(e,"BoxHelper",function(){return wp}),t.d(e,"BufferAttribute",function(){return T}),t.d(e,"BufferGeometry",function(){return _}),t.d(e,"BufferGeometryLoader",function(){return td}),t.d(e,"ByteType",function(){return tt}),t.d(e,"Cache",function(){return bu}),t.d(e,"Camera",function(){return Hs}),t.d(e,"CameraHelper",function(){return yp}),t.d(e,"CanvasRenderer",function(){return hm}),t.d(e,"CanvasTexture",function(){return Bh}),t.d(e,"CatmullRomCurve3",function(){return nc}),t.d(e,"CineonToneMapping",function(){return V}),t.d(e,"CircleBufferGeometry",function(){return Hh}),t.d(e,"CircleGeometry",function(){return Hh}),t.d(e,"ClampToEdgeWrapping",function(){return Ce}),t.d(e,"Clock",function(){return fd}),t.d(e,"Color",function(){return g}),t.d(e,"ColorKeyframeTrack",function(){return mu}),t.d(e,"CompressedTexture",function(){return Nh}),t.d(e,"CompressedTextureLoader",function(){return Cu}),t.d(e,"ConeBufferGeometry",function(){return Gh}),t.d(e,"ConeGeometry",function(){return Gh}),t.d(e,"CubeCamera",function(){return Us}),t.d(e,"CubeReflectionMapping",function(){return Fe}),t.d(e,"CubeRefractionMapping",function(){return He}),t.d(e,"CubeTexture",function(){return Gs}),t.d(e,"CubeTextureLoader",function(){return Lu}),t.d(e,"CubeUVReflectionMapping",function(){return We}),t.d(e,"CubeUVRefractionMapping",function(){return ke}),t.d(e,"CubicBezierCurve",function(){return ac}),t.d(e,"CubicBezierCurve3",function(){return lc}),t.d(e,"CubicInterpolant",function(){return hu}),t.d(e,"CullFaceBack",function(){return X}),t.d(e,"CullFaceFront",function(){return q}),t.d(e,"CullFaceFrontBack",function(){return C}),t.d(e,"CullFaceNone",function(){return j}),t.d(e,"Curve",function(){return Jh}),t.d(e,"CurvePath",function(){return fc}),t.d(e,"CustomBlending",function(){return $}),t.d(e,"CustomToneMapping",function(){return Te}),t.d(e,"CylinderBufferGeometry",function(){return Uh}),t.d(e,"CylinderGeometry",function(){return Uh}),t.d(e,"Cylindrical",function(){return Yd}),t.d(e,"DataTexture",function(){return lh}),t.d(e,"DataTexture2DArray",function(){return Io}),t.d(e,"DataTexture3D",function(){return Uo}),t.d(e,"DataTextureLoader",function(){return Pu}),t.d(e,"DataUtils",function(){return Pp}),t.d(e,"DecrementStencilOp",function(){return Ui}),t.d(e,"DecrementWrapStencilOp",function(){return Wi}),t.d(e,"DefaultLoadingManager",function(){return _u}),t.d(e,"DepthFormat",function(){return vt}),t.d(e,"DepthStencilFormat",function(){return yt}),t.d(e,"DepthTexture",function(){return Fh}),t.d(e,"DirectionalLight",function(){return qu}),t.d(e,"DirectionalLightHelper",function(){return gp}),t.d(e,"DiscreteInterpolant",function(){return uu}),t.d(e,"DodecahedronBufferGeometry",function(){return kh}),t.d(e,"DodecahedronGeometry",function(){return kh}),t.d(e,"DoubleSide",function(){return Ne}),t.d(e,"DstAlphaFactor",function(){return ue}),t.d(e,"DstColorFactor",function(){return pe}),t.d(e,"DynamicBufferAttribute",function(){return Xp}),t.d(e,"DynamicCopyUsage",function(){return on}),t.d(e,"DynamicDrawUsage",function(){return $i}),t.d(e,"DynamicReadUsage",function(){return nn}),t.d(e,"EdgesGeometry",function(){return Yh}),t.d(e,"EdgesHelper",function(){return rm}),t.d(e,"EllipseCurve",function(){return Zh}),t.d(e,"EqualDepth",function(){return we}),t.d(e,"EqualStencilFunc",function(){return Xi}),t.d(e,"EquirectangularReflectionMapping",function(){return Ue}),t.d(e,"EquirectangularRefractionMapping",function(){return Ge}),t.d(e,"Euler",function(){return br}),t.d(e,"EventDispatcher",function(){return cn}),t.d(e,"ExtrudeBufferGeometry",function(){return Bc}),t.d(e,"ExtrudeGeometry",function(){return Bc}),t.d(e,"FaceColors",function(){return Op}),t.d(e,"FileLoader",function(){return Eu}),t.d(e,"FlatShading",function(){return D}),t.d(e,"Float16BufferAttribute",function(){return ls}),t.d(e,"Float32Attribute",function(){return em}),t.d(e,"Float32BufferAttribute",function(){return k}),t.d(e,"Float64Attribute",function(){return tm}),t.d(e,"Float64BufferAttribute",function(){return hs}),t.d(e,"FloatType",function(){return ot}),t.d(e,"Fog",function(){return zl}),t.d(e,"FogExp2",function(){return Pl}),t.d(e,"Font",function(){return gm}),t.d(e,"FontLoader",function(){return fm}),t.d(e,"FrontSide",function(){return Oe}),t.d(e,"Frustum",function(){return Js}),t.d(e,"GLBufferAttribute",function(){return kd}),t.d(e,"GLSL1",function(){return ln}),t.d(e,"GLSL3",function(){return hn}),t.d(e,"GammaEncoding",function(){return Ei}),t.d(e,"GreaterDepth",function(){return Me}),t.d(e,"GreaterEqualDepth",function(){return be}),t.d(e,"GreaterEqualStencilFunc",function(){return Zi}),t.d(e,"GreaterStencilFunc",function(){return Yi}),t.d(e,"GridHelper",function(){return up}),t.d(e,"Group",function(){return Tl}),t.d(e,"HalfFloatType",function(){return at}),t.d(e,"HemisphereLight",function(){return Iu}),t.d(e,"HemisphereLightHelper",function(){return cp}),t.d(e,"HemisphereLightProbe",function(){return cd}),t.d(e,"IcosahedronBufferGeometry",function(){return Hc}),t.d(e,"IcosahedronGeometry",function(){return Hc}),t.d(e,"ImageBitmapLoader",function(){return od}),t.d(e,"ImageLoader",function(){return Ru}),t.d(e,"ImageUtils",function(){return Rn}),t.d(e,"ImmediateRenderObject",function(){return vm}),t.d(e,"IncrementStencilOp",function(){return Hi}),t.d(e,"IncrementWrapStencilOp",function(){return Gi}),t.d(e,"InstancedBufferAttribute",function(){return dh}),t.d(e,"InstancedBufferGeometry",function(){return ed}),t.d(e,"InstancedInterleavedBuffer",function(){return Wd}),t.d(e,"InstancedMesh",function(){return vh}),t.d(e,"Int16Attribute",function(){return Zp}),t.d(e,"Int16BufferAttribute",function(){return rs}),t.d(e,"Int32Attribute",function(){return Kp}),t.d(e,"Int32BufferAttribute",function(){return os}),t.d(e,"Int8Attribute",function(){return qp}),t.d(e,"Int8BufferAttribute",function(){return ts}),t.d(e,"IntType",function(){return rt}),t.d(e,"InterleavedBuffer",function(){return Il}),t.d(e,"InterleavedBufferAttribute",function(){return Ol}),t.d(e,"Interpolant",function(){return lu}),t.d(e,"InterpolateDiscrete",function(){return mi}),t.d(e,"InterpolateLinear",function(){return fi}),t.d(e,"InterpolateSmooth",function(){return gi}),t.d(e,"InvertStencilOp",function(){return ki}),t.d(e,"JSONLoader",function(){return cm}),t.d(e,"KeepStencilOp",function(){return Bi}),t.d(e,"KeyframeTrack",function(){return du}),t.d(e,"LOD",function(){return eh}),t.d(e,"LatheBufferGeometry",function(){return Uc}),t.d(e,"LatheGeometry",function(){return Uc}),t.d(e,"Layers",function(){return Mr}),t.d(e,"LensFlare",function(){return dm}),t.d(e,"LessDepth",function(){return ye}),t.d(e,"LessEqualDepth",function(){return xe}),t.d(e,"LessEqualStencilFunc",function(){return qi}),t.d(e,"LessStencilFunc",function(){return ji}),t.d(e,"Light",function(){return Du}),t.d(e,"LightProbe",function(){return Qu}),t.d(e,"Line",function(){return _h}),t.d(e,"Line3",function(){return $d}),t.d(e,"LineBasicMaterial",function(){return y}),t.d(e,"LineCurve",function(){return hc}),t.d(e,"LineCurve3",function(){return cc}),t.d(e,"LineDashedMaterial",function(){return ou}),t.d(e,"LineLoop",function(){return Ah}),t.d(e,"LinePieces",function(){return Dp}),t.d(e,"LineSegments",function(){return Eh}),t.d(e,"LineStrip",function(){return zp}),t.d(e,"LinearEncoding",function(){return Pe}),t.d(e,"LinearFilter",function(){return F}),t.d(e,"LinearInterpolant",function(){return cu}),t.d(e,"LinearMipMapLinearFilter",function(){return $e}),t.d(e,"LinearMipMapNearestFilter",function(){return Qe}),t.d(e,"LinearMipmapLinearFilter",function(){return Ke}),t.d(e,"LinearMipmapNearestFilter",function(){return Ze}),t.d(e,"LinearToneMapping",function(){return U}),t.d(e,"Loader",function(){return Su}),t.d(e,"LoaderUtils",function(){return $u}),t.d(e,"LoadingManager",function(){return Mu}),t.d(e,"LogLuvEncoding",function(){return Ci}),t.d(e,"LoopOnce",function(){return ui}),t.d(e,"LoopPingPong",function(){return pi}),t.d(e,"LoopRepeat",function(){return di}),t.d(e,"LuminanceAlphaFormat",function(){return ft}),t.d(e,"LuminanceFormat",function(){return mt}),t.d(e,"MOUSE",function(){return b}),t.d(e,"Material",function(){return i}),t.d(e,"MaterialLoader",function(){return Ku}),t.d(e,"Math",function(){return Mn}),t.d(e,"MathUtils",function(){return Mn}),t.d(e,"Matrix3",function(){return v}),t.d(e,"Matrix4",function(){return Ie}),t.d(e,"MaxEquation",function(){return re}),t.d(e,"Mesh",function(){return S}),t.d(e,"MeshBasicMaterial",function(){return $r}),t.d(e,"MeshDepthMaterial",function(){return yl}),t.d(e,"MeshDistanceMaterial",function(){return xl}),t.d(e,"MeshFaceMaterial",function(){return Bp}),t.d(e,"MeshLambertMaterial",function(){return ru}),t.d(e,"MeshMatcapMaterial",function(){return su}),t.d(e,"MeshNormalMaterial",function(){return nu}),t.d(e,"MeshPhongMaterial",function(){return tu}),t.d(e,"MeshPhysicalMaterial",function(){return eu}),t.d(e,"MeshStandardMaterial",function(){return $c}),t.d(e,"MeshToonMaterial",function(){return iu}),t.d(e,"MinEquation",function(){return ne}),t.d(e,"MirroredRepeatWrapping",function(){return je}),t.d(e,"MixOperation",function(){return N}),t.d(e,"MultiMaterial",function(){return Fp}),t.d(e,"MultiplyBlending",function(){return K}),t.d(e,"MultiplyOperation",function(){return O}),t.d(e,"NearestFilter",function(){return Re}),t.d(e,"NearestMipMapLinearFilter",function(){return Je}),t.d(e,"NearestMipMapNearestFilter",function(){return qe}),t.d(e,"NearestMipmapLinearFilter",function(){return Ye}),t.d(e,"NearestMipmapNearestFilter",function(){return Xe}),t.d(e,"NeverDepth",function(){return ge}),t.d(e,"NeverStencilFunc",function(){return Vi}),t.d(e,"NoBlending",function(){return Y}),t.d(e,"NoColors",function(){return Ip}),t.d(e,"NoToneMapping",function(){return Be}),t.d(e,"NormalAnimationBlendMode",function(){return wi}),t.d(e,"NormalBlending",function(){return J}),t.d(e,"NotEqualDepth",function(){return _e}),t.d(e,"NotEqualStencilFunc",function(){return Ji}),t.d(e,"NumberKeyframeTrack",function(){return fu}),t.d(e,"Object3D",function(){return u}),t.d(e,"ObjectLoader",function(){return id}),t.d(e,"ObjectSpaceNormalMap",function(){return Oi}),t.d(e,"OctahedronBufferGeometry",function(){return Gc}),t.d(e,"OctahedronGeometry",function(){return Gc}),t.d(e,"OneFactor",function(){return oe}),t.d(e,"OneMinusDstAlphaFactor",function(){return de}),t.d(e,"OneMinusDstColorFactor",function(){return me}),t.d(e,"OneMinusSrcAlphaFactor",function(){return ce}),t.d(e,"OneMinusSrcColorFactor",function(){return le}),t.d(e,"OrthographicCamera",function(){return oo}),t.d(e,"PCFShadowMap",function(){return L}),t.d(e,"PCFSoftShadowMap",function(){return P}),t.d(e,"PMREMGenerator",function(){return Mo}),t.d(e,"ParametricGeometry",function(){return pm}),t.d(e,"Particle",function(){return Up}),t.d(e,"ParticleBasicMaterial",function(){return kp}),t.d(e,"ParticleSystem",function(){return Gp}),t.d(e,"ParticleSystemMaterial",function(){return Vp}),t.d(e,"Path",function(){return gc}),t.d(e,"PerspectiveCamera",function(){return B}),t.d(e,"Plane",function(){return Xs}),t.d(e,"PlaneBufferGeometry",function(){return Ks}),t.d(e,"PlaneGeometry",function(){return Ks}),t.d(e,"PlaneHelper",function(){return Mp}),t.d(e,"PointCloud",function(){return Hp}),t.d(e,"PointCloudMaterial",function(){return Wp}),t.d(e,"PointLight",function(){return ju}),t.d(e,"PointLightHelper",function(){return op}),t.d(e,"Points",function(){return Dh}),t.d(e,"PointsMaterial",function(){return Ch}),t.d(e,"PolarGridHelper",function(){return dp}),t.d(e,"PolyhedronBufferGeometry",function(){return Wh}),t.d(e,"PolyhedronGeometry",function(){return Wh}),t.d(e,"PositionalAudio",function(){return Ad}),t.d(e,"PropertyBinding",function(){return x}),t.d(e,"PropertyMixer",function(){return Rd}),t.d(e,"QuadraticBezierCurve",function(){return uc}),t.d(e,"QuadraticBezierCurve3",function(){return dc}),t.d(e,"Quaternion",function(){return On}),t.d(e,"QuaternionKeyframeTrack",function(){return vu}),t.d(e,"QuaternionLinearInterpolant",function(){return gu}),t.d(e,"REVISION",function(){return w}),t.d(e,"RGBADepthPacking",function(){return Di}),t.d(e,"RGBAFormat",function(){return Le}),t.d(e,"RGBAIntegerFormat",function(){return St}),t.d(e,"RGBA_ASTC_10x10_Format",function(){return qt}),t.d(e,"RGBA_ASTC_10x5_Format",function(){return Vt}),t.d(e,"RGBA_ASTC_10x6_Format",function(){return jt}),t.d(e,"RGBA_ASTC_10x8_Format",function(){return Xt}),t.d(e,"RGBA_ASTC_12x10_Format",function(){return Yt}),t.d(e,"RGBA_ASTC_12x12_Format",function(){return Jt}),t.d(e,"RGBA_ASTC_4x4_Format",function(){return Nt}),t.d(e,"RGBA_ASTC_5x4_Format",function(){return Bt}),t.d(e,"RGBA_ASTC_5x5_Format",function(){return Ft}),t.d(e,"RGBA_ASTC_6x5_Format",function(){return Ht}),t.d(e,"RGBA_ASTC_6x6_Format",function(){return Ut}),t.d(e,"RGBA_ASTC_8x5_Format",function(){return Gt}),t.d(e,"RGBA_ASTC_8x6_Format",function(){return Wt}),t.d(e,"RGBA_ASTC_8x8_Format",function(){return kt}),t.d(e,"RGBA_BPTC_Format",function(){return Zt}),t.d(e,"RGBA_ETC2_EAC_Format",function(){return Ot}),t.d(e,"RGBA_PVRTC_2BPPV1_Format",function(){return zt}),t.d(e,"RGBA_PVRTC_4BPPV1_Format",function(){return Pt}),t.d(e,"RGBA_S3TC_DXT1_Format",function(){return Et}),t.d(e,"RGBA_S3TC_DXT3_Format",function(){return At}),t.d(e,"RGBA_S3TC_DXT5_Format",function(){return Ct}),t.d(e,"RGBDEncoding",function(){return Pi}),t.d(e,"RGBEEncoding",function(){return Ai}),t.d(e,"RGBEFormat",function(){return gt}),t.d(e,"RGBFormat",function(){return pt}),t.d(e,"RGBIntegerFormat",function(){return _t}),t.d(e,"RGBM16Encoding",function(){return Li}),t.d(e,"RGBM7Encoding",function(){return Ri}),t.d(e,"RGB_ETC1_Format",function(){return Dt}),t.d(e,"RGB_ETC2_Format",function(){return It}),t.d(e,"RGB_PVRTC_2BPPV1_Format",function(){return Lt}),t.d(e,"RGB_PVRTC_4BPPV1_Format",function(){return Rt}),t.d(e,"RGB_S3TC_DXT1_Format",function(){return Tt}),t.d(e,"RGFormat",function(){return bt}),t.d(e,"RGIntegerFormat",function(){return Mt}),t.d(e,"RawShaderMaterial",function(){return ao}),t.d(e,"Ray",function(){return ur}),t.d(e,"Raycaster",function(){return Vd}),t.d(e,"RectAreaLight",function(){return Ju}),t.d(e,"RedFormat",function(){return xt}),t.d(e,"RedIntegerFormat",function(){return wt}),t.d(e,"ReinhardToneMapping",function(){return G}),t.d(e,"RepeatWrapping",function(){return Ve}),t.d(e,"ReplaceStencilOp",function(){return Fi}),t.d(e,"ReverseSubtractEquation",function(){return ie}),t.d(e,"RingBufferGeometry",function(){return Wc}),t.d(e,"RingGeometry",function(){return Wc}),t.d(e,"SRGB8_ALPHA8_ASTC_10x10_Format",function(){return li}),t.d(e,"SRGB8_ALPHA8_ASTC_10x5_Format",function(){return si}),t.d(e,"SRGB8_ALPHA8_ASTC_10x6_Format",function(){return oi}),t.d(e,"SRGB8_ALPHA8_ASTC_10x8_Format",function(){return ai}),t.d(e,"SRGB8_ALPHA8_ASTC_12x10_Format",function(){return hi}),t.d(e,"SRGB8_ALPHA8_ASTC_12x12_Format",function(){return ci}),t.d(e,"SRGB8_ALPHA8_ASTC_4x4_Format",function(){return Qt}),t.d(e,"SRGB8_ALPHA8_ASTC_5x4_Format",function(){return Kt}),t.d(e,"SRGB8_ALPHA8_ASTC_5x5_Format",function(){return $t}),t.d(e,"SRGB8_ALPHA8_ASTC_6x5_Format",function(){return ei}),t.d(e,"SRGB8_ALPHA8_ASTC_6x6_Format",function(){return ti}),t.d(e,"SRGB8_ALPHA8_ASTC_8x5_Format",function(){return ii}),t.d(e,"SRGB8_ALPHA8_ASTC_8x6_Format",function(){return ni}),t.d(e,"SRGB8_ALPHA8_ASTC_8x8_Format",function(){return ri}),t.d(e,"Scene",function(){return Dl}),t.d(e,"SceneUtils",function(){return um}),t.d(e,"ShaderChunk",function(){return E}),t.d(e,"ShaderLib",function(){return $s}),t.d(e,"ShaderMaterial",function(){return Fs}),t.d(e,"ShadowMaterial",function(){return Kc}),t.d(e,"Shape",function(){return vc}),t.d(e,"ShapeBufferGeometry",function(){return kc}),t.d(e,"ShapeGeometry",function(){return kc}),t.d(e,"ShapePath",function(){return Cp}),t.d(e,"ShapeUtils",function(){return Ic}),t.d(e,"ShortType",function(){return it}),t.d(e,"Skeleton",function(){return uh}),t.d(e,"SkeletonHelper",function(){return sp}),t.d(e,"SkinnedMesh",function(){return oh}),t.d(e,"SmoothShading",function(){return I}),t.d(e,"Sphere",function(){return nr}),t.d(e,"SphereBufferGeometry",function(){return Vc}),t.d(e,"SphereGeometry",function(){return Vc}),t.d(e,"Spherical",function(){return qd}),t.d(e,"SphericalHarmonics3",function(){return Zu}),t.d(e,"SplineCurve",function(){return pc}),t.d(e,"SpotLight",function(){return Uu}),t.d(e,"SpotLightHelper",function(){return tp}),t.d(e,"Sprite",function(){return Zl}),t.d(e,"SpriteMaterial",function(){return Nl}),t.d(e,"SrcAlphaFactor",function(){return he}),t.d(e,"SrcAlphaSaturateFactor",function(){return fe}),t.d(e,"SrcColorFactor",function(){return ae}),t.d(e,"StaticCopyUsage",function(){return sn}),t.d(e,"StaticDrawUsage",function(){return Ki}),t.d(e,"StaticReadUsage",function(){return tn}),t.d(e,"StereoCamera",function(){return md}),t.d(e,"StreamCopyUsage",function(){return an}),t.d(e,"StreamDrawUsage",function(){return en}),t.d(e,"StreamReadUsage",function(){return rn}),t.d(e,"StringKeyframeTrack",function(){return yu}),t.d(e,"SubtractEquation",function(){return te}),t.d(e,"SubtractiveBlending",function(){return Q}),t.d(e,"TOUCH",function(){return M}),t.d(e,"TangentSpaceNormalMap",function(){return Ii}),t.d(e,"TetrahedronBufferGeometry",function(){return jc}),t.d(e,"TetrahedronGeometry",function(){return jc}),t.d(e,"TextGeometry",function(){return mm}),t.d(e,"Texture",function(){return c}),t.d(e,"TextureLoader",function(){return zu}),t.d(e,"TorusBufferGeometry",function(){return Xc}),t.d(e,"TorusGeometry",function(){return Xc}),t.d(e,"TorusKnotBufferGeometry",function(){return qc}),t.d(e,"TorusKnotGeometry",function(){return qc}),t.d(e,"Triangle",function(){return p}),t.d(e,"TriangleFanDrawMode",function(){return Si}),t.d(e,"TriangleStripDrawMode",function(){return _i}),t.d(e,"TrianglesDrawMode",function(){return Mi}),t.d(e,"TubeBufferGeometry",function(){return Yc}),t.d(e,"TubeGeometry",function(){return Yc}),t.d(e,"UVMapping",function(){return Ee}),t.d(e,"Uint16Attribute",function(){return Qp}),t.d(e,"Uint16BufferAttribute",function(){return ss}),t.d(e,"Uint32Attribute",function(){return $p}),t.d(e,"Uint32BufferAttribute",function(){return as}),t.d(e,"Uint8Attribute",function(){return Yp}),t.d(e,"Uint8BufferAttribute",function(){return is}),t.d(e,"Uint8ClampedAttribute",function(){return Jp}),t.d(e,"Uint8ClampedBufferAttribute",function(){return ns}),t.d(e,"Uniform",function(){return Gd}),t.d(e,"UniformsLib",function(){return A}),t.d(e,"UniformsUtils",function(){return Bs}),t.d(e,"UnsignedByteType",function(){return et}),t.d(e,"UnsignedInt248Type",function(){return ut}),t.d(e,"UnsignedIntType",function(){return st}),t.d(e,"UnsignedShort4444Type",function(){return lt}),t.d(e,"UnsignedShort5551Type",function(){return ht}),t.d(e,"UnsignedShort565Type",function(){return ct}),t.d(e,"UnsignedShortType",function(){return nt}),t.d(e,"VSMShadowMap",function(){return z}),t.d(e,"Vector2",function(){return W}),t.d(e,"Vector3",function(){return De}),t.d(e,"Vector4",function(){return ze}),t.d(e,"VectorKeyframeTrack",function(){return xu}),t.d(e,"Vertex",function(){return jp}),t.d(e,"VertexColors",function(){return Np}),t.d(e,"VideoTexture",function(){return Oh}),t.d(e,"WebGL1Renderer",function(){return Ll}),t.d(e,"WebGLCubeRenderTarget",function(){return Ws}),t.d(e,"WebGLMultipleRenderTargets",function(){return Dn}),t.d(e,"WebGLMultisampleRenderTarget",function(){return In}),t.d(e,"WebGLRenderTarget",function(){return zn}),t.d(e,"WebGLRenderTargetCube",function(){return lm}),t.d(e,"WebGLRenderer",function(){return s}),t.d(e,"WebGLUtils",function(){return _l}),t.d(e,"WireframeGeometry",function(){return Jc}),t.d(e,"WireframeHelper",function(){return sm}),t.d(e,"WrapAroundEnding",function(){return xi}),t.d(e,"XHRLoader",function(){return om}),t.d(e,"ZeroCurvatureEnding",function(){return vi}),t.d(e,"ZeroFactor",function(){return se}),t.d(e,"ZeroSlopeEnding",function(){return yi}),t.d(e,"ZeroStencilOp",function(){return Ni}),t.d(e,"sRGBEncoding",function(){return Ti});const w="134",b={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},M={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},j=0,X=1,q=2,C=3,R=0,L=1,P=2,z=3,Oe=0,Ae=1,Ne=2,D=1,I=2,Y=0,J=1,Z=2,Q=3,K=4,$=5,ee=100,te=101,ie=102,ne=103,re=104,se=200,oe=201,ae=202,le=203,he=204,ce=205,ue=206,de=207,pe=208,me=209,fe=210,ge=0,ve=1,ye=2,xe=3,we=4,be=5,Me=6,_e=7,O=0,N=1,H=2,Be=0,U=1,G=2,V=3,Se=4,Te=5,Ee=300,Fe=301,He=302,Ue=303,Ge=304,We=306,ke=307,Ve=1e3,Ce=1001,je=1002,Re=1003,Xe=1004,qe=1004,Ye=1005,Je=1005,F=1006,Ze=1007,Qe=1007,Ke=1008,$e=1008,et=1009,tt=1010,it=1011,nt=1012,rt=1013,st=1014,ot=1015,at=1016,lt=1017,ht=1018,ct=1019,ut=1020,dt=1021,pt=1022,Le=1023,mt=1024,ft=1025,gt=Le,vt=1026,yt=1027,xt=1028,wt=1029,bt=1030,Mt=1031,_t=1032,St=1033,Tt=33776,Et=33777,At=33778,Ct=33779,Rt=35840,Lt=35841,Pt=35842,zt=35843,Dt=36196,It=37492,Ot=37496,Nt=37808,Bt=37809,Ft=37810,Ht=37811,Ut=37812,Gt=37813,Wt=37814,kt=37815,Vt=37816,jt=37817,Xt=37818,qt=37819,Yt=37820,Jt=37821,Zt=36492,Qt=37840,Kt=37841,$t=37842,ei=37843,ti=37844,ii=37845,ni=37846,ri=37847,si=37848,oi=37849,ai=37850,li=37851,hi=37852,ci=37853,ui=2200,di=2201,pi=2202,mi=2300,fi=2301,gi=2302,vi=2400,yi=2401,xi=2402,wi=2500,bi=2501,Mi=0,_i=1,Si=2,Pe=3e3,Ti=3001,Ei=3007,Ai=3002,Ci=3003,Ri=3004,Li=3005,Pi=3006,zi=3200,Di=3201,Ii=0,Oi=1,Ni=0,Bi=7680,Fi=7681,Hi=7682,Ui=7683,Gi=34055,Wi=34056,ki=5386,Vi=512,ji=513,Xi=514,qi=515,Yi=516,Ji=517,Zi=518,Qi=519,Ki=35044,$i=35048,en=35040,tn=35045,nn=35049,rn=35041,sn=35046,on=35050,an=35042,ln="100",hn="300 es";class cn{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){var i;return void 0!==this._listeners&&void 0!==(i=this._listeners)[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0!==this._listeners){var i=this._listeners[e];if(void 0!==i){const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}dispatchEvent(i){if(void 0!==this._listeners){var e=this._listeners[i.type];if(void 0!==e){i.target=this;var n=e.slice(0);for(let e=0,t=n.length;e<t;e++)n[e].call(this,i);i.target=null}}}}let un=1234567;const dn=Math.PI/180,pn=180/Math.PI,r=[];for(let e=0;e<256;e++)r[e]=(e<16?"0":"")+e.toString(16);const mn="undefined"!=typeof crypto&&"randomUUID"in crypto;function fn(){var e,t,i,n;return(mn?crypto.randomUUID():(e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r[255&e]+r[e>>8&255]+r[e>>16&255]+r[e>>24&255]+"-"+r[255&t]+r[t>>8&255]+"-"+r[t>>16&15|64]+r[t>>24&255]+"-"+r[63&i|128]+r[i>>8&255]+"-"+r[i>>16&255]+r[i>>24&255]+r[255&n]+r[n>>8&255]+r[n>>16&255]+r[n>>24&255])).toUpperCase()}function gn(e,t,i){return Math.max(t,Math.min(i,e))}function vn(e,t){return(e%t+t)%t}function yn(e,t,i){return(1-i)*e+i*t}function xn(e){return 0==(e&e-1)&&0!==e}function wn(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function bn(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var Mn=Object.freeze({__proto__:null,DEG2RAD:dn,RAD2DEG:pn,generateUUID:fn,clamp:gn,euclideanModulo:vn,mapLinear:function(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},inverseLerp:function(e,t,i){return e!==t?(i-e)/(t-e):0},lerp:yn,damp:function(e,t,i,n){return yn(e,t,1-Math.exp(-i*n))},pingpong:function(e,t=1){return t-Math.abs(vn(e,2*t)-t)},smoothstep:function(e,t,i){return e<=t?0:i<=e?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:i<=e?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return((un=16807*(un=void 0!==e?e%2147483647:un)%2147483647)-1)/2147483646},degToRad:function(e){return e*dn},radToDeg:function(e){return e*pn},isPowerOfTwo:xn,ceilPowerOfTwo:wn,floorPowerOfTwo:bn,setQuaternionFromProperEuler:function(e,t,i,n,r){var s=Math.cos,o=Math.sin,a=s(i/2),l=o(i/2),h=s((t+n)/2),c=o((t+n)/2),u=s((t-n)/2),d=o((t-n)/2),p=s((n-t)/2),m=o((n-t)/2);switch(r){case"XYX":e.set(a*c,l*u,l*d,a*h);break;case"YZY":e.set(l*d,a*c,l*u,a*h);break;case"ZXZ":e.set(l*u,l*d,a*c,a*h);break;case"XZX":e.set(a*c,l*m,l*p,a*h);break;case"YXY":e.set(l*p,a*c,l*m,a*h);break;case"ZYZ":e.set(l*m,l*p,a*c,a*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}});class W{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){var t=this.x,i=this.y,e=e.elements;return this.x=e[0]*t+e[3]*i+e[6],this.y=e[1]*t+e[4]*i+e[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){var t=this.x-e.x,e=this.y-e.y;return t*t+e*e}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){var i=Math.cos(t),t=Math.sin(t),n=this.x-e.x,r=this.y-e.y;return this.x=n*i-r*t+e.x,this.y=n*t+r*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}W.prototype.isVector2=!0;class v{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,n,r,s,o,a,l){var h=this.elements;return h[0]=e,h[1]=n,h[2]=o,h[3]=t,h[4]=r,h[5]=a,h[6]=i,h[7]=s,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){var t=this.elements,e=e.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){e=e.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){var e=e.elements,t=t.elements,i=this.elements,n=e[0],r=e[3],s=e[6],o=e[1],a=e[4],l=e[7],h=e[2],c=e[5],e=e[8],u=t[0],d=t[3],p=t[6],m=t[1],f=t[4],g=t[7],v=t[2],y=t[5],t=t[8];return i[0]=n*u+r*m+s*v,i[3]=n*d+r*f+s*y,i[6]=n*p+r*g+s*t,i[1]=o*u+a*m+l*v,i[4]=o*d+a*f+l*y,i[7]=o*p+a*g+l*t,i[2]=h*u+c*m+e*v,i[5]=h*d+c*f+e*y,i[8]=h*p+c*g+e*t,this}multiplyScalar(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(){var e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],e=e[8];return t*s*e-t*o*l-i*r*e+i*o*a+n*r*l-n*s*a}invert(){var e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],h=e[8],c=h*s-o*l,u=o*a-h*r,d=l*r-s*a,p=t*c+i*u+n*d;return 0==p?this.set(0,0,0,0,0,0,0,0,0):(e[0]=c*(c=1/p),e[1]=(n*l-h*i)*c,e[2]=(o*i-n*s)*c,e[3]=u*c,e[4]=(h*t-n*a)*c,e[5]=(n*r-o*t)*c,e[6]=d*c,e[7]=(i*a-l*t)*c,e[8]=(s*t-i*r)*c,this)}transpose(){var e=this.elements,t=e[1];return e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(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(e,t,i,n,r,s,o){var a=Math.cos(r),r=Math.sin(r);return this.set(i*a,i*r,-i*(a*s+r*o)+s+e,-n*r,n*a,-n*(-r*s+a*o)+o+t,0,0,1),this}scale(e,t){var i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this}rotate(e){var t=Math.cos(e),e=Math.sin(e),i=this.elements,n=i[0],r=i[3],s=i[6],o=i[1],a=i[4],l=i[7];return i[0]=t*n+e*o,i[3]=t*r+e*a,i[6]=t*s+e*l,i[1]=-e*n+t*o,i[4]=-e*r+t*a,i[7]=-e*s+t*l,this}translate(e,t){var i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this}equals(e){var t=this.elements,i=e.elements;for(let e=0;e<9;e++)if(t[e]!==i[e])return!1;return!0}fromArray(t,i=0){for(let e=0;e<9;e++)this.elements[e]=t[e+i];return this}toArray(e=[],t=0){var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}function _n(i){if(0===i.length)return-1/0;let n=i[0];for(let e=1,t=i.length;e<t;++e)i[e]>n&&(n=i[e]);return n}v.prototype.isMatrix3=!0;const Sn={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Tn(e,t){return new Sn[e](t)}function En(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function An(i,e=0){let n=3735928559^e,r=1103547991^e;for(let e,t=0;t<i.length;t++)e=i.charCodeAt(t),n=Math.imul(n^e,2654435761),r=Math.imul(r^e,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&(r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0)}let Cn;class Rn{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;var i;return 2048<(t=e instanceof HTMLCanvasElement?e:((Cn=void 0===Cn?En("canvas"):Cn).width=e.width,Cn.height=e.height,i=Cn.getContext("2d"),e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),Cn)).width||2048<t.height?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}let Ln=0;class c extends cn{constructor(e=c.DEFAULT_IMAGE,t=c.DEFAULT_MAPPING,i=Ce,n=Ce,r=F,s=Ke,o=Le,a=et,l=1,h=Pe){super(),Object.defineProperty(this,"id",{value:Ln++}),this.uuid=fn(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=s,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=a,this.offset=new W(0,0),this.repeat=new W(1,1),this.center=new W(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new v,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this}toJSON(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=fn()),!t&&void 0===e.images[n.uuid]){let i;if(Array.isArray(n)){i=[];for(let e=0,t=n.length;e<t;e++)n[e].isDataTexture?i.push(Pn(n[e].image)):i.push(Pn(n[e]))}else i=Pn(n);e.images[n.uuid]={uuid:n.uuid,url:i}}i.image=n.uuid}return"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping===Ee){if(e.applyMatrix3(this.matrix),e.x<0||1<e.x)switch(this.wrapS){case Ve:e.x=e.x-Math.floor(e.x);break;case Ce:e.x=e.x<0?0:1;break;case je:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||1<e.y)switch(this.wrapT){case Ve:e.y=e.y-Math.floor(e.y);break;case Ce:e.y=e.y<0?0:1;break;case je:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}return e}set needsUpdate(e){!0===e&&this.version++}}function Pn(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Rn.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}c.DEFAULT_IMAGE=void 0,c.DEFAULT_MAPPING=Ee,c.prototype.isTexture=!0;class ze{constructor(e=0,t=0,i=0,n=1){this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){var t=this.x,i=this.y,n=this.z,r=this.w,e=e.elements;return this.x=e[0]*t+e[4]*i+e[8]*n+e[12]*r,this.y=e[1]*t+e[5]*i+e[9]*n+e[13]*r,this.z=e[2]*t+e[6]*i+e[10]*n+e[14]*r,this.w=e[3]*t+e[7]*i+e[11]*n+e[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(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(e){let t,i,n,r;const s=e.elements,o=s[0],a=s[4],l=s[8],h=s[1],c=s[5],u=s[9],d=s[2],p=s[6],m=s[10];if(Math.abs(a-h)<.01&&Math.abs(l-d)<.01&&Math.abs(u-p)<.01)if(Math.abs(a+h)<.1&&Math.abs(l+d)<.1&&Math.abs(u+p)<.1&&Math.abs(o+c+m-3)<.1)this.set(1,0,0,0);else{t=Math.PI;const e=(o+1)/2,s=(c+1)/2,f=(m+1)/2,g=(a+h)/4,v=(l+d)/4,y=(u+p)/4;e>s&&e>f?r=e<.01?(i=0,n=.707106781):(i=Math.sqrt(e),n=g/i,v/i):s>f?r=s<.01?(i=.707106781,n=0,.707106781):(n=Math.sqrt(s),i=g/n,y/n):f<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(f),i=v/r,n=y/r),this.set(i,n,r,t)}else{let e=Math.sqrt((p-u)*(p-u)+(l-d)*(l-d)+(h-a)*(h-a));Math.abs(e)<.001&&(e=1),this.x=(p-u)/e,this.y=(l-d)/e,this.z=(h-a)/e,this.w=Math.acos((o+c+m-1)/2)}return this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}ze.prototype.isVector4=!0;class zn extends cn{constructor(e,t,i={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new ze(0,0,e,t),this.scissorTest=!1,this.viewport=new ze(0,0,e,t),this.texture=new c(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:F,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,i=1){this.width===e&&this.height===t&&this.depth===i||(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image={...this.texture.image},this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}zn.prototype.isWebGLRenderTarget=!0;class Dn extends zn{constructor(e,t,i){super(e,t);var n=this.texture;this.texture=[];for(let e=0;e<i;e++)this.texture[e]=n.clone()}setSize(i,n,r=1){if(this.width!==i||this.height!==n||this.depth!==r){this.width=i,this.height=n,this.depth=r;for(let e=0,t=this.texture.length;e<t;e++)this.texture[e].image.width=i,this.texture[e].image.height=n,this.texture[e].image.depth=r;this.dispose()}return this.viewport.set(0,0,i,n),this.scissor.set(0,0,i,n),this}copy(i){this.dispose(),this.width=i.width,this.height=i.height,this.depth=i.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture;for(let e=this.texture.length=0,t=i.texture.length;e<t;e++)this.texture[e]=i.texture[e].clone();return this}}Dn.prototype.isWebGLMultipleRenderTargets=!0;class In extends zn{constructor(e,t,i){super(e,t,i),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}In.prototype.isWebGLMultisampleRenderTarget=!0;class On{constructor(e=0,t=0,i=0,n=1){this._x=e,this._y=t,this._z=i,this._w=n}static slerp(e,t,i,n){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(e,t,n)}static slerpFlat(t,i,n,r,s,o,a){let l=n[r+0],h=n[r+1],c=n[r+2],u=n[r+3];var d=s[o+0],p=s[o+1],m=s[o+2],o=s[o+3];if(0===a)t[i+0]=l,t[i+1]=h,t[i+2]=c,t[i+3]=u;else if(1===a)t[i+0]=d,t[i+1]=p,t[i+2]=m,t[i+3]=o;else{if(u!==o||l!==d||h!==p||c!==m){let e=1-a;const i=l*d+h*p+c*m+u*o,n=0<=i?1:-1,r=1-i*i;if(r>Number.EPSILON){const s=Math.sqrt(r),o=Math.atan2(s,i*n);e=Math.sin(e*o)/s,a=Math.sin(a*o)/s}const s=a*n;if(l=l*e+d*s,h=h*e+p*s,c=c*e+m*s,u=u*e+o*s,e===1-a){const t=1/Math.sqrt(l*l+h*h+c*c+u*u);l*=t,h*=t,c*=t,u*=t}}t[i]=l,t[i+1]=h,t[i+2]=c,t[i+3]=u}}static multiplyQuaternionsFlat(e,t,i,n,r,s){var o=i[n],a=i[n+1],l=i[n+2],i=i[n+3],n=r[s],h=r[s+1],c=r[s+2],r=r[s+3];return e[t]=o*r+i*n+a*c-l*h,e[t+1]=a*r+i*h+l*n-o*c,e[t+2]=l*r+i*c+o*h-a*n,e[t+3]=i*r-o*n-a*h-l*c,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var i=e._x,n=e._y,r=e._z,s=e._order,e=Math.cos,o=Math.sin,a=e(i/2),l=e(n/2),h=e(r/2),c=o(i/2),u=o(n/2),d=o(r/2);switch(s){case"XYZ":this._x=c*l*h+a*u*d,this._y=a*u*h-c*l*d,this._z=a*l*d+c*u*h,this._w=a*l*h-c*u*d;break;case"YXZ":this._x=c*l*h+a*u*d,this._y=a*u*h-c*l*d,this._z=a*l*d-c*u*h,this._w=a*l*h+c*u*d;break;case"ZXY":this._x=c*l*h-a*u*d,this._y=a*u*h+c*l*d,this._z=a*l*d+c*u*h,this._w=a*l*h-c*u*d;break;case"ZYX":this._x=c*l*h-a*u*d,this._y=a*u*h+c*l*d,this._z=a*l*d-c*u*h,this._w=a*l*h+c*u*d;break;case"YZX":this._x=c*l*h+a*u*d,this._y=a*u*h+c*l*d,this._z=a*l*d-c*u*h,this._w=a*l*h-c*u*d;break;case"XZY":this._x=c*l*h-a*u*d,this._y=a*u*h-c*l*d,this._z=a*l*d+c*u*h,this._w=a*l*h+c*u*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){var t=t/2,i=Math.sin(t);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(t),this._onChangeCallback(),this}setFromRotationMatrix(e){var e=e.elements,t=e[0],i=e[4],n=e[8],r=e[1],s=e[5],o=e[9],a=e[2],l=e[6],h=e[10],c=t+s+h;if(0<c){const e=.5/Math.sqrt(c+1);this._w=.25/e,this._x=(l-o)*e,this._y=(n-a)*e,this._z=(r-i)*e}else if(s<t&&h<t){const e=2*Math.sqrt(1+t-s-h);this._w=(l-o)/e,this._x=.25*e,this._y=(i+r)/e,this._z=(n+a)/e}else if(h<s){const e=2*Math.sqrt(1+s-t-h);this._w=(n-a)/e,this._x=(i+r)/e,this._y=.25*e,this._z=(o+l)/e}else{const e=2*Math.sqrt(1+h-t-s);this._w=(r-i)/e,this._x=(n+a)/e,this._y=(o+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=i,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(gn(this.dot(e),-1,1)))}rotateTowards(e,t){var i=this.angleTo(e);return 0!==i&&(t=Math.min(1,t/i),this.slerp(e,t)),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(this._x=this._x*(e=1/e),this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){var i=e._x,n=e._y,r=e._z,e=e._w,s=t._x,o=t._y,a=t._z,t=t._w;return this._x=i*t+e*s+n*a-r*o,this._y=n*t+e*o+r*s-i*a,this._z=r*t+e*a+i*o-n*s,this._w=e*t-i*s-n*o-r*a,this._onChangeCallback(),this}slerp(t,i){if(0!==i){if(1===i)return this.copy(t);var n=this._x,r=this._y,s=this._z,o=this._w;let e=o*t._w+n*t._x+r*t._y+s*t._z;if(e<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,e=-e):this.copy(t),1<=e)this._w=o,this._x=n,this._y=r,this._z=s;else{t=1-e*e;if(t<=Number.EPSILON){const t=1-i;this._w=t*o+i*this._w,this._x=t*n+i*this._x,this._y=t*r+i*this._y,this._z=t*s+i*this._z,this.normalize()}else{var t=Math.sqrt(t),a=Math.atan2(t,e),l=Math.sin((1-i)*a)/t,i=Math.sin(i*a)/t;this._w=o*l+this._w*i,this._x=n*l+this._x*i,this._y=r*l+this._y*i,this._z=s*l+this._z*i}this._onChangeCallback()}}return this}slerpQuaternions(e,t,i){this.copy(e).slerp(t,i)}random(){var e=Math.random(),t=Math.sqrt(1-e),e=Math.sqrt(e),i=2*Math.PI*Math.random(),n=2*Math.PI*Math.random();return this.set(t*Math.cos(i),e*Math.sin(n),e*Math.cos(n),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}On.prototype.isQuaternion=!0;class De{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Bn.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Bn.setFromAxisAngle(e,t))}applyMatrix3(e){var t=this.x,i=this.y,n=this.z,e=e.elements;return this.x=e[0]*t+e[3]*i+e[6]*n,this.y=e[1]*t+e[4]*i+e[7]*n,this.z=e[2]*t+e[5]*i+e[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){var t=this.x,i=this.y,n=this.z,e=e.elements,r=1/(e[3]*t+e[7]*i+e[11]*n+e[15]);return this.x=(e[0]*t+e[4]*i+e[8]*n+e[12])*r,this.y=(e[1]*t+e[5]*i+e[9]*n+e[13])*r,this.z=(e[2]*t+e[6]*i+e[10]*n+e[14])*r,this}applyQuaternion(e){var t=this.x,i=this.y,n=this.z,r=e.x,s=e.y,o=e.z,e=e.w,a=e*t+s*n-o*i,l=e*i+o*t-r*n,h=e*n+r*i-s*t,t=-r*t-s*i-o*n;return this.x=a*e+t*-r+l*-o-h*-s,this.y=l*e+t*-s+h*-r-a*-o,this.z=h*e+t*-o+a*-s-l*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){var t=this.x,i=this.y,n=this.z,e=e.elements;return this.x=e[0]*t+e[4]*i+e[8]*n,this.y=e[1]*t+e[5]*i+e[9]*n,this.z=e[2]*t+e[6]*i+e[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){var i=e.x,n=e.y,e=e.z,r=t.x,s=t.y,t=t.z;return this.x=n*t-e*s,this.y=e*r-i*t,this.z=i*s-n*r,this}projectOnVector(e){var t=e.lengthSq();return 0===t?this.set(0,0,0):(t=e.dot(this)/t,this.copy(e).multiplyScalar(t))}projectOnPlane(e){return Nn.copy(this).projectOnVector(e),this.sub(Nn)}reflect(e){return this.sub(Nn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:(e=this.dot(e)/t,Math.acos(gn(e,-1,1)))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){var t=this.x-e.x,i=this.y-e.y,e=this.z-e.z;return t*t+i*i+e*e}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){var n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){e=e.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(e){var t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),e=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=e,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){var e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}De.prototype.isVector3=!0;const Nn=new De,Bn=new On;class Fn{constructor(e=new De(1/0,1/0,1/0),t=new De(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(i){let n=1/0,r=1/0,s=1/0,o=-1/0,a=-1/0,l=-1/0;for(let e=0,t=i.length;e<t;e+=3){var h=i[e],c=i[e+1],u=i[e+2];h<n&&(n=h),c<r&&(r=c),u<s&&(s=u),h>o&&(o=h),c>a&&(a=c),u>l&&(l=u)}return this.min.set(n,r,s),this.max.set(o,a,l),this}setFromBufferAttribute(i){let n=1/0,r=1/0,s=1/0,o=-1/0,a=-1/0,l=-1/0;for(let e=0,t=i.count;e<t;e++){var h=i.getX(e),c=i.getY(e),u=i.getZ(e);h<n&&(n=h),c<r&&(r=c),u<s&&(s=u),h>o&&(o=h),c>a&&(a=c),u>l&&(l=u)}return this.min.set(n,r,s),this.max.set(o,a,l),this}setFromPoints(i){this.makeEmpty();for(let e=0,t=i.length;e<t;e++)this.expandByPoint(i[e]);return this}setFromCenterAndSize(e,t){t=Un.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(t),this.max.copy(e).add(t),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);var t=e.geometry,i=(void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),Gn.copy(t.boundingBox),Gn.applyMatrix4(e.matrixWorld),this.union(Gn)),e.children);for(let e=0,t=i.length;e<t;e++)this.expandByObject(i[e]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Un),Un.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return i=0<e.normal.x?(t=e.normal.x*this.min.x,e.normal.x*this.max.x):(t=e.normal.x*this.max.x,e.normal.x*this.min.x),0<e.normal.y?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),0<e.normal.z?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){return!this.isEmpty()&&(this.getCenter(Yn),Jn.subVectors(this.max,Yn),Wn.subVectors(e.a,Yn),kn.subVectors(e.b,Yn),Vn.subVectors(e.c,Yn),jn.subVectors(kn,Wn),Xn.subVectors(Vn,kn),qn.subVectors(Wn,Vn),!!Kn([0,-jn.z,jn.y,0,-Xn.z,Xn.y,0,-qn.z,qn.y,jn.z,0,-jn.x,Xn.z,0,-Xn.x,qn.z,0,-qn.x,-jn.y,jn.x,0,-Xn.y,Xn.x,0,-qn.y,qn.x,0],Wn,kn,Vn,Jn))&&!!Kn([1,0,0,0,1,0,0,0,1],Wn,kn,Vn,Jn)&&(Zn.crossVectors(jn,Xn),Kn([Zn.x,Zn.y,Zn.z],Wn,kn,Vn,Jn))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Un.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(Un).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Hn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Hn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Hn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Hn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Hn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Hn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Hn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Hn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Hn)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}Fn.prototype.isBox3=!0;const Hn=[new De,new De,new De,new De,new De,new De,new De,new De],Un=new De,Gn=new Fn,Wn=new De,kn=new De,Vn=new De,jn=new De,Xn=new De,qn=new De,Yn=new De,Jn=new De,Zn=new De,Qn=new De;function Kn(i,n,r,s,o){for(let e=0,t=i.length-3;e<=t;e+=3){Qn.fromArray(i,e);var a=o.x*Math.abs(Qn.x)+o.y*Math.abs(Qn.y)+o.z*Math.abs(Qn.z),l=n.dot(Qn),h=r.dot(Qn),c=s.dot(Qn);if(Math.max(-Math.max(l,h,c),Math.min(l,h,c))>a)return!1}return!0}const $n=new Fn,er=new De,tr=new De,ir=new De;class nr{constructor(e=new De,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(i,e){var n=this.center;void 0!==e?n.copy(e):$n.setFromPoints(i).getCenter(n);let r=0;for(let e=0,t=i.length;e<t;e++)r=Math.max(r,n.distanceToSquared(i[e]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){var i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){ir.subVectors(e,this.center);var t=ir.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),i=.5*(e-this.radius);this.center.add(ir.multiplyScalar(i/e)),this.radius+=i}return this}union(e){return tr.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(er.copy(e.center).add(tr)),this.expandByPoint(er.copy(e.center).sub(tr)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const rr=new De,sr=new De,or=new De,ar=new De,lr=new De,hr=new De,cr=new De;class ur{constructor(e=new De,t=new De(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,rr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);e=t.dot(this.direction);return e<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(e).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){var t=rr.subVectors(e,this.origin).dot(this.direction);return(t<0?this.origin:(rr.copy(this.direction).multiplyScalar(t).add(this.origin),rr)).distanceToSquared(e)}distanceSqToSegment(e,t,i,n){sr.copy(e).add(t).multiplyScalar(.5),or.copy(t).sub(e).normalize(),ar.copy(this.origin).sub(sr);var e=.5*e.distanceTo(t),t=-this.direction.dot(or),r=ar.dot(this.direction),s=-ar.dot(or),o=ar.lengthSq(),a=Math.abs(1-t*t);let l,h,c,u;if(0<a)if(l=t*s-r,h=t*r-s,u=e*a,0<=l)if(h>=-u)if(h<=u){const e=1/a;l*=e,h*=e,c=l*(l+t*h+2*r)+h*(t*l+h+2*s)+o}else h=e,l=Math.max(0,-(t*h+r)),c=-l*l+h*(h+2*s)+o;else h=-e,l=Math.max(0,-(t*h+r)),c=-l*l+h*(h+2*s)+o;else c=h<=-u?(l=Math.max(0,-(-t*e+r)),h=0<l?-e:Math.min(Math.max(-e,-s),e),-l*l+h*(h+2*s)+o):h<=u?(l=0,(h=Math.min(Math.max(-e,-s),e))*(h+2*s)+o):(l=Math.max(0,-(t*e+r)),h=0<l?e:Math.min(Math.max(-e,-s),e),-l*l+h*(h+2*s)+o);else h=0<t?-e:e,l=Math.max(0,-(t*h+r)),c=-l*l+h*(h+2*s)+o;return i&&i.copy(this.direction).multiplyScalar(l).add(this.origin),n&&n.copy(or).multiplyScalar(h).add(sr),c}intersectSphere(e,t){rr.subVectors(e.center,this.origin);var i=rr.dot(this.direction),n=rr.dot(rr)-i*i,e=e.radius*e.radius;return e<n||(n=i+(e=Math.sqrt(e-n)),(i=i-e)<0&&n<0)?null:i<0?this.at(n,t):this.at(i,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){var t=e.normal.dot(this.direction);return 0===t?0===e.distanceToPoint(this.origin)?0:null:0<=(e=-(this.origin.dot(e.normal)+e.constant)/t)?e:null}intersectPlane(e,t){e=this.distanceToPlane(e);return null===e?null:this.at(e,t)}intersectsPlane(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,r,s,o,a;var l=1/this.direction.x,h=1/this.direction.y,c=1/this.direction.z,u=this.origin;return n=0<=l?(i=(e.min.x-u.x)*l,(e.max.x-u.x)*l):(i=(e.max.x-u.x)*l,(e.min.x-u.x)*l),s=0<=h?(r=(e.min.y-u.y)*h,(e.max.y-u.y)*h):(r=(e.max.y-u.y)*h,(e.min.y-u.y)*h),i>s||r>n||((r>i||i!=i)&&(i=r),(s<n||n!=n)&&(n=s),a=0<=c?(o=(e.min.z-u.z)*c,(e.max.z-u.z)*c):(o=(e.max.z-u.z)*c,(e.min.z-u.z)*c),i>a)||o>n||((o>i||i!=i)&&(i=o),(n=a<n||n!=n?a:n)<0)?null:this.at(0<=i?i:n,t)}intersectsBox(e){return null!==this.intersectBox(e,rr)}intersectTriangle(e,t,i,n,r){lr.subVectors(t,e),hr.subVectors(i,e),cr.crossVectors(lr,hr);let s,o=this.direction.dot(cr);if(0<o){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}ar.subVectors(this.origin,e);t=s*this.direction.dot(hr.crossVectors(ar,hr));return t<0||(i=s*this.direction.dot(lr.cross(ar)))<0||t+i>o||(n=-s*ar.dot(cr))<0?null:this.at(n/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Ie{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,n,r,s,o,a,l,h,c,u,d,p,m,f){var g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=h,g[10]=c,g[14]=u,g[3]=d,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Ie).fromArray(this.elements)}copy(e){var t=this.elements,e=e.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],this}copyPosition(e){var t=this.elements,e=e.elements;return t[12]=e[12],t[13]=e[13],t[14]=e[14],this}setFromMatrix3(e){e=e.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){var t=this.elements,i=e.elements,n=1/dr.setFromMatrixColumn(e,0).length(),r=1/dr.setFromMatrixColumn(e,1).length(),e=1/dr.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*e,t[9]=i[9]*e,t[10]=i[10]*e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,i=e.x,n=e.y,r=e.z,s=Math.cos(i),o=Math.sin(i),a=Math.cos(n),l=Math.sin(n),h=Math.cos(r),c=Math.sin(r);if("XYZ"===e.order){const e=s*h,i=s*c,n=o*h,r=o*c;t[0]=a*h,t[4]=-a*c,t[8]=l,t[1]=i+n*l,t[5]=e-r*l,t[9]=-o*a,t[2]=r-e*l,t[6]=n+i*l,t[10]=s*a}else if("YXZ"===e.order){const e=a*h,i=a*c,n=l*h,r=l*c;t[0]=e+r*o,t[4]=n*o-i,t[8]=s*l,t[1]=s*c,t[5]=s*h,t[9]=-o,t[2]=i*o-n,t[6]=r+e*o,t[10]=s*a}else if("ZXY"===e.order){const e=a*h,i=a*c,n=l*h,r=l*c;t[0]=e-r*o,t[4]=-s*c,t[8]=n+i*o,t[1]=i+n*o,t[5]=s*h,t[9]=r-e*o,t[2]=-s*l,t[6]=o,t[10]=s*a}else if("ZYX"===e.order){const e=s*h,i=s*c,n=o*h,r=o*c;t[0]=a*h,t[4]=n*l-i,t[8]=e*l+r,t[1]=a*c,t[5]=r*l+e,t[9]=i*l-n,t[2]=-l,t[6]=o*a,t[10]=s*a}else if("YZX"===e.order){const e=s*a,i=s*l,n=o*a,r=o*l;t[0]=a*h,t[4]=r-e*c,t[8]=n*c+i,t[1]=c,t[5]=s*h,t[9]=-o*h,t[2]=-l*h,t[6]=i*c+n,t[10]=e-r*c}else if("XZY"===e.order){const e=s*a,i=s*l,n=o*a,r=o*l;t[0]=a*h,t[4]=-c,t[8]=l*h,t[1]=e*c+r,t[5]=s*h,t[9]=i*c-n,t[2]=n*c-i,t[6]=o*h,t[10]=r*c+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(mr,e,fr)}lookAt(e,t,i){var n=this.elements;return yr.subVectors(e,t),0===yr.lengthSq()&&(yr.z=1),yr.normalize(),gr.crossVectors(i,yr),0===gr.lengthSq()&&(1===Math.abs(i.z)?yr.x+=1e-4:yr.z+=1e-4,yr.normalize(),gr.crossVectors(i,yr)),gr.normalize(),vr.crossVectors(yr,gr),n[0]=gr.x,n[4]=vr.x,n[8]=yr.x,n[1]=gr.y,n[5]=vr.y,n[9]=yr.y,n[2]=gr.z,n[6]=vr.z,n[10]=yr.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){var e=e.elements,t=t.elements,i=this.elements,n=e[0],r=e[4],s=e[8],o=e[12],a=e[1],l=e[5],h=e[9],c=e[13],u=e[2],d=e[6],p=e[10],m=e[14],f=e[3],g=e[7],v=e[11],e=e[15],y=t[0],x=t[4],w=t[8],b=t[12],M=t[1],_=t[5],S=t[9],T=t[13],E=t[2],A=t[6],C=t[10],R=t[14],L=t[3],P=t[7],z=t[11],t=t[15];return i[0]=n*y+r*M+s*E+o*L,i[4]=n*x+r*_+s*A+o*P,i[8]=n*w+r*S+s*C+o*z,i[12]=n*b+r*T+s*R+o*t,i[1]=a*y+l*M+h*E+c*L,i[5]=a*x+l*_+h*A+c*P,i[9]=a*w+l*S+h*C+c*z,i[13]=a*b+l*T+h*R+c*t,i[2]=u*y+d*M+p*E+m*L,i[6]=u*x+d*_+p*A+m*P,i[10]=u*w+d*S+p*C+m*z,i[14]=u*b+d*T+p*R+m*t,i[3]=f*y+g*M+v*E+e*L,i[7]=f*x+g*_+v*A+e*P,i[11]=f*w+g*S+v*C+e*z,i[15]=f*b+g*T+v*R+e*t,this}multiplyScalar(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(){var e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],s=e[1],o=e[5],a=e[9],l=e[13],h=e[2],c=e[6],u=e[10],d=e[14];return e[3]*(+r*a*c-n*l*c-r*o*u+i*l*u+n*o*d-i*a*d)+e[7]*(+t*a*d-t*l*u+r*s*u-n*s*d+n*l*h-r*a*h)+e[11]*(+t*l*c-t*o*d-r*s*c+i*s*d+r*o*h-i*l*h)+e[15]*(-n*o*h-t*a*c+t*o*u+n*s*c-i*s*u+i*a*h)}transpose(){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(e,t,i){var n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){var e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],h=e[8],c=e[9],u=e[10],d=e[11],p=e[12],m=e[13],f=e[14],g=e[15],v=c*f*l-m*u*l+m*a*d-o*f*d-c*a*g+o*u*g,y=p*u*l-h*f*l-p*a*d+s*f*d+h*a*g-s*u*g,x=h*m*l-p*c*l+p*o*d-s*m*d-h*o*g+s*c*g,w=p*c*a-h*m*a-p*o*u+s*m*u+h*o*f-s*c*f,b=t*v+i*y+n*x+r*w;return 0==b?this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0):(e[0]=v*(v=1/b),e[1]=(m*u*r-c*f*r-m*n*d+i*f*d+c*n*g-i*u*g)*v,e[2]=(o*f*r-m*a*r+m*n*l-i*f*l-o*n*g+i*a*g)*v,e[3]=(c*a*r-o*u*r-c*n*l+i*u*l+o*n*d-i*a*d)*v,e[4]=y*v,e[5]=(h*f*r-p*u*r+p*n*d-t*f*d-h*n*g+t*u*g)*v,e[6]=(p*a*r-s*f*r-p*n*l+t*f*l+s*n*g-t*a*g)*v,e[7]=(s*u*r-h*a*r+h*n*l-t*u*l-s*n*d+t*a*d)*v,e[8]=x*v,e[9]=(p*c*r-h*m*r-p*i*d+t*m*d+h*i*g-t*c*g)*v,e[10]=(s*m*r-p*o*r+p*i*l-t*m*l-s*i*g+t*o*g)*v,e[11]=(h*o*r-s*c*r-h*i*l+t*c*l+s*i*d-t*o*d)*v,e[12]=w*v,e[13]=(h*m*n-p*c*n+p*i*u-t*m*u-h*i*f+t*c*f)*v,e[14]=(p*o*n-s*m*n-p*i*a+t*m*a+s*i*f-t*o*f)*v,e[15]=(s*c*n-h*o*n+h*i*a-t*c*a-s*i*u+t*o*u)*v,this)}scale(e){var t=this.elements,i=e.x,n=e.y,e=e.z;return t[0]*=i,t[4]*=n,t[8]*=e,t[1]*=i,t[5]*=n,t[9]*=e,t[2]*=i,t[6]*=n,t[10]*=e,t[3]*=i,t[7]*=n,t[11]*=e,this}getMaxScaleOnAxis(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,e))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){var t=Math.cos(e),e=Math.sin(e);return this.set(1,0,0,0,0,t,-e,0,0,e,t,0,0,0,0,1),this}makeRotationY(e){var t=Math.cos(e),e=Math.sin(e);return this.set(t,0,e,0,0,1,0,0,-e,0,t,0,0,0,0,1),this}makeRotationZ(e){var t=Math.cos(e),e=Math.sin(e);return this.set(t,-e,0,0,e,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){var i=Math.cos(t),t=Math.sin(t),n=1-i,r=e.x,s=e.y,e=e.z,o=n*r,a=n*s;return this.set(o*r+i,o*s-t*e,o*e+t*s,0,o*s+t*e,a*s+i,a*e-t*r,0,o*e-t*s,a*e+t*r,n*e*e+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,r,s){return this.set(1,i,r,0,e,1,s,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){var n=this.elements,r=t._x,s=t._y,o=t._z,t=t._w,a=r+r,l=s+s,h=o+o,c=r*a,u=r*l,r=r*h,d=s*l,s=s*h,o=o*h,a=t*a,l=t*l,t=t*h,h=i.x,p=i.y,i=i.z;return n[0]=(1-(d+o))*h,n[1]=(u+t)*h,n[2]=(r-l)*h,n[3]=0,n[4]=(u-t)*p,n[5]=(1-(c+o))*p,n[6]=(s+a)*p,n[7]=0,n[8]=(r+l)*i,n[9]=(s-a)*i,n[10]=(1-(c+d))*i,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){var n=this.elements;let r=dr.set(n[0],n[1],n[2]).length();var s=dr.set(n[4],n[5],n[6]).length(),o=dr.set(n[8],n[9],n[10]).length(),e=(this.determinant()<0&&(r=-r),e.x=n[12],e.y=n[13],e.z=n[14],pr.copy(this),1/r),n=1/s,a=1/o;return pr.elements[0]*=e,pr.elements[1]*=e,pr.elements[2]*=e,pr.elements[4]*=n,pr.elements[5]*=n,pr.elements[6]*=n,pr.elements[8]*=a,pr.elements[9]*=a,pr.elements[10]*=a,t.setFromRotationMatrix(pr),i.x=r,i.y=s,i.z=o,this}makePerspective(e,t,i,n,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,a=2*r/(i-n),l=(t+e)/(t-e),i=(i+n)/(i-n),n=-(s+r)/(s-r),s=-2*s*r/(s-r);return o[0]=2*r/(t-e),o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=a,o[9]=i,o[13]=0,o[2]=0,o[6]=0,o[10]=n,o[14]=s,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,i,n,r,s){var o=this.elements,a=1/(t-e),l=1/(i-n),h=1/(s-r),t=(t+e)*a,e=(i+n)*l,i=(s+r)*h;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-t,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-e,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-i,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){var t=this.elements,i=e.elements;for(let e=0;e<16;e++)if(t[e]!==i[e])return!1;return!0}fromArray(t,i=0){for(let e=0;e<16;e++)this.elements[e]=t[e+i];return this}toArray(e=[],t=0){var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}Ie.prototype.isMatrix4=!0;const dr=new De,pr=new Ie,mr=new De(0,0,0),fr=new De(1,1,1),gr=new De,vr=new De,yr=new De,xr=new Ie,wr=new On;class br{constructor(e=0,t=0,i=0,n=br.DefaultOrder){this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){var e=e.elements,n=e[0],r=e[4],s=e[8],o=e[1],a=e[5],l=e[9],h=e[2],c=e[6],u=e[10];switch(t){case"XYZ":this._y=Math.asin(gn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,u),this._z=Math.atan2(-r,n)):(this._x=Math.atan2(c,a),this._z=0);break;case"YXZ":this._x=Math.asin(-gn(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(s,u),this._z=Math.atan2(o,a)):(this._y=Math.atan2(-h,n),this._z=0);break;case"ZXY":this._x=Math.asin(gn(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-h,u),this._z=Math.atan2(-r,a)):(this._y=0,this._z=Math.atan2(o,n));break;case"ZYX":this._y=Math.asin(-gn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(c,u),this._z=Math.atan2(o,n)):(this._x=0,this._z=Math.atan2(-r,a));break;case"YZX":this._z=Math.asin(gn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,a),this._y=Math.atan2(-h,n)):(this._x=0,this._y=Math.atan2(s,u));break;case"XZY":this._z=Math.asin(-gn(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(c,a),this._y=Math.atan2(s,n)):(this._x=Math.atan2(-l,u),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return xr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(xr,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return wr.setFromEuler(this),this.setFromQuaternion(wr,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new De(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}br.prototype.isEuler=!0,br.DefaultOrder="XYZ",br.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Mr{constructor(){this.mask=1}set(e){this.mask=1<<e|0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}}let _r=0;const Sr=new De,Tr=new On,Er=new Ie,Ar=new De,Cr=new De,Rr=new De,Lr=new On,Pr=new De(1,0,0),zr=new De(0,1,0),Dr=new De(0,0,1),Ir={type:"added"},Or={type:"removed"};class u extends cn{constructor(){super(),Object.defineProperty(this,"id",{value:_r++}),this.uuid=fn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=u.DefaultUp.clone();const e=new De,t=new br,i=new On,n=new De(1,1,1);t._onChange(function(){i.setFromEuler(t,!1)}),i._onChange(function(){t.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Ie},normalMatrix:{value:new v}}),this.matrix=new Ie,this.matrixWorld=new Ie,this.matrixAutoUpdate=u.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Mr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Tr.setFromAxisAngle(e,t),this.quaternion.multiply(Tr),this}rotateOnWorldAxis(e,t){return Tr.setFromAxisAngle(e,t),this.quaternion.premultiply(Tr),this}rotateX(e){return this.rotateOnAxis(Pr,e)}rotateY(e){return this.rotateOnAxis(zr,e)}rotateZ(e){return this.rotateOnAxis(Dr,e)}translateOnAxis(e,t){return Sr.copy(e).applyQuaternion(this.quaternion),this.position.add(Sr.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Pr,e)}translateY(e){return this.translateOnAxis(zr,e)}translateZ(e){return this.translateOnAxis(Dr,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(Er.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?Ar.copy(e):Ar.set(e,t,i);e=this.parent;this.updateWorldMatrix(!0,!1),Cr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Er.lookAt(Cr,Ar,this.up):Er.lookAt(Ar,Cr,this.up),this.quaternion.setFromRotationMatrix(Er),e&&(Er.extractRotation(e.matrixWorld),Tr.setFromRotationMatrix(Er),this.quaternion.premultiply(Tr.invert()))}add(e){if(1<arguments.length)for(let e=0;e<arguments.length;e++)this.add(arguments[e]);else e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),(e.parent=this).children.push(e),e.dispatchEvent(Ir)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e);return this}remove(e){if(1<arguments.length)for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);else{var t=this.children.indexOf(e);-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Or))}return this}removeFromParent(){var e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){var t=this.children[e];t.parent=null,t.dispatchEvent(Or)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),Er.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Er.multiply(e.parent.matrixWorld)),e.applyMatrix4(Er),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(i,n){if(this[i]===n)return this;for(let e=0,t=this.children.length;e<t;e++){var r=this.children[e].getObjectByProperty(i,n);if(void 0!==r)return r}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Cr,e,Rr),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Cr,Lr,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(i){i(this);var n=this.children;for(let e=0,t=n.length;e<t;e++)n[e].traverse(i)}traverseVisible(i){if(!1!==this.visible){i(this);var n=this.children;for(let e=0,t=n.length;e<t;e++)n[e].traverseVisible(i)}}traverseAncestors(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(i){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||i)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),i=!(this.matrixWorldNeedsUpdate=!1));var n=this.children;for(let e=0,t=n.length;e<t;e++)n[e].updateMatrixWorld(i)}updateWorldMatrix(i,e){var t=this.parent;if(!0===i&&null!==t&&t.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const i=this.children;for(let e=0,t=i.length;e<t;e++)i[e].updateWorldMatrix(!1,!0)}}toJSON(i){const n=void 0===i||"string"==typeof i,r={},s=(n&&(i={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"}),{});function o(e,t){return void 0===e[t.uuid]&&(e[t.uuid]=t.toJSON(i)),t.uuid}if(s.uuid=this.uuid,s.type=this.type,""!==this.name&&(s.name=this.name),!0===this.castShadow&&(s.castShadow=!0),!0===this.receiveShadow&&(s.receiveShadow=!0),!1===this.visible&&(s.visible=!1),!1===this.frustumCulled&&(s.frustumCulled=!1),0!==this.renderOrder&&(s.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor)&&(s.instanceColor=this.instanceColor.toJSON()),this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(i).uuid)),this.environment&&this.environment.isTexture&&(s.environment=this.environment.toJSON(i).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=o(i.geometries,this.geometry);const n=this.geometry.parameters;if(void 0!==n&&void 0!==n.shapes){const r=n.shapes;if(Array.isArray(r))for(let e=0,t=r.length;e<t;e++){const s=r[e];o(i.shapes,s)}else o(i.shapes,r)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton)&&(o(i.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid),void 0!==this.material)if(Array.isArray(this.material)){const n=[];for(let e=0,t=this.material.length;e<t;e++)n.push(o(i.materials,this.material[e]));s.material=n}else s.material=o(i.materials,this.material);if(0<this.children.length){s.children=[];for(let e=0;e<this.children.length;e++)s.children.push(this.children[e].toJSON(i).object)}if(0<this.animations.length){s.animations=[];for(let e=0;e<this.animations.length;e++){const r=this.animations[e];s.animations.push(o(i.animations,r))}}if(n){const n=e(i.geometries),s=e(i.materials),o=e(i.textures),t=e(i.images),a=e(i.shapes),l=e(i.skeletons),h=e(i.animations);0<n.length&&(r.geometries=n),0<s.length&&(r.materials=s),0<o.length&&(r.textures=o),0<t.length&&(r.images=t),0<a.length&&(r.shapes=a),0<l.length&&(r.skeletons=l),0<h.length&&(r.animations=h)}return r.object=s,r;function e(e){var t=[];for(const n in e){var i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){var i=t.children[e];this.add(i.clone())}return this}}u.DefaultUp=new De(0,1,0),u.DefaultMatrixAutoUpdate=!0,u.prototype.isObject3D=!0;const Nr=new De,Br=new De,Fr=new De,Hr=new De,Ur=new De,Gr=new De,Wr=new De,kr=new De,Vr=new De,jr=new De;class p{constructor(e=new De,t=new De,i=new De){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),Nr.subVectors(e,t),n.cross(Nr);i=n.lengthSq();return 0<i?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)}static getBarycoord(e,t,i,n,r){Nr.subVectors(n,t),Br.subVectors(i,t),Fr.subVectors(e,t);var n=Nr.dot(Nr),i=Nr.dot(Br),e=Nr.dot(Fr),t=Br.dot(Br),s=Br.dot(Fr),o=n*t-i*i;return 0==o?r.set(-2,-1,-1):r.set(1-(t=(t*e-i*s)*(r=1/o))-(o=(n*s-i*e)*r),o,t)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,Hr),0<=Hr.x&&0<=Hr.y&&Hr.x+Hr.y<=1}static getUV(e,t,i,n,r,s,o,a){return this.getBarycoord(e,t,i,n,Hr),a.set(0,0),a.addScaledVector(r,Hr.x),a.addScaledVector(s,Hr.y),a.addScaledVector(o,Hr.z),a}static isFrontFacing(e,t,i,n){return Nr.subVectors(i,t),Br.subVectors(e,t),Nr.cross(Br).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Nr.subVectors(this.c,this.b),Br.subVectors(this.a,this.b),.5*Nr.cross(Br).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return p.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return p.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,n,r){return p.getUV(e,this.a,this.b,this.c,t,i,n,r)}containsPoint(e){return p.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return p.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){var i=this.a,n=this.b,r=this.c;let s,o;Ur.subVectors(n,i),Gr.subVectors(r,i),kr.subVectors(e,i);var a=Ur.dot(kr),l=Gr.dot(kr);if(a<=0&&l<=0)return t.copy(i);Vr.subVectors(e,n);var h=Ur.dot(Vr),c=Gr.dot(Vr);if(0<=h&&c<=h)return t.copy(n);var u=a*c-h*l;if(u<=0&&0<=a&&h<=0)return s=a/(a-h),t.copy(i).addScaledVector(Ur,s);jr.subVectors(e,r);var e=Ur.dot(jr),d=Gr.dot(jr);return 0<=d&&e<=d?t.copy(r):(a=e*l-a*d)<=0&&0<=l&&d<=0?(o=l/(l-d),t.copy(i).addScaledVector(Gr,o)):(l=h*d-e*c)<=0&&0<=c-h&&0<=e-d?(Wr.subVectors(r,n),o=(c-h)/(c-h+(e-d)),t.copy(n).addScaledVector(Wr,o)):(r=1/(l+a+u),s=a*r,o=u*r,t.copy(i).addScaledVector(Ur,s).addScaledVector(Gr,o))}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Xr=0;class i extends cn{constructor(){super(),Object.defineProperty(this,"id",{value:Xr++}),this.uuid=fn(),this.name="",this.type="Material",this.fog=!0,this.blending=J,this.side=Oe,this.vertexColors=!1,this.opacity=1,this.format=Le,this.transparent=!1,this.blendSrc=he,this.blendDst=ce,this.blendEquation=ee,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=xe,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Qi,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Bi,this.stencilZFail=Bi,this.stencilZPass=Bi,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.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){0<this._alphaTest!=0<e&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const n in e){var t,i=e[n];void 0===i?console.warn("THREE.Material: '"+n+"' parameter is undefined."):"shading"===n?(console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===D):void 0!==(t=this[n])?t&&t.isColor?t.set(i):t&&t.isVector3&&i&&i.isVector3?t.copy(i):this[n]=i:console.warn("THREE."+this.type+": '"+n+"' is not a property of this material.")}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(e){var t=[];for(const n in e){var i=e[n];delete i.metadata,t.push(i)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine)&&(i.combine=this.combine),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==J&&(i.blending=this.blending),this.side!==Oe&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.format!==Le&&(i.format=this.format),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),0<this.alphaTest&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),1<this.wireframeLinewidth&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),t){const t=n(e.textures),r=n(e.images);0<t.length&&(i.textures=t),0<r.length&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.format=t.format,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var i=t.clippingPlanes;let n=null;if(null!==i){const t=i.length;n=new Array(t);for(let e=0;e!==t;++e)n[e]=i[e].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}i.prototype.isMaterial=!0;const qr={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},Yr={h:0,s:0,l:0},Jr={h:0,s:0,l:0};function Zr(e,t,i){return i<0&&(i+=1),1<i&&--i,i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}function Qr(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Kr(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class g{constructor(e,t,i){return void 0===t&&void 0===i?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,i){return this.r=e,this.g=t,this.b=i,this}setHSL(e,t,i){return e=vn(e,1),t=gn(t,0,1),i=gn(i,0,1),0===t?this.r=this.g=this.b=i:(this.r=Zr(t=2*i-(i=i<=.5?i*(1+t):i+t-i*t),i,e+1/3),this.g=Zr(t,i,e),this.b=Zr(t,i,e-1/3)),this}setStyle(t){function i(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let e;var r=n[1],s=n[2];switch(r){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,i(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,i(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const n=parseFloat(e[1])/360,o=parseInt(e[2],10)/100,a=parseInt(e[3],10)/100;return i(e[4]),this.setHSL(n,o,a)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],i=t.length;if(3===i)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===i)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&0<t.length?this.setColorName(t):this}setColorName(e){var t=qr[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){t=0<t?1/t:1;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=Qr(e.r),this.g=Qr(e.g),this.b=Qr(e.b),this}copyLinearToSRGB(e){return this.r=Kr(e.r),this.g=Kr(e.g),this.b=Kr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){var t=this.r,i=this.g,n=this.b,r=Math.max(t,i,n),s=Math.min(t,i,n);let o,a;var l=(s+r)/2;if(s===r)o=0,a=0;else{const e=r-s;switch(a=l<=.5?e/(r+s):e/(2-r-s),r){case t:o=(i-n)/e+(i<n?6:0);break;case i:o=(n-t)/e+2;break;case n:o=(t-i)/e+4}o/=6}return e.h=o,e.s=a,e.l=l,e}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(e,t,i){return this.getHSL(Yr),Yr.h+=e,Yr.s+=t,Yr.l+=i,this.setHSL(Yr.h,Yr.s,Yr.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Yr),e.getHSL(Jr);var e=yn(Yr.h,Jr.h,t),i=yn(Yr.s,Jr.s,t),t=yn(Yr.l,Jr.l,t);return this.setHSL(e,i,t),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}g.NAMES=qr,g.prototype.isColor=!0,g.prototype.r=1,g.prototype.g=1,g.prototype.b=1;class $r extends i{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new g(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=O,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}$r.prototype.isMeshBasicMaterial=!0;const n=new De,es=new W;class T{constructor(e,t,i){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===i,this.usage=Ki,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(i,n,r){i*=this.itemSize,r*=n.itemSize;for(let e=0,t=this.itemSize;e<t;e++)this.array[i+e]=n.array[r+e];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(i){var n=this.array;let r=0;for(let t=0,e=i.length;t<e;t++){let e=i[t];void 0===e&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",t),e=new g),n[r++]=e.r,n[r++]=e.g,n[r++]=e.b}return this}copyVector2sArray(i){var n=this.array;let r=0;for(let t=0,e=i.length;t<e;t++){let e=i[t];void 0===e&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",t),e=new W),n[r++]=e.x,n[r++]=e.y}return this}copyVector3sArray(i){var n=this.array;let r=0;for(let t=0,e=i.length;t<e;t++){let e=i[t];void 0===e&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",t),e=new De),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z}return this}copyVector4sArray(i){var n=this.array;let r=0;for(let t=0,e=i.length;t<e;t++){let e=i[t];void 0===e&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",t),e=new ze),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r++]=e.w}return this}applyMatrix3(i){if(2===this.itemSize)for(let e=0,t=this.count;e<t;e++)es.fromBufferAttribute(this,e),es.applyMatrix3(i),this.setXY(e,es.x,es.y);else if(3===this.itemSize)for(let e=0,t=this.count;e<t;e++)n.fromBufferAttribute(this,e),n.applyMatrix3(i),this.setXYZ(e,n.x,n.y,n.z);return this}applyMatrix4(i){for(let e=0,t=this.count;e<t;e++)n.x=this.getX(e),n.y=this.getY(e),n.z=this.getZ(e),n.applyMatrix4(i),this.setXYZ(e,n.x,n.y,n.z);return this}applyNormalMatrix(i){for(let e=0,t=this.count;e<t;e++)n.x=this.getX(e),n.y=this.getY(e),n.z=this.getZ(e),n.applyNormalMatrix(i),this.setXYZ(e,n.x,n.y,n.z);return this}transformDirection(i){for(let e=0,t=this.count;e<t;e++)n.x=this.getX(e),n.y=this.getY(e),n.z=this.getZ(e),n.transformDirection(i),this.setXYZ(e,n.x,n.y,n.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){var e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==Ki&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}}T.prototype.isBufferAttribute=!0;class ts extends T{constructor(e,t,i){super(new Int8Array(e),t,i)}}class is extends T{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class ns extends T{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class rs extends T{constructor(e,t,i){super(new Int16Array(e),t,i)}}class ss extends T{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class os extends T{constructor(e,t,i){super(new Int32Array(e),t,i)}}class as extends T{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class ls extends T{constructor(e,t,i){super(new Uint16Array(e),t,i)}}ls.prototype.isFloat16BufferAttribute=!0;class k extends T{constructor(e,t,i){super(new Float32Array(e),t,i)}}class hs extends T{constructor(e,t,i){super(new Float64Array(e),t,i)}}let cs=0;const us=new Ie,ds=new u,ps=new De,ms=new Fn,fs=new Fn,h=new De;class _ extends cn{constructor(){super(),Object.defineProperty(this,"id",{value:cs++}),this.uuid=fn(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(65535<_n(e)?as:ss)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){const t=(new v).getNormalMatrix(e);i.applyNormalMatrix(t),i.needsUpdate=!0}i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return us.makeRotationFromQuaternion(e),this.applyMatrix4(us),this}rotateX(e){return us.makeRotationX(e),this.applyMatrix4(us),this}rotateY(e){return us.makeRotationY(e),this.applyMatrix4(us),this}rotateZ(e){return us.makeRotationZ(e),this.applyMatrix4(us),this}translate(e,t,i){return us.makeTranslation(e,t,i),this.applyMatrix4(us),this}scale(e,t,i){return us.makeScale(e,t,i),this.applyMatrix4(us),this}lookAt(e){return ds.lookAt(e),ds.updateMatrix(),this.applyMatrix4(ds.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ps).negate(),this.translate(ps.x,ps.y,ps.z),this}setFromPoints(i){var n=[];for(let e=0,t=i.length;e<t;e++){var r=i[e];n.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new k(n,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Fn);var e=this.attributes.position,i=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingBox.set(new De(-1/0,-1/0,-1/0),new De(1/0,1/0,1/0));else{if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),i)for(let e=0,t=i.length;e<t;e++){var n=i[e];ms.setFromBufferAttribute(n),this.morphTargetsRelative?(h.addVectors(this.boundingBox.min,ms.min),this.boundingBox.expandByPoint(h),h.addVectors(this.boundingBox.max,ms.max),this.boundingBox.expandByPoint(h)):(this.boundingBox.expandByPoint(ms.min),this.boundingBox.expandByPoint(ms.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(){null===this.boundingSphere&&(this.boundingSphere=new nr);var n=this.attributes.position,r=this.morphAttributes.position;if(n&&n.isGLBufferAttribute)console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingSphere.set(new De,1/0);else if(n){var s=this.boundingSphere.center;if(ms.setFromBufferAttribute(n),r)for(let e=0,t=r.length;e<t;e++){var o=r[e];fs.setFromBufferAttribute(o),this.morphTargetsRelative?(h.addVectors(ms.min,fs.min),ms.expandByPoint(h),h.addVectors(ms.max,fs.max),ms.expandByPoint(h)):(ms.expandByPoint(fs.min),ms.expandByPoint(fs.max))}ms.getCenter(s);let i=0;for(let e=0,t=n.count;e<t;e++)h.fromBufferAttribute(n,e),i=Math.max(i,s.distanceToSquared(h));if(r)for(let e=0,t=r.length;e<t;e++){var a=r[e],l=this.morphTargetsRelative;for(let e=0,t=a.count;e<t;e++)h.fromBufferAttribute(a,e),l&&(ps.fromBufferAttribute(n,e),h.add(ps)),i=Math.max(i,s.distanceToSquared(h))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(null===e||void 0===n.position||void 0===n.normal||void 0===n.uv)console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");else{const o=e.array,a=n.position.array,l=n.normal.array,h=n.uv.array,t=a.length/3,c=(void 0===n.tangent&&this.setAttribute("tangent",new T(new Float32Array(4*t),4)),n.tangent.array),u=[],d=[];for(let e=0;e<t;e++)u[e]=new De,d[e]=new De;const p=new De,m=new De,f=new De,g=new W,v=new W,y=new W,x=new De,w=new De;let i=this.groups;for(let e=0,t=(i=0===i.length?[{start:0,count:o.length}]:i).length;e<t;++e){const n=i[e],a=n.start;for(let e=a,t=a+n.count;e<t;e+=3)r(o[e+0],o[e+1],o[e+2])}const b=new De,M=new De,_=new De,S=new De;for(let e=0,t=i.length;e<t;++e){const n=i[e],a=n.start;for(let e=a,t=a+n.count;e<t;e+=3)s(o[e+0]),s(o[e+1]),s(o[e+2])}function r(e,t,i){p.fromArray(a,3*e),m.fromArray(a,3*t),f.fromArray(a,3*i),g.fromArray(h,2*e),v.fromArray(h,2*t),y.fromArray(h,2*i),m.sub(p),f.sub(p),v.sub(g),y.sub(g);var n=1/(v.x*y.y-y.x*v.y);isFinite(n)&&(x.copy(m).multiplyScalar(y.y).addScaledVector(f,-v.y).multiplyScalar(n),w.copy(f).multiplyScalar(v.x).addScaledVector(m,-y.x).multiplyScalar(n),u[e].add(x),u[t].add(x),u[i].add(x),d[e].add(w),d[t].add(w),d[i].add(w))}function s(e){_.fromArray(l,3*e),S.copy(_);var t=u[e],t=(b.copy(t),b.sub(_.multiplyScalar(_.dot(t))).normalize(),M.crossVectors(S,t),M.dot(d[e])<0?-1:1);c[4*e]=b.x,c[4*e+1]=b.y,c[4*e+2]=b.z,c[4*e+3]=t}}}computeVertexNormals(){var n=this.index,r=this.getAttribute("position");if(void 0!==r){let i=this.getAttribute("normal");if(void 0===i)i=new T(new Float32Array(3*r.count),3),this.setAttribute("normal",i);else for(let e=0,t=i.count;e<t;e++)i.setXYZ(e,0,0,0);var s=new De,o=new De,a=new De,l=new De,h=new De,c=new De,u=new De,d=new De;if(n)for(let e=0,t=n.count;e<t;e+=3){var p=n.getX(e+0),m=n.getX(e+1),f=n.getX(e+2);s.fromBufferAttribute(r,p),o.fromBufferAttribute(r,m),a.fromBufferAttribute(r,f),u.subVectors(a,o),d.subVectors(s,o),u.cross(d),l.fromBufferAttribute(i,p),h.fromBufferAttribute(i,m),c.fromBufferAttribute(i,f),l.add(u),h.add(u),c.add(u),i.setXYZ(p,l.x,l.y,l.z),i.setXYZ(m,h.x,h.y,h.z),i.setXYZ(f,c.x,c.y,c.z)}else for(let e=0,t=r.count;e<t;e+=3)s.fromBufferAttribute(r,e+0),o.fromBufferAttribute(r,e+1),a.fromBufferAttribute(r,e+2),u.subVectors(a,o),d.subVectors(s,o),u.cross(d),i.setXYZ(e+0,u.x,u.y,u.z),i.setXYZ(e+1,u.x,u.y,u.z),i.setXYZ(e+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var i=this.attributes;for(const a in i)if(void 0!==e.attributes[a]){var n=i[a].array,r=e.attributes[a],s=r.array,r=r.itemSize*t,o=Math.min(s.length,n.length-r);for(let e=0,t=r;e<o;e++,t++)n[t]=s[e]}return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)}normalizeNormals(){var i=this.attributes.normal;for(let e=0,t=i.count;e<t;e++)h.fromBufferAttribute(i,e),h.normalize(),i.setXYZ(e,h.x,h.y,h.z)}toNonIndexed(){function i(i,n){var r=i.array,s=i.itemSize,e=i.normalized,o=new r.constructor(n.length*s);let a=0,l=0;for(let e=0,t=n.length;e<t;e++){a=i.isInterleavedBufferAttribute?n[e]*i.data.stride+i.offset:n[e]*s;for(let e=0;e<s;e++)o[l++]=r[a++]}return new T(o,s,e)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new _,r=this.index.array,s=this.attributes;for(const e in s){const o=i(s[e],r);n.setAttribute(e,o)}const e=this.morphAttributes;for(const s in e){const o=[],a=e[s];for(let e=0,t=a.length;e<t;e++){const s=i(a[e],r);o.push(s)}n.morphAttributes[s]=o}n.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let e=0,t=o.length;e<t;e++){const r=o[e];n.addGroup(r.start,r.count,r.materialIndex)}return n}toJSON(){var i={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),0<Object.keys(this.userData).length&&(i.userData=this.userData),void 0!==this.parameters){const n=this.parameters;for(const r in n)void 0!==n[r]&&(i[r]=n[r])}else{i.data={attributes:{}};const n=this.index,r=(null!==n&&(i.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)}),this.attributes);for(const n in r){const s=r[n];i.data.attributes[n]=s.toJSON(i.data)}const s={};let e=!1;for(const n in this.morphAttributes){const r=this.morphAttributes[n],o=[];for(let e=0,t=r.length;e<t;e++){const s=r[e];o.push(s.toJSON(i.data))}0<o.length&&(s[n]=o,e=!0)}e&&(i.data.morphAttributes=s,i.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;0<o.length&&(i.data.groups=JSON.parse(JSON.stringify(o)));var t=this.boundingSphere;null!==t&&(i.data.boundingSphere={center:t.center.toArray(),radius:t.radius})}return i}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const i={},n=(this.name=e.name,e.index),r=(null!==n&&this.setIndex(n.clone(i)),e.attributes);for(const e in r){const n=r[e];this.setAttribute(e,n.clone(i))}var t=e.morphAttributes;for(const e in t){const n=[],r=t[e];for(let e=0,t=r.length;e<t;e++)n.push(r[e].clone(i));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;var s=e.groups;for(let e=0,t=s.length;e<t;e++){const i=s[e];this.addGroup(i.start,i.count,i.materialIndex)}var o=e.boundingBox,o=(null!==o&&(this.boundingBox=o.clone()),e.boundingSphere);return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}_.prototype.isBufferGeometry=!0;const gs=new Ie,vs=new ur,ys=new nr,xs=new De,ws=new De,bs=new De,Ms=new De,_s=new De,Ss=new De,Ts=new De,Es=new De,As=new De,Cs=new W,Rs=new W,Ls=new W,Ps=new De,zs=new De;class S extends u{constructor(e=new _,t=new $r){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const i=this.geometry;if(i.isBufferGeometry){var e=i.morphAttributes,t=Object.keys(e);if(0<t.length){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){var n=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{e=i.morphTargets;void 0!==e&&0<e.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(n,r){const e=this.geometry,s=this.material,o=this.matrixWorld;if(void 0!==s&&(null===e.boundingSphere&&e.computeBoundingSphere(),ys.copy(e.boundingSphere),ys.applyMatrix4(o),!1!==n.ray.intersectsSphere(ys))&&(gs.copy(o).invert(),vs.copy(n.ray).applyMatrix4(gs),null===e.boundingBox||!1!==vs.intersectsBox(e.boundingBox))){let i;if(e.isBufferGeometry){const o=e.index,d=e.attributes.position,p=e.morphAttributes.position,m=e.morphTargetsRelative,f=e.attributes.uv,g=e.attributes.uv2,v=e.groups,y=e.drawRange;if(null!==o)if(Array.isArray(s))for(let e=0,t=v.length;e<t;e++){var a=v[e],l=s[a.materialIndex];for(let e=Math.max(a.start,y.start),t=Math.min(o.count,Math.min(a.start+a.count,y.start+y.count));e<t;e+=3){const s=o.getX(e),x=o.getX(e+1),w=o.getX(e+2);(i=Ds(this,l,n,vs,d,p,m,f,g,s,x,w))&&(i.faceIndex=Math.floor(e/3),i.face.materialIndex=a.materialIndex,r.push(i))}}else for(let e=Math.max(0,y.start),t=Math.min(o.count,y.start+y.count);e<t;e+=3){var h=o.getX(e),c=o.getX(e+1),u=o.getX(e+2);(i=Ds(this,s,n,vs,d,p,m,f,g,h,c,u))&&(i.faceIndex=Math.floor(e/3),r.push(i))}else if(void 0!==d)if(Array.isArray(s))for(let e=0,t=v.length;e<t;e++){const o=v[e],b=s[o.materialIndex];for(let e=Math.max(o.start,y.start),t=Math.min(d.count,Math.min(o.start+o.count,y.start+y.count));e<t;e+=3)(i=Ds(this,b,n,vs,d,p,m,f,g,e,e+1,e+2))&&(i.faceIndex=Math.floor(e/3),i.face.materialIndex=o.materialIndex,r.push(i))}else for(let e=Math.max(0,y.start),t=Math.min(d.count,y.start+y.count);e<t;e+=3)(i=Ds(this,s,n,vs,d,p,m,f,g,e,e+1,e+2))&&(i.faceIndex=Math.floor(e/3),r.push(i))}else e.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function Ds(e,i,n,t,r,s,o,a,l,h,c,u){xs.fromBufferAttribute(r,h),ws.fromBufferAttribute(r,c),bs.fromBufferAttribute(r,u);var d=e.morphTargetInfluences;if(s&&d){Ts.set(0,0,0),Es.set(0,0,0),As.set(0,0,0);for(let e=0,t=s.length;e<t;e++){const i=d[e],n=s[e];0!==i&&(Ms.fromBufferAttribute(n,h),_s.fromBufferAttribute(n,c),Ss.fromBufferAttribute(n,u),o?(Ts.addScaledVector(Ms,i),Es.addScaledVector(_s,i),As.addScaledVector(Ss,i)):(Ts.addScaledVector(Ms.sub(xs),i),Es.addScaledVector(_s.sub(ws),i),As.addScaledVector(Ss.sub(bs),i)))}xs.add(Ts),ws.add(Es),bs.add(As)}e.isSkinnedMesh&&(e.boneTransform(h,xs),e.boneTransform(c,ws),e.boneTransform(u,bs));r=function(e,t,i,n,r,s,o,a){if(null===(t.side===Ae?n.intersectTriangle(o,s,r,!0,a):n.intersectTriangle(r,s,o,t.side!==Ne,a)))return null;zs.copy(a),zs.applyMatrix4(e.matrixWorld);n=i.ray.origin.distanceTo(zs);return n<i.near||n>i.far?null:{distance:n,point:zs.clone(),object:e}}(e,i,n,t,xs,ws,bs,Ps);if(r){a&&(Cs.fromBufferAttribute(a,h),Rs.fromBufferAttribute(a,c),Ls.fromBufferAttribute(a,u),r.uv=p.getUV(Ps,xs,ws,bs,Cs,Rs,Ls,new W)),l&&(Cs.fromBufferAttribute(l,h),Rs.fromBufferAttribute(l,c),Ls.fromBufferAttribute(l,u),r.uv2=p.getUV(Ps,xs,ws,bs,Cs,Rs,Ls,new W));const e={a:h,b:c,c:u,normal:new De,materialIndex:0};p.getNormal(xs,ws,bs,e.normal),r.face=e}return r}S.prototype.isMesh=!0;class Is extends _{constructor(e=1,t=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};const b=this,M=(n=Math.floor(n),r=Math.floor(r),s=Math.floor(s),[]),_=[],S=[],T=[];let E=0,A=0;function o(i,n,r,s,o,a,e,l,h,c,t){var u=a/h,d=e/c,p=a/2,m=e/2,f=l/2,g=h+1,v=c+1;let y=0,x=0;var w=new De;for(let t=0;t<v;t++){const b=t*d-m;for(let e=0;e<g;e++){const E=e*u-p;w[i]=E*s,w[n]=b*o,w[r]=f,_.push(w.x,w.y,w.z),w[i]=0,w[n]=0,w[r]=0<l?1:-1,S.push(w.x,w.y,w.z),T.push(e/h),T.push(1-t/c),y+=1}}for(let t=0;t<c;t++)for(let e=0;e<h;e++){const r=E+e+g*t,s=E+e+g*(t+1),o=E+(e+1)+g*(t+1),a=E+(e+1)+g*t;M.push(r,s,a),M.push(s,o,a),x+=6}b.addGroup(A,x,t),A+=x,E+=y}o("z","y","x",-1,-1,i,t,e,s,r,0),o("z","y","x",1,-1,i,t,-e,s,r,1),o("x","z","y",1,1,e,i,t,n,s,2),o("x","z","y",1,-1,e,i,-t,n,s,3),o("x","y","z",1,-1,e,t,i,n,r,4),o("x","y","z",-1,-1,e,t,-i,n,r,5),this.setIndex(M),this.setAttribute("position",new k(_,3)),this.setAttribute("normal",new k(S,3)),this.setAttribute("uv",new k(T,2))}static fromJSON(e){return new Is(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Os(e){var t={};for(const n in e){t[n]={};for(const r in e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function Ns(t){var i={};for(let e=0;e<t.length;e++){var n=Os(t[e]);for(const t in n)i[t]=n[t]}return i}const Bs={clone:Os,merge:Ns};class Fs extends i{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!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,this.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Os(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){var t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){var i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}0<Object.keys(this.defines).length&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return 0<Object.keys(n).length&&(t.extensions=n),t}}Fs.prototype.isShaderMaterial=!0;class Hs extends u{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Ie,this.projectionMatrix=new Ie,this.projectionMatrixInverse=new Ie}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}Hs.prototype.isCamera=!0;class B extends Hs{constructor(e=50,t=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){e=.5*this.getFilmHeight()/e;this.fov=2*pn*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){var e=Math.tan(.5*dn*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*pn*Math.atan(Math.tan(.5*dn*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,n,r,s){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*dn*this.fov)/this.zoom,i=2*t,n=this.aspect*i,r=-.5*n;var s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,o=s.fullHeight;r+=s.offsetX*n/e,t-=s.offsetY*i/o,n*=s.width/e,i*=s.height/o}const o=this.filmOffset;0!==o&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){e=super.toJSON(e);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}B.prototype.isPerspectiveCamera=!0;class Us extends u{constructor(e,t,i){super(),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget?console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."):(this.renderTarget=i,(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,-1,0),i.lookAt(new De(1,0,0)),this.add(i),(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,-1,0),i.lookAt(new De(-1,0,0)),this.add(i),(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,0,1),i.lookAt(new De(0,1,0)),this.add(i),(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,0,-1),i.lookAt(new De(0,-1,0)),this.add(i),(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,-1,0),i.lookAt(new De(0,0,1)),this.add(i),(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,-1,0),i.lookAt(new De(0,0,-1)),this.add(i))}update(e,t){null===this.parent&&this.updateMatrixWorld();var i=this.renderTarget,[n,r,s,o,a,l]=this.children,h=e.xr.enabled,c=e.getRenderTarget(),u=(e.xr.enabled=!1,i.texture.generateMipmaps);i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,n),e.setRenderTarget(i,1),e.render(t,r),e.setRenderTarget(i,2),e.render(t,s),e.setRenderTarget(i,3),e.render(t,o),e.setRenderTarget(i,4),e.render(t,a),i.texture.generateMipmaps=u,e.setRenderTarget(i,5),e.render(t,l),e.setRenderTarget(c),e.xr.enabled=h}}class Gs extends c{constructor(e,t,i,n,r,s,o,a,l,h){super(e=void 0!==e?e:[],t=void 0!==t?t:Fe,i,n,r,s,o,a,l,h),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Gs.prototype.isCubeTexture=!0;class Ws extends zn{constructor(e,t,i){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=i),super(e,e,t),t=t||{},this.texture=new Gs(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:F,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=Le,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={tEquirect:{value:null}},n="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",r="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",s=new Is(5,5,5),o=new Fs({name:"CubemapFromEquirect",uniforms:Os(i),vertexShader:n,fragmentShader:r,side:Ae,blending:Y});o.uniforms.tEquirect.value=t;var a=new S(s,o),l=t.minFilter;return t.minFilter===Ke&&(t.minFilter=F),new Us(1,10,this).update(e,a),t.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(t,i,n,r){var e=t.getRenderTarget();for(let e=0;e<6;e++)t.setRenderTarget(this,e),t.clear(i,n,r);t.setRenderTarget(e)}}Ws.prototype.isWebGLCubeRenderTarget=!0;const ks=new De,Vs=new De,js=new v;class Xs{constructor(e=new De(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){i=ks.subVectors(i,t).cross(Vs.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){var i=e.delta(ks),n=this.normal.dot(i);return 0===n?0===this.distanceToPoint(e.start)?t.copy(e.start):null:(n=-(e.start.dot(this.normal)+this.constant)/n)<0||1<n?null:t.copy(i).multiplyScalar(n).add(e.start)}intersectsLine(e){var t=this.distanceToPoint(e.start),e=this.distanceToPoint(e.end);return t<0&&0<e||e<0&&0<t}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){t=t||js.getNormalMatrix(e),e=this.coplanarPoint(ks).applyMatrix4(e),t=this.normal.applyMatrix3(t).normalize();return this.constant=-e.dot(t),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}Xs.prototype.isPlane=!0;const qs=new nr,Ys=new De;class Js{constructor(e=new Xs,t=new Xs,i=new Xs,n=new Xs,r=new Xs,s=new Xs){this.planes=[e,t,i,n,r,s]}set(e,t,i,n,r,s){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(s),this}copy(t){var i=this.planes;for(let e=0;e<6;e++)i[e].copy(t.planes[e]);return this}setFromProjectionMatrix(e){var t=this.planes,e=e.elements,i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],h=e[7],c=e[8],u=e[9],d=e[10],p=e[11],m=e[12],f=e[13],g=e[14],e=e[15];return t[0].setComponents(s-i,h-o,p-c,e-m).normalize(),t[1].setComponents(s+i,h+o,p+c,e+m).normalize(),t[2].setComponents(s+n,h+a,p+u,e+f).normalize(),t[3].setComponents(s-n,h-a,p-u,e-f).normalize(),t[4].setComponents(s-r,h-l,p-d,e-g).normalize(),t[5].setComponents(s+r,h+l,p+d,e+g).normalize(),this}intersectsObject(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),qs.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(qs)}intersectsSprite(e){return qs.center.set(0,0,0),qs.radius=.7071067811865476,qs.applyMatrix4(e.matrixWorld),this.intersectsSphere(qs)}intersectsSphere(e){var t=this.planes,i=e.center,n=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(i)<n)return!1;return!0}intersectsBox(t){var i=this.planes;for(let e=0;e<6;e++){var n=i[e];if(Ys.x=(0<n.normal.x?t.max:t.min).x,Ys.y=(0<n.normal.y?t.max:t.min).y,Ys.z=(0<n.normal.z?t.max:t.min).z,n.distanceToPoint(Ys)<0)return!1}return!0}containsPoint(t){var i=this.planes;for(let e=0;e<6;e++)if(i[e].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Zs(){let i=null,e=!1,n=null,r=null;function s(e,t){n(e,t),r=i.requestAnimationFrame(s)}return{start:function(){!0!==e&&null!==n&&(r=i.requestAnimationFrame(s),e=!0)},stop:function(){i.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(e){n=e},setContext:function(e){i=e}}}function Qs(o,e){const a=e.isWebGL2,l=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),l.get(e)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var t=l.get(e);t&&(o.deleteBuffer(t.buffer),l.delete(e))},update:function(e,t){if(e.isGLBufferAttribute){const o=l.get(e);void((!o||o.version<e.version)&&l.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}else{e.isInterleavedBufferAttribute&&(e=e.data);var i,n,r,s=l.get(e);void 0===s?l.set(e,function(e,t){var i=e.array,n=e.usage,r=o.createBuffer();o.bindBuffer(t,r),o.bufferData(t,i,n),e.onUploadCallback();let s=5126;return i instanceof Float32Array?s=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?e.isFloat16BufferAttribute?a?s=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):s=5123:i instanceof Int16Array?s=5122:i instanceof Uint32Array?s=5125:i instanceof Int32Array?s=5124:i instanceof Int8Array?s=5120:(i instanceof Uint8Array||i instanceof Uint8ClampedArray)&&(s=5121),{buffer:r,type:s,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(e,t)):s.version<e.version&&(i=s.buffer,t=t,r=(n=e).array,n=n.updateRange,o.bindBuffer(t,i),-1===n.count?o.bufferSubData(t,0,r):(a?o.bufferSubData(t,n.offset*r.BYTES_PER_ELEMENT,r,n.offset,n.count):o.bufferSubData(t,n.offset*r.BYTES_PER_ELEMENT,r.subarray(n.offset,n.offset+n.count)),n.count=-1),s.version=e.version)}}}}class Ks extends _{constructor(e=1,i=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:i,widthSegments:n,heightSegments:r};const s=e/2,o=i/2,a=Math.floor(n),l=Math.floor(r),h=a+1,c=l+1,u=e/a,d=i/l,p=[],m=[],f=[],g=[];for(let t=0;t<c;t++){const i=t*d-o;for(let e=0;e<h;e++){const r=e*u-s;m.push(r,-i,0),f.push(0,0,1),g.push(e/a),g.push(1-t/l)}}for(let t=0;t<l;t++)for(let e=0;e<a;e++){const n=e+h*t,r=e+h*(t+1),s=e+1+h*(t+1),o=e+1+h*t;p.push(n,r,o),p.push(r,s,o)}this.setIndex(p),this.setAttribute("position",new k(m,3)),this.setAttribute("normal",new k(f,3)),this.setAttribute("uv",new k(g,2))}static fromJSON(e){return new Ks(e.width,e.height,e.widthSegments,e.heightSegments)}}const E={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= specularColorMapTexelToLinear( texture2D( specularColorMap, vUv ) ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= sheenColorMapTexelToLinear( texture2D( sheenColorMap, vUv ) ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\n\t\t\tfloat texelIndex = float( vertexIndex * stride + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\t#ifndef USE_MORPHNORMALS\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\n\t\t\t#else\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\n\t\t\t#endif\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( float roughness, float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - clearcoat * Fcc ) + clearcoatSpecular * clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},A={common:{diffuse:{value:new g(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new v},uv2Transform:{value:new v},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new W(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 g(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new g(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new v}},sprite:{diffuse:{value:new g(16777215)},opacity:{value:1},center:{value:new W(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new v}}},$s={basic:{uniforms:Ns([A.common,A.specularmap,A.envmap,A.aomap,A.lightmap,A.fog]),vertexShader:E.meshbasic_vert,fragmentShader:E.meshbasic_frag},lambert:{uniforms:Ns([A.common,A.specularmap,A.envmap,A.aomap,A.lightmap,A.emissivemap,A.fog,A.lights,{emissive:{value:new g(0)}}]),vertexShader:E.meshlambert_vert,fragmentShader:E.meshlambert_frag},phong:{uniforms:Ns([A.common,A.specularmap,A.envmap,A.aomap,A.lightmap,A.emissivemap,A.bumpmap,A.normalmap,A.displacementmap,A.fog,A.lights,{emissive:{value:new g(0)},specular:{value:new g(1118481)},shininess:{value:30}}]),vertexShader:E.meshphong_vert,fragmentShader:E.meshphong_frag},standard:{uniforms:Ns([A.common,A.envmap,A.aomap,A.lightmap,A.emissivemap,A.bumpmap,A.normalmap,A.displacementmap,A.roughnessmap,A.metalnessmap,A.fog,A.lights,{emissive:{value:new g(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:E.meshphysical_vert,fragmentShader:E.meshphysical_frag},toon:{uniforms:Ns([A.common,A.aomap,A.lightmap,A.emissivemap,A.bumpmap,A.normalmap,A.displacementmap,A.gradientmap,A.fog,A.lights,{emissive:{value:new g(0)}}]),vertexShader:E.meshtoon_vert,fragmentShader:E.meshtoon_frag},matcap:{uniforms:Ns([A.common,A.bumpmap,A.normalmap,A.displacementmap,A.fog,{matcap:{value:null}}]),vertexShader:E.meshmatcap_vert,fragmentShader:E.meshmatcap_frag},points:{uniforms:Ns([A.points,A.fog]),vertexShader:E.points_vert,fragmentShader:E.points_frag},dashed:{uniforms:Ns([A.common,A.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:E.linedashed_vert,fragmentShader:E.linedashed_frag},depth:{uniforms:Ns([A.common,A.displacementmap]),vertexShader:E.depth_vert,fragmentShader:E.depth_frag},normal:{uniforms:Ns([A.common,A.bumpmap,A.normalmap,A.displacementmap,{opacity:{value:1}}]),vertexShader:E.meshnormal_vert,fragmentShader:E.meshnormal_frag},sprite:{uniforms:Ns([A.sprite,A.fog]),vertexShader:E.sprite_vert,fragmentShader:E.sprite_frag},background:{uniforms:{uvTransform:{value:new v},t2D:{value:null}},vertexShader:E.background_vert,fragmentShader:E.background_frag},cube:{uniforms:Ns([A.envmap,{opacity:{value:1}}]),vertexShader:E.cube_vert,fragmentShader:E.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:E.equirect_vert,fragmentShader:E.equirect_frag},distanceRGBA:{uniforms:Ns([A.common,A.displacementmap,{referencePosition:{value:new De},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:E.distanceRGBA_vert,fragmentShader:E.distanceRGBA_frag},shadow:{uniforms:Ns([A.lights,A.fog,{color:{value:new g(0)},opacity:{value:1}}]),vertexShader:E.shadow_vert,fragmentShader:E.shadow_frag}};function eo(r,s,i,o,n){const a=new g(0);let l,h,c=0,u=null,d=0,p=null;function m(e,t){i.buffers.color.setClear(e.r,e.g,e.b,t,n)}return{getClearColor:function(){return a},setClearColor:function(e,t=1){a.set(e),c=t,m(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,m(a,c)},render:function(e,t){let i=!1,n=!0===t.isScene?t.background:null;n&&n.isTexture&&(n=s.get(n));t=r.xr,t=t.getSession&&t.getSession();null===(n=t&&"additive"===t.environmentBlendMode?null:n)?m(a,c):n&&n.isColor&&(m(n,1),i=!0),(r.autoClear||i)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),n&&(n.isCubeTexture||n.mapping===We)?(void 0===h&&((h=new S(new Is(1,1,1),new Fs({name:"BackgroundCubeMaterial",uniforms:Os($s.cube.uniforms),vertexShader:$s.cube.vertexShader,fragmentShader:$s.cube.fragmentShader,side:Ae,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(e,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),o.update(h)),h.material.uniforms.envMap.value=n,h.material.uniforms.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,u===n&&d===n.version&&p===r.toneMapping||(h.material.needsUpdate=!0,u=n,d=n.version,p=r.toneMapping),e.unshift(h,h.geometry,h.material,0,0,null)):n&&n.isTexture&&(void 0===l&&((l=new S(new Ks(2,2),new Fs({name:"BackgroundMaterial",uniforms:Os($s.background.uniforms),vertexShader:$s.background.vertexShader,fragmentShader:$s.background.fragmentShader,side:Oe,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),o.update(l)),!0===(l.material.uniforms.t2D.value=n).matrixAutoUpdate&&n.updateMatrix(),l.material.uniforms.uvTransform.value.copy(n.matrix),u===n&&d===n.version&&p===r.toneMapping||(l.material.needsUpdate=!0,u=n,d=n.version,p=r.toneMapping),e.unshift(l,l.geometry,l.material,0,0,null))}}}function to(u,d,p,m){const r=u.getParameter(34921),f=m.isWebGL2?null:d.get("OES_vertex_array_object"),g=m.isWebGL2||null!==f,v={},e=w(null);let y=e;function x(e){m.isWebGL2?u.bindVertexArray(e):f.bindVertexArrayOES(e)}function s(e){m.isWebGL2?u.deleteVertexArray(e):f.deleteVertexArrayOES(e)}function w(e){var t=[],i=[],n=[];for(let e=0;e<r;e++)t[e]=0,i[e]=0,n[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:n,object:e,attributes:{},index:null}}function b(){var i=y.newAttributes;for(let e=0,t=i.length;e<t;e++)i[e]=0}function M(e){_(e,0)}function _(e,t){var i=y.newAttributes,n=y.enabledAttributes,r=y.attributeDivisors;i[e]=1,0===n[e]&&(u.enableVertexAttribArray(e),n[e]=1),r[e]!==t&&((m.isWebGL2?u:d.get("ANGLE_instanced_arrays"))[m.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](e,t),r[e]=t)}function S(){var i=y.newAttributes,n=y.enabledAttributes;for(let e=0,t=n.length;e<t;e++)n[e]!==i[e]&&(u.disableVertexAttribArray(e),n[e]=0)}function T(e,t,i,n,r,s){!0!==m.isWebGL2||5124!==i&&5125!==i?u.vertexAttribPointer(e,t,i,n,r,s):u.vertexAttribIPointer(e,t,i,r,s)}function o(){t(),y!==e&&x((y=e).object)}function t(){e.geometry=null,e.program=null,e.wireframe=!1}return{setup:function(e,o,t,i,n){let r=!1;if(g){const d=function(e,t){var i=!0===o.wireframe;let n=v[e.id],r=(void 0===n&&(n={},v[e.id]=n),n[t.id]),s=(void 0===r&&(r={},n[t.id]=r),r[i]);return void 0===s&&(s=w(m.isWebGL2?u.createVertexArray():f.createVertexArrayOES()),r[i]=s),s}(i,t);if(y!==d&&x((y=d).object),r=function(e,t){var i=y.attributes,n=e.attributes;let r=0;for(const e in n){const t=i[e],s=n[e];if(void 0===t)return!0;if(t.attribute!==s)return!0;if(t.data!==s.data)return!0;r++}return y.attributesNum!==r||y.index!==t}(i,n)){var s=i;var a=n;var l={},h=s.attributes;let e=0;for(const s in h){const a=h[s],c={};(c.attribute=a).data&&(c.data=a.data),l[s]=c,e++}y.attributes=l,y.attributesNum=e,y.index=a}}else{const u=!0===o.wireframe;y.geometry===i.id&&y.program===t.id&&y.wireframe===u||(y.geometry=i.id,y.program=t.id,y.wireframe=u,r=!0)}!0===e.isInstancedMesh&&(r=!0),null!==n&&p.update(n,34963),r&&(function(e,t,i,n){if(!1!==m.isWebGL2||!e.isInstancedMesh&&!n.isInstancedBufferGeometry||null!==d.get("ANGLE_instanced_arrays")){b();const r=n.attributes,s=i.getAttributes(),o=t.defaultAttributeValues;for(const d in s){const m=s[d];if(0<=m.location){let t=r[d];if(void 0!==(t=void 0===t&&("instanceMatrix"===d&&e.instanceMatrix&&(t=e.instanceMatrix),"instanceColor"===d)&&e.instanceColor?e.instanceColor:t)){const d=t.normalized,i=t.itemSize,r=p.get(t);if(void 0!==r){const s=r.buffer,o=r.type,a=r.bytesPerElement;if(t.isInterleavedBufferAttribute){const p=t.data,r=p.stride,l=t.offset;if(p&&p.isInstancedInterleavedBuffer){for(let e=0;e<m.locationSize;e++)_(m.location+e,p.meshPerAttribute);!0!==e.isInstancedMesh&&void 0===n._maxInstanceCount&&(n._maxInstanceCount=p.meshPerAttribute*p.count)}else for(let e=0;e<m.locationSize;e++)M(m.location+e);u.bindBuffer(34962,s);for(let e=0;e<m.locationSize;e++)T(m.location+e,i/m.locationSize,o,d,r*a,(l+i/m.locationSize*e)*a)}else{if(t.isInstancedBufferAttribute){for(let e=0;e<m.locationSize;e++)_(m.location+e,t.meshPerAttribute);!0!==e.isInstancedMesh&&void 0===n._maxInstanceCount&&(n._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<m.locationSize;e++)M(m.location+e);u.bindBuffer(34962,s);for(let e=0;e<m.locationSize;e++)T(m.location+e,i/m.locationSize,o,d,i*a,i/m.locationSize*e*a)}}}else if(void 0!==o){const p=o[d];if(void 0!==p)switch(p.length){case 2:u.vertexAttrib2fv(m.location,p);break;case 3:u.vertexAttrib3fv(m.location,p);break;case 4:u.vertexAttrib4fv(m.location,p);break;default:u.vertexAttrib1fv(m.location,p)}}}}S()}}(e,o,t,i),null!==n)&&u.bindBuffer(34963,p.get(n).buffer)},reset:o,resetDefaultState:t,dispose:function(){o();for(const i in v){var e=v[i];for(const n in e){var t=e[n];for(const r in t)s(t[r].object),delete t[r];delete e[n]}delete v[i]}},releaseStatesOfGeometry:function(e){if(void 0!==v[e.id]){var t=v[e.id];for(const e in t){var i=t[e];for(const e in i)s(i[e].object),delete i[e];delete t[e]}delete v[e.id]}},releaseStatesOfProgram:function(e){for(const n in v){var t=v[n];if(void 0!==t[e.id]){var i=t[e.id];for(const e in i)s(i[e].object),delete i[e];delete t[e.id]}}},initAttributes:b,enableAttribute:M,disableUnusedAttributes:S}}function io(s,o,a,e){const l=e.isWebGL2;let h;this.setMode=function(e){h=e},this.render=function(e,t){s.drawArrays(h,e,t),a.update(t,h,1)},this.renderInstances=function(i,n,r){if(0!==r){let e,t;if(l)e=s,t="drawArraysInstanced";else if(e=o.get("ANGLE_instanced_arrays"),t="drawArraysInstancedANGLE",null===e)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");e[t](h,i,n,r),a.update(n,h,r)}}}function no(t,i,e){let n;function r(e){if("highp"===e){if(0<t.getShaderPrecisionFormat(35633,36338).precision&&0<t.getShaderPrecisionFormat(35632,36338).precision)return"highp";e="mediump"}return"mediump"===e&&0<t.getShaderPrecisionFormat(35633,36337).precision&&0<t.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let o=void 0!==e.precision?e.precision:"highp";var a=r(o),a=(a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a),s||i.has("WEBGL_draw_buffers")),e=!0===e.logarithmicDepthBuffer,l=t.getParameter(34930),h=t.getParameter(35660),c=t.getParameter(3379),u=t.getParameter(34076),d=t.getParameter(34921),p=t.getParameter(36347),m=t.getParameter(36348),f=t.getParameter(36349),g=0<h,v=s||i.has("OES_texture_float");return{isWebGL2:s,drawBuffers:a,getMaxAnisotropy:function(){var e;return n=void 0===n?!0===i.has("EXT_texture_filter_anisotropic")?(e=i.get("EXT_texture_filter_anisotropic"),t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT)):0:n},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:e,maxTextures:l,maxVertexTextures:h,maxTextureSize:c,maxCubemapSize:u,maxAttributes:d,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:f,vertexTextures:g,floatFragmentTextures:v,floatVertexTextures:g&&v,maxSamples:s?t.getParameter(36183):0}}function ro(l){const t=this;let h=null,c=0,u=!1,d=!1;const a=new Xs,p=new v,m={value:null,needsUpdate:!1};function f(){m.value!==h&&(m.value=h,m.needsUpdate=0<c),t.numPlanes=c,t.numIntersection=0}function g(i,e,n,r){var s=null!==i?i.length:0;let o=null;if(0!==s){if(o=m.value,!0!==r||null===o){const t=n+4*s,r=e.matrixWorldInverse;p.getNormalMatrix(r),(null===o||o.length<t)&&(o=new Float32Array(t));for(let e=0,t=n;e!==s;++e,t+=4)a.copy(i[e]).applyMatrix4(r,p),a.normal.toArray(o,t),o[t+3]=a.constant}m.value=o,m.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,o}this.uniform=m,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,i){var n=0!==e.length||t||0!==c||u;return u=t,h=g(e,i,0),c=e.length,n},this.beginShadows=function(){d=!0,g(null)},this.endShadows=function(){d=!1,f()},this.setState=function(t,e,i){var n=t.clippingPlanes,r=t.clipIntersection,s=t.clipShadows,o=l.get(t);if(!u||null===n||0===n.length||d&&!s)d?g(null):f();else{const l=d?0:c,t=4*l;var a=o.clippingState||null;m.value=a,a=g(n,e,t,i);for(let e=0;e!==t;++e)a[e]=h[e];o.clippingState=a,this.numIntersection=r?this.numPlanes:0,this.numPlanes+=l}}}function so(n){let r=new WeakMap;function s(e,t){return t===Ue?e.mapping=Fe:t===Ge&&(e.mapping=He),e}function o(e){var e=e.target,t=(e.removeEventListener("dispose",o),r.get(e));void 0!==t&&(r.delete(e),t.dispose())}return{get:function(e){if(e&&e.isTexture&&!1===e.isRenderTargetTexture){var t,i=e.mapping;if(i===Ue||i===Ge)return r.has(e)?s(r.get(e).texture,e.mapping):(i=e.image)&&0<i.height?(t=n.getRenderTarget(),(i=new Ws(i.height/2)).fromEquirectangularTexture(n,e),r.set(e,i),n.setRenderTarget(t),e.addEventListener("dispose",o),s(i.texture,e.mapping)):null}return e},dispose:function(){r=new WeakMap}}}$s.physical={uniforms:Ns([$s.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new W(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new g(0)},sheenColorMap:{value:null},sheenRoughness:{value:0},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new W},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new g(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularColor:{value:new g(1,1,1)},specularColorMap:{value:null}}]),vertexShader:E.meshphysical_vert,fragmentShader:E.meshphysical_frag};class oo extends Hs{constructor(e=-1,t=1,i=1,n=-1,r=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-e,s=i+e,o=n+t,a=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,s=r+e*this.view.width,o-=t*this.view.offsetY,a=o-t*this.view.height}this.projectionMatrix.makeOrthographic(r,s,o,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){e=super.toJSON(e);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}oo.prototype.isOrthographicCamera=!0;class ao extends Fs{constructor(e){super(e),this.type="RawShaderMaterial"}}ao.prototype.isRawShaderMaterial=!0;const lo=Math.pow(2,8),ho=[.125,.215,.35,.446,.526,.582],co=5+ho.length,uo={[Pe]:0,[Ti]:1,[Ai]:2,[Ri]:3,[Li]:4,[Pi]:5,[Ei]:6},po=new oo,{_lodPlanes:mo,_sizeLods:fo,_sigmas:go}=function(){const i=[],n=[],r=[];let s=8;for(let t=0;t<co;t++){var o=Math.pow(2,s);n.push(o);let e=1/o;4<t?e=ho[t-8+4-1]:0==t&&(e=0),r.push(e);var o=1/(o-1),a=-o/2,o=1+o/2,l=[a,a,o,a,o,o,a,a,o,o,a,o],h=new Float32Array(108),c=new Float32Array(72),u=new Float32Array(36);for(let e=0;e<6;e++){const n=e%3*2/3-1,r=2<e?0:-1,s=[n,r,0,n+2/3,r,0,n+2/3,1+r,0,n,r,0,n+2/3,1+r,0,n,1+r,0];h.set(s,18*e),c.set(l,12*e);var d=[e,e,e,e,e,e];u.set(d,6*e)}a=new _;a.setAttribute("position",new T(h,3)),a.setAttribute("uv",new T(c,2)),a.setAttribute("faceIndex",new T(u,1)),i.push(a),4<s&&s--}return{_lodPlanes:i,_sizeLods:n,_sigmas:r}}(),vo=new g;let yo=null;const xo=(1+Math.sqrt(5))/2,wo=1/xo,bo=[new De(1,1,1),new De(-1,1,1),new De(1,1,-1),new De(-1,1,-1),new De(0,xo,wo),new De(0,xo,-wo),new De(wo,0,xo),new De(-wo,0,xo),new De(xo,wo,0),new De(-xo,wo,0)];class Mo{constructor(e){var t;this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=(e=new Float32Array(20),t=new De(0,1,0),new ao({name:"SphericalGaussianBlur",defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:uo[Pe]},outputEncoding:{value:uo[Pe]}},vertexShader:Ao(),fragmentShader:`
1
+ (window.webpackJsonpfeffery_utils_components=window.webpackJsonpfeffery_utils_components||[]).push([[2],{513:function(e,t,i){"use strict";i.r(t);var L=i(1),P=i.n(L),n=i(861),z=i.n(n),D=i(554),I=i(60),O=i(22),n=i(214);function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.scaleMobile,m=e.backgroundColor,f=e.backgroundAlpha,g=e.color1,v=e.color2,y=e.colorMode,x=e.quantity,w=e.birdSize,b=e.wingSpan,M=e.speedLimit,_=e.separation,S=e.alignment,T=e.cohesion,e=(e.setProps,e.loading_state),E=(E=Object(L.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(E)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(E,t)||function(e,t){var i;if(e)return"string"==typeof e?N(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?N(e,t):void 0}(E,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),A=E[0],C=E[1],R=Object(L.useRef)(null);return Object(L.useEffect)(function(){return A||C(z()({el:R.current,THREE:D,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,scaleMobile:p,backgroundColor:m,backgroundAlpha:f,color1:g,color2:v,colorMode:y,quantity:x,birdSize:w,wingSpan:b,speedLimit:M,separation:_,alignment:S,cohesion:T})),function(){A&&A.destroy()}},[A]),P.a.createElement("div",{id:i,children:n,className:Object(O.isString)(r)?r:r?Object(I.a)(r):void 0,style:s,key:o,ref:R,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},514:function(e,t,i){"use strict";i.r(t);var _=i(1),S=i.n(_),n=i(862),T=i.n(n),E=i(554),A=i(60),C=i(22),n=i(215);function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.highlightColor,p=e.midtoneColor,m=e.lowlightColor,f=e.baseColor,g=e.blurFactor,v=e.zoom,y=e.speed,e=(e.setProps,e.loading_state),x=(x=Object(_.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(x)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(x,t)||function(e,t){var i;if(e)return"string"==typeof e?R(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?R(e,t):void 0}(x,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=x[0],b=x[1],M=Object(_.useRef)(null);return Object(_.useEffect)(function(){return w||b(T()({el:M.current,THREE:E,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,highlightColor:d,midtoneColor:p,lowlightColor:m,baseColor:f,blurFactor:g,zoom:v,speed:y})),function(){w&&w.destroy()}},[w]),S.a.createElement("div",{id:i,children:n,className:Object(C.isString)(r)?r:r?Object(A.a)(r):void 0,style:s,key:o,ref:M,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},515:function(e,t,i){"use strict";i.r(t);var _=i(1),S=i.n(_),n=i(863),T=i.n(n),E=i(554),A=i(60),C=i(22),n=i(216);function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.scaleMobile,m=e.color,f=e.shininess,g=e.waveHeight,v=e.waveSpeed,y=e.zoom,e=(e.setProps,e.loading_state),x=(x=Object(_.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(x)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(x,t)||function(e,t){var i;if(e)return"string"==typeof e?R(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?R(e,t):void 0}(x,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=x[0],b=x[1],M=Object(_.useRef)(null);return Object(_.useEffect)(function(){return w||b(T()({el:M.current,THREE:E,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,scaleMobile:p,color:m,shininess:f,waveHeight:g,waveSpeed:v,zoom:y})),function(){w&&w.destroy()}},[w]),S.a.createElement("div",{id:i,children:n,className:Object(C.isString)(r)?r:r?Object(A.a)(r):void 0,style:s,key:o,ref:M,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},516:function(e,t,i){"use strict";i.r(t);var S=i(1),T=i.n(S),n=i(864),E=i.n(n),A=i(554),C=i(60),R=i(22),n=i(217);function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.backgroundColor,p=e.skyColor,m=e.cloudColor,f=e.cloudShadowColor,g=e.sunColor,v=e.sunGlareColor,y=e.sunlightColor,x=e.speed,e=(e.setProps,e.loading_state),w=(w=Object(S.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(w)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(w,t)||function(e,t){var i;if(e)return"string"==typeof e?L(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?L(e,t):void 0}(w,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=w[0],M=w[1],_=Object(S.useRef)(null);return Object(S.useEffect)(function(){return b||M(E()({el:_.current,THREE:A,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,backgroundColor:d,skyColor:p,cloudColor:m,cloudShadowColor:f,sunColor:g,sunGlareColor:v,sunlightColor:y,speed:x})),function(){b&&b.destroy()}},[b]),T.a.createElement("div",{id:i,children:n,className:Object(R.isString)(r)?r:r?Object(C.a)(r):void 0,style:s,key:o,ref:_,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},517:function(e,t,i){"use strict";i.r(t);var _=i(1),S=i.n(_),n=i(865),T=i.n(n),E=i(554),A=i(60),C=i(22),n=i(218);function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.texturePath,m=e.backgroundColor,f=e.skyColor,g=e.cloudColor,v=e.lightColor,y=e.speed,e=(e.setProps,e.loading_state),x=(x=Object(_.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(x)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(x,t)||function(e,t){var i;if(e)return"string"==typeof e?R(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?R(e,t):void 0}(x,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=x[0],b=x[1],M=Object(_.useRef)(null);return Object(_.useEffect)(function(){return w||b(T()({el:M.current,THREE:E,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,texturePath:p,backgroundColor:m,skyColor:f,cloudColor:g,lightColor:v,speed:y})),function(){w&&w.destroy()}},[w]),S.a.createElement("div",{id:i,children:n,className:Object(C.isString)(r)?r:r?Object(A.a)(r):void 0,style:s,key:o,ref:M,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},518:function(e,t,i){"use strict";i.r(t);var M=i(1),_=i.n(M),n=i(866),S=i.n(n),T=i(554),E=i(60),A=i(22),n=i(219);function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.scaleMobile,m=e.backgroundColor,f=e.color,g=e.color2,v=e.size,e=(e.setProps,e.loading_state),y=(y=Object(M.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(y)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(y,t)||function(e,t){var i;if(e)return"string"==typeof e?C(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?C(e,t):void 0}(y,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),x=y[0],w=y[1],b=Object(M.useRef)(null);return Object(M.useEffect)(function(){return x||w(S()({el:b.current,THREE:T,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,scaleMobile:p,backgroundColor:m,color:f,color2:g,size:v})),function(){x&&x.destroy()}},[x]),_.a.createElement("div",{id:i,children:n,className:Object(A.isString)(r)?r:r?Object(E.a)(r):void 0,style:s,key:o,ref:b,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},519:function(e,t,i){"use strict";i.r(t);var S=i(1),T=i.n(S),n=i(867),E=i.n(n),A=i(554),C=i(60),R=i(22),n=i(220);function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.scaleMobile,m=e.color,f=e.backgroundColor,g=e.points,v=e.maxDistance,y=e.spacing,x=e.showDots,e=(e.setProps,e.loading_state),w=(w=Object(S.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(w)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(w,t)||function(e,t){var i;if(e)return"string"==typeof e?L(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?L(e,t):void 0}(w,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=w[0],M=w[1],_=Object(S.useRef)(null);return Object(S.useEffect)(function(){return b||M(E()({el:_.current,THREE:A,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,scaleMobile:p,color:m,backgroundColor:f,points:g,maxDistance:v,spacing:y,showDots:x})),function(){b&&b.destroy()}},[b]),T.a.createElement("div",{id:i,children:n,className:Object(R.isString)(r)?r:r?Object(C.a)(r):void 0,style:s,key:o,ref:_,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},520:function(e,t,i){"use strict";i.r(t);var b=i(1),M=i.n(b),n=i(868),_=i.n(n),S=i(554),T=i(60),E=i(22),n=i(221);function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.color1,m=e.color2,f=e.size,g=e.speed,e=(e.setProps,e.loading_state),v=(v=Object(b.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(v)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(v,t)||function(e,t){var i;if(e)return"string"==typeof e?A(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?A(e,t):void 0}(v,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=v[0],x=v[1],w=Object(b.useRef)(null);return Object(b.useEffect)(function(){return y||x(_()({el:w.current,THREE:S,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,color1:p,color2:m,size:f,speed:g})),function(){y&&y.destroy()}},[y]),M.a.createElement("div",{id:i,children:n,className:Object(E.isString)(r)?r:r?Object(T.a)(r):void 0,style:s,key:o,ref:w,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},521:function(e,t,i){"use strict";i.r(t);var b=i(1),M=i.n(b),n=i(869),_=i.n(n),S=i(554),T=i(60),E=i(22),n=i(222);function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.scale,p=e.scaleMobile,m=e.color,f=e.backgroundColor,g=e.backgroundAlpha,e=(e.setProps,e.loading_state),v=(v=Object(b.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(v)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(v,t)||function(e,t){var i;if(e)return"string"==typeof e?A(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?A(e,t):void 0}(v,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=v[0],x=v[1],w=Object(b.useRef)(null);return Object(b.useEffect)(function(){return y||x(_()({el:w.current,THREE:S,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,scale:d,scaleMobile:p,color:m,backgroundColor:f,backgroundAlpha:g})),function(){y&&y.destroy()}},[y]),M.a.createElement("div",{id:i,children:n,className:Object(E.isString)(r)?r:r?Object(T.a)(r):void 0,style:s,key:o,ref:w,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},522:function(e,t,i){"use strict";i.r(t);var M=i(1),_=i.n(M),n=i(870),S=i.n(n),T=i(554),E=i(60),A=i(22),n=i(223);function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e){var t,i=e.id,n=e.children,r=e.className,s=e.style,o=e.key,a=e.mouseControls,l=e.touchControls,h=e.gyroControls,c=e.minHeight,u=e.minWidth,d=e.backgroundColor,p=e.baseColor,m=e.size,f=e.amplitudeFactor,g=e.xOffset,v=e.yOffset,e=(e.setProps,e.loading_state),y=(y=Object(M.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(y)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return a}}(y,t)||function(e,t){var i;if(e)return"string"==typeof e?C(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?C(e,t):void 0}(y,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),x=y[0],w=y[1],b=Object(M.useRef)(null);return Object(M.useEffect)(function(){return x||w(S()({el:b.current,THREE:T,mouseControls:a,touchControls:l,gyroControls:h,minHeight:c,minWidth:u,backgroundColor:d,baseColor:p,size:m,amplitudeFactor:f,xOffset:g,yOffset:v})),function(){x&&x.destroy()}},[x]),_.a.createElement("div",{id:i,children:n,className:Object(A.isString)(r)?r:r?Object(E.a)(r):void 0,style:s,key:o,ref:b,"data-dash-is-loading":e&&e.is_loading||void 0},n)}(t.default=r).defaultProps=n.b,r.propTypes=n.c},554:function(d,e,t){"use strict";t.r(e),t.d(e,"ACESFilmicToneMapping",function(){return Se}),t.d(e,"AddEquation",function(){return ee}),t.d(e,"AddOperation",function(){return H}),t.d(e,"AdditiveAnimationBlendMode",function(){return bi}),t.d(e,"AdditiveBlending",function(){return Z}),t.d(e,"AlphaFormat",function(){return dt}),t.d(e,"AlwaysDepth",function(){return ve}),t.d(e,"AlwaysStencilFunc",function(){return Qi}),t.d(e,"AmbientLight",function(){return Yu}),t.d(e,"AmbientLightProbe",function(){return ud}),t.d(e,"AnimationClip",function(){return wu}),t.d(e,"AnimationLoader",function(){return Au}),t.d(e,"AnimationMixer",function(){return Ud}),t.d(e,"AnimationObjectGroup",function(){return Fd}),t.d(e,"AnimationUtils",function(){return m}),t.d(e,"ArcCurve",function(){return Qh}),t.d(e,"ArrayCamera",function(){return Sl}),t.d(e,"ArrowHelper",function(){return Ep}),t.d(e,"Audio",function(){return Md}),t.d(e,"AudioAnalyser",function(){return Cd}),t.d(e,"AudioContext",function(){return ld}),t.d(e,"AudioListener",function(){return bd}),t.d(e,"AudioLoader",function(){return hd}),t.d(e,"AxesHelper",function(){return Ap}),t.d(e,"AxisHelper",function(){return im}),t.d(e,"BackSide",function(){return Ae}),t.d(e,"BasicDepthPacking",function(){return zi}),t.d(e,"BasicShadowMap",function(){return R}),t.d(e,"BinaryTextureLoader",function(){return am}),t.d(e,"Bone",function(){return ah}),t.d(e,"BooleanKeyframeTrack",function(){return pu}),t.d(e,"BoundingBoxHelper",function(){return nm}),t.d(e,"Box2",function(){return Zd}),t.d(e,"Box3",function(){return Fn}),t.d(e,"Box3Helper",function(){return bp}),t.d(e,"BoxBufferGeometry",function(){return Is}),t.d(e,"BoxGeometry",function(){return Is}),t.d(e,"BoxHelper",function(){return wp}),t.d(e,"BufferAttribute",function(){return T}),t.d(e,"BufferGeometry",function(){return _}),t.d(e,"BufferGeometryLoader",function(){return td}),t.d(e,"ByteType",function(){return tt}),t.d(e,"Cache",function(){return bu}),t.d(e,"Camera",function(){return Hs}),t.d(e,"CameraHelper",function(){return yp}),t.d(e,"CanvasRenderer",function(){return hm}),t.d(e,"CanvasTexture",function(){return Bh}),t.d(e,"CatmullRomCurve3",function(){return nc}),t.d(e,"CineonToneMapping",function(){return V}),t.d(e,"CircleBufferGeometry",function(){return Hh}),t.d(e,"CircleGeometry",function(){return Hh}),t.d(e,"ClampToEdgeWrapping",function(){return Ce}),t.d(e,"Clock",function(){return fd}),t.d(e,"Color",function(){return g}),t.d(e,"ColorKeyframeTrack",function(){return mu}),t.d(e,"CompressedTexture",function(){return Nh}),t.d(e,"CompressedTextureLoader",function(){return Cu}),t.d(e,"ConeBufferGeometry",function(){return Gh}),t.d(e,"ConeGeometry",function(){return Gh}),t.d(e,"CubeCamera",function(){return Us}),t.d(e,"CubeReflectionMapping",function(){return Fe}),t.d(e,"CubeRefractionMapping",function(){return He}),t.d(e,"CubeTexture",function(){return Gs}),t.d(e,"CubeTextureLoader",function(){return Lu}),t.d(e,"CubeUVReflectionMapping",function(){return We}),t.d(e,"CubeUVRefractionMapping",function(){return ke}),t.d(e,"CubicBezierCurve",function(){return ac}),t.d(e,"CubicBezierCurve3",function(){return lc}),t.d(e,"CubicInterpolant",function(){return hu}),t.d(e,"CullFaceBack",function(){return X}),t.d(e,"CullFaceFront",function(){return q}),t.d(e,"CullFaceFrontBack",function(){return C}),t.d(e,"CullFaceNone",function(){return j}),t.d(e,"Curve",function(){return Jh}),t.d(e,"CurvePath",function(){return fc}),t.d(e,"CustomBlending",function(){return $}),t.d(e,"CustomToneMapping",function(){return Te}),t.d(e,"CylinderBufferGeometry",function(){return Uh}),t.d(e,"CylinderGeometry",function(){return Uh}),t.d(e,"Cylindrical",function(){return Yd}),t.d(e,"DataTexture",function(){return lh}),t.d(e,"DataTexture2DArray",function(){return Io}),t.d(e,"DataTexture3D",function(){return Uo}),t.d(e,"DataTextureLoader",function(){return Pu}),t.d(e,"DataUtils",function(){return Pp}),t.d(e,"DecrementStencilOp",function(){return Ui}),t.d(e,"DecrementWrapStencilOp",function(){return Wi}),t.d(e,"DefaultLoadingManager",function(){return _u}),t.d(e,"DepthFormat",function(){return vt}),t.d(e,"DepthStencilFormat",function(){return yt}),t.d(e,"DepthTexture",function(){return Fh}),t.d(e,"DirectionalLight",function(){return qu}),t.d(e,"DirectionalLightHelper",function(){return gp}),t.d(e,"DiscreteInterpolant",function(){return uu}),t.d(e,"DodecahedronBufferGeometry",function(){return kh}),t.d(e,"DodecahedronGeometry",function(){return kh}),t.d(e,"DoubleSide",function(){return Ne}),t.d(e,"DstAlphaFactor",function(){return ue}),t.d(e,"DstColorFactor",function(){return pe}),t.d(e,"DynamicBufferAttribute",function(){return Xp}),t.d(e,"DynamicCopyUsage",function(){return on}),t.d(e,"DynamicDrawUsage",function(){return $i}),t.d(e,"DynamicReadUsage",function(){return nn}),t.d(e,"EdgesGeometry",function(){return Yh}),t.d(e,"EdgesHelper",function(){return rm}),t.d(e,"EllipseCurve",function(){return Zh}),t.d(e,"EqualDepth",function(){return we}),t.d(e,"EqualStencilFunc",function(){return Xi}),t.d(e,"EquirectangularReflectionMapping",function(){return Ue}),t.d(e,"EquirectangularRefractionMapping",function(){return Ge}),t.d(e,"Euler",function(){return br}),t.d(e,"EventDispatcher",function(){return cn}),t.d(e,"ExtrudeBufferGeometry",function(){return Bc}),t.d(e,"ExtrudeGeometry",function(){return Bc}),t.d(e,"FaceColors",function(){return Op}),t.d(e,"FileLoader",function(){return Eu}),t.d(e,"FlatShading",function(){return D}),t.d(e,"Float16BufferAttribute",function(){return ls}),t.d(e,"Float32Attribute",function(){return em}),t.d(e,"Float32BufferAttribute",function(){return k}),t.d(e,"Float64Attribute",function(){return tm}),t.d(e,"Float64BufferAttribute",function(){return hs}),t.d(e,"FloatType",function(){return ot}),t.d(e,"Fog",function(){return zl}),t.d(e,"FogExp2",function(){return Pl}),t.d(e,"Font",function(){return gm}),t.d(e,"FontLoader",function(){return fm}),t.d(e,"FrontSide",function(){return Oe}),t.d(e,"Frustum",function(){return Js}),t.d(e,"GLBufferAttribute",function(){return kd}),t.d(e,"GLSL1",function(){return ln}),t.d(e,"GLSL3",function(){return hn}),t.d(e,"GammaEncoding",function(){return Ei}),t.d(e,"GreaterDepth",function(){return Me}),t.d(e,"GreaterEqualDepth",function(){return be}),t.d(e,"GreaterEqualStencilFunc",function(){return Zi}),t.d(e,"GreaterStencilFunc",function(){return Yi}),t.d(e,"GridHelper",function(){return up}),t.d(e,"Group",function(){return Tl}),t.d(e,"HalfFloatType",function(){return at}),t.d(e,"HemisphereLight",function(){return Iu}),t.d(e,"HemisphereLightHelper",function(){return cp}),t.d(e,"HemisphereLightProbe",function(){return cd}),t.d(e,"IcosahedronBufferGeometry",function(){return Hc}),t.d(e,"IcosahedronGeometry",function(){return Hc}),t.d(e,"ImageBitmapLoader",function(){return od}),t.d(e,"ImageLoader",function(){return Ru}),t.d(e,"ImageUtils",function(){return Rn}),t.d(e,"ImmediateRenderObject",function(){return vm}),t.d(e,"IncrementStencilOp",function(){return Hi}),t.d(e,"IncrementWrapStencilOp",function(){return Gi}),t.d(e,"InstancedBufferAttribute",function(){return dh}),t.d(e,"InstancedBufferGeometry",function(){return ed}),t.d(e,"InstancedInterleavedBuffer",function(){return Wd}),t.d(e,"InstancedMesh",function(){return vh}),t.d(e,"Int16Attribute",function(){return Zp}),t.d(e,"Int16BufferAttribute",function(){return rs}),t.d(e,"Int32Attribute",function(){return Kp}),t.d(e,"Int32BufferAttribute",function(){return os}),t.d(e,"Int8Attribute",function(){return qp}),t.d(e,"Int8BufferAttribute",function(){return ts}),t.d(e,"IntType",function(){return rt}),t.d(e,"InterleavedBuffer",function(){return Il}),t.d(e,"InterleavedBufferAttribute",function(){return Ol}),t.d(e,"Interpolant",function(){return lu}),t.d(e,"InterpolateDiscrete",function(){return mi}),t.d(e,"InterpolateLinear",function(){return fi}),t.d(e,"InterpolateSmooth",function(){return gi}),t.d(e,"InvertStencilOp",function(){return ki}),t.d(e,"JSONLoader",function(){return cm}),t.d(e,"KeepStencilOp",function(){return Bi}),t.d(e,"KeyframeTrack",function(){return du}),t.d(e,"LOD",function(){return eh}),t.d(e,"LatheBufferGeometry",function(){return Uc}),t.d(e,"LatheGeometry",function(){return Uc}),t.d(e,"Layers",function(){return Mr}),t.d(e,"LensFlare",function(){return dm}),t.d(e,"LessDepth",function(){return ye}),t.d(e,"LessEqualDepth",function(){return xe}),t.d(e,"LessEqualStencilFunc",function(){return qi}),t.d(e,"LessStencilFunc",function(){return ji}),t.d(e,"Light",function(){return Du}),t.d(e,"LightProbe",function(){return Qu}),t.d(e,"Line",function(){return _h}),t.d(e,"Line3",function(){return $d}),t.d(e,"LineBasicMaterial",function(){return y}),t.d(e,"LineCurve",function(){return hc}),t.d(e,"LineCurve3",function(){return cc}),t.d(e,"LineDashedMaterial",function(){return ou}),t.d(e,"LineLoop",function(){return Ah}),t.d(e,"LinePieces",function(){return Dp}),t.d(e,"LineSegments",function(){return Eh}),t.d(e,"LineStrip",function(){return zp}),t.d(e,"LinearEncoding",function(){return Pe}),t.d(e,"LinearFilter",function(){return F}),t.d(e,"LinearInterpolant",function(){return cu}),t.d(e,"LinearMipMapLinearFilter",function(){return $e}),t.d(e,"LinearMipMapNearestFilter",function(){return Qe}),t.d(e,"LinearMipmapLinearFilter",function(){return Ke}),t.d(e,"LinearMipmapNearestFilter",function(){return Ze}),t.d(e,"LinearToneMapping",function(){return U}),t.d(e,"Loader",function(){return Su}),t.d(e,"LoaderUtils",function(){return $u}),t.d(e,"LoadingManager",function(){return Mu}),t.d(e,"LogLuvEncoding",function(){return Ci}),t.d(e,"LoopOnce",function(){return ui}),t.d(e,"LoopPingPong",function(){return pi}),t.d(e,"LoopRepeat",function(){return di}),t.d(e,"LuminanceAlphaFormat",function(){return ft}),t.d(e,"LuminanceFormat",function(){return mt}),t.d(e,"MOUSE",function(){return b}),t.d(e,"Material",function(){return i}),t.d(e,"MaterialLoader",function(){return Ku}),t.d(e,"Math",function(){return Mn}),t.d(e,"MathUtils",function(){return Mn}),t.d(e,"Matrix3",function(){return v}),t.d(e,"Matrix4",function(){return Ie}),t.d(e,"MaxEquation",function(){return re}),t.d(e,"Mesh",function(){return S}),t.d(e,"MeshBasicMaterial",function(){return $r}),t.d(e,"MeshDepthMaterial",function(){return yl}),t.d(e,"MeshDistanceMaterial",function(){return xl}),t.d(e,"MeshFaceMaterial",function(){return Bp}),t.d(e,"MeshLambertMaterial",function(){return ru}),t.d(e,"MeshMatcapMaterial",function(){return su}),t.d(e,"MeshNormalMaterial",function(){return nu}),t.d(e,"MeshPhongMaterial",function(){return tu}),t.d(e,"MeshPhysicalMaterial",function(){return eu}),t.d(e,"MeshStandardMaterial",function(){return $c}),t.d(e,"MeshToonMaterial",function(){return iu}),t.d(e,"MinEquation",function(){return ne}),t.d(e,"MirroredRepeatWrapping",function(){return je}),t.d(e,"MixOperation",function(){return N}),t.d(e,"MultiMaterial",function(){return Fp}),t.d(e,"MultiplyBlending",function(){return K}),t.d(e,"MultiplyOperation",function(){return O}),t.d(e,"NearestFilter",function(){return Re}),t.d(e,"NearestMipMapLinearFilter",function(){return Je}),t.d(e,"NearestMipMapNearestFilter",function(){return qe}),t.d(e,"NearestMipmapLinearFilter",function(){return Ye}),t.d(e,"NearestMipmapNearestFilter",function(){return Xe}),t.d(e,"NeverDepth",function(){return ge}),t.d(e,"NeverStencilFunc",function(){return Vi}),t.d(e,"NoBlending",function(){return Y}),t.d(e,"NoColors",function(){return Ip}),t.d(e,"NoToneMapping",function(){return Be}),t.d(e,"NormalAnimationBlendMode",function(){return wi}),t.d(e,"NormalBlending",function(){return J}),t.d(e,"NotEqualDepth",function(){return _e}),t.d(e,"NotEqualStencilFunc",function(){return Ji}),t.d(e,"NumberKeyframeTrack",function(){return fu}),t.d(e,"Object3D",function(){return u}),t.d(e,"ObjectLoader",function(){return id}),t.d(e,"ObjectSpaceNormalMap",function(){return Oi}),t.d(e,"OctahedronBufferGeometry",function(){return Gc}),t.d(e,"OctahedronGeometry",function(){return Gc}),t.d(e,"OneFactor",function(){return oe}),t.d(e,"OneMinusDstAlphaFactor",function(){return de}),t.d(e,"OneMinusDstColorFactor",function(){return me}),t.d(e,"OneMinusSrcAlphaFactor",function(){return ce}),t.d(e,"OneMinusSrcColorFactor",function(){return le}),t.d(e,"OrthographicCamera",function(){return oo}),t.d(e,"PCFShadowMap",function(){return L}),t.d(e,"PCFSoftShadowMap",function(){return P}),t.d(e,"PMREMGenerator",function(){return Mo}),t.d(e,"ParametricGeometry",function(){return pm}),t.d(e,"Particle",function(){return Up}),t.d(e,"ParticleBasicMaterial",function(){return kp}),t.d(e,"ParticleSystem",function(){return Gp}),t.d(e,"ParticleSystemMaterial",function(){return Vp}),t.d(e,"Path",function(){return gc}),t.d(e,"PerspectiveCamera",function(){return B}),t.d(e,"Plane",function(){return Xs}),t.d(e,"PlaneBufferGeometry",function(){return Ks}),t.d(e,"PlaneGeometry",function(){return Ks}),t.d(e,"PlaneHelper",function(){return Mp}),t.d(e,"PointCloud",function(){return Hp}),t.d(e,"PointCloudMaterial",function(){return Wp}),t.d(e,"PointLight",function(){return ju}),t.d(e,"PointLightHelper",function(){return op}),t.d(e,"Points",function(){return Dh}),t.d(e,"PointsMaterial",function(){return Ch}),t.d(e,"PolarGridHelper",function(){return dp}),t.d(e,"PolyhedronBufferGeometry",function(){return Wh}),t.d(e,"PolyhedronGeometry",function(){return Wh}),t.d(e,"PositionalAudio",function(){return Ad}),t.d(e,"PropertyBinding",function(){return x}),t.d(e,"PropertyMixer",function(){return Rd}),t.d(e,"QuadraticBezierCurve",function(){return uc}),t.d(e,"QuadraticBezierCurve3",function(){return dc}),t.d(e,"Quaternion",function(){return On}),t.d(e,"QuaternionKeyframeTrack",function(){return vu}),t.d(e,"QuaternionLinearInterpolant",function(){return gu}),t.d(e,"REVISION",function(){return w}),t.d(e,"RGBADepthPacking",function(){return Di}),t.d(e,"RGBAFormat",function(){return Le}),t.d(e,"RGBAIntegerFormat",function(){return St}),t.d(e,"RGBA_ASTC_10x10_Format",function(){return qt}),t.d(e,"RGBA_ASTC_10x5_Format",function(){return Vt}),t.d(e,"RGBA_ASTC_10x6_Format",function(){return jt}),t.d(e,"RGBA_ASTC_10x8_Format",function(){return Xt}),t.d(e,"RGBA_ASTC_12x10_Format",function(){return Yt}),t.d(e,"RGBA_ASTC_12x12_Format",function(){return Jt}),t.d(e,"RGBA_ASTC_4x4_Format",function(){return Nt}),t.d(e,"RGBA_ASTC_5x4_Format",function(){return Bt}),t.d(e,"RGBA_ASTC_5x5_Format",function(){return Ft}),t.d(e,"RGBA_ASTC_6x5_Format",function(){return Ht}),t.d(e,"RGBA_ASTC_6x6_Format",function(){return Ut}),t.d(e,"RGBA_ASTC_8x5_Format",function(){return Gt}),t.d(e,"RGBA_ASTC_8x6_Format",function(){return Wt}),t.d(e,"RGBA_ASTC_8x8_Format",function(){return kt}),t.d(e,"RGBA_BPTC_Format",function(){return Zt}),t.d(e,"RGBA_ETC2_EAC_Format",function(){return Ot}),t.d(e,"RGBA_PVRTC_2BPPV1_Format",function(){return zt}),t.d(e,"RGBA_PVRTC_4BPPV1_Format",function(){return Pt}),t.d(e,"RGBA_S3TC_DXT1_Format",function(){return Et}),t.d(e,"RGBA_S3TC_DXT3_Format",function(){return At}),t.d(e,"RGBA_S3TC_DXT5_Format",function(){return Ct}),t.d(e,"RGBDEncoding",function(){return Pi}),t.d(e,"RGBEEncoding",function(){return Ai}),t.d(e,"RGBEFormat",function(){return gt}),t.d(e,"RGBFormat",function(){return pt}),t.d(e,"RGBIntegerFormat",function(){return _t}),t.d(e,"RGBM16Encoding",function(){return Li}),t.d(e,"RGBM7Encoding",function(){return Ri}),t.d(e,"RGB_ETC1_Format",function(){return Dt}),t.d(e,"RGB_ETC2_Format",function(){return It}),t.d(e,"RGB_PVRTC_2BPPV1_Format",function(){return Lt}),t.d(e,"RGB_PVRTC_4BPPV1_Format",function(){return Rt}),t.d(e,"RGB_S3TC_DXT1_Format",function(){return Tt}),t.d(e,"RGFormat",function(){return bt}),t.d(e,"RGIntegerFormat",function(){return Mt}),t.d(e,"RawShaderMaterial",function(){return ao}),t.d(e,"Ray",function(){return ur}),t.d(e,"Raycaster",function(){return Vd}),t.d(e,"RectAreaLight",function(){return Ju}),t.d(e,"RedFormat",function(){return xt}),t.d(e,"RedIntegerFormat",function(){return wt}),t.d(e,"ReinhardToneMapping",function(){return G}),t.d(e,"RepeatWrapping",function(){return Ve}),t.d(e,"ReplaceStencilOp",function(){return Fi}),t.d(e,"ReverseSubtractEquation",function(){return ie}),t.d(e,"RingBufferGeometry",function(){return Wc}),t.d(e,"RingGeometry",function(){return Wc}),t.d(e,"SRGB8_ALPHA8_ASTC_10x10_Format",function(){return li}),t.d(e,"SRGB8_ALPHA8_ASTC_10x5_Format",function(){return si}),t.d(e,"SRGB8_ALPHA8_ASTC_10x6_Format",function(){return oi}),t.d(e,"SRGB8_ALPHA8_ASTC_10x8_Format",function(){return ai}),t.d(e,"SRGB8_ALPHA8_ASTC_12x10_Format",function(){return hi}),t.d(e,"SRGB8_ALPHA8_ASTC_12x12_Format",function(){return ci}),t.d(e,"SRGB8_ALPHA8_ASTC_4x4_Format",function(){return Qt}),t.d(e,"SRGB8_ALPHA8_ASTC_5x4_Format",function(){return Kt}),t.d(e,"SRGB8_ALPHA8_ASTC_5x5_Format",function(){return $t}),t.d(e,"SRGB8_ALPHA8_ASTC_6x5_Format",function(){return ei}),t.d(e,"SRGB8_ALPHA8_ASTC_6x6_Format",function(){return ti}),t.d(e,"SRGB8_ALPHA8_ASTC_8x5_Format",function(){return ii}),t.d(e,"SRGB8_ALPHA8_ASTC_8x6_Format",function(){return ni}),t.d(e,"SRGB8_ALPHA8_ASTC_8x8_Format",function(){return ri}),t.d(e,"Scene",function(){return Dl}),t.d(e,"SceneUtils",function(){return um}),t.d(e,"ShaderChunk",function(){return E}),t.d(e,"ShaderLib",function(){return $s}),t.d(e,"ShaderMaterial",function(){return Fs}),t.d(e,"ShadowMaterial",function(){return Kc}),t.d(e,"Shape",function(){return vc}),t.d(e,"ShapeBufferGeometry",function(){return kc}),t.d(e,"ShapeGeometry",function(){return kc}),t.d(e,"ShapePath",function(){return Cp}),t.d(e,"ShapeUtils",function(){return Ic}),t.d(e,"ShortType",function(){return it}),t.d(e,"Skeleton",function(){return uh}),t.d(e,"SkeletonHelper",function(){return sp}),t.d(e,"SkinnedMesh",function(){return oh}),t.d(e,"SmoothShading",function(){return I}),t.d(e,"Sphere",function(){return nr}),t.d(e,"SphereBufferGeometry",function(){return Vc}),t.d(e,"SphereGeometry",function(){return Vc}),t.d(e,"Spherical",function(){return qd}),t.d(e,"SphericalHarmonics3",function(){return Zu}),t.d(e,"SplineCurve",function(){return pc}),t.d(e,"SpotLight",function(){return Uu}),t.d(e,"SpotLightHelper",function(){return tp}),t.d(e,"Sprite",function(){return Zl}),t.d(e,"SpriteMaterial",function(){return Nl}),t.d(e,"SrcAlphaFactor",function(){return he}),t.d(e,"SrcAlphaSaturateFactor",function(){return fe}),t.d(e,"SrcColorFactor",function(){return ae}),t.d(e,"StaticCopyUsage",function(){return sn}),t.d(e,"StaticDrawUsage",function(){return Ki}),t.d(e,"StaticReadUsage",function(){return tn}),t.d(e,"StereoCamera",function(){return md}),t.d(e,"StreamCopyUsage",function(){return an}),t.d(e,"StreamDrawUsage",function(){return en}),t.d(e,"StreamReadUsage",function(){return rn}),t.d(e,"StringKeyframeTrack",function(){return yu}),t.d(e,"SubtractEquation",function(){return te}),t.d(e,"SubtractiveBlending",function(){return Q}),t.d(e,"TOUCH",function(){return M}),t.d(e,"TangentSpaceNormalMap",function(){return Ii}),t.d(e,"TetrahedronBufferGeometry",function(){return jc}),t.d(e,"TetrahedronGeometry",function(){return jc}),t.d(e,"TextGeometry",function(){return mm}),t.d(e,"Texture",function(){return c}),t.d(e,"TextureLoader",function(){return zu}),t.d(e,"TorusBufferGeometry",function(){return Xc}),t.d(e,"TorusGeometry",function(){return Xc}),t.d(e,"TorusKnotBufferGeometry",function(){return qc}),t.d(e,"TorusKnotGeometry",function(){return qc}),t.d(e,"Triangle",function(){return p}),t.d(e,"TriangleFanDrawMode",function(){return Si}),t.d(e,"TriangleStripDrawMode",function(){return _i}),t.d(e,"TrianglesDrawMode",function(){return Mi}),t.d(e,"TubeBufferGeometry",function(){return Yc}),t.d(e,"TubeGeometry",function(){return Yc}),t.d(e,"UVMapping",function(){return Ee}),t.d(e,"Uint16Attribute",function(){return Qp}),t.d(e,"Uint16BufferAttribute",function(){return ss}),t.d(e,"Uint32Attribute",function(){return $p}),t.d(e,"Uint32BufferAttribute",function(){return as}),t.d(e,"Uint8Attribute",function(){return Yp}),t.d(e,"Uint8BufferAttribute",function(){return is}),t.d(e,"Uint8ClampedAttribute",function(){return Jp}),t.d(e,"Uint8ClampedBufferAttribute",function(){return ns}),t.d(e,"Uniform",function(){return Gd}),t.d(e,"UniformsLib",function(){return A}),t.d(e,"UniformsUtils",function(){return Bs}),t.d(e,"UnsignedByteType",function(){return et}),t.d(e,"UnsignedInt248Type",function(){return ut}),t.d(e,"UnsignedIntType",function(){return st}),t.d(e,"UnsignedShort4444Type",function(){return lt}),t.d(e,"UnsignedShort5551Type",function(){return ht}),t.d(e,"UnsignedShort565Type",function(){return ct}),t.d(e,"UnsignedShortType",function(){return nt}),t.d(e,"VSMShadowMap",function(){return z}),t.d(e,"Vector2",function(){return W}),t.d(e,"Vector3",function(){return De}),t.d(e,"Vector4",function(){return ze}),t.d(e,"VectorKeyframeTrack",function(){return xu}),t.d(e,"Vertex",function(){return jp}),t.d(e,"VertexColors",function(){return Np}),t.d(e,"VideoTexture",function(){return Oh}),t.d(e,"WebGL1Renderer",function(){return Ll}),t.d(e,"WebGLCubeRenderTarget",function(){return Ws}),t.d(e,"WebGLMultipleRenderTargets",function(){return Dn}),t.d(e,"WebGLMultisampleRenderTarget",function(){return In}),t.d(e,"WebGLRenderTarget",function(){return zn}),t.d(e,"WebGLRenderTargetCube",function(){return lm}),t.d(e,"WebGLRenderer",function(){return s}),t.d(e,"WebGLUtils",function(){return _l}),t.d(e,"WireframeGeometry",function(){return Jc}),t.d(e,"WireframeHelper",function(){return sm}),t.d(e,"WrapAroundEnding",function(){return xi}),t.d(e,"XHRLoader",function(){return om}),t.d(e,"ZeroCurvatureEnding",function(){return vi}),t.d(e,"ZeroFactor",function(){return se}),t.d(e,"ZeroSlopeEnding",function(){return yi}),t.d(e,"ZeroStencilOp",function(){return Ni}),t.d(e,"sRGBEncoding",function(){return Ti});const w="134",b={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},M={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},j=0,X=1,q=2,C=3,R=0,L=1,P=2,z=3,Oe=0,Ae=1,Ne=2,D=1,I=2,Y=0,J=1,Z=2,Q=3,K=4,$=5,ee=100,te=101,ie=102,ne=103,re=104,se=200,oe=201,ae=202,le=203,he=204,ce=205,ue=206,de=207,pe=208,me=209,fe=210,ge=0,ve=1,ye=2,xe=3,we=4,be=5,Me=6,_e=7,O=0,N=1,H=2,Be=0,U=1,G=2,V=3,Se=4,Te=5,Ee=300,Fe=301,He=302,Ue=303,Ge=304,We=306,ke=307,Ve=1e3,Ce=1001,je=1002,Re=1003,Xe=1004,qe=1004,Ye=1005,Je=1005,F=1006,Ze=1007,Qe=1007,Ke=1008,$e=1008,et=1009,tt=1010,it=1011,nt=1012,rt=1013,st=1014,ot=1015,at=1016,lt=1017,ht=1018,ct=1019,ut=1020,dt=1021,pt=1022,Le=1023,mt=1024,ft=1025,gt=Le,vt=1026,yt=1027,xt=1028,wt=1029,bt=1030,Mt=1031,_t=1032,St=1033,Tt=33776,Et=33777,At=33778,Ct=33779,Rt=35840,Lt=35841,Pt=35842,zt=35843,Dt=36196,It=37492,Ot=37496,Nt=37808,Bt=37809,Ft=37810,Ht=37811,Ut=37812,Gt=37813,Wt=37814,kt=37815,Vt=37816,jt=37817,Xt=37818,qt=37819,Yt=37820,Jt=37821,Zt=36492,Qt=37840,Kt=37841,$t=37842,ei=37843,ti=37844,ii=37845,ni=37846,ri=37847,si=37848,oi=37849,ai=37850,li=37851,hi=37852,ci=37853,ui=2200,di=2201,pi=2202,mi=2300,fi=2301,gi=2302,vi=2400,yi=2401,xi=2402,wi=2500,bi=2501,Mi=0,_i=1,Si=2,Pe=3e3,Ti=3001,Ei=3007,Ai=3002,Ci=3003,Ri=3004,Li=3005,Pi=3006,zi=3200,Di=3201,Ii=0,Oi=1,Ni=0,Bi=7680,Fi=7681,Hi=7682,Ui=7683,Gi=34055,Wi=34056,ki=5386,Vi=512,ji=513,Xi=514,qi=515,Yi=516,Ji=517,Zi=518,Qi=519,Ki=35044,$i=35048,en=35040,tn=35045,nn=35049,rn=35041,sn=35046,on=35050,an=35042,ln="100",hn="300 es";class cn{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){var i;return void 0!==this._listeners&&void 0!==(i=this._listeners)[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0!==this._listeners){var i=this._listeners[e];if(void 0!==i){const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}dispatchEvent(i){if(void 0!==this._listeners){var e=this._listeners[i.type];if(void 0!==e){i.target=this;var n=e.slice(0);for(let e=0,t=n.length;e<t;e++)n[e].call(this,i);i.target=null}}}}let un=1234567;const dn=Math.PI/180,pn=180/Math.PI,r=[];for(let e=0;e<256;e++)r[e]=(e<16?"0":"")+e.toString(16);const mn="undefined"!=typeof crypto&&"randomUUID"in crypto;function fn(){var e,t,i,n;return(mn?crypto.randomUUID():(e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r[255&e]+r[e>>8&255]+r[e>>16&255]+r[e>>24&255]+"-"+r[255&t]+r[t>>8&255]+"-"+r[t>>16&15|64]+r[t>>24&255]+"-"+r[63&i|128]+r[i>>8&255]+"-"+r[i>>16&255]+r[i>>24&255]+r[255&n]+r[n>>8&255]+r[n>>16&255]+r[n>>24&255])).toUpperCase()}function gn(e,t,i){return Math.max(t,Math.min(i,e))}function vn(e,t){return(e%t+t)%t}function yn(e,t,i){return(1-i)*e+i*t}function xn(e){return 0==(e&e-1)&&0!==e}function wn(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function bn(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var Mn=Object.freeze({__proto__:null,DEG2RAD:dn,RAD2DEG:pn,generateUUID:fn,clamp:gn,euclideanModulo:vn,mapLinear:function(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},inverseLerp:function(e,t,i){return e!==t?(i-e)/(t-e):0},lerp:yn,damp:function(e,t,i,n){return yn(e,t,1-Math.exp(-i*n))},pingpong:function(e,t=1){return t-Math.abs(vn(e,2*t)-t)},smoothstep:function(e,t,i){return e<=t?0:i<=e?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:i<=e?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return((un=16807*(un=void 0!==e?e%2147483647:un)%2147483647)-1)/2147483646},degToRad:function(e){return e*dn},radToDeg:function(e){return e*pn},isPowerOfTwo:xn,ceilPowerOfTwo:wn,floorPowerOfTwo:bn,setQuaternionFromProperEuler:function(e,t,i,n,r){var s=Math.cos,o=Math.sin,a=s(i/2),l=o(i/2),h=s((t+n)/2),c=o((t+n)/2),u=s((t-n)/2),d=o((t-n)/2),p=s((n-t)/2),m=o((n-t)/2);switch(r){case"XYX":e.set(a*c,l*u,l*d,a*h);break;case"YZY":e.set(l*d,a*c,l*u,a*h);break;case"ZXZ":e.set(l*u,l*d,a*c,a*h);break;case"XZX":e.set(a*c,l*m,l*p,a*h);break;case"YXY":e.set(l*p,a*c,l*m,a*h);break;case"ZYZ":e.set(l*m,l*p,a*c,a*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}});class W{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){var t=this.x,i=this.y,e=e.elements;return this.x=e[0]*t+e[3]*i+e[6],this.y=e[1]*t+e[4]*i+e[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){var t=this.x-e.x,e=this.y-e.y;return t*t+e*e}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){var i=Math.cos(t),t=Math.sin(t),n=this.x-e.x,r=this.y-e.y;return this.x=n*i-r*t+e.x,this.y=n*t+r*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}W.prototype.isVector2=!0;class v{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,n,r,s,o,a,l){var h=this.elements;return h[0]=e,h[1]=n,h[2]=o,h[3]=t,h[4]=r,h[5]=a,h[6]=i,h[7]=s,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){var t=this.elements,e=e.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){e=e.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){var e=e.elements,t=t.elements,i=this.elements,n=e[0],r=e[3],s=e[6],o=e[1],a=e[4],l=e[7],h=e[2],c=e[5],e=e[8],u=t[0],d=t[3],p=t[6],m=t[1],f=t[4],g=t[7],v=t[2],y=t[5],t=t[8];return i[0]=n*u+r*m+s*v,i[3]=n*d+r*f+s*y,i[6]=n*p+r*g+s*t,i[1]=o*u+a*m+l*v,i[4]=o*d+a*f+l*y,i[7]=o*p+a*g+l*t,i[2]=h*u+c*m+e*v,i[5]=h*d+c*f+e*y,i[8]=h*p+c*g+e*t,this}multiplyScalar(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(){var e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],e=e[8];return t*s*e-t*o*l-i*r*e+i*o*a+n*r*l-n*s*a}invert(){var e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],h=e[8],c=h*s-o*l,u=o*a-h*r,d=l*r-s*a,p=t*c+i*u+n*d;return 0==p?this.set(0,0,0,0,0,0,0,0,0):(e[0]=c*(c=1/p),e[1]=(n*l-h*i)*c,e[2]=(o*i-n*s)*c,e[3]=u*c,e[4]=(h*t-n*a)*c,e[5]=(n*r-o*t)*c,e[6]=d*c,e[7]=(i*a-l*t)*c,e[8]=(s*t-i*r)*c,this)}transpose(){var e=this.elements,t=e[1];return e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(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(e,t,i,n,r,s,o){var a=Math.cos(r),r=Math.sin(r);return this.set(i*a,i*r,-i*(a*s+r*o)+s+e,-n*r,n*a,-n*(-r*s+a*o)+o+t,0,0,1),this}scale(e,t){var i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this}rotate(e){var t=Math.cos(e),e=Math.sin(e),i=this.elements,n=i[0],r=i[3],s=i[6],o=i[1],a=i[4],l=i[7];return i[0]=t*n+e*o,i[3]=t*r+e*a,i[6]=t*s+e*l,i[1]=-e*n+t*o,i[4]=-e*r+t*a,i[7]=-e*s+t*l,this}translate(e,t){var i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this}equals(e){var t=this.elements,i=e.elements;for(let e=0;e<9;e++)if(t[e]!==i[e])return!1;return!0}fromArray(t,i=0){for(let e=0;e<9;e++)this.elements[e]=t[e+i];return this}toArray(e=[],t=0){var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}function _n(i){if(0===i.length)return-1/0;let n=i[0];for(let e=1,t=i.length;e<t;++e)i[e]>n&&(n=i[e]);return n}v.prototype.isMatrix3=!0;const Sn={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Tn(e,t){return new Sn[e](t)}function En(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function An(i,e=0){let n=3735928559^e,r=1103547991^e;for(let e,t=0;t<i.length;t++)e=i.charCodeAt(t),n=Math.imul(n^e,2654435761),r=Math.imul(r^e,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&(r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0)}let Cn;class Rn{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;var i;return 2048<(t=e instanceof HTMLCanvasElement?e:((Cn=void 0===Cn?En("canvas"):Cn).width=e.width,Cn.height=e.height,i=Cn.getContext("2d"),e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),Cn)).width||2048<t.height?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}let Ln=0;class c extends cn{constructor(e=c.DEFAULT_IMAGE,t=c.DEFAULT_MAPPING,i=Ce,n=Ce,r=F,s=Ke,o=Le,a=et,l=1,h=Pe){super(),Object.defineProperty(this,"id",{value:Ln++}),this.uuid=fn(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=s,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=a,this.offset=new W(0,0),this.repeat=new W(1,1),this.center=new W(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new v,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this}toJSON(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=fn()),!t&&void 0===e.images[n.uuid]){let i;if(Array.isArray(n)){i=[];for(let e=0,t=n.length;e<t;e++)n[e].isDataTexture?i.push(Pn(n[e].image)):i.push(Pn(n[e]))}else i=Pn(n);e.images[n.uuid]={uuid:n.uuid,url:i}}i.image=n.uuid}return"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping===Ee){if(e.applyMatrix3(this.matrix),e.x<0||1<e.x)switch(this.wrapS){case Ve:e.x=e.x-Math.floor(e.x);break;case Ce:e.x=e.x<0?0:1;break;case je:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||1<e.y)switch(this.wrapT){case Ve:e.y=e.y-Math.floor(e.y);break;case Ce:e.y=e.y<0?0:1;break;case je:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}return e}set needsUpdate(e){!0===e&&this.version++}}function Pn(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Rn.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}c.DEFAULT_IMAGE=void 0,c.DEFAULT_MAPPING=Ee,c.prototype.isTexture=!0;class ze{constructor(e=0,t=0,i=0,n=1){this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){var t=this.x,i=this.y,n=this.z,r=this.w,e=e.elements;return this.x=e[0]*t+e[4]*i+e[8]*n+e[12]*r,this.y=e[1]*t+e[5]*i+e[9]*n+e[13]*r,this.z=e[2]*t+e[6]*i+e[10]*n+e[14]*r,this.w=e[3]*t+e[7]*i+e[11]*n+e[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(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(e){let t,i,n,r;const s=e.elements,o=s[0],a=s[4],l=s[8],h=s[1],c=s[5],u=s[9],d=s[2],p=s[6],m=s[10];if(Math.abs(a-h)<.01&&Math.abs(l-d)<.01&&Math.abs(u-p)<.01)if(Math.abs(a+h)<.1&&Math.abs(l+d)<.1&&Math.abs(u+p)<.1&&Math.abs(o+c+m-3)<.1)this.set(1,0,0,0);else{t=Math.PI;const e=(o+1)/2,s=(c+1)/2,f=(m+1)/2,g=(a+h)/4,v=(l+d)/4,y=(u+p)/4;e>s&&e>f?r=e<.01?(i=0,n=.707106781):(i=Math.sqrt(e),n=g/i,v/i):s>f?r=s<.01?(i=.707106781,n=0,.707106781):(n=Math.sqrt(s),i=g/n,y/n):f<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(f),i=v/r,n=y/r),this.set(i,n,r,t)}else{let e=Math.sqrt((p-u)*(p-u)+(l-d)*(l-d)+(h-a)*(h-a));Math.abs(e)<.001&&(e=1),this.x=(p-u)/e,this.y=(l-d)/e,this.z=(h-a)/e,this.w=Math.acos((o+c+m-1)/2)}return this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}ze.prototype.isVector4=!0;class zn extends cn{constructor(e,t,i={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new ze(0,0,e,t),this.scissorTest=!1,this.viewport=new ze(0,0,e,t),this.texture=new c(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:F,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,i=1){this.width===e&&this.height===t&&this.depth===i||(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image={...this.texture.image},this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}zn.prototype.isWebGLRenderTarget=!0;class Dn extends zn{constructor(e,t,i){super(e,t);var n=this.texture;this.texture=[];for(let e=0;e<i;e++)this.texture[e]=n.clone()}setSize(i,n,r=1){if(this.width!==i||this.height!==n||this.depth!==r){this.width=i,this.height=n,this.depth=r;for(let e=0,t=this.texture.length;e<t;e++)this.texture[e].image.width=i,this.texture[e].image.height=n,this.texture[e].image.depth=r;this.dispose()}return this.viewport.set(0,0,i,n),this.scissor.set(0,0,i,n),this}copy(i){this.dispose(),this.width=i.width,this.height=i.height,this.depth=i.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture;for(let e=this.texture.length=0,t=i.texture.length;e<t;e++)this.texture[e]=i.texture[e].clone();return this}}Dn.prototype.isWebGLMultipleRenderTargets=!0;class In extends zn{constructor(e,t,i){super(e,t,i),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}In.prototype.isWebGLMultisampleRenderTarget=!0;class On{constructor(e=0,t=0,i=0,n=1){this._x=e,this._y=t,this._z=i,this._w=n}static slerp(e,t,i,n){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(e,t,n)}static slerpFlat(t,i,n,r,s,o,a){let l=n[r+0],h=n[r+1],c=n[r+2],u=n[r+3];var d=s[o+0],p=s[o+1],m=s[o+2],o=s[o+3];if(0===a)t[i+0]=l,t[i+1]=h,t[i+2]=c,t[i+3]=u;else if(1===a)t[i+0]=d,t[i+1]=p,t[i+2]=m,t[i+3]=o;else{if(u!==o||l!==d||h!==p||c!==m){let e=1-a;const i=l*d+h*p+c*m+u*o,n=0<=i?1:-1,r=1-i*i;if(r>Number.EPSILON){const s=Math.sqrt(r),o=Math.atan2(s,i*n);e=Math.sin(e*o)/s,a=Math.sin(a*o)/s}const s=a*n;if(l=l*e+d*s,h=h*e+p*s,c=c*e+m*s,u=u*e+o*s,e===1-a){const t=1/Math.sqrt(l*l+h*h+c*c+u*u);l*=t,h*=t,c*=t,u*=t}}t[i]=l,t[i+1]=h,t[i+2]=c,t[i+3]=u}}static multiplyQuaternionsFlat(e,t,i,n,r,s){var o=i[n],a=i[n+1],l=i[n+2],i=i[n+3],n=r[s],h=r[s+1],c=r[s+2],r=r[s+3];return e[t]=o*r+i*n+a*c-l*h,e[t+1]=a*r+i*h+l*n-o*c,e[t+2]=l*r+i*c+o*h-a*n,e[t+3]=i*r-o*n-a*h-l*c,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var i=e._x,n=e._y,r=e._z,s=e._order,e=Math.cos,o=Math.sin,a=e(i/2),l=e(n/2),h=e(r/2),c=o(i/2),u=o(n/2),d=o(r/2);switch(s){case"XYZ":this._x=c*l*h+a*u*d,this._y=a*u*h-c*l*d,this._z=a*l*d+c*u*h,this._w=a*l*h-c*u*d;break;case"YXZ":this._x=c*l*h+a*u*d,this._y=a*u*h-c*l*d,this._z=a*l*d-c*u*h,this._w=a*l*h+c*u*d;break;case"ZXY":this._x=c*l*h-a*u*d,this._y=a*u*h+c*l*d,this._z=a*l*d+c*u*h,this._w=a*l*h-c*u*d;break;case"ZYX":this._x=c*l*h-a*u*d,this._y=a*u*h+c*l*d,this._z=a*l*d-c*u*h,this._w=a*l*h+c*u*d;break;case"YZX":this._x=c*l*h+a*u*d,this._y=a*u*h+c*l*d,this._z=a*l*d-c*u*h,this._w=a*l*h-c*u*d;break;case"XZY":this._x=c*l*h-a*u*d,this._y=a*u*h-c*l*d,this._z=a*l*d+c*u*h,this._w=a*l*h+c*u*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){var t=t/2,i=Math.sin(t);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(t),this._onChangeCallback(),this}setFromRotationMatrix(e){var e=e.elements,t=e[0],i=e[4],n=e[8],r=e[1],s=e[5],o=e[9],a=e[2],l=e[6],h=e[10],c=t+s+h;if(0<c){const e=.5/Math.sqrt(c+1);this._w=.25/e,this._x=(l-o)*e,this._y=(n-a)*e,this._z=(r-i)*e}else if(s<t&&h<t){const e=2*Math.sqrt(1+t-s-h);this._w=(l-o)/e,this._x=.25*e,this._y=(i+r)/e,this._z=(n+a)/e}else if(h<s){const e=2*Math.sqrt(1+s-t-h);this._w=(n-a)/e,this._x=(i+r)/e,this._y=.25*e,this._z=(o+l)/e}else{const e=2*Math.sqrt(1+h-t-s);this._w=(r-i)/e,this._x=(n+a)/e,this._y=(o+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=i,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(gn(this.dot(e),-1,1)))}rotateTowards(e,t){var i=this.angleTo(e);return 0!==i&&(t=Math.min(1,t/i),this.slerp(e,t)),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(this._x=this._x*(e=1/e),this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){var i=e._x,n=e._y,r=e._z,e=e._w,s=t._x,o=t._y,a=t._z,t=t._w;return this._x=i*t+e*s+n*a-r*o,this._y=n*t+e*o+r*s-i*a,this._z=r*t+e*a+i*o-n*s,this._w=e*t-i*s-n*o-r*a,this._onChangeCallback(),this}slerp(t,i){if(0!==i){if(1===i)return this.copy(t);var n=this._x,r=this._y,s=this._z,o=this._w;let e=o*t._w+n*t._x+r*t._y+s*t._z;if(e<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,e=-e):this.copy(t),1<=e)this._w=o,this._x=n,this._y=r,this._z=s;else{t=1-e*e;if(t<=Number.EPSILON){const t=1-i;this._w=t*o+i*this._w,this._x=t*n+i*this._x,this._y=t*r+i*this._y,this._z=t*s+i*this._z,this.normalize()}else{var t=Math.sqrt(t),a=Math.atan2(t,e),l=Math.sin((1-i)*a)/t,i=Math.sin(i*a)/t;this._w=o*l+this._w*i,this._x=n*l+this._x*i,this._y=r*l+this._y*i,this._z=s*l+this._z*i}this._onChangeCallback()}}return this}slerpQuaternions(e,t,i){this.copy(e).slerp(t,i)}random(){var e=Math.random(),t=Math.sqrt(1-e),e=Math.sqrt(e),i=2*Math.PI*Math.random(),n=2*Math.PI*Math.random();return this.set(t*Math.cos(i),e*Math.sin(n),e*Math.cos(n),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}On.prototype.isQuaternion=!0;class De{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Bn.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Bn.setFromAxisAngle(e,t))}applyMatrix3(e){var t=this.x,i=this.y,n=this.z,e=e.elements;return this.x=e[0]*t+e[3]*i+e[6]*n,this.y=e[1]*t+e[4]*i+e[7]*n,this.z=e[2]*t+e[5]*i+e[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){var t=this.x,i=this.y,n=this.z,e=e.elements,r=1/(e[3]*t+e[7]*i+e[11]*n+e[15]);return this.x=(e[0]*t+e[4]*i+e[8]*n+e[12])*r,this.y=(e[1]*t+e[5]*i+e[9]*n+e[13])*r,this.z=(e[2]*t+e[6]*i+e[10]*n+e[14])*r,this}applyQuaternion(e){var t=this.x,i=this.y,n=this.z,r=e.x,s=e.y,o=e.z,e=e.w,a=e*t+s*n-o*i,l=e*i+o*t-r*n,h=e*n+r*i-s*t,t=-r*t-s*i-o*n;return this.x=a*e+t*-r+l*-o-h*-s,this.y=l*e+t*-s+h*-r-a*-o,this.z=h*e+t*-o+a*-s-l*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){var t=this.x,i=this.y,n=this.z,e=e.elements;return this.x=e[0]*t+e[4]*i+e[8]*n,this.y=e[1]*t+e[5]*i+e[9]*n,this.z=e[2]*t+e[6]*i+e[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){var i=e.x,n=e.y,e=e.z,r=t.x,s=t.y,t=t.z;return this.x=n*t-e*s,this.y=e*r-i*t,this.z=i*s-n*r,this}projectOnVector(e){var t=e.lengthSq();return 0===t?this.set(0,0,0):(t=e.dot(this)/t,this.copy(e).multiplyScalar(t))}projectOnPlane(e){return Nn.copy(this).projectOnVector(e),this.sub(Nn)}reflect(e){return this.sub(Nn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:(e=this.dot(e)/t,Math.acos(gn(e,-1,1)))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){var t=this.x-e.x,i=this.y-e.y,e=this.z-e.z;return t*t+i*i+e*e}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){var n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){e=e.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(e){var t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),e=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=e,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){var e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}De.prototype.isVector3=!0;const Nn=new De,Bn=new On;class Fn{constructor(e=new De(1/0,1/0,1/0),t=new De(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(i){let n=1/0,r=1/0,s=1/0,o=-1/0,a=-1/0,l=-1/0;for(let e=0,t=i.length;e<t;e+=3){var h=i[e],c=i[e+1],u=i[e+2];h<n&&(n=h),c<r&&(r=c),u<s&&(s=u),h>o&&(o=h),c>a&&(a=c),u>l&&(l=u)}return this.min.set(n,r,s),this.max.set(o,a,l),this}setFromBufferAttribute(i){let n=1/0,r=1/0,s=1/0,o=-1/0,a=-1/0,l=-1/0;for(let e=0,t=i.count;e<t;e++){var h=i.getX(e),c=i.getY(e),u=i.getZ(e);h<n&&(n=h),c<r&&(r=c),u<s&&(s=u),h>o&&(o=h),c>a&&(a=c),u>l&&(l=u)}return this.min.set(n,r,s),this.max.set(o,a,l),this}setFromPoints(i){this.makeEmpty();for(let e=0,t=i.length;e<t;e++)this.expandByPoint(i[e]);return this}setFromCenterAndSize(e,t){t=Un.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(t),this.max.copy(e).add(t),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);var t=e.geometry,i=(void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),Gn.copy(t.boundingBox),Gn.applyMatrix4(e.matrixWorld),this.union(Gn)),e.children);for(let e=0,t=i.length;e<t;e++)this.expandByObject(i[e]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Un),Un.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return i=0<e.normal.x?(t=e.normal.x*this.min.x,e.normal.x*this.max.x):(t=e.normal.x*this.max.x,e.normal.x*this.min.x),0<e.normal.y?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),0<e.normal.z?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){return!this.isEmpty()&&(this.getCenter(Yn),Jn.subVectors(this.max,Yn),Wn.subVectors(e.a,Yn),kn.subVectors(e.b,Yn),Vn.subVectors(e.c,Yn),jn.subVectors(kn,Wn),Xn.subVectors(Vn,kn),qn.subVectors(Wn,Vn),!!Kn([0,-jn.z,jn.y,0,-Xn.z,Xn.y,0,-qn.z,qn.y,jn.z,0,-jn.x,Xn.z,0,-Xn.x,qn.z,0,-qn.x,-jn.y,jn.x,0,-Xn.y,Xn.x,0,-qn.y,qn.x,0],Wn,kn,Vn,Jn))&&!!Kn([1,0,0,0,1,0,0,0,1],Wn,kn,Vn,Jn)&&(Zn.crossVectors(jn,Xn),Kn([Zn.x,Zn.y,Zn.z],Wn,kn,Vn,Jn))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Un.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(Un).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Hn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Hn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Hn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Hn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Hn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Hn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Hn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Hn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Hn)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}Fn.prototype.isBox3=!0;const Hn=[new De,new De,new De,new De,new De,new De,new De,new De],Un=new De,Gn=new Fn,Wn=new De,kn=new De,Vn=new De,jn=new De,Xn=new De,qn=new De,Yn=new De,Jn=new De,Zn=new De,Qn=new De;function Kn(i,n,r,s,o){for(let e=0,t=i.length-3;e<=t;e+=3){Qn.fromArray(i,e);var a=o.x*Math.abs(Qn.x)+o.y*Math.abs(Qn.y)+o.z*Math.abs(Qn.z),l=n.dot(Qn),h=r.dot(Qn),c=s.dot(Qn);if(Math.max(-Math.max(l,h,c),Math.min(l,h,c))>a)return!1}return!0}const $n=new Fn,er=new De,tr=new De,ir=new De;class nr{constructor(e=new De,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(i,e){var n=this.center;void 0!==e?n.copy(e):$n.setFromPoints(i).getCenter(n);let r=0;for(let e=0,t=i.length;e<t;e++)r=Math.max(r,n.distanceToSquared(i[e]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){var i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){ir.subVectors(e,this.center);var t=ir.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),i=.5*(e-this.radius);this.center.add(ir.multiplyScalar(i/e)),this.radius+=i}return this}union(e){return tr.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(er.copy(e.center).add(tr)),this.expandByPoint(er.copy(e.center).sub(tr)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const rr=new De,sr=new De,or=new De,ar=new De,lr=new De,hr=new De,cr=new De;class ur{constructor(e=new De,t=new De(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,rr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);e=t.dot(this.direction);return e<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(e).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){var t=rr.subVectors(e,this.origin).dot(this.direction);return(t<0?this.origin:(rr.copy(this.direction).multiplyScalar(t).add(this.origin),rr)).distanceToSquared(e)}distanceSqToSegment(e,t,i,n){sr.copy(e).add(t).multiplyScalar(.5),or.copy(t).sub(e).normalize(),ar.copy(this.origin).sub(sr);var e=.5*e.distanceTo(t),t=-this.direction.dot(or),r=ar.dot(this.direction),s=-ar.dot(or),o=ar.lengthSq(),a=Math.abs(1-t*t);let l,h,c,u;if(0<a)if(l=t*s-r,h=t*r-s,u=e*a,0<=l)if(h>=-u)if(h<=u){const e=1/a;l*=e,h*=e,c=l*(l+t*h+2*r)+h*(t*l+h+2*s)+o}else h=e,l=Math.max(0,-(t*h+r)),c=-l*l+h*(h+2*s)+o;else h=-e,l=Math.max(0,-(t*h+r)),c=-l*l+h*(h+2*s)+o;else c=h<=-u?(l=Math.max(0,-(-t*e+r)),h=0<l?-e:Math.min(Math.max(-e,-s),e),-l*l+h*(h+2*s)+o):h<=u?(l=0,(h=Math.min(Math.max(-e,-s),e))*(h+2*s)+o):(l=Math.max(0,-(t*e+r)),h=0<l?e:Math.min(Math.max(-e,-s),e),-l*l+h*(h+2*s)+o);else h=0<t?-e:e,l=Math.max(0,-(t*h+r)),c=-l*l+h*(h+2*s)+o;return i&&i.copy(this.direction).multiplyScalar(l).add(this.origin),n&&n.copy(or).multiplyScalar(h).add(sr),c}intersectSphere(e,t){rr.subVectors(e.center,this.origin);var i=rr.dot(this.direction),n=rr.dot(rr)-i*i,e=e.radius*e.radius;return e<n||(n=i+(e=Math.sqrt(e-n)),(i=i-e)<0&&n<0)?null:i<0?this.at(n,t):this.at(i,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){var t=e.normal.dot(this.direction);return 0===t?0===e.distanceToPoint(this.origin)?0:null:0<=(e=-(this.origin.dot(e.normal)+e.constant)/t)?e:null}intersectPlane(e,t){e=this.distanceToPlane(e);return null===e?null:this.at(e,t)}intersectsPlane(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,r,s,o,a;var l=1/this.direction.x,h=1/this.direction.y,c=1/this.direction.z,u=this.origin;return n=0<=l?(i=(e.min.x-u.x)*l,(e.max.x-u.x)*l):(i=(e.max.x-u.x)*l,(e.min.x-u.x)*l),s=0<=h?(r=(e.min.y-u.y)*h,(e.max.y-u.y)*h):(r=(e.max.y-u.y)*h,(e.min.y-u.y)*h),i>s||r>n||((r>i||i!=i)&&(i=r),(s<n||n!=n)&&(n=s),a=0<=c?(o=(e.min.z-u.z)*c,(e.max.z-u.z)*c):(o=(e.max.z-u.z)*c,(e.min.z-u.z)*c),i>a)||o>n||((o>i||i!=i)&&(i=o),(n=a<n||n!=n?a:n)<0)?null:this.at(0<=i?i:n,t)}intersectsBox(e){return null!==this.intersectBox(e,rr)}intersectTriangle(e,t,i,n,r){lr.subVectors(t,e),hr.subVectors(i,e),cr.crossVectors(lr,hr);let s,o=this.direction.dot(cr);if(0<o){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}ar.subVectors(this.origin,e);t=s*this.direction.dot(hr.crossVectors(ar,hr));return t<0||(i=s*this.direction.dot(lr.cross(ar)))<0||t+i>o||(n=-s*ar.dot(cr))<0?null:this.at(n/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Ie{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,n,r,s,o,a,l,h,c,u,d,p,m,f){var g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=h,g[10]=c,g[14]=u,g[3]=d,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Ie).fromArray(this.elements)}copy(e){var t=this.elements,e=e.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],this}copyPosition(e){var t=this.elements,e=e.elements;return t[12]=e[12],t[13]=e[13],t[14]=e[14],this}setFromMatrix3(e){e=e.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){var t=this.elements,i=e.elements,n=1/dr.setFromMatrixColumn(e,0).length(),r=1/dr.setFromMatrixColumn(e,1).length(),e=1/dr.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*e,t[9]=i[9]*e,t[10]=i[10]*e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,i=e.x,n=e.y,r=e.z,s=Math.cos(i),o=Math.sin(i),a=Math.cos(n),l=Math.sin(n),h=Math.cos(r),c=Math.sin(r);if("XYZ"===e.order){const e=s*h,i=s*c,n=o*h,r=o*c;t[0]=a*h,t[4]=-a*c,t[8]=l,t[1]=i+n*l,t[5]=e-r*l,t[9]=-o*a,t[2]=r-e*l,t[6]=n+i*l,t[10]=s*a}else if("YXZ"===e.order){const e=a*h,i=a*c,n=l*h,r=l*c;t[0]=e+r*o,t[4]=n*o-i,t[8]=s*l,t[1]=s*c,t[5]=s*h,t[9]=-o,t[2]=i*o-n,t[6]=r+e*o,t[10]=s*a}else if("ZXY"===e.order){const e=a*h,i=a*c,n=l*h,r=l*c;t[0]=e-r*o,t[4]=-s*c,t[8]=n+i*o,t[1]=i+n*o,t[5]=s*h,t[9]=r-e*o,t[2]=-s*l,t[6]=o,t[10]=s*a}else if("ZYX"===e.order){const e=s*h,i=s*c,n=o*h,r=o*c;t[0]=a*h,t[4]=n*l-i,t[8]=e*l+r,t[1]=a*c,t[5]=r*l+e,t[9]=i*l-n,t[2]=-l,t[6]=o*a,t[10]=s*a}else if("YZX"===e.order){const e=s*a,i=s*l,n=o*a,r=o*l;t[0]=a*h,t[4]=r-e*c,t[8]=n*c+i,t[1]=c,t[5]=s*h,t[9]=-o*h,t[2]=-l*h,t[6]=i*c+n,t[10]=e-r*c}else if("XZY"===e.order){const e=s*a,i=s*l,n=o*a,r=o*l;t[0]=a*h,t[4]=-c,t[8]=l*h,t[1]=e*c+r,t[5]=s*h,t[9]=i*c-n,t[2]=n*c-i,t[6]=o*h,t[10]=r*c+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(mr,e,fr)}lookAt(e,t,i){var n=this.elements;return yr.subVectors(e,t),0===yr.lengthSq()&&(yr.z=1),yr.normalize(),gr.crossVectors(i,yr),0===gr.lengthSq()&&(1===Math.abs(i.z)?yr.x+=1e-4:yr.z+=1e-4,yr.normalize(),gr.crossVectors(i,yr)),gr.normalize(),vr.crossVectors(yr,gr),n[0]=gr.x,n[4]=vr.x,n[8]=yr.x,n[1]=gr.y,n[5]=vr.y,n[9]=yr.y,n[2]=gr.z,n[6]=vr.z,n[10]=yr.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){var e=e.elements,t=t.elements,i=this.elements,n=e[0],r=e[4],s=e[8],o=e[12],a=e[1],l=e[5],h=e[9],c=e[13],u=e[2],d=e[6],p=e[10],m=e[14],f=e[3],g=e[7],v=e[11],e=e[15],y=t[0],x=t[4],w=t[8],b=t[12],M=t[1],_=t[5],S=t[9],T=t[13],E=t[2],A=t[6],C=t[10],R=t[14],L=t[3],P=t[7],z=t[11],t=t[15];return i[0]=n*y+r*M+s*E+o*L,i[4]=n*x+r*_+s*A+o*P,i[8]=n*w+r*S+s*C+o*z,i[12]=n*b+r*T+s*R+o*t,i[1]=a*y+l*M+h*E+c*L,i[5]=a*x+l*_+h*A+c*P,i[9]=a*w+l*S+h*C+c*z,i[13]=a*b+l*T+h*R+c*t,i[2]=u*y+d*M+p*E+m*L,i[6]=u*x+d*_+p*A+m*P,i[10]=u*w+d*S+p*C+m*z,i[14]=u*b+d*T+p*R+m*t,i[3]=f*y+g*M+v*E+e*L,i[7]=f*x+g*_+v*A+e*P,i[11]=f*w+g*S+v*C+e*z,i[15]=f*b+g*T+v*R+e*t,this}multiplyScalar(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(){var e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],s=e[1],o=e[5],a=e[9],l=e[13],h=e[2],c=e[6],u=e[10],d=e[14];return e[3]*(+r*a*c-n*l*c-r*o*u+i*l*u+n*o*d-i*a*d)+e[7]*(+t*a*d-t*l*u+r*s*u-n*s*d+n*l*h-r*a*h)+e[11]*(+t*l*c-t*o*d-r*s*c+i*s*d+r*o*h-i*l*h)+e[15]*(-n*o*h-t*a*c+t*o*u+n*s*c-i*s*u+i*a*h)}transpose(){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(e,t,i){var n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){var e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],h=e[8],c=e[9],u=e[10],d=e[11],p=e[12],m=e[13],f=e[14],g=e[15],v=c*f*l-m*u*l+m*a*d-o*f*d-c*a*g+o*u*g,y=p*u*l-h*f*l-p*a*d+s*f*d+h*a*g-s*u*g,x=h*m*l-p*c*l+p*o*d-s*m*d-h*o*g+s*c*g,w=p*c*a-h*m*a-p*o*u+s*m*u+h*o*f-s*c*f,b=t*v+i*y+n*x+r*w;return 0==b?this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0):(e[0]=v*(v=1/b),e[1]=(m*u*r-c*f*r-m*n*d+i*f*d+c*n*g-i*u*g)*v,e[2]=(o*f*r-m*a*r+m*n*l-i*f*l-o*n*g+i*a*g)*v,e[3]=(c*a*r-o*u*r-c*n*l+i*u*l+o*n*d-i*a*d)*v,e[4]=y*v,e[5]=(h*f*r-p*u*r+p*n*d-t*f*d-h*n*g+t*u*g)*v,e[6]=(p*a*r-s*f*r-p*n*l+t*f*l+s*n*g-t*a*g)*v,e[7]=(s*u*r-h*a*r+h*n*l-t*u*l-s*n*d+t*a*d)*v,e[8]=x*v,e[9]=(p*c*r-h*m*r-p*i*d+t*m*d+h*i*g-t*c*g)*v,e[10]=(s*m*r-p*o*r+p*i*l-t*m*l-s*i*g+t*o*g)*v,e[11]=(h*o*r-s*c*r-h*i*l+t*c*l+s*i*d-t*o*d)*v,e[12]=w*v,e[13]=(h*m*n-p*c*n+p*i*u-t*m*u-h*i*f+t*c*f)*v,e[14]=(p*o*n-s*m*n-p*i*a+t*m*a+s*i*f-t*o*f)*v,e[15]=(s*c*n-h*o*n+h*i*a-t*c*a-s*i*u+t*o*u)*v,this)}scale(e){var t=this.elements,i=e.x,n=e.y,e=e.z;return t[0]*=i,t[4]*=n,t[8]*=e,t[1]*=i,t[5]*=n,t[9]*=e,t[2]*=i,t[6]*=n,t[10]*=e,t[3]*=i,t[7]*=n,t[11]*=e,this}getMaxScaleOnAxis(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,e))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){var t=Math.cos(e),e=Math.sin(e);return this.set(1,0,0,0,0,t,-e,0,0,e,t,0,0,0,0,1),this}makeRotationY(e){var t=Math.cos(e),e=Math.sin(e);return this.set(t,0,e,0,0,1,0,0,-e,0,t,0,0,0,0,1),this}makeRotationZ(e){var t=Math.cos(e),e=Math.sin(e);return this.set(t,-e,0,0,e,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){var i=Math.cos(t),t=Math.sin(t),n=1-i,r=e.x,s=e.y,e=e.z,o=n*r,a=n*s;return this.set(o*r+i,o*s-t*e,o*e+t*s,0,o*s+t*e,a*s+i,a*e-t*r,0,o*e-t*s,a*e+t*r,n*e*e+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,r,s){return this.set(1,i,r,0,e,1,s,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){var n=this.elements,r=t._x,s=t._y,o=t._z,t=t._w,a=r+r,l=s+s,h=o+o,c=r*a,u=r*l,r=r*h,d=s*l,s=s*h,o=o*h,a=t*a,l=t*l,t=t*h,h=i.x,p=i.y,i=i.z;return n[0]=(1-(d+o))*h,n[1]=(u+t)*h,n[2]=(r-l)*h,n[3]=0,n[4]=(u-t)*p,n[5]=(1-(c+o))*p,n[6]=(s+a)*p,n[7]=0,n[8]=(r+l)*i,n[9]=(s-a)*i,n[10]=(1-(c+d))*i,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){var n=this.elements;let r=dr.set(n[0],n[1],n[2]).length();var s=dr.set(n[4],n[5],n[6]).length(),o=dr.set(n[8],n[9],n[10]).length(),e=(this.determinant()<0&&(r=-r),e.x=n[12],e.y=n[13],e.z=n[14],pr.copy(this),1/r),n=1/s,a=1/o;return pr.elements[0]*=e,pr.elements[1]*=e,pr.elements[2]*=e,pr.elements[4]*=n,pr.elements[5]*=n,pr.elements[6]*=n,pr.elements[8]*=a,pr.elements[9]*=a,pr.elements[10]*=a,t.setFromRotationMatrix(pr),i.x=r,i.y=s,i.z=o,this}makePerspective(e,t,i,n,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,a=2*r/(i-n),l=(t+e)/(t-e),i=(i+n)/(i-n),n=-(s+r)/(s-r),s=-2*s*r/(s-r);return o[0]=2*r/(t-e),o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=a,o[9]=i,o[13]=0,o[2]=0,o[6]=0,o[10]=n,o[14]=s,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,i,n,r,s){var o=this.elements,a=1/(t-e),l=1/(i-n),h=1/(s-r),t=(t+e)*a,e=(i+n)*l,i=(s+r)*h;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-t,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-e,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-i,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){var t=this.elements,i=e.elements;for(let e=0;e<16;e++)if(t[e]!==i[e])return!1;return!0}fromArray(t,i=0){for(let e=0;e<16;e++)this.elements[e]=t[e+i];return this}toArray(e=[],t=0){var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}Ie.prototype.isMatrix4=!0;const dr=new De,pr=new Ie,mr=new De(0,0,0),fr=new De(1,1,1),gr=new De,vr=new De,yr=new De,xr=new Ie,wr=new On;class br{constructor(e=0,t=0,i=0,n=br.DefaultOrder){this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){var e=e.elements,n=e[0],r=e[4],s=e[8],o=e[1],a=e[5],l=e[9],h=e[2],c=e[6],u=e[10];switch(t){case"XYZ":this._y=Math.asin(gn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,u),this._z=Math.atan2(-r,n)):(this._x=Math.atan2(c,a),this._z=0);break;case"YXZ":this._x=Math.asin(-gn(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(s,u),this._z=Math.atan2(o,a)):(this._y=Math.atan2(-h,n),this._z=0);break;case"ZXY":this._x=Math.asin(gn(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-h,u),this._z=Math.atan2(-r,a)):(this._y=0,this._z=Math.atan2(o,n));break;case"ZYX":this._y=Math.asin(-gn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(c,u),this._z=Math.atan2(o,n)):(this._x=0,this._z=Math.atan2(-r,a));break;case"YZX":this._z=Math.asin(gn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,a),this._y=Math.atan2(-h,n)):(this._x=0,this._y=Math.atan2(s,u));break;case"XZY":this._z=Math.asin(-gn(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(c,a),this._y=Math.atan2(s,n)):(this._x=Math.atan2(-l,u),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return xr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(xr,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return wr.setFromEuler(this),this.setFromQuaternion(wr,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new De(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}br.prototype.isEuler=!0,br.DefaultOrder="XYZ",br.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Mr{constructor(){this.mask=1}set(e){this.mask=1<<e|0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}}let _r=0;const Sr=new De,Tr=new On,Er=new Ie,Ar=new De,Cr=new De,Rr=new De,Lr=new On,Pr=new De(1,0,0),zr=new De(0,1,0),Dr=new De(0,0,1),Ir={type:"added"},Or={type:"removed"};class u extends cn{constructor(){super(),Object.defineProperty(this,"id",{value:_r++}),this.uuid=fn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=u.DefaultUp.clone();const e=new De,t=new br,i=new On,n=new De(1,1,1);t._onChange(function(){i.setFromEuler(t,!1)}),i._onChange(function(){t.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Ie},normalMatrix:{value:new v}}),this.matrix=new Ie,this.matrixWorld=new Ie,this.matrixAutoUpdate=u.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Mr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Tr.setFromAxisAngle(e,t),this.quaternion.multiply(Tr),this}rotateOnWorldAxis(e,t){return Tr.setFromAxisAngle(e,t),this.quaternion.premultiply(Tr),this}rotateX(e){return this.rotateOnAxis(Pr,e)}rotateY(e){return this.rotateOnAxis(zr,e)}rotateZ(e){return this.rotateOnAxis(Dr,e)}translateOnAxis(e,t){return Sr.copy(e).applyQuaternion(this.quaternion),this.position.add(Sr.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Pr,e)}translateY(e){return this.translateOnAxis(zr,e)}translateZ(e){return this.translateOnAxis(Dr,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(Er.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?Ar.copy(e):Ar.set(e,t,i);e=this.parent;this.updateWorldMatrix(!0,!1),Cr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Er.lookAt(Cr,Ar,this.up):Er.lookAt(Ar,Cr,this.up),this.quaternion.setFromRotationMatrix(Er),e&&(Er.extractRotation(e.matrixWorld),Tr.setFromRotationMatrix(Er),this.quaternion.premultiply(Tr.invert()))}add(e){if(1<arguments.length)for(let e=0;e<arguments.length;e++)this.add(arguments[e]);else e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),(e.parent=this).children.push(e),e.dispatchEvent(Ir)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e);return this}remove(e){if(1<arguments.length)for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);else{var t=this.children.indexOf(e);-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Or))}return this}removeFromParent(){var e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){var t=this.children[e];t.parent=null,t.dispatchEvent(Or)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),Er.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Er.multiply(e.parent.matrixWorld)),e.applyMatrix4(Er),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(i,n){if(this[i]===n)return this;for(let e=0,t=this.children.length;e<t;e++){var r=this.children[e].getObjectByProperty(i,n);if(void 0!==r)return r}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Cr,e,Rr),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Cr,Lr,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(i){i(this);var n=this.children;for(let e=0,t=n.length;e<t;e++)n[e].traverse(i)}traverseVisible(i){if(!1!==this.visible){i(this);var n=this.children;for(let e=0,t=n.length;e<t;e++)n[e].traverseVisible(i)}}traverseAncestors(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(i){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||i)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),i=!(this.matrixWorldNeedsUpdate=!1));var n=this.children;for(let e=0,t=n.length;e<t;e++)n[e].updateMatrixWorld(i)}updateWorldMatrix(i,e){var t=this.parent;if(!0===i&&null!==t&&t.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const i=this.children;for(let e=0,t=i.length;e<t;e++)i[e].updateWorldMatrix(!1,!0)}}toJSON(i){const n=void 0===i||"string"==typeof i,r={},s=(n&&(i={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"}),{});function o(e,t){return void 0===e[t.uuid]&&(e[t.uuid]=t.toJSON(i)),t.uuid}if(s.uuid=this.uuid,s.type=this.type,""!==this.name&&(s.name=this.name),!0===this.castShadow&&(s.castShadow=!0),!0===this.receiveShadow&&(s.receiveShadow=!0),!1===this.visible&&(s.visible=!1),!1===this.frustumCulled&&(s.frustumCulled=!1),0!==this.renderOrder&&(s.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor)&&(s.instanceColor=this.instanceColor.toJSON()),this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(i).uuid)),this.environment&&this.environment.isTexture&&(s.environment=this.environment.toJSON(i).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=o(i.geometries,this.geometry);const n=this.geometry.parameters;if(void 0!==n&&void 0!==n.shapes){const r=n.shapes;if(Array.isArray(r))for(let e=0,t=r.length;e<t;e++){const s=r[e];o(i.shapes,s)}else o(i.shapes,r)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton)&&(o(i.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid),void 0!==this.material)if(Array.isArray(this.material)){const n=[];for(let e=0,t=this.material.length;e<t;e++)n.push(o(i.materials,this.material[e]));s.material=n}else s.material=o(i.materials,this.material);if(0<this.children.length){s.children=[];for(let e=0;e<this.children.length;e++)s.children.push(this.children[e].toJSON(i).object)}if(0<this.animations.length){s.animations=[];for(let e=0;e<this.animations.length;e++){const r=this.animations[e];s.animations.push(o(i.animations,r))}}if(n){const n=e(i.geometries),s=e(i.materials),o=e(i.textures),t=e(i.images),a=e(i.shapes),l=e(i.skeletons),h=e(i.animations);0<n.length&&(r.geometries=n),0<s.length&&(r.materials=s),0<o.length&&(r.textures=o),0<t.length&&(r.images=t),0<a.length&&(r.shapes=a),0<l.length&&(r.skeletons=l),0<h.length&&(r.animations=h)}return r.object=s,r;function e(e){var t=[];for(const n in e){var i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){var i=t.children[e];this.add(i.clone())}return this}}u.DefaultUp=new De(0,1,0),u.DefaultMatrixAutoUpdate=!0,u.prototype.isObject3D=!0;const Nr=new De,Br=new De,Fr=new De,Hr=new De,Ur=new De,Gr=new De,Wr=new De,kr=new De,Vr=new De,jr=new De;class p{constructor(e=new De,t=new De,i=new De){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),Nr.subVectors(e,t),n.cross(Nr);i=n.lengthSq();return 0<i?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)}static getBarycoord(e,t,i,n,r){Nr.subVectors(n,t),Br.subVectors(i,t),Fr.subVectors(e,t);var n=Nr.dot(Nr),i=Nr.dot(Br),e=Nr.dot(Fr),t=Br.dot(Br),s=Br.dot(Fr),o=n*t-i*i;return 0==o?r.set(-2,-1,-1):r.set(1-(t=(t*e-i*s)*(r=1/o))-(o=(n*s-i*e)*r),o,t)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,Hr),0<=Hr.x&&0<=Hr.y&&Hr.x+Hr.y<=1}static getUV(e,t,i,n,r,s,o,a){return this.getBarycoord(e,t,i,n,Hr),a.set(0,0),a.addScaledVector(r,Hr.x),a.addScaledVector(s,Hr.y),a.addScaledVector(o,Hr.z),a}static isFrontFacing(e,t,i,n){return Nr.subVectors(i,t),Br.subVectors(e,t),Nr.cross(Br).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Nr.subVectors(this.c,this.b),Br.subVectors(this.a,this.b),.5*Nr.cross(Br).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return p.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return p.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,n,r){return p.getUV(e,this.a,this.b,this.c,t,i,n,r)}containsPoint(e){return p.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return p.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){var i=this.a,n=this.b,r=this.c;let s,o;Ur.subVectors(n,i),Gr.subVectors(r,i),kr.subVectors(e,i);var a=Ur.dot(kr),l=Gr.dot(kr);if(a<=0&&l<=0)return t.copy(i);Vr.subVectors(e,n);var h=Ur.dot(Vr),c=Gr.dot(Vr);if(0<=h&&c<=h)return t.copy(n);var u=a*c-h*l;if(u<=0&&0<=a&&h<=0)return s=a/(a-h),t.copy(i).addScaledVector(Ur,s);jr.subVectors(e,r);var e=Ur.dot(jr),d=Gr.dot(jr);return 0<=d&&e<=d?t.copy(r):(a=e*l-a*d)<=0&&0<=l&&d<=0?(o=l/(l-d),t.copy(i).addScaledVector(Gr,o)):(l=h*d-e*c)<=0&&0<=c-h&&0<=e-d?(Wr.subVectors(r,n),o=(c-h)/(c-h+(e-d)),t.copy(n).addScaledVector(Wr,o)):(r=1/(l+a+u),s=a*r,o=u*r,t.copy(i).addScaledVector(Ur,s).addScaledVector(Gr,o))}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Xr=0;class i extends cn{constructor(){super(),Object.defineProperty(this,"id",{value:Xr++}),this.uuid=fn(),this.name="",this.type="Material",this.fog=!0,this.blending=J,this.side=Oe,this.vertexColors=!1,this.opacity=1,this.format=Le,this.transparent=!1,this.blendSrc=he,this.blendDst=ce,this.blendEquation=ee,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=xe,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Qi,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Bi,this.stencilZFail=Bi,this.stencilZPass=Bi,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.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){0<this._alphaTest!=0<e&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const n in e){var t,i=e[n];void 0===i?console.warn("THREE.Material: '"+n+"' parameter is undefined."):"shading"===n?(console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===D):void 0!==(t=this[n])?t&&t.isColor?t.set(i):t&&t.isVector3&&i&&i.isVector3?t.copy(i):this[n]=i:console.warn("THREE."+this.type+": '"+n+"' is not a property of this material.")}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(e){var t=[];for(const n in e){var i=e[n];delete i.metadata,t.push(i)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine)&&(i.combine=this.combine),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==J&&(i.blending=this.blending),this.side!==Oe&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.format!==Le&&(i.format=this.format),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),0<this.alphaTest&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),1<this.wireframeLinewidth&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),t){const t=n(e.textures),r=n(e.images);0<t.length&&(i.textures=t),0<r.length&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.format=t.format,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var i=t.clippingPlanes;let n=null;if(null!==i){const t=i.length;n=new Array(t);for(let e=0;e!==t;++e)n[e]=i[e].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}i.prototype.isMaterial=!0;const qr={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},Yr={h:0,s:0,l:0},Jr={h:0,s:0,l:0};function Zr(e,t,i){return i<0&&(i+=1),1<i&&--i,i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}function Qr(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Kr(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class g{constructor(e,t,i){return void 0===t&&void 0===i?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,i){return this.r=e,this.g=t,this.b=i,this}setHSL(e,t,i){return e=vn(e,1),t=gn(t,0,1),i=gn(i,0,1),0===t?this.r=this.g=this.b=i:(this.r=Zr(t=2*i-(i=i<=.5?i*(1+t):i+t-i*t),i,e+1/3),this.g=Zr(t,i,e),this.b=Zr(t,i,e-1/3)),this}setStyle(t){function i(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let e;var r=n[1],s=n[2];switch(r){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,i(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,i(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const n=parseFloat(e[1])/360,o=parseInt(e[2],10)/100,a=parseInt(e[3],10)/100;return i(e[4]),this.setHSL(n,o,a)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],i=t.length;if(3===i)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===i)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&0<t.length?this.setColorName(t):this}setColorName(e){var t=qr[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){t=0<t?1/t:1;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=Qr(e.r),this.g=Qr(e.g),this.b=Qr(e.b),this}copyLinearToSRGB(e){return this.r=Kr(e.r),this.g=Kr(e.g),this.b=Kr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){var t=this.r,i=this.g,n=this.b,r=Math.max(t,i,n),s=Math.min(t,i,n);let o,a;var l=(s+r)/2;if(s===r)o=0,a=0;else{const e=r-s;switch(a=l<=.5?e/(r+s):e/(2-r-s),r){case t:o=(i-n)/e+(i<n?6:0);break;case i:o=(n-t)/e+2;break;case n:o=(t-i)/e+4}o/=6}return e.h=o,e.s=a,e.l=l,e}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(e,t,i){return this.getHSL(Yr),Yr.h+=e,Yr.s+=t,Yr.l+=i,this.setHSL(Yr.h,Yr.s,Yr.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Yr),e.getHSL(Jr);var e=yn(Yr.h,Jr.h,t),i=yn(Yr.s,Jr.s,t),t=yn(Yr.l,Jr.l,t);return this.setHSL(e,i,t),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}g.NAMES=qr,g.prototype.isColor=!0,g.prototype.r=1,g.prototype.g=1,g.prototype.b=1;class $r extends i{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new g(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=O,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}$r.prototype.isMeshBasicMaterial=!0;const n=new De,es=new W;class T{constructor(e,t,i){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===i,this.usage=Ki,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(i,n,r){i*=this.itemSize,r*=n.itemSize;for(let e=0,t=this.itemSize;e<t;e++)this.array[i+e]=n.array[r+e];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(i){var n=this.array;let r=0;for(let t=0,e=i.length;t<e;t++){let e=i[t];void 0===e&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",t),e=new g),n[r++]=e.r,n[r++]=e.g,n[r++]=e.b}return this}copyVector2sArray(i){var n=this.array;let r=0;for(let t=0,e=i.length;t<e;t++){let e=i[t];void 0===e&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",t),e=new W),n[r++]=e.x,n[r++]=e.y}return this}copyVector3sArray(i){var n=this.array;let r=0;for(let t=0,e=i.length;t<e;t++){let e=i[t];void 0===e&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",t),e=new De),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z}return this}copyVector4sArray(i){var n=this.array;let r=0;for(let t=0,e=i.length;t<e;t++){let e=i[t];void 0===e&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",t),e=new ze),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r++]=e.w}return this}applyMatrix3(i){if(2===this.itemSize)for(let e=0,t=this.count;e<t;e++)es.fromBufferAttribute(this,e),es.applyMatrix3(i),this.setXY(e,es.x,es.y);else if(3===this.itemSize)for(let e=0,t=this.count;e<t;e++)n.fromBufferAttribute(this,e),n.applyMatrix3(i),this.setXYZ(e,n.x,n.y,n.z);return this}applyMatrix4(i){for(let e=0,t=this.count;e<t;e++)n.x=this.getX(e),n.y=this.getY(e),n.z=this.getZ(e),n.applyMatrix4(i),this.setXYZ(e,n.x,n.y,n.z);return this}applyNormalMatrix(i){for(let e=0,t=this.count;e<t;e++)n.x=this.getX(e),n.y=this.getY(e),n.z=this.getZ(e),n.applyNormalMatrix(i),this.setXYZ(e,n.x,n.y,n.z);return this}transformDirection(i){for(let e=0,t=this.count;e<t;e++)n.x=this.getX(e),n.y=this.getY(e),n.z=this.getZ(e),n.transformDirection(i),this.setXYZ(e,n.x,n.y,n.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){var e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==Ki&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}}T.prototype.isBufferAttribute=!0;class ts extends T{constructor(e,t,i){super(new Int8Array(e),t,i)}}class is extends T{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class ns extends T{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class rs extends T{constructor(e,t,i){super(new Int16Array(e),t,i)}}class ss extends T{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class os extends T{constructor(e,t,i){super(new Int32Array(e),t,i)}}class as extends T{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class ls extends T{constructor(e,t,i){super(new Uint16Array(e),t,i)}}ls.prototype.isFloat16BufferAttribute=!0;class k extends T{constructor(e,t,i){super(new Float32Array(e),t,i)}}class hs extends T{constructor(e,t,i){super(new Float64Array(e),t,i)}}let cs=0;const us=new Ie,ds=new u,ps=new De,ms=new Fn,fs=new Fn,h=new De;class _ extends cn{constructor(){super(),Object.defineProperty(this,"id",{value:cs++}),this.uuid=fn(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(65535<_n(e)?as:ss)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){const t=(new v).getNormalMatrix(e);i.applyNormalMatrix(t),i.needsUpdate=!0}i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return us.makeRotationFromQuaternion(e),this.applyMatrix4(us),this}rotateX(e){return us.makeRotationX(e),this.applyMatrix4(us),this}rotateY(e){return us.makeRotationY(e),this.applyMatrix4(us),this}rotateZ(e){return us.makeRotationZ(e),this.applyMatrix4(us),this}translate(e,t,i){return us.makeTranslation(e,t,i),this.applyMatrix4(us),this}scale(e,t,i){return us.makeScale(e,t,i),this.applyMatrix4(us),this}lookAt(e){return ds.lookAt(e),ds.updateMatrix(),this.applyMatrix4(ds.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ps).negate(),this.translate(ps.x,ps.y,ps.z),this}setFromPoints(i){var n=[];for(let e=0,t=i.length;e<t;e++){var r=i[e];n.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new k(n,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Fn);var e=this.attributes.position,i=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingBox.set(new De(-1/0,-1/0,-1/0),new De(1/0,1/0,1/0));else{if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),i)for(let e=0,t=i.length;e<t;e++){var n=i[e];ms.setFromBufferAttribute(n),this.morphTargetsRelative?(h.addVectors(this.boundingBox.min,ms.min),this.boundingBox.expandByPoint(h),h.addVectors(this.boundingBox.max,ms.max),this.boundingBox.expandByPoint(h)):(this.boundingBox.expandByPoint(ms.min),this.boundingBox.expandByPoint(ms.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(){null===this.boundingSphere&&(this.boundingSphere=new nr);var n=this.attributes.position,r=this.morphAttributes.position;if(n&&n.isGLBufferAttribute)console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingSphere.set(new De,1/0);else if(n){var s=this.boundingSphere.center;if(ms.setFromBufferAttribute(n),r)for(let e=0,t=r.length;e<t;e++){var o=r[e];fs.setFromBufferAttribute(o),this.morphTargetsRelative?(h.addVectors(ms.min,fs.min),ms.expandByPoint(h),h.addVectors(ms.max,fs.max),ms.expandByPoint(h)):(ms.expandByPoint(fs.min),ms.expandByPoint(fs.max))}ms.getCenter(s);let i=0;for(let e=0,t=n.count;e<t;e++)h.fromBufferAttribute(n,e),i=Math.max(i,s.distanceToSquared(h));if(r)for(let e=0,t=r.length;e<t;e++){var a=r[e],l=this.morphTargetsRelative;for(let e=0,t=a.count;e<t;e++)h.fromBufferAttribute(a,e),l&&(ps.fromBufferAttribute(n,e),h.add(ps)),i=Math.max(i,s.distanceToSquared(h))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(null===e||void 0===n.position||void 0===n.normal||void 0===n.uv)console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");else{const o=e.array,a=n.position.array,l=n.normal.array,h=n.uv.array,t=a.length/3,c=(void 0===n.tangent&&this.setAttribute("tangent",new T(new Float32Array(4*t),4)),n.tangent.array),u=[],d=[];for(let e=0;e<t;e++)u[e]=new De,d[e]=new De;const p=new De,m=new De,f=new De,g=new W,v=new W,y=new W,x=new De,w=new De;let i=this.groups;for(let e=0,t=(i=0===i.length?[{start:0,count:o.length}]:i).length;e<t;++e){const n=i[e],a=n.start;for(let e=a,t=a+n.count;e<t;e+=3)r(o[e+0],o[e+1],o[e+2])}const b=new De,M=new De,_=new De,S=new De;for(let e=0,t=i.length;e<t;++e){const n=i[e],a=n.start;for(let e=a,t=a+n.count;e<t;e+=3)s(o[e+0]),s(o[e+1]),s(o[e+2])}function r(e,t,i){p.fromArray(a,3*e),m.fromArray(a,3*t),f.fromArray(a,3*i),g.fromArray(h,2*e),v.fromArray(h,2*t),y.fromArray(h,2*i),m.sub(p),f.sub(p),v.sub(g),y.sub(g);var n=1/(v.x*y.y-y.x*v.y);isFinite(n)&&(x.copy(m).multiplyScalar(y.y).addScaledVector(f,-v.y).multiplyScalar(n),w.copy(f).multiplyScalar(v.x).addScaledVector(m,-y.x).multiplyScalar(n),u[e].add(x),u[t].add(x),u[i].add(x),d[e].add(w),d[t].add(w),d[i].add(w))}function s(e){_.fromArray(l,3*e),S.copy(_);var t=u[e],t=(b.copy(t),b.sub(_.multiplyScalar(_.dot(t))).normalize(),M.crossVectors(S,t),M.dot(d[e])<0?-1:1);c[4*e]=b.x,c[4*e+1]=b.y,c[4*e+2]=b.z,c[4*e+3]=t}}}computeVertexNormals(){var n=this.index,r=this.getAttribute("position");if(void 0!==r){let i=this.getAttribute("normal");if(void 0===i)i=new T(new Float32Array(3*r.count),3),this.setAttribute("normal",i);else for(let e=0,t=i.count;e<t;e++)i.setXYZ(e,0,0,0);var s=new De,o=new De,a=new De,l=new De,h=new De,c=new De,u=new De,d=new De;if(n)for(let e=0,t=n.count;e<t;e+=3){var p=n.getX(e+0),m=n.getX(e+1),f=n.getX(e+2);s.fromBufferAttribute(r,p),o.fromBufferAttribute(r,m),a.fromBufferAttribute(r,f),u.subVectors(a,o),d.subVectors(s,o),u.cross(d),l.fromBufferAttribute(i,p),h.fromBufferAttribute(i,m),c.fromBufferAttribute(i,f),l.add(u),h.add(u),c.add(u),i.setXYZ(p,l.x,l.y,l.z),i.setXYZ(m,h.x,h.y,h.z),i.setXYZ(f,c.x,c.y,c.z)}else for(let e=0,t=r.count;e<t;e+=3)s.fromBufferAttribute(r,e+0),o.fromBufferAttribute(r,e+1),a.fromBufferAttribute(r,e+2),u.subVectors(a,o),d.subVectors(s,o),u.cross(d),i.setXYZ(e+0,u.x,u.y,u.z),i.setXYZ(e+1,u.x,u.y,u.z),i.setXYZ(e+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var i=this.attributes;for(const a in i)if(void 0!==e.attributes[a]){var n=i[a].array,r=e.attributes[a],s=r.array,r=r.itemSize*t,o=Math.min(s.length,n.length-r);for(let e=0,t=r;e<o;e++,t++)n[t]=s[e]}return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)}normalizeNormals(){var i=this.attributes.normal;for(let e=0,t=i.count;e<t;e++)h.fromBufferAttribute(i,e),h.normalize(),i.setXYZ(e,h.x,h.y,h.z)}toNonIndexed(){function i(i,n){var r=i.array,s=i.itemSize,e=i.normalized,o=new r.constructor(n.length*s);let a=0,l=0;for(let e=0,t=n.length;e<t;e++){a=i.isInterleavedBufferAttribute?n[e]*i.data.stride+i.offset:n[e]*s;for(let e=0;e<s;e++)o[l++]=r[a++]}return new T(o,s,e)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new _,r=this.index.array,s=this.attributes;for(const e in s){const o=i(s[e],r);n.setAttribute(e,o)}const e=this.morphAttributes;for(const s in e){const o=[],a=e[s];for(let e=0,t=a.length;e<t;e++){const s=i(a[e],r);o.push(s)}n.morphAttributes[s]=o}n.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let e=0,t=o.length;e<t;e++){const r=o[e];n.addGroup(r.start,r.count,r.materialIndex)}return n}toJSON(){var i={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),0<Object.keys(this.userData).length&&(i.userData=this.userData),void 0!==this.parameters){const n=this.parameters;for(const r in n)void 0!==n[r]&&(i[r]=n[r])}else{i.data={attributes:{}};const n=this.index,r=(null!==n&&(i.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)}),this.attributes);for(const n in r){const s=r[n];i.data.attributes[n]=s.toJSON(i.data)}const s={};let e=!1;for(const n in this.morphAttributes){const r=this.morphAttributes[n],o=[];for(let e=0,t=r.length;e<t;e++){const s=r[e];o.push(s.toJSON(i.data))}0<o.length&&(s[n]=o,e=!0)}e&&(i.data.morphAttributes=s,i.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;0<o.length&&(i.data.groups=JSON.parse(JSON.stringify(o)));var t=this.boundingSphere;null!==t&&(i.data.boundingSphere={center:t.center.toArray(),radius:t.radius})}return i}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const i={},n=(this.name=e.name,e.index),r=(null!==n&&this.setIndex(n.clone(i)),e.attributes);for(const e in r){const n=r[e];this.setAttribute(e,n.clone(i))}var t=e.morphAttributes;for(const e in t){const n=[],r=t[e];for(let e=0,t=r.length;e<t;e++)n.push(r[e].clone(i));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;var s=e.groups;for(let e=0,t=s.length;e<t;e++){const i=s[e];this.addGroup(i.start,i.count,i.materialIndex)}var o=e.boundingBox,o=(null!==o&&(this.boundingBox=o.clone()),e.boundingSphere);return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}_.prototype.isBufferGeometry=!0;const gs=new Ie,vs=new ur,ys=new nr,xs=new De,ws=new De,bs=new De,Ms=new De,_s=new De,Ss=new De,Ts=new De,Es=new De,As=new De,Cs=new W,Rs=new W,Ls=new W,Ps=new De,zs=new De;class S extends u{constructor(e=new _,t=new $r){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const i=this.geometry;if(i.isBufferGeometry){var e=i.morphAttributes,t=Object.keys(e);if(0<t.length){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){var n=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{e=i.morphTargets;void 0!==e&&0<e.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(n,r){const e=this.geometry,s=this.material,o=this.matrixWorld;if(void 0!==s&&(null===e.boundingSphere&&e.computeBoundingSphere(),ys.copy(e.boundingSphere),ys.applyMatrix4(o),!1!==n.ray.intersectsSphere(ys))&&(gs.copy(o).invert(),vs.copy(n.ray).applyMatrix4(gs),null===e.boundingBox||!1!==vs.intersectsBox(e.boundingBox))){let i;if(e.isBufferGeometry){const o=e.index,d=e.attributes.position,p=e.morphAttributes.position,m=e.morphTargetsRelative,f=e.attributes.uv,g=e.attributes.uv2,v=e.groups,y=e.drawRange;if(null!==o)if(Array.isArray(s))for(let e=0,t=v.length;e<t;e++){var a=v[e],l=s[a.materialIndex];for(let e=Math.max(a.start,y.start),t=Math.min(o.count,Math.min(a.start+a.count,y.start+y.count));e<t;e+=3){const s=o.getX(e),x=o.getX(e+1),w=o.getX(e+2);(i=Ds(this,l,n,vs,d,p,m,f,g,s,x,w))&&(i.faceIndex=Math.floor(e/3),i.face.materialIndex=a.materialIndex,r.push(i))}}else for(let e=Math.max(0,y.start),t=Math.min(o.count,y.start+y.count);e<t;e+=3){var h=o.getX(e),c=o.getX(e+1),u=o.getX(e+2);(i=Ds(this,s,n,vs,d,p,m,f,g,h,c,u))&&(i.faceIndex=Math.floor(e/3),r.push(i))}else if(void 0!==d)if(Array.isArray(s))for(let e=0,t=v.length;e<t;e++){const o=v[e],b=s[o.materialIndex];for(let e=Math.max(o.start,y.start),t=Math.min(d.count,Math.min(o.start+o.count,y.start+y.count));e<t;e+=3)(i=Ds(this,b,n,vs,d,p,m,f,g,e,e+1,e+2))&&(i.faceIndex=Math.floor(e/3),i.face.materialIndex=o.materialIndex,r.push(i))}else for(let e=Math.max(0,y.start),t=Math.min(d.count,y.start+y.count);e<t;e+=3)(i=Ds(this,s,n,vs,d,p,m,f,g,e,e+1,e+2))&&(i.faceIndex=Math.floor(e/3),r.push(i))}else e.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function Ds(e,i,n,t,r,s,o,a,l,h,c,u){xs.fromBufferAttribute(r,h),ws.fromBufferAttribute(r,c),bs.fromBufferAttribute(r,u);var d=e.morphTargetInfluences;if(s&&d){Ts.set(0,0,0),Es.set(0,0,0),As.set(0,0,0);for(let e=0,t=s.length;e<t;e++){const i=d[e],n=s[e];0!==i&&(Ms.fromBufferAttribute(n,h),_s.fromBufferAttribute(n,c),Ss.fromBufferAttribute(n,u),o?(Ts.addScaledVector(Ms,i),Es.addScaledVector(_s,i),As.addScaledVector(Ss,i)):(Ts.addScaledVector(Ms.sub(xs),i),Es.addScaledVector(_s.sub(ws),i),As.addScaledVector(Ss.sub(bs),i)))}xs.add(Ts),ws.add(Es),bs.add(As)}e.isSkinnedMesh&&(e.boneTransform(h,xs),e.boneTransform(c,ws),e.boneTransform(u,bs));r=function(e,t,i,n,r,s,o,a){if(null===(t.side===Ae?n.intersectTriangle(o,s,r,!0,a):n.intersectTriangle(r,s,o,t.side!==Ne,a)))return null;zs.copy(a),zs.applyMatrix4(e.matrixWorld);n=i.ray.origin.distanceTo(zs);return n<i.near||n>i.far?null:{distance:n,point:zs.clone(),object:e}}(e,i,n,t,xs,ws,bs,Ps);if(r){a&&(Cs.fromBufferAttribute(a,h),Rs.fromBufferAttribute(a,c),Ls.fromBufferAttribute(a,u),r.uv=p.getUV(Ps,xs,ws,bs,Cs,Rs,Ls,new W)),l&&(Cs.fromBufferAttribute(l,h),Rs.fromBufferAttribute(l,c),Ls.fromBufferAttribute(l,u),r.uv2=p.getUV(Ps,xs,ws,bs,Cs,Rs,Ls,new W));const e={a:h,b:c,c:u,normal:new De,materialIndex:0};p.getNormal(xs,ws,bs,e.normal),r.face=e}return r}S.prototype.isMesh=!0;class Is extends _{constructor(e=1,t=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};const b=this,M=(n=Math.floor(n),r=Math.floor(r),s=Math.floor(s),[]),_=[],S=[],T=[];let E=0,A=0;function o(i,n,r,s,o,a,e,l,h,c,t){var u=a/h,d=e/c,p=a/2,m=e/2,f=l/2,g=h+1,v=c+1;let y=0,x=0;var w=new De;for(let t=0;t<v;t++){const b=t*d-m;for(let e=0;e<g;e++){const E=e*u-p;w[i]=E*s,w[n]=b*o,w[r]=f,_.push(w.x,w.y,w.z),w[i]=0,w[n]=0,w[r]=0<l?1:-1,S.push(w.x,w.y,w.z),T.push(e/h),T.push(1-t/c),y+=1}}for(let t=0;t<c;t++)for(let e=0;e<h;e++){const r=E+e+g*t,s=E+e+g*(t+1),o=E+(e+1)+g*(t+1),a=E+(e+1)+g*t;M.push(r,s,a),M.push(s,o,a),x+=6}b.addGroup(A,x,t),A+=x,E+=y}o("z","y","x",-1,-1,i,t,e,s,r,0),o("z","y","x",1,-1,i,t,-e,s,r,1),o("x","z","y",1,1,e,i,t,n,s,2),o("x","z","y",1,-1,e,i,-t,n,s,3),o("x","y","z",1,-1,e,t,i,n,r,4),o("x","y","z",-1,-1,e,t,-i,n,r,5),this.setIndex(M),this.setAttribute("position",new k(_,3)),this.setAttribute("normal",new k(S,3)),this.setAttribute("uv",new k(T,2))}static fromJSON(e){return new Is(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Os(e){var t={};for(const n in e){t[n]={};for(const r in e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function Ns(t){var i={};for(let e=0;e<t.length;e++){var n=Os(t[e]);for(const t in n)i[t]=n[t]}return i}const Bs={clone:Os,merge:Ns};class Fs extends i{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!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,this.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Os(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){var t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){var i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}0<Object.keys(this.defines).length&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return 0<Object.keys(n).length&&(t.extensions=n),t}}Fs.prototype.isShaderMaterial=!0;class Hs extends u{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Ie,this.projectionMatrix=new Ie,this.projectionMatrixInverse=new Ie}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}Hs.prototype.isCamera=!0;class B extends Hs{constructor(e=50,t=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){e=.5*this.getFilmHeight()/e;this.fov=2*pn*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){var e=Math.tan(.5*dn*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*pn*Math.atan(Math.tan(.5*dn*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,n,r,s){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*dn*this.fov)/this.zoom,i=2*t,n=this.aspect*i,r=-.5*n;var s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,o=s.fullHeight;r+=s.offsetX*n/e,t-=s.offsetY*i/o,n*=s.width/e,i*=s.height/o}const o=this.filmOffset;0!==o&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){e=super.toJSON(e);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}B.prototype.isPerspectiveCamera=!0;class Us extends u{constructor(e,t,i){super(),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget?console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."):(this.renderTarget=i,(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,-1,0),i.lookAt(new De(1,0,0)),this.add(i),(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,-1,0),i.lookAt(new De(-1,0,0)),this.add(i),(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,0,1),i.lookAt(new De(0,1,0)),this.add(i),(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,0,-1),i.lookAt(new De(0,-1,0)),this.add(i),(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,-1,0),i.lookAt(new De(0,0,1)),this.add(i),(i=new B(90,1,e,t)).layers=this.layers,i.up.set(0,-1,0),i.lookAt(new De(0,0,-1)),this.add(i))}update(e,t){null===this.parent&&this.updateMatrixWorld();var i=this.renderTarget,[n,r,s,o,a,l]=this.children,h=e.xr.enabled,c=e.getRenderTarget(),u=(e.xr.enabled=!1,i.texture.generateMipmaps);i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,n),e.setRenderTarget(i,1),e.render(t,r),e.setRenderTarget(i,2),e.render(t,s),e.setRenderTarget(i,3),e.render(t,o),e.setRenderTarget(i,4),e.render(t,a),i.texture.generateMipmaps=u,e.setRenderTarget(i,5),e.render(t,l),e.setRenderTarget(c),e.xr.enabled=h}}class Gs extends c{constructor(e,t,i,n,r,s,o,a,l,h){super(e=void 0!==e?e:[],t=void 0!==t?t:Fe,i,n,r,s,o,a,l,h),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Gs.prototype.isCubeTexture=!0;class Ws extends zn{constructor(e,t,i){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=i),super(e,e,t),t=t||{},this.texture=new Gs(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:F,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=Le,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={tEquirect:{value:null}},n="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",r="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",s=new Is(5,5,5),o=new Fs({name:"CubemapFromEquirect",uniforms:Os(i),vertexShader:n,fragmentShader:r,side:Ae,blending:Y});o.uniforms.tEquirect.value=t;var a=new S(s,o),l=t.minFilter;return t.minFilter===Ke&&(t.minFilter=F),new Us(1,10,this).update(e,a),t.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(t,i,n,r){var e=t.getRenderTarget();for(let e=0;e<6;e++)t.setRenderTarget(this,e),t.clear(i,n,r);t.setRenderTarget(e)}}Ws.prototype.isWebGLCubeRenderTarget=!0;const ks=new De,Vs=new De,js=new v;class Xs{constructor(e=new De(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){i=ks.subVectors(i,t).cross(Vs.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){var i=e.delta(ks),n=this.normal.dot(i);return 0===n?0===this.distanceToPoint(e.start)?t.copy(e.start):null:(n=-(e.start.dot(this.normal)+this.constant)/n)<0||1<n?null:t.copy(i).multiplyScalar(n).add(e.start)}intersectsLine(e){var t=this.distanceToPoint(e.start),e=this.distanceToPoint(e.end);return t<0&&0<e||e<0&&0<t}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){t=t||js.getNormalMatrix(e),e=this.coplanarPoint(ks).applyMatrix4(e),t=this.normal.applyMatrix3(t).normalize();return this.constant=-e.dot(t),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}Xs.prototype.isPlane=!0;const qs=new nr,Ys=new De;class Js{constructor(e=new Xs,t=new Xs,i=new Xs,n=new Xs,r=new Xs,s=new Xs){this.planes=[e,t,i,n,r,s]}set(e,t,i,n,r,s){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(s),this}copy(t){var i=this.planes;for(let e=0;e<6;e++)i[e].copy(t.planes[e]);return this}setFromProjectionMatrix(e){var t=this.planes,e=e.elements,i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],h=e[7],c=e[8],u=e[9],d=e[10],p=e[11],m=e[12],f=e[13],g=e[14],e=e[15];return t[0].setComponents(s-i,h-o,p-c,e-m).normalize(),t[1].setComponents(s+i,h+o,p+c,e+m).normalize(),t[2].setComponents(s+n,h+a,p+u,e+f).normalize(),t[3].setComponents(s-n,h-a,p-u,e-f).normalize(),t[4].setComponents(s-r,h-l,p-d,e-g).normalize(),t[5].setComponents(s+r,h+l,p+d,e+g).normalize(),this}intersectsObject(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),qs.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(qs)}intersectsSprite(e){return qs.center.set(0,0,0),qs.radius=.7071067811865476,qs.applyMatrix4(e.matrixWorld),this.intersectsSphere(qs)}intersectsSphere(e){var t=this.planes,i=e.center,n=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(i)<n)return!1;return!0}intersectsBox(t){var i=this.planes;for(let e=0;e<6;e++){var n=i[e];if(Ys.x=(0<n.normal.x?t.max:t.min).x,Ys.y=(0<n.normal.y?t.max:t.min).y,Ys.z=(0<n.normal.z?t.max:t.min).z,n.distanceToPoint(Ys)<0)return!1}return!0}containsPoint(t){var i=this.planes;for(let e=0;e<6;e++)if(i[e].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Zs(){let i=null,e=!1,n=null,r=null;function s(e,t){n(e,t),r=i.requestAnimationFrame(s)}return{start:function(){!0!==e&&null!==n&&(r=i.requestAnimationFrame(s),e=!0)},stop:function(){i.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(e){n=e},setContext:function(e){i=e}}}function Qs(o,e){const a=e.isWebGL2,l=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),l.get(e)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var t=l.get(e);t&&(o.deleteBuffer(t.buffer),l.delete(e))},update:function(e,t){if(e.isGLBufferAttribute){const o=l.get(e);void((!o||o.version<e.version)&&l.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}else{e.isInterleavedBufferAttribute&&(e=e.data);var i,n,r,s=l.get(e);void 0===s?l.set(e,function(e,t){var i=e.array,n=e.usage,r=o.createBuffer();o.bindBuffer(t,r),o.bufferData(t,i,n),e.onUploadCallback();let s=5126;return i instanceof Float32Array?s=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?e.isFloat16BufferAttribute?a?s=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):s=5123:i instanceof Int16Array?s=5122:i instanceof Uint32Array?s=5125:i instanceof Int32Array?s=5124:i instanceof Int8Array?s=5120:(i instanceof Uint8Array||i instanceof Uint8ClampedArray)&&(s=5121),{buffer:r,type:s,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(e,t)):s.version<e.version&&(i=s.buffer,t=t,r=(n=e).array,n=n.updateRange,o.bindBuffer(t,i),-1===n.count?o.bufferSubData(t,0,r):(a?o.bufferSubData(t,n.offset*r.BYTES_PER_ELEMENT,r,n.offset,n.count):o.bufferSubData(t,n.offset*r.BYTES_PER_ELEMENT,r.subarray(n.offset,n.offset+n.count)),n.count=-1),s.version=e.version)}}}}class Ks extends _{constructor(e=1,i=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:i,widthSegments:n,heightSegments:r};const s=e/2,o=i/2,a=Math.floor(n),l=Math.floor(r),h=a+1,c=l+1,u=e/a,d=i/l,p=[],m=[],f=[],g=[];for(let t=0;t<c;t++){const i=t*d-o;for(let e=0;e<h;e++){const r=e*u-s;m.push(r,-i,0),f.push(0,0,1),g.push(e/a),g.push(1-t/l)}}for(let t=0;t<l;t++)for(let e=0;e<a;e++){const n=e+h*t,r=e+h*(t+1),s=e+1+h*(t+1),o=e+1+h*t;p.push(n,r,o),p.push(r,s,o)}this.setIndex(p),this.setAttribute("position",new k(m,3)),this.setAttribute("normal",new k(f,3)),this.setAttribute("uv",new k(g,2))}static fromJSON(e){return new Ks(e.width,e.height,e.widthSegments,e.heightSegments)}}const E={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= specularColorMapTexelToLinear( texture2D( specularColorMap, vUv ) ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= sheenColorMapTexelToLinear( texture2D( sheenColorMap, vUv ) ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\n\t\t\tfloat texelIndex = float( vertexIndex * stride + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\t#ifndef USE_MORPHNORMALS\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\n\t\t\t#else\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\n\t\t\t#endif\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( float roughness, float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - clearcoat * Fcc ) + clearcoatSpecular * clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},A={common:{diffuse:{value:new g(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new v},uv2Transform:{value:new v},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new W(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 g(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new g(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new v}},sprite:{diffuse:{value:new g(16777215)},opacity:{value:1},center:{value:new W(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new v}}},$s={basic:{uniforms:Ns([A.common,A.specularmap,A.envmap,A.aomap,A.lightmap,A.fog]),vertexShader:E.meshbasic_vert,fragmentShader:E.meshbasic_frag},lambert:{uniforms:Ns([A.common,A.specularmap,A.envmap,A.aomap,A.lightmap,A.emissivemap,A.fog,A.lights,{emissive:{value:new g(0)}}]),vertexShader:E.meshlambert_vert,fragmentShader:E.meshlambert_frag},phong:{uniforms:Ns([A.common,A.specularmap,A.envmap,A.aomap,A.lightmap,A.emissivemap,A.bumpmap,A.normalmap,A.displacementmap,A.fog,A.lights,{emissive:{value:new g(0)},specular:{value:new g(1118481)},shininess:{value:30}}]),vertexShader:E.meshphong_vert,fragmentShader:E.meshphong_frag},standard:{uniforms:Ns([A.common,A.envmap,A.aomap,A.lightmap,A.emissivemap,A.bumpmap,A.normalmap,A.displacementmap,A.roughnessmap,A.metalnessmap,A.fog,A.lights,{emissive:{value:new g(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:E.meshphysical_vert,fragmentShader:E.meshphysical_frag},toon:{uniforms:Ns([A.common,A.aomap,A.lightmap,A.emissivemap,A.bumpmap,A.normalmap,A.displacementmap,A.gradientmap,A.fog,A.lights,{emissive:{value:new g(0)}}]),vertexShader:E.meshtoon_vert,fragmentShader:E.meshtoon_frag},matcap:{uniforms:Ns([A.common,A.bumpmap,A.normalmap,A.displacementmap,A.fog,{matcap:{value:null}}]),vertexShader:E.meshmatcap_vert,fragmentShader:E.meshmatcap_frag},points:{uniforms:Ns([A.points,A.fog]),vertexShader:E.points_vert,fragmentShader:E.points_frag},dashed:{uniforms:Ns([A.common,A.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:E.linedashed_vert,fragmentShader:E.linedashed_frag},depth:{uniforms:Ns([A.common,A.displacementmap]),vertexShader:E.depth_vert,fragmentShader:E.depth_frag},normal:{uniforms:Ns([A.common,A.bumpmap,A.normalmap,A.displacementmap,{opacity:{value:1}}]),vertexShader:E.meshnormal_vert,fragmentShader:E.meshnormal_frag},sprite:{uniforms:Ns([A.sprite,A.fog]),vertexShader:E.sprite_vert,fragmentShader:E.sprite_frag},background:{uniforms:{uvTransform:{value:new v},t2D:{value:null}},vertexShader:E.background_vert,fragmentShader:E.background_frag},cube:{uniforms:Ns([A.envmap,{opacity:{value:1}}]),vertexShader:E.cube_vert,fragmentShader:E.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:E.equirect_vert,fragmentShader:E.equirect_frag},distanceRGBA:{uniforms:Ns([A.common,A.displacementmap,{referencePosition:{value:new De},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:E.distanceRGBA_vert,fragmentShader:E.distanceRGBA_frag},shadow:{uniforms:Ns([A.lights,A.fog,{color:{value:new g(0)},opacity:{value:1}}]),vertexShader:E.shadow_vert,fragmentShader:E.shadow_frag}};function eo(r,s,i,o,n){const a=new g(0);let l,h,c=0,u=null,d=0,p=null;function m(e,t){i.buffers.color.setClear(e.r,e.g,e.b,t,n)}return{getClearColor:function(){return a},setClearColor:function(e,t=1){a.set(e),c=t,m(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,m(a,c)},render:function(e,t){let i=!1,n=!0===t.isScene?t.background:null;n&&n.isTexture&&(n=s.get(n));t=r.xr,t=t.getSession&&t.getSession();null===(n=t&&"additive"===t.environmentBlendMode?null:n)?m(a,c):n&&n.isColor&&(m(n,1),i=!0),(r.autoClear||i)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),n&&(n.isCubeTexture||n.mapping===We)?(void 0===h&&((h=new S(new Is(1,1,1),new Fs({name:"BackgroundCubeMaterial",uniforms:Os($s.cube.uniforms),vertexShader:$s.cube.vertexShader,fragmentShader:$s.cube.fragmentShader,side:Ae,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(e,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),o.update(h)),h.material.uniforms.envMap.value=n,h.material.uniforms.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,u===n&&d===n.version&&p===r.toneMapping||(h.material.needsUpdate=!0,u=n,d=n.version,p=r.toneMapping),e.unshift(h,h.geometry,h.material,0,0,null)):n&&n.isTexture&&(void 0===l&&((l=new S(new Ks(2,2),new Fs({name:"BackgroundMaterial",uniforms:Os($s.background.uniforms),vertexShader:$s.background.vertexShader,fragmentShader:$s.background.fragmentShader,side:Oe,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),o.update(l)),!0===(l.material.uniforms.t2D.value=n).matrixAutoUpdate&&n.updateMatrix(),l.material.uniforms.uvTransform.value.copy(n.matrix),u===n&&d===n.version&&p===r.toneMapping||(l.material.needsUpdate=!0,u=n,d=n.version,p=r.toneMapping),e.unshift(l,l.geometry,l.material,0,0,null))}}}function to(u,d,p,m){const r=u.getParameter(34921),f=m.isWebGL2?null:d.get("OES_vertex_array_object"),g=m.isWebGL2||null!==f,v={},e=w(null);let y=e;function x(e){m.isWebGL2?u.bindVertexArray(e):f.bindVertexArrayOES(e)}function s(e){m.isWebGL2?u.deleteVertexArray(e):f.deleteVertexArrayOES(e)}function w(e){var t=[],i=[],n=[];for(let e=0;e<r;e++)t[e]=0,i[e]=0,n[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:n,object:e,attributes:{},index:null}}function b(){var i=y.newAttributes;for(let e=0,t=i.length;e<t;e++)i[e]=0}function M(e){_(e,0)}function _(e,t){var i=y.newAttributes,n=y.enabledAttributes,r=y.attributeDivisors;i[e]=1,0===n[e]&&(u.enableVertexAttribArray(e),n[e]=1),r[e]!==t&&((m.isWebGL2?u:d.get("ANGLE_instanced_arrays"))[m.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](e,t),r[e]=t)}function S(){var i=y.newAttributes,n=y.enabledAttributes;for(let e=0,t=n.length;e<t;e++)n[e]!==i[e]&&(u.disableVertexAttribArray(e),n[e]=0)}function T(e,t,i,n,r,s){!0!==m.isWebGL2||5124!==i&&5125!==i?u.vertexAttribPointer(e,t,i,n,r,s):u.vertexAttribIPointer(e,t,i,r,s)}function o(){t(),y!==e&&x((y=e).object)}function t(){e.geometry=null,e.program=null,e.wireframe=!1}return{setup:function(e,o,t,i,n){let r=!1;if(g){const d=function(e,t){var i=!0===o.wireframe;let n=v[e.id],r=(void 0===n&&(n={},v[e.id]=n),n[t.id]),s=(void 0===r&&(r={},n[t.id]=r),r[i]);return void 0===s&&(s=w(m.isWebGL2?u.createVertexArray():f.createVertexArrayOES()),r[i]=s),s}(i,t);if(y!==d&&x((y=d).object),r=function(e,t){var i=y.attributes,n=e.attributes;let r=0;for(const e in n){const t=i[e],s=n[e];if(void 0===t)return!0;if(t.attribute!==s)return!0;if(t.data!==s.data)return!0;r++}return y.attributesNum!==r||y.index!==t}(i,n)){var s=i;var a=n;var l={},h=s.attributes;let e=0;for(const s in h){const a=h[s],c={};(c.attribute=a).data&&(c.data=a.data),l[s]=c,e++}y.attributes=l,y.attributesNum=e,y.index=a}}else{const u=!0===o.wireframe;y.geometry===i.id&&y.program===t.id&&y.wireframe===u||(y.geometry=i.id,y.program=t.id,y.wireframe=u,r=!0)}!0===e.isInstancedMesh&&(r=!0),null!==n&&p.update(n,34963),r&&(function(e,t,i,n){if(!1!==m.isWebGL2||!e.isInstancedMesh&&!n.isInstancedBufferGeometry||null!==d.get("ANGLE_instanced_arrays")){b();const r=n.attributes,s=i.getAttributes(),o=t.defaultAttributeValues;for(const d in s){const m=s[d];if(0<=m.location){let t=r[d];if(void 0!==(t=void 0===t&&("instanceMatrix"===d&&e.instanceMatrix&&(t=e.instanceMatrix),"instanceColor"===d)&&e.instanceColor?e.instanceColor:t)){const d=t.normalized,i=t.itemSize,r=p.get(t);if(void 0!==r){const s=r.buffer,o=r.type,a=r.bytesPerElement;if(t.isInterleavedBufferAttribute){const p=t.data,r=p.stride,l=t.offset;if(p&&p.isInstancedInterleavedBuffer){for(let e=0;e<m.locationSize;e++)_(m.location+e,p.meshPerAttribute);!0!==e.isInstancedMesh&&void 0===n._maxInstanceCount&&(n._maxInstanceCount=p.meshPerAttribute*p.count)}else for(let e=0;e<m.locationSize;e++)M(m.location+e);u.bindBuffer(34962,s);for(let e=0;e<m.locationSize;e++)T(m.location+e,i/m.locationSize,o,d,r*a,(l+i/m.locationSize*e)*a)}else{if(t.isInstancedBufferAttribute){for(let e=0;e<m.locationSize;e++)_(m.location+e,t.meshPerAttribute);!0!==e.isInstancedMesh&&void 0===n._maxInstanceCount&&(n._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<m.locationSize;e++)M(m.location+e);u.bindBuffer(34962,s);for(let e=0;e<m.locationSize;e++)T(m.location+e,i/m.locationSize,o,d,i*a,i/m.locationSize*e*a)}}}else if(void 0!==o){const p=o[d];if(void 0!==p)switch(p.length){case 2:u.vertexAttrib2fv(m.location,p);break;case 3:u.vertexAttrib3fv(m.location,p);break;case 4:u.vertexAttrib4fv(m.location,p);break;default:u.vertexAttrib1fv(m.location,p)}}}}S()}}(e,o,t,i),null!==n)&&u.bindBuffer(34963,p.get(n).buffer)},reset:o,resetDefaultState:t,dispose:function(){o();for(const i in v){var e=v[i];for(const n in e){var t=e[n];for(const r in t)s(t[r].object),delete t[r];delete e[n]}delete v[i]}},releaseStatesOfGeometry:function(e){if(void 0!==v[e.id]){var t=v[e.id];for(const e in t){var i=t[e];for(const e in i)s(i[e].object),delete i[e];delete t[e]}delete v[e.id]}},releaseStatesOfProgram:function(e){for(const n in v){var t=v[n];if(void 0!==t[e.id]){var i=t[e.id];for(const e in i)s(i[e].object),delete i[e];delete t[e.id]}}},initAttributes:b,enableAttribute:M,disableUnusedAttributes:S}}function io(s,o,a,e){const l=e.isWebGL2;let h;this.setMode=function(e){h=e},this.render=function(e,t){s.drawArrays(h,e,t),a.update(t,h,1)},this.renderInstances=function(i,n,r){if(0!==r){let e,t;if(l)e=s,t="drawArraysInstanced";else if(e=o.get("ANGLE_instanced_arrays"),t="drawArraysInstancedANGLE",null===e)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");e[t](h,i,n,r),a.update(n,h,r)}}}function no(t,i,e){let n;function r(e){if("highp"===e){if(0<t.getShaderPrecisionFormat(35633,36338).precision&&0<t.getShaderPrecisionFormat(35632,36338).precision)return"highp";e="mediump"}return"mediump"===e&&0<t.getShaderPrecisionFormat(35633,36337).precision&&0<t.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let o=void 0!==e.precision?e.precision:"highp";var a=r(o),a=(a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a),s||i.has("WEBGL_draw_buffers")),e=!0===e.logarithmicDepthBuffer,l=t.getParameter(34930),h=t.getParameter(35660),c=t.getParameter(3379),u=t.getParameter(34076),d=t.getParameter(34921),p=t.getParameter(36347),m=t.getParameter(36348),f=t.getParameter(36349),g=0<h,v=s||i.has("OES_texture_float");return{isWebGL2:s,drawBuffers:a,getMaxAnisotropy:function(){var e;return n=void 0===n?!0===i.has("EXT_texture_filter_anisotropic")?(e=i.get("EXT_texture_filter_anisotropic"),t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT)):0:n},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:e,maxTextures:l,maxVertexTextures:h,maxTextureSize:c,maxCubemapSize:u,maxAttributes:d,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:f,vertexTextures:g,floatFragmentTextures:v,floatVertexTextures:g&&v,maxSamples:s?t.getParameter(36183):0}}function ro(l){const t=this;let h=null,c=0,u=!1,d=!1;const a=new Xs,p=new v,m={value:null,needsUpdate:!1};function f(){m.value!==h&&(m.value=h,m.needsUpdate=0<c),t.numPlanes=c,t.numIntersection=0}function g(i,e,n,r){var s=null!==i?i.length:0;let o=null;if(0!==s){if(o=m.value,!0!==r||null===o){const t=n+4*s,r=e.matrixWorldInverse;p.getNormalMatrix(r),(null===o||o.length<t)&&(o=new Float32Array(t));for(let e=0,t=n;e!==s;++e,t+=4)a.copy(i[e]).applyMatrix4(r,p),a.normal.toArray(o,t),o[t+3]=a.constant}m.value=o,m.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,o}this.uniform=m,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,i){var n=0!==e.length||t||0!==c||u;return u=t,h=g(e,i,0),c=e.length,n},this.beginShadows=function(){d=!0,g(null)},this.endShadows=function(){d=!1,f()},this.setState=function(t,e,i){var n=t.clippingPlanes,r=t.clipIntersection,s=t.clipShadows,o=l.get(t);if(!u||null===n||0===n.length||d&&!s)d?g(null):f();else{const l=d?0:c,t=4*l;var a=o.clippingState||null;m.value=a,a=g(n,e,t,i);for(let e=0;e!==t;++e)a[e]=h[e];o.clippingState=a,this.numIntersection=r?this.numPlanes:0,this.numPlanes+=l}}}function so(n){let r=new WeakMap;function s(e,t){return t===Ue?e.mapping=Fe:t===Ge&&(e.mapping=He),e}function o(e){var e=e.target,t=(e.removeEventListener("dispose",o),r.get(e));void 0!==t&&(r.delete(e),t.dispose())}return{get:function(e){if(e&&e.isTexture&&!1===e.isRenderTargetTexture){var t,i=e.mapping;if(i===Ue||i===Ge)return r.has(e)?s(r.get(e).texture,e.mapping):(i=e.image)&&0<i.height?(t=n.getRenderTarget(),(i=new Ws(i.height/2)).fromEquirectangularTexture(n,e),r.set(e,i),n.setRenderTarget(t),e.addEventListener("dispose",o),s(i.texture,e.mapping)):null}return e},dispose:function(){r=new WeakMap}}}$s.physical={uniforms:Ns([$s.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new W(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new g(0)},sheenColorMap:{value:null},sheenRoughness:{value:0},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new W},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new g(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularColor:{value:new g(1,1,1)},specularColorMap:{value:null}}]),vertexShader:E.meshphysical_vert,fragmentShader:E.meshphysical_frag};class oo extends Hs{constructor(e=-1,t=1,i=1,n=-1,r=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-e,s=i+e,o=n+t,a=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,s=r+e*this.view.width,o-=t*this.view.offsetY,a=o-t*this.view.height}this.projectionMatrix.makeOrthographic(r,s,o,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){e=super.toJSON(e);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}oo.prototype.isOrthographicCamera=!0;class ao extends Fs{constructor(e){super(e),this.type="RawShaderMaterial"}}ao.prototype.isRawShaderMaterial=!0;const lo=Math.pow(2,8),ho=[.125,.215,.35,.446,.526,.582],co=5+ho.length,uo={[Pe]:0,[Ti]:1,[Ai]:2,[Ri]:3,[Li]:4,[Pi]:5,[Ei]:6},po=new oo,{_lodPlanes:mo,_sizeLods:fo,_sigmas:go}=function(){const i=[],n=[],r=[];let s=8;for(let t=0;t<co;t++){var o=Math.pow(2,s);n.push(o);let e=1/o;4<t?e=ho[t-8+4-1]:0==t&&(e=0),r.push(e);var o=1/(o-1),a=-o/2,o=1+o/2,l=[a,a,o,a,o,o,a,a,o,o,a,o],h=new Float32Array(108),c=new Float32Array(72),u=new Float32Array(36);for(let e=0;e<6;e++){const n=e%3*2/3-1,r=2<e?0:-1,s=[n,r,0,n+2/3,r,0,n+2/3,1+r,0,n,r,0,n+2/3,1+r,0,n,1+r,0];h.set(s,18*e),c.set(l,12*e);var d=[e,e,e,e,e,e];u.set(d,6*e)}a=new _;a.setAttribute("position",new T(h,3)),a.setAttribute("uv",new T(c,2)),a.setAttribute("faceIndex",new T(u,1)),i.push(a),4<s&&s--}return{_lodPlanes:i,_sizeLods:n,_sigmas:r}}(),vo=new g;let yo=null;const xo=(1+Math.sqrt(5))/2,wo=1/xo,bo=[new De(1,1,1),new De(-1,1,1),new De(1,1,-1),new De(-1,1,-1),new De(0,xo,wo),new De(0,xo,-wo),new De(wo,0,xo),new De(-wo,0,xo),new De(xo,wo,0),new De(-xo,wo,0)];class Mo{constructor(e){var t;this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=(e=new Float32Array(20),t=new De(0,1,0),new ao({name:"SphericalGaussianBlur",defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:uo[Pe]},outputEncoding:{value:uo[Pe]}},vertexShader:Ao(),fragmentShader:`
2
2
 
3
3
  precision mediump float;
4
4
  precision mediump int;
@@ -118,4 +118,4 @@
118
118
  gl_FragColor = linearToOutputTexel( gl_FragColor );
119
119
 
120
120
  }
121
- `,blending:Y,depthTest:!1,depthWrite:!1})}function Ao(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function Co(){return"\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t"}function Ro(r){let s=new WeakMap,o=null;function a(e){var e=e.target,t=(e.removeEventListener("dispose",a),s.get(e));void 0!==t&&(s.delete(e),t.dispose())}return{get:function(e){if(e&&e.isTexture&&!1===e.isRenderTargetTexture){var t,i=e.mapping,n=i===Ue||i===Ge,i=i===Fe||i===He;if(n||i)return s.has(e)?s.get(e).texture:(t=e.image,n&&t&&0<t.height||i&&t&&function(t){let i=0;for(let e=0;e<6;e++)void 0!==t[e]&&i++;return 6===i}(t)?(i=r.getRenderTarget(),null===o&&(o=new Mo(r)),t=n?o.fromEquirectangular(e):o.fromCubemap(e),s.set(e,t),r.setRenderTarget(i),e.addEventListener("dispose",a),t.texture):null)}return e},dispose:function(){s=new WeakMap,null!==o&&(o.dispose(),o=null)}}}function Lo(i){const n={};function r(e){if(void 0!==n[e])return n[e];let t;switch(e){case"WEBGL_depth_texture":t=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":t=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":t=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":t=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:t=i.getExtension(e)}return n[e]=t}return{has:function(e){return null!==r(e)},init:function(e){e.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float")},get:function(e){var t=r(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Po(e,a,i,n){const r={},l=new WeakMap;function s(e){var t=e.target;null!==t.index&&a.remove(t.index);for(const e in t.attributes)a.remove(t.attributes[e]);t.removeEventListener("dispose",s),delete r[t.id];e=l.get(t);e&&(a.remove(e),l.delete(t)),n.releaseStatesOfGeometry(t),!0===t.isInstancedBufferGeometry&&delete t._maxInstanceCount,i.memory.geometries--}function o(i){const n=[],r=i.index,s=i.attributes.position;let e=0;if(null!==r){const i=r.array;e=r.version;for(let e=0,t=i.length;e<t;e+=3){const r=i[e+0],s=i[e+1],l=i[e+2];n.push(r,s,s,l,l,r)}}else{const i=s.array;e=s.version;for(let e=0,t=i.length/3-1;e<t;e+=3){const i=e+0,r=e+1,s=e+2;n.push(i,r,r,s,s,i)}}var t=new(65535<_n(n)?as:ss)(n,1),o=(t.version=e,l.get(i));o&&a.remove(o),l.set(i,t)}return{get:function(e,t){return!0!==r[t.id]&&(t.addEventListener("dispose",s),r[t.id]=!0,i.memory.geometries++),t},update:function(e){const i=e.attributes;for(const e in i)a.update(i[e],34962);var t=e.morphAttributes;for(const e in t){const i=t[e];for(let e=0,t=i.length;e<t;e++)a.update(i[e],34962)}},getWireframeAttribute:function(e){var t,i=l.get(e);return(!i||null!==(t=e.index)&&i.version<t.version)&&o(e),l.get(e)}}}function zo(s,o,a,e){const l=e.isWebGL2;let h,c,u;this.setMode=function(e){h=e},this.setIndex=function(e){c=e.type,u=e.bytesPerElement},this.render=function(e,t){s.drawElements(h,t,c,e*u),a.update(t,h,1)},this.renderInstances=function(i,n,r){if(0!==r){let e,t;if(l)e=s,t="drawElementsInstanced";else if(e=o.get("ANGLE_instanced_arrays"),t="drawElementsInstancedANGLE",null===e)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");e[t](h,n,c,i*u,r),a.update(n,h,r)}}}function Do(e){const n={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:n,programs:null,autoReset:!0,reset:function(){n.frame++,n.calls=0,n.triangles=0,n.points=0,n.lines=0},update:function(e,t,i){switch(n.calls++,t){case 4:n.triangles+=i*(e/3);break;case 1:n.lines+=i*(e/2);break;case 3:n.lines+=i*(e-1);break;case 2:n.lines+=i*e;break;case 0:n.points+=i*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",t)}}}}class Io extends c{constructor(e=null,t=1,i=1,n=1){super(null),this.image={data:e,width:t,height:i,depth:n},this.magFilter=Re,this.minFilter=Re,this.wrapR=Ce,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}function Oo(e,t){return e[0]-t[0]}function No(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Bo(e,t){let i=1;t=(t.isInterleavedBufferAttribute?t.data:t).array;t instanceof Int8Array?i=127:t instanceof Int16Array?i=32767:t instanceof Int32Array?i=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",t),e.divideScalar(i)}function Fo(h,c,u){const d={},p=new Float32Array(8),m=new WeakMap,f=new De,g=[];for(let e=0;e<8;e++)g[e]=[e,0];return{update:function(n,r,e,s){const o=n.morphTargetInfluences;if(!0===c.isWebGL2){const d=r.morphAttributes.position.length;let e=m.get(r);if(void 0===e||e.count!==d){void 0!==e&&e.texture.dispose();const h=void 0!==r.morphAttributes.normal,u=r.morphAttributes.position,g=r.morphAttributes.normal||[],n=!0==h?2:1;let t=r.attributes.position.count*n,i=1;t>c.maxTextureSize&&(i=Math.ceil(t/c.maxTextureSize),t=c.maxTextureSize);const o=new Float32Array(t*i*4*d),l=new Io(o,t,i,d);l.format=Le,l.type=ot;var a=4*n;for(let e=0;e<d;e++){const d=u[e],p=g[e],m=t*i*4*e;for(let e=0;e<d.count;e++){f.fromBufferAttribute(d,e),!0===d.normalized&&Bo(f,d);const u=e*a;o[m+u]=f.x,o[m+u+1]=f.y,o[m+u+2]=f.z,!(o[m+u+3]=0)==h&&(f.fromBufferAttribute(p,e),!0===p.normalized&&Bo(f,p),o[m+u+4]=f.x,o[m+u+5]=f.y,o[m+u+6]=f.z,o[m+u+7]=0)}}e={count:d,texture:l,size:new W(t,i)},m.set(r,e)}let t=0;for(let e=0;e<o.length;e++)t+=o[e];const n=r.morphTargetsRelative?1:1-t;s.getUniforms().setValue(h,"morphTargetBaseInfluence",n),s.getUniforms().setValue(h,"morphTargetInfluences",o),s.getUniforms().setValue(h,"morphTargetsTexture",e.texture,u),s.getUniforms().setValue(h,"morphTargetsTextureSize",e.size)}else{const c=void 0===o?0:o.length;let t=d[r.id];if(void 0===t||t.length!==c){t=[];for(let e=0;e<c;e++)t[e]=[e,0];d[r.id]=t}for(let e=0;e<c;e++){const c=t[e];c[0]=e,c[1]=o[e]}t.sort(No);for(let e=0;e<8;e++)e<c&&t[e][1]?(g[e][0]=t[e][0],g[e][1]=t[e][1]):(g[e][0]=Number.MAX_SAFE_INTEGER,g[e][1]=0);g.sort(Oo);const m=r.morphAttributes.position,f=r.morphAttributes.normal;let i=0;for(let e=0;e<8;e++){const c=g[e],u=c[0],d=c[1];u!==Number.MAX_SAFE_INTEGER&&d?(m&&r.getAttribute("morphTarget"+e)!==m[u]&&r.setAttribute("morphTarget"+e,m[u]),f&&r.getAttribute("morphNormal"+e)!==f[u]&&r.setAttribute("morphNormal"+e,f[u]),p[e]=d,i+=d):(m&&!0===r.hasAttribute("morphTarget"+e)&&r.deleteAttribute("morphTarget"+e),f&&!0===r.hasAttribute("morphNormal"+e)&&r.deleteAttribute("morphNormal"+e),p[e]=0)}const e=r.morphTargetsRelative?1:1-i;s.getUniforms().setValue(h,"morphTargetBaseInfluence",e),s.getUniforms().setValue(h,"morphTargetInfluences",p)}}}}function Ho(e,n,r,s){let o=new WeakMap;function a(e){e=e.target;e.removeEventListener("dispose",a),r.remove(e.instanceMatrix),null!==e.instanceColor&&r.remove(e.instanceColor)}return{update:function(e){var t=s.render.frame,i=e.geometry,i=n.get(e,i);return o.get(i)!==t&&(n.update(i),o.set(i,t)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",a)&&e.addEventListener("dispose",a),r.update(e.instanceMatrix,34962),null!==e.instanceColor)&&r.update(e.instanceColor,34962),i},dispose:function(){o=new WeakMap}}}Io.prototype.isDataTexture2DArray=!0;class Uo extends c{constructor(e=null,t=1,i=1,n=1){super(null),this.image={data:e,width:t,height:i,depth:n},this.magFilter=Re,this.minFilter=Re,this.wrapR=Ce,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Uo.prototype.isDataTexture3D=!0;const Go=new c,Wo=new Io,ko=new Uo,Vo=new Gs,jo=[],Xo=[],qo=new Float32Array(16),Yo=new Float32Array(9),Jo=new Float32Array(4);function Zo(i,n,r){var e=i[0];if(e<=0||0<e)return i;var t=n*r;let s=jo[t];if(void 0===s&&(s=new Float32Array(t),jo[t]=s),0!==n){e.toArray(s,0);for(let e=1,t=0;e!==n;++e)t+=r,i[e].toArray(s,t)}return s}function Qo(i,n){if(i.length===n.length){for(let e=0,t=i.length;e<t;e++)if(i[e]!==n[e])return;return 1}}function Ko(i,n){for(let e=0,t=n.length;e<t;e++)i[e]=n[e]}function $o(t,i){let n=Xo[i];void 0===n&&(n=new Int32Array(i),Xo[i]=n);for(let e=0;e!==i;++e)n[e]=t.allocateTextureUnit();return n}function ea(e,t){var i=this.cache;i[0]!==t&&(e.uniform1f(this.addr,t),i[0]=t)}function ta(e,t){var i=this.cache;void 0!==t.x?i[0]===t.x&&i[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y):Qo(i,t)||(e.uniform2fv(this.addr,t),Ko(i,t))}function ia(e,t){var i=this.cache;void 0!==t.x?i[0]===t.x&&i[1]===t.y&&i[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z):void 0!==t.r?i[0]===t.r&&i[1]===t.g&&i[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b):Qo(i,t)||(e.uniform3fv(this.addr,t),Ko(i,t))}function na(e,t){var i=this.cache;void 0!==t.x?i[0]===t.x&&i[1]===t.y&&i[2]===t.z&&i[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w):Qo(i,t)||(e.uniform4fv(this.addr,t),Ko(i,t))}function ra(e,t){var i=this.cache,n=t.elements;void 0===n?Qo(i,t)||(e.uniformMatrix2fv(this.addr,!1,t),Ko(i,t)):Qo(i,n)||(Jo.set(n),e.uniformMatrix2fv(this.addr,!1,Jo),Ko(i,n))}function sa(e,t){var i=this.cache,n=t.elements;void 0===n?Qo(i,t)||(e.uniformMatrix3fv(this.addr,!1,t),Ko(i,t)):Qo(i,n)||(Yo.set(n),e.uniformMatrix3fv(this.addr,!1,Yo),Ko(i,n))}function oa(e,t){var i=this.cache,n=t.elements;void 0===n?Qo(i,t)||(e.uniformMatrix4fv(this.addr,!1,t),Ko(i,t)):Qo(i,n)||(qo.set(n),e.uniformMatrix4fv(this.addr,!1,qo),Ko(i,n))}function aa(e,t){var i=this.cache;i[0]!==t&&(e.uniform1i(this.addr,t),i[0]=t)}function la(e,t){var i=this.cache;Qo(i,t)||(e.uniform2iv(this.addr,t),Ko(i,t))}function ha(e,t){var i=this.cache;Qo(i,t)||(e.uniform3iv(this.addr,t),Ko(i,t))}function ca(e,t){var i=this.cache;Qo(i,t)||(e.uniform4iv(this.addr,t),Ko(i,t))}function ua(e,t){var i=this.cache;i[0]!==t&&(e.uniform1ui(this.addr,t),i[0]=t)}function da(e,t){var i=this.cache;Qo(i,t)||(e.uniform2uiv(this.addr,t),Ko(i,t))}function pa(e,t){var i=this.cache;Qo(i,t)||(e.uniform3uiv(this.addr,t),Ko(i,t))}function ma(e,t){var i=this.cache;Qo(i,t)||(e.uniform4uiv(this.addr,t),Ko(i,t))}function fa(e,t,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.safeSetTexture2D(t||Go,r)}function ga(e,t,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(t||ko,r)}function va(e,t,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.safeSetTextureCube(t||Vo,r)}function ya(e,t,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(t||Wo,r)}function xa(e,t){e.uniform1fv(this.addr,t)}function wa(e,t){t=Zo(t,this.size,2);e.uniform2fv(this.addr,t)}function ba(e,t){t=Zo(t,this.size,3);e.uniform3fv(this.addr,t)}function Ma(e,t){t=Zo(t,this.size,4);e.uniform4fv(this.addr,t)}function _a(e,t){t=Zo(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,t)}function Sa(e,t){t=Zo(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,t)}function Ta(e,t){t=Zo(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,t)}function Ea(e,t){e.uniform1iv(this.addr,t)}function Aa(e,t){e.uniform2iv(this.addr,t)}function Ca(e,t){e.uniform3iv(this.addr,t)}function Ra(e,t){e.uniform4iv(this.addr,t)}function La(e,t){e.uniform1uiv(this.addr,t)}function Pa(e,t){e.uniform2uiv(this.addr,t)}function za(e,t){e.uniform3uiv(this.addr,t)}function Da(e,t){e.uniform4uiv(this.addr,t)}function Ia(e,t,i){var n=t.length,r=$o(i,n);e.uniform1iv(this.addr,r);for(let e=0;e!==n;++e)i.safeSetTexture2D(t[e]||Go,r[e])}function Oa(e,t,i){var n=t.length,r=$o(i,n);e.uniform1iv(this.addr,r);for(let e=0;e!==n;++e)i.safeSetTextureCube(t[e]||Vo,r[e])}function Na(e,t,i){this.id=e,this.addr=i,this.cache=[],this.setValue=function(){switch(t.type){case 5126:return ea;case 35664:return ta;case 35665:return ia;case 35666:return na;case 35674:return ra;case 35675:return sa;case 35676:return oa;case 5124:case 35670:return aa;case 35667:case 35671:return la;case 35668:case 35672:return ha;case 35669:case 35673:return ca;case 5125:return ua;case 36294:return da;case 36295:return pa;case 36296:return ma;case 35678:case 36198:case 36298:case 36306:case 35682:return fa;case 35679:case 36299:case 36307:return ga;case 35680:case 36300:case 36308:case 36293:return va;case 36289:case 36303:case 36311:case 36292:return ya}}()}function Ba(e,t,i){this.id=e,this.addr=i,this.cache=[],this.size=t.size,this.setValue=function(){switch(t.type){case 5126:return xa;case 35664:return wa;case 35665:return ba;case 35666:return Ma;case 35674:return _a;case 35675:return Sa;case 35676:return Ta;case 5124:case 35670:return Ea;case 35667:case 35671:return Aa;case 35668:case 35672:return Ca;case 35669:case 35673:return Ra;case 5125:return La;case 36294:return Pa;case 36295:return za;case 36296:return Da;case 35678:case 36198:case 36298:case 36306:case 35682:return Ia;case 35680:case 36300:case 36308:case 36293:return Oa}}()}function Fa(e){this.id=e,this.seq=[],this.map={}}Ba.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Ko(t,e)},Fa.prototype.setValue=function(i,n,r){var s=this.seq;for(let e=0,t=s.length;e!==t;++e){var o=s[e];o.setValue(i,n[o.id],r)}};const Ha=/(\w+)(\])?(\[|\.)?/g;function Ua(e,t){e.seq.push(t),e.map[t.id]=t}function Ga(t,i){this.seq=[],this.map={};const n=t.getProgramParameter(i,35718);for(let e=0;e<n;++e){const n=t.getActiveUniform(i,e);u=c=h=l=a=o=s=r=void 0;var r=n,s=t.getUniformLocation(i,n.name),o=this,a=r.name,l=a.length;for(Ha.lastIndex=0;;){var h=Ha.exec(a),c=Ha.lastIndex;let t=h[1];var u="]"===h[2],h=h[3];if(u&&(t|=0),void 0===h||"["===h&&c+2===l){Ua(o,new(void 0===h?Na:Ba)(t,r,s));break}{let e=o.map[t];void 0===e&&Ua(o,e=new Fa(t)),o=e}}}}function Wa(e,t,i){t=e.createShader(t);return e.shaderSource(t,i),e.compileShader(t),t}Ga.prototype.setValue=function(e,t,i,n){t=this.map[t];void 0!==t&&t.setValue(e,i,n)},Ga.prototype.setOptional=function(e,t,i){t=t[i];void 0!==t&&this.setValue(e,i,t)},Ga.upload=function(i,n,r,s){for(let e=0,t=n.length;e!==t;++e){var o=n[e],a=r[o.id];!1!==a.needsUpdate&&o.setValue(i,a.value,s)}},Ga.seqWithValue=function(i,n){var r=[];for(let e=0,t=i.length;e!==t;++e){var s=i[e];s.id in n&&r.push(s)}return r};let ka=0;function Va(e){switch(e){case Pe:return["Linear","( value )"];case Ti:return["sRGB","( value )"];case Ai:return["RGBE","( value )"];case Ri:return["RGBM","( value, 7.0 )"];case Li:return["RGBM","( value, 16.0 )"];case Pi:return["RGBD","( value, 256.0 )"];case Ei:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case Ci:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function ja(e,i,t){var n=e.getShaderParameter(i,35713),r=e.getShaderInfoLog(i).trim();return n&&""===r?"":t.toUpperCase()+"\n\n"+r+"\n\n"+function(){var t=e.getShaderSource(i).split("\n");for(let e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}()}function Xa(e,t){t=Va(t);return"vec4 "+e+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function qa(e){return""!==e}function Ya(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 Ja(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Za=/^[ \t]*#include +<([\w\d./]+)>/gm;function Qa(e){return e.replace(Za,Ka)}function Ka(e,t){var i=E[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return Qa(i)}const $a=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,el=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function tl(e){return e.replace(el,nl).replace($a,il)}function il(e,t,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),nl(0,t,i,n)}function nl(e,t,i,n){let r="";for(let e=parseInt(t);e<parseInt(i);e++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return r}function rl(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function sl(i,n,r,e){const s=i.getContext(),t=r.defines;var o=r.vertexShader,a=r.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===L?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===P?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===z&&(t="SHADOWMAP_TYPE_VSM"),t}(r),h=function(){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case Fe:case He:e="ENVMAP_TYPE_CUBE";break;case We:case ke:e="ENVMAP_TYPE_CUBE_UV"}return e}(),c=function(){let e="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case He:case ke:e="ENVMAP_MODE_REFRACTION"}return e}(),u=function(){let e="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case O:e="ENVMAP_BLENDING_MULTIPLY";break;case N:e="ENVMAP_BLENDING_MIX";break;case H:e="ENVMAP_BLENDING_ADD"}return e}(),d=0<i.gammaFactor?i.gammaFactor:1,p=r.isWebGL2?"":[r.extensionDerivatives||r.envMapCubeUV||r.bumpMap||r.tangentSpaceNormalMap||r.clearcoatNormalMap||r.flatShading||"physical"===r.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(qa).join("\n"),m=function(e){var t=[];for(const n in e){var i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(t),f=s.createProgram();let g,v,y=r.glslVersion?"#version "+r.glslVersion+"\n":"";r.isRawShaderMaterial?(0<(g=[m].filter(qa).join("\n")).length&&(g+="\n"),0<(v=[p,m].filter(qa).join("\n")).length&&(v+="\n")):(g=[rl(r),"#define SHADER_NAME "+r.shaderName,m,r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+r.maxBones,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+c:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",r.specularColorMap?"#define USE_SPECULARCOLORMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEENCOLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphTargets&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",r.morphTargets&&r.isWebGL2?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(qa).join("\n"),v=[p,rl(r),"#define SHADER_NAME "+r.shaderName,m,"#define GAMMA_FACTOR "+d,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.envMap?"#define "+c:"",r.envMap?"#define "+u:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",r.specularColorMap?"#define USE_SPECULARCOLORMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEENCOLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(r.extensionShaderTextureLOD||r.envMap)&&r.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==Be?"#define TONE_MAPPING":"",r.toneMapping!==Be?E.tonemapping_pars_fragment:"",r.toneMapping!==Be?function(e,t){let i;switch(t){case U:i="Linear";break;case G:i="Reinhard";break;case V:i="OptimizedCineon";break;case Se:i="ACESFilmic";break;case Te:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.format===pt?"#define OPAQUE":"",E.encodings_pars_fragment,r.map?Xa("mapTexelToLinear",r.mapEncoding):"",r.matcap?Xa("matcapTexelToLinear",r.matcapEncoding):"",r.envMap?Xa("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMap?Xa("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.specularColorMap?Xa("specularColorMapTexelToLinear",r.specularColorMapEncoding):"",r.sheenColorMap?Xa("sheenColorMapTexelToLinear",r.sheenColorMapEncoding):"",r.lightMap?Xa("lightMapTexelToLinear",r.lightMapEncoding):"",(x="linearToOutputTexel",w=Va(w=r.outputEncoding),"vec4 "+x+"( vec4 value ) { return LinearTo"+w[0]+w[1]+"; }"),r.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(qa).join("\n")),o=Ja(Ya(Qa(o),r),r),a=Ja(Ya(Qa(a),r),r),o=tl(o),a=tl(a),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(y="#version 300 es\n",g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in",r.glslVersion===hn?"":"out highp vec4 pc_fragColor;",r.glslVersion===hn?"":"#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"+v);var x=y+v+a,w=Wa(s,35633,y+g+o),a=Wa(s,35632,x);if(s.attachShader(f,w),s.attachShader(f,a),void 0!==r.index0AttributeName?s.bindAttribLocation(f,0,r.index0AttributeName):!0===r.morphTargets&&s.bindAttribLocation(f,0,"position"),s.linkProgram(f),i.debug.checkShaderErrors){const i=s.getProgramInfoLog(f).trim(),n=s.getShaderInfoLog(w).trim(),r=s.getShaderInfoLog(a).trim();let e=!0,t=!0;if(!1===s.getProgramParameter(f,35714)){e=!1;const n=ja(s,w,"vertex"),r=ja(s,a,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(f,35715)+"\n\nProgram Info Log: "+i+"\n"+n+"\n"+r)}else""!==i?console.warn("THREE.WebGLProgram: Program Info Log:",i):""!==n&&""!==r||(t=!1);t&&(this.diagnostics={runnable:e,programLog:i,vertexShader:{log:n,prefix:g},fragmentShader:{log:r,prefix:v}})}let b,M;return s.deleteShader(w),s.deleteShader(a),this.getUniforms=function(){return b=void 0===b?new Ga(s,f):b},this.getAttributes=function(){return M=void 0===M?function(i,n){const r={},s=i.getProgramParameter(n,35721);for(let t=0;t<s;t++){const s=i.getActiveAttrib(n,t),o=s.name;let e=1;35674===s.type&&(e=2),35675===s.type&&(e=3),35676===s.type&&(e=4),r[o]={type:s.type,location:i.getAttribLocation(n,o),locationSize:e}}return r}(s,f):M},this.destroy=function(){e.releaseStatesOfProgram(this),s.deleteProgram(f),this.program=void 0},this.name=r.shaderName,this.id=ka++,this.cacheKey=n,this.usedTimes=1,this.program=f,this.vertexShader=w,this.fragmentShader=a,this}function ol(p,m,f,g,v,e,y){const s=[],x=v.isWebGL2,w=v.logarithmicDepthBuffer,b=v.floatVertexTextures,M=v.maxVertexUniforms,_=v.vertexTextures;let S=v.precision;const T={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"},n=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoat","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap",,"roughnessMap","metalnessMap","gradientMap","alphaMap","alphaTest","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","morphTargetsCount","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","format","specularIntensityMap","specularColorMap","specularColorMapEncoding","transmission","transmissionMap","thicknessMap","sheen","sheenColorMap","sheenColorMapEncoding","sheenRoughnessMap"];function E(e){let t;return t=e&&e.isTexture?e.encoding:e&&e.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e.texture.encoding):Pe,t=x&&e&&e.isTexture&&e.format===Le&&e.type===et&&e.encoding===Ti?Pe:t}return{getParameters:function(e,t,i,n,r){var s=n.fog,n=e.isMeshStandardMaterial?n.environment:null,n=(e.isMeshStandardMaterial?f:m).get(e.envMap||n),o=T[e.type],a=r.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(b)return 1024;{const e=M,i=Math.floor((e-20)/4),n=Math.min(i,t.length);return n<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+n+"."),0):n}}(r):0;let l,h;if(null!==e.precision&&(S=v.getMaxPrecision(e.precision))!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",S,"instead."),o){const p=$s[o];l=p.vertexShader,h=p.fragmentShader}else l=e.vertexShader,h=e.fragmentShader;var c=p.getRenderTarget(),u=0<e.alphaTest,d=0<e.clearcoat;return{isWebGL2:x,shaderID:o,shaderName:e.type,vertexShader:l,fragmentShader:h,defines:e.defines,isRawShaderMaterial:!0===e.isRawShaderMaterial,glslVersion:e.glslVersion,precision:S,instancing:!0===r.isInstancedMesh,instancingColor:!0===r.isInstancedMesh&&null!==r.instanceColor,supportsVertexTextures:_,outputEncoding:null!==c?E(c.texture):p.outputEncoding,map:!!e.map,mapEncoding:E(e.map),matcap:!!e.matcap,matcapEncoding:E(e.matcap),envMap:!!n,envMapMode:n&&n.mapping,envMapEncoding:E(n),envMapCubeUV:!!n&&(n.mapping===We||n.mapping===ke),lightMap:!!e.lightMap,lightMapEncoding:E(e.lightMap),aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:E(e.emissiveMap),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:e.normalMapType===Oi,tangentSpaceNormalMap:e.normalMapType===Ii,clearcoat:d,clearcoatMap:d&&!!e.clearcoatMap,clearcoatRoughnessMap:d&&!!e.clearcoatRoughnessMap,clearcoatNormalMap:d&&!!e.clearcoatNormalMap,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,specularIntensityMap:!!e.specularIntensityMap,specularColorMap:!!e.specularColorMap,specularColorMapEncoding:E(e.specularColorMap),alphaMap:!!e.alphaMap,alphaTest:u,gradientMap:!!e.gradientMap,sheen:0<e.sheen,sheenColorMap:!!e.sheenColorMap,sheenColorMapEncoding:E(e.sheenColorMap),sheenRoughnessMap:!!e.sheenRoughnessMap,transmission:0<e.transmission,transmissionMap:!!e.transmissionMap,thicknessMap:!!e.thicknessMap,combine:e.combine,vertexTangents:!!e.normalMap&&!!r.geometry&&!!r.geometry.attributes.tangent,vertexColors:e.vertexColors,vertexAlphas:!0===e.vertexColors&&!!r.geometry&&!!r.geometry.attributes.color&&4===r.geometry.attributes.color.itemSize,vertexUvs:!!e.map||!!e.bumpMap||!!e.normalMap||!!e.specularMap||!!e.alphaMap||!!e.emissiveMap||!!e.roughnessMap||!!e.metalnessMap||!!e.clearcoatMap||!!e.clearcoatRoughnessMap||!!e.clearcoatNormalMap||!!e.displacementMap||!!e.transmissionMap||!!e.thicknessMap||!!e.specularIntensityMap||!!e.specularColorMap||!!e.sheenColorMap||e.sheenRoughnessMap,uvsVertexOnly:!(e.map||e.bumpMap||e.normalMap||e.specularMap||e.alphaMap||e.emissiveMap||e.roughnessMap||e.metalnessMap||e.clearcoatNormalMap||0<e.transmission||e.transmissionMap||e.thicknessMap||e.specularIntensityMap||e.specularColorMap||0<!!e.sheen||e.sheenColorMap||e.sheenRoughnessMap||!e.displacementMap),fog:!!s,useFog:e.fog,fogExp2:s&&s.isFogExp2,flatShading:!!e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:w,skinning:!0===r.isSkinnedMesh&&0<a,maxBones:a,useVertexTexture:b,morphTargets:!!r.geometry&&!!r.geometry.morphAttributes.position,morphNormals:!!r.geometry&&!!r.geometry.morphAttributes.normal,morphTargetsCount:r.geometry&&r.geometry.morphAttributes.position?r.geometry.morphAttributes.position.length:0,numDirLights:t.directional.length,numPointLights:t.point.length,numSpotLights:t.spot.length,numRectAreaLights:t.rectArea.length,numHemiLights:t.hemi.length,numDirLightShadows:t.directionalShadowMap.length,numPointLightShadows:t.pointShadowMap.length,numSpotLightShadows:t.spotShadowMap.length,numClippingPlanes:y.numPlanes,numClipIntersection:y.numIntersection,format:e.format,dithering:e.dithering,shadowMapEnabled:p.shadowMap.enabled&&0<i.length,shadowMapType:p.shadowMap.type,toneMapping:e.toneMapped?p.toneMapping:Be,physicallyCorrectLights:p.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,doubleSided:e.side===Ne,flipSided:e.side===Ae,depthPacking:void 0!==e.depthPacking&&e.depthPacking,index0AttributeName:e.index0AttributeName,extensionDerivatives:e.extensions&&e.extensions.derivatives,extensionFragDepth:e.extensions&&e.extensions.fragDepth,extensionDrawBuffers:e.extensions&&e.extensions.drawBuffers,extensionShaderTextureLOD:e.extensions&&e.extensions.shaderTextureLOD,rendererExtensionFragDepth:x||g.has("EXT_frag_depth"),rendererExtensionDrawBuffers:x||g.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:x||g.has("EXT_shader_texture_lod"),customProgramCacheKey:e.customProgramCacheKey()}},getProgramCacheKey:function(t){var i=[];if(t.shaderID?i.push(t.shaderID):(i.push(An(t.fragmentShader)),i.push(An(t.vertexShader))),void 0!==t.defines)for(const p in t.defines)i.push(p),i.push(t.defines[p]);if(!1===t.isRawShaderMaterial){for(let e=0;e<n.length;e++)i.push(t[n[e]]);i.push(p.outputEncoding),i.push(p.gammaFactor)}return i.push(t.customProgramCacheKey),i.join()},getUniforms:function(e){var t=T[e.type];let i;if(t){const e=$s[t];i=Bs.clone(e.uniforms)}else i=e.uniforms;return i},acquireProgram:function(i,n){let r;for(let e=0,t=s.length;e<t;e++){const i=s[e];if(i.cacheKey===n){++(r=i).usedTimes;break}}return void 0===r&&(r=new sl(p,n,i,e),s.push(r)),r},releaseProgram:function(e){var t;0==--e.usedTimes&&(t=s.indexOf(e),s[t]=s[s.length-1],s.pop(),e.destroy())},programs:s}}function al(){let n=new WeakMap;return{get:function(e){let t=n.get(e);return void 0===t&&(t={},n.set(e,t)),t},remove:function(e){n.delete(e)},update:function(e,t,i){n.get(e)[t]=i},dispose:function(){n=new WeakMap}}}function ll(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function hl(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function cl(l){const h=[];let c=0;const o=[],a=[],u=[],d={id:-1};function p(e,t,i,n,r,s){let o=h[c];var a=l.get(i);return void 0===o?(o={id:e.id,object:e,geometry:t,material:i,program:a.program||d,groupOrder:n,renderOrder:e.renderOrder,z:r,group:s},h[c]=o):(o.id=e.id,o.object=e,o.geometry=t,o.material=i,o.program=a.program||d,o.groupOrder=n,o.renderOrder=e.renderOrder,o.z=r,o.group=s),c++,o}return{opaque:o,transmissive:a,transparent:u,init:function(){c=0,o.length=0,a.length=0,u.length=0},push:function(e,t,i,n,r,s){e=p(e,t,i,n,r,s);(0<i.transmission?a:!0===i.transparent?u:o).push(e)},unshift:function(e,t,i,n,r,s){e=p(e,t,i,n,r,s);(0<i.transmission?a:!0===i.transparent?u:o).unshift(e)},finish:function(){for(let e=c,t=h.length;e<t;e++){const c=h[e];if(null===c.id)break;c.id=null,c.object=null,c.geometry=null,c.material=null,c.program=null,c.group=null}},sort:function(e,t){1<o.length&&o.sort(e||ll),1<a.length&&a.sort(t||hl),1<u.length&&u.sort(t||hl)}}}function ul(n){let r=new WeakMap;return{get:function(e,t){let i;return!1===r.has(e)?(i=new cl(n),r.set(e,[i])):t>=r.get(e).length?(i=new cl(n),r.get(e).push(i)):i=r.get(e)[t],i},dispose:function(){r=new WeakMap}}}function dl(){const i={};return{get:function(e){if(void 0!==i[e.id])return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new De,color:new g};break;case"SpotLight":t={position:new De,direction:new De,color:new g,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new De,color:new g,distance:0,decay:0};break;case"HemisphereLight":t={direction:new De,skyColor:new g,groundColor:new g};break;case"RectAreaLight":t={color:new g,position:new De,halfWidth:new De,halfHeight:new De}}return i[e.id]=t}}}let pl=0;function ml(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function fl(x,w){const b=new dl,M=function(){const i={};return{get:function(e){if(void 0!==i[e.id])return i[e.id];let t;switch(e.type){case"DirectionalLight":case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new W};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new W,shadowCameraNear:1,shadowCameraFar:1e3}}return i[e.id]=t}}}(),_={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)_.probe.push(new De);const c=new De,u=new Ie,d=new Ie;return{setup:function(i,n){let r=0,s=0,o=0;for(let e=0;e<9;e++)_.probe[e].set(0,0,0);let a=0,l=0,h=0,c=0,u=0,d=0,p=0,m=0;i.sort(ml);var f=!0!==n?Math.PI:1;for(let e=0,t=i.length;e<t;e++){const w=i[e],n=w.color,g=w.intensity,v=w.distance,y=w.shadow&&w.shadow.map?w.shadow.map.texture:null;if(w.isAmbientLight)r+=n.r*g*f,s+=n.g*g*f,o+=n.b*g*f;else if(w.isLightProbe)for(let e=0;e<9;e++)_.probe[e].addScaledVector(w.sh.coefficients[e],g);else if(w.isDirectionalLight){const x=b.get(w);if(x.color.copy(w.color).multiplyScalar(w.intensity*f),w.castShadow){const x=w.shadow,b=M.get(w);b.shadowBias=x.bias,b.shadowNormalBias=x.normalBias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize,_.directionalShadow[a]=b,_.directionalShadowMap[a]=y,_.directionalShadowMatrix[a]=w.shadow.matrix,d++}_.directional[a]=x,a++}else if(w.isSpotLight){const x=b.get(w);if(x.position.setFromMatrixPosition(w.matrixWorld),x.color.copy(n).multiplyScalar(g*f),x.distance=v,x.coneCos=Math.cos(w.angle),x.penumbraCos=Math.cos(w.angle*(1-w.penumbra)),x.decay=w.decay,w.castShadow){const x=w.shadow,b=M.get(w);b.shadowBias=x.bias,b.shadowNormalBias=x.normalBias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize,_.spotShadow[h]=b,_.spotShadowMap[h]=y,_.spotShadowMatrix[h]=w.shadow.matrix,m++}_.spot[h]=x,h++}else if(w.isRectAreaLight){const x=b.get(w);x.color.copy(n).multiplyScalar(g),x.halfWidth.set(.5*w.width,0,0),x.halfHeight.set(0,.5*w.height,0),_.rectArea[c]=x,c++}else if(w.isPointLight){const x=b.get(w);if(x.color.copy(w.color).multiplyScalar(w.intensity*f),x.distance=w.distance,x.decay=w.decay,w.castShadow){const x=w.shadow,b=M.get(w);b.shadowBias=x.bias,b.shadowNormalBias=x.normalBias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize,b.shadowCameraNear=x.camera.near,b.shadowCameraFar=x.camera.far,_.pointShadow[l]=b,_.pointShadowMap[l]=y,_.pointShadowMatrix[l]=w.shadow.matrix,p++}_.point[l]=x,l++}else if(w.isHemisphereLight){const x=b.get(w);x.skyColor.copy(w.color).multiplyScalar(g*f),x.groundColor.copy(w.groundColor).multiplyScalar(g*f),_.hemi[u]=x,u++}}0<c&&(w.isWebGL2||!0===x.has("OES_texture_float_linear")?(_.rectAreaLTC1=A.LTC_FLOAT_1,_.rectAreaLTC2=A.LTC_FLOAT_2):!0===x.has("OES_texture_half_float_linear")?(_.rectAreaLTC1=A.LTC_HALF_1,_.rectAreaLTC2=A.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),_.ambient[0]=r,_.ambient[1]=s,_.ambient[2]=o;const g=_.hash;g.directionalLength===a&&g.pointLength===l&&g.spotLength===h&&g.rectAreaLength===c&&g.hemiLength===u&&g.numDirectionalShadows===d&&g.numPointShadows===p&&g.numSpotShadows===m||(_.directional.length=a,_.spot.length=h,_.rectArea.length=c,_.point.length=l,_.hemi.length=u,_.directionalShadow.length=d,_.directionalShadowMap.length=d,_.pointShadow.length=p,_.pointShadowMap.length=p,_.spotShadow.length=m,_.spotShadowMap.length=m,_.directionalShadowMatrix.length=d,_.pointShadowMatrix.length=p,_.spotShadowMatrix.length=m,g.directionalLength=a,g.pointLength=l,g.spotLength=h,g.rectAreaLength=c,g.hemiLength=u,g.numDirectionalShadows=d,g.numPointShadows=p,g.numSpotShadows=m,_.version=pl++)},setupView:function(i,e){let n=0,r=0,s=0,o=0,a=0;var l=e.matrixWorldInverse;for(let e=0,t=i.length;e<t;e++){var h=i[e];if(h.isDirectionalLight){const i=_.directional[n];i.direction.setFromMatrixPosition(h.matrixWorld),c.setFromMatrixPosition(h.target.matrixWorld),i.direction.sub(c),i.direction.transformDirection(l),n++}else if(h.isSpotLight){const i=_.spot[s];i.position.setFromMatrixPosition(h.matrixWorld),i.position.applyMatrix4(l),i.direction.setFromMatrixPosition(h.matrixWorld),c.setFromMatrixPosition(h.target.matrixWorld),i.direction.sub(c),i.direction.transformDirection(l),s++}else if(h.isRectAreaLight){const i=_.rectArea[o];i.position.setFromMatrixPosition(h.matrixWorld),i.position.applyMatrix4(l),d.identity(),u.copy(h.matrixWorld),u.premultiply(l),d.extractRotation(u),i.halfWidth.set(.5*h.width,0,0),i.halfHeight.set(0,.5*h.height,0),i.halfWidth.applyMatrix4(d),i.halfHeight.applyMatrix4(d),o++}else if(h.isPointLight){const i=_.point[r];i.position.setFromMatrixPosition(h.matrixWorld),i.position.applyMatrix4(l),r++}else if(h.isHemisphereLight){const i=_.hemi[a];i.direction.setFromMatrixPosition(h.matrixWorld),i.direction.transformDirection(l),i.direction.normalize(),a++}}},state:_}}function gl(e,t){const i=new fl(e,t),n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:i},setupLights:function(e){i.setup(n,e)},setupLightsView:function(e){i.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){r.push(e)}}}function vl(n,r){let s=new WeakMap;return{get:function(e,t=0){let i;return!1===s.has(e)?(i=new gl(n,r),s.set(e,[i])):t>=s.get(e).length?(i=new gl(n,r),s.get(e).push(i)):i=s.get(e)[t],i},dispose:function(){s=new WeakMap}}}class yl extends i{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=zi,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.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}}yl.prototype.isMeshDepthMaterial=!0;class xl extends i{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new De,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function wl(d,p,e){let m=new Js;const f=new W,g=new W,v=new ze,l=new yl({depthPacking:Di}),h=new xl,c={},y=e.maxTextureSize,u={0:Ae,1:Oe,2:Ne},x=new Fs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new W},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),w=x.clone();w.defines.HORIZONTAL_PASS=1;e=new _;e.setAttribute("position",new T(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new S(e,x),t=this;function M(i,e,n,t,r,s,o){let a=null;i=!0===t.isPointLight?i.customDistanceMaterial:i.customDepthMaterial;if(a=void 0!==i?i:!0===t.isPointLight?h:l,d.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&0<n.alphaTest){const d=a.uuid,i=n.uuid;let e=c[d],t=(void 0===e&&(e={},c[d]=e),e[i]);void 0===t&&(t=a.clone(),e[i]=t),a=t}return a.visible=n.visible,a.wireframe=n.wireframe,a.side=o===z?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===t.isPointLight&&!0===a.isMeshDistanceMaterial&&(a.referencePosition.setFromMatrixPosition(t.matrixWorld),a.nearDistance=r,a.farDistance=s),a}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=L,this.render=function(i,n,r){if(!1!==t.enabled&&(!1!==t.autoUpdate||!1!==t.needsUpdate)&&0!==i.length){const e=d.getRenderTarget(),h=d.getActiveCubeFace(),c=d.getActiveMipmapLevel(),u=d.state;u.setBlending(Y),u.buffers.color.setClear(1,1,1,1),u.buffers.depth.setTest(!0),u.setScissorTest(!1);for(let e=0,t=i.length;e<t;e++){const h=i[e],c=h.shadow;if(void 0===c)console.warn("THREE.WebGLShadowMap:",h,"has no shadow.");else if(!1!==c.autoUpdate||!1!==c.needsUpdate){f.copy(c.mapSize);var s=c.getFrameExtents();if(f.multiply(s),g.copy(c.mapSize),(f.x>y||f.y>y)&&(f.x>y&&(g.x=Math.floor(y/s.x),f.x=g.x*s.x,c.mapSize.x=g.x),f.y>y)&&(g.y=Math.floor(y/s.y),f.y=g.y*s.y,c.mapSize.y=g.y),null===c.map&&!c.isPointLightShadow&&this.type===z){const d={minFilter:F,magFilter:F,format:Le};c.map=new zn(f.x,f.y,d),c.map.texture.name=h.name+".shadowMap",c.mapPass=new zn(f.x,f.y,d),c.camera.updateProjectionMatrix()}if(null===c.map){const d={minFilter:Re,magFilter:Re,format:Le};c.map=new zn(f.x,f.y,d),c.map.texture.name=h.name+".shadowMap",c.camera.updateProjectionMatrix()}d.setRenderTarget(c.map),d.clear();var o=c.getViewportCount();for(let e=0;e<o;e++){const i=c.getViewport(e);v.set(g.x*i.x,g.y*i.y,g.x*i.z,g.y*i.w),u.viewport(v),c.updateMatrices(h,e),m=c.getFrustum(),function i(n,r,s,o,a){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&a===z)&&(!n.frustumCulled||m.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const m=p.update(n),r=n.material;if(Array.isArray(r)){const p=m.groups;for(let e=0,t=p.length;e<t;e++){var l=p[e],h=r[l.materialIndex];if(h&&h.visible){const p=M(n,0,h,o,s.near,s.far,a);d.renderBufferDirect(s,null,m,p,n,l)}}}else if(r.visible){const p=M(n,0,r,o,s.near,s.far,a);d.renderBufferDirect(s,null,m,p,n,null)}}var c=n.children;for(let e=0,t=c.length;e<t;e++)i(c[e],r,s,o,a)}}(n,r,c.camera,h,this.type)}c.isPointLightShadow||this.type!==z||(s=c,a=r,l=void 0,l=p.update(b),x.defines.VSM_SAMPLES!==s.blurSamples&&(x.defines.VSM_SAMPLES=s.blurSamples,w.defines.VSM_SAMPLES=s.blurSamples,x.needsUpdate=!0,w.needsUpdate=!0),x.uniforms.shadow_pass.value=s.map.texture,x.uniforms.resolution.value=s.mapSize,x.uniforms.radius.value=s.radius,d.setRenderTarget(s.mapPass),d.clear(),d.renderBufferDirect(a,null,l,x,b,null),w.uniforms.shadow_pass.value=s.mapPass.texture,w.uniforms.resolution.value=s.mapSize,w.uniforms.radius.value=s.radius,d.setRenderTarget(s.map),d.clear(),d.renderBufferDirect(a,null,l,w,b,null)),c.needsUpdate=!1}}var a,l;t.needsUpdate=!1,d.setRenderTarget(e,h,c)}}}function bl(c,N,e){const i=e.isWebGL2,n=new function(){let t=!1;const s=new ze;let i=null;const o=new ze(0,0,0,0);return{setMask:function(e){i===e||t||(c.colorMask(e,e,e,e),i=e)},setLocked:function(e){t=e},setClear:function(e,t,i,n,r){!0===r&&(e*=n,t*=n,i*=n),s.set(e,t,i,n),!1===o.equals(s)&&(c.clearColor(e,t,i,n),o.copy(s))},reset:function(){t=!1,i=null,o.set(-1,0,0,0)}}},r=new function(){let t=!1,i=null,n=null,r=null;return{setTest:function(e){(e?P:z)(2929)},setMask:function(e){i===e||t||(c.depthMask(e),i=e)},setFunc:function(e){if(n!==e){if(e)switch(e){case ge:c.depthFunc(512);break;case ve:c.depthFunc(519);break;case ye:c.depthFunc(513);break;case xe:c.depthFunc(515);break;case we:c.depthFunc(514);break;case be:c.depthFunc(518);break;case Me:c.depthFunc(516);break;case _e:c.depthFunc(517);break;default:c.depthFunc(515)}else c.depthFunc(515);n=e}},setLocked:function(e){t=e},setClear:function(e){r!==e&&(c.clearDepth(e),r=e)},reset:function(){t=!1,i=null,n=null,r=null}}},s=new function(){let t=!1,i=null,n=null,r=null,s=null,o=null,a=null,l=null,h=null;return{setTest:function(e){t||(e?P:z)(2960)},setMask:function(e){i===e||t||(c.stencilMask(e),i=e)},setFunc:function(e,t,i){n===e&&r===t&&s===i||(c.stencilFunc(e,t,i),n=e,r=t,s=i)},setOp:function(e,t,i){o===e&&a===t&&l===i||(c.stencilOp(e,t,i),o=e,a=t,l=i)},setLocked:function(e){t=e},setClear:function(e){h!==e&&(c.clearStencil(e),h=e)},reset:function(){t=!1,i=null,n=null,r=null,s=null,o=null,a=null,l=null,h=null}}};let t={},o=null,a={},l=null,h=!1,u=null,d=null,p=null,m=null,f=null,g=null,v=null,y=!1,x=null,w=null,b=null,M=null,_=null;const B=c.getParameter(35661);let S=!1,T=0;e=c.getParameter(7938);-1!==e.indexOf("WebGL")?(T=parseFloat(/^WebGL (\d)/.exec(e)[1]),S=1<=T):-1!==e.indexOf("OpenGL ES")&&(T=parseFloat(/^OpenGL ES (\d)/.exec(e)[1]),S=2<=T);let E=null,A={};const F=c.getParameter(3088),H=c.getParameter(2978),C=(new ze).fromArray(F),R=(new ze).fromArray(H);function U(e,t,i){var n=new Uint8Array(4),r=c.createTexture();c.bindTexture(e,r),c.texParameteri(e,10241,9728),c.texParameteri(e,10240,9728);for(let e=0;e<i;e++)c.texImage2D(t+e,0,6408,1,1,0,6408,5121,n);return r}const L={};function P(e){!0!==t[e]&&(c.enable(e),t[e]=!0)}function z(e){!1!==t[e]&&(c.disable(e),t[e]=!1)}L[3553]=U(3553,3553,1),L[34067]=U(34067,34069,6),n.setClear(0,0,0,1),r.setClear(1),s.setClear(0),P(2929),r.setFunc(xe),G(!1),W(X),P(2884),O(Y);const D={[ee]:32774,[te]:32778,[ie]:32779};if(i)D[ne]=32775,D[re]=32776;else{const c=N.get("EXT_blend_minmax");null!==c&&(D[ne]=c.MIN_EXT,D[re]=c.MAX_EXT)}const I={[se]:0,[oe]:1,[ae]:768,[he]:770,[fe]:776,[pe]:774,[ue]:772,[le]:769,[ce]:771,[me]:775,[de]:773};function O(e,t,i,n,r,s,o,a){if(e!==Y){if(!1===h&&(P(3042),h=!0),e===$)r=r||t,s=s||i,o=o||n,t===d&&r===f||(c.blendEquationSeparate(D[t],D[r]),d=t,f=r),i===p&&n===m&&s===g&&o===v||(c.blendFuncSeparate(I[i],I[n],I[s],I[o]),p=i,m=n,g=s,v=o),u=e,y=null;else if(e!==u||a!==y){if(d===ee&&f===ee||(c.blendEquation(32774),d=ee,f=ee),a)switch(e){case J:c.blendFuncSeparate(1,771,1,771);break;case Z:c.blendFunc(1,1);break;case Q:c.blendFuncSeparate(0,0,769,771);break;case K:c.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case J:c.blendFuncSeparate(770,771,1,771);break;case Z:c.blendFunc(770,1);break;case Q:c.blendFunc(0,769);break;case K:c.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}p=null,m=null,g=null,v=null,u=e,y=a}}else!0===h&&(z(3042),h=!1)}function G(e){x!==e&&(e?c.frontFace(2304):c.frontFace(2305),x=e)}function W(e){e!==j?(P(2884),e!==w&&(e===X?c.cullFace(1029):e===q?c.cullFace(1028):c.cullFace(1032))):z(2884),w=e}function k(e,t,i){e?(P(32823),M===t&&_===i||(c.polygonOffset(t,i),M=t,_=i)):z(32823)}function V(e){void 0===e&&(e=33984+B-1),E!==e&&(c.activeTexture(e),E=e)}return{buffers:{color:n,depth:r,stencil:s},enable:P,disable:z,bindFramebuffer:function(e,t){return null===t&&null!==o&&(t=o),a[e]!==t&&(c.bindFramebuffer(e,t),a[e]=t,i&&(36009===e&&(a[36160]=t),36160===e)&&(a[36009]=t),!0)},bindXRFramebuffer:function(e){e!==o&&(c.bindFramebuffer(36160,e),o=e)},useProgram:function(e){return l!==e&&(c.useProgram(e),l=e,!0)},setBlending:O,setMaterial:function(e,t){(e.side===Ne?z:P)(2884);let i=e.side===Ae;G(i=t?!i:i),e.blending===J&&!1===e.transparent?O(Y):O(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),r.setFunc(e.depthFunc),r.setTest(e.depthTest),r.setMask(e.depthWrite),n.setMask(e.colorWrite);t=e.stencilWrite;s.setTest(t),t&&(s.setMask(e.stencilWriteMask),s.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),s.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),k(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),(!0===e.alphaToCoverage?P:z)(32926)},setFlipSided:G,setCullFace:W,setLineWidth:function(e){e!==b&&(S&&c.lineWidth(e),b=e)},setPolygonOffset:k,setScissorTest:function(e){(e?P:z)(3089)},activeTexture:V,bindTexture:function(e,t){null===E&&V();let i=A[E];void 0===i&&(i={type:void 0,texture:void 0},A[E]=i),i.type===e&&i.texture===t||(c.bindTexture(e,t||L[e]),i.type=e,i.texture=t)},unbindTexture:function(){var e=A[E];void 0!==e&&void 0!==e.type&&(c.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{c.compressedTexImage2D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{c.texImage2D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{c.texImage3D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(e){!1===C.equals(e)&&(c.scissor(e.x,e.y,e.z,e.w),C.copy(e))},viewport:function(e){!1===R.equals(e)&&(c.viewport(e.x,e.y,e.z,e.w),R.copy(e))},reset:function(){c.disable(3042),c.disable(2884),c.disable(2929),c.disable(32823),c.disable(3089),c.disable(2960),c.disable(32926),c.blendEquation(32774),c.blendFunc(1,0),c.blendFuncSeparate(1,0,1,0),c.colorMask(!0,!0,!0,!0),c.clearColor(0,0,0,0),c.depthMask(!0),c.depthFunc(513),c.clearDepth(1),c.stencilMask(4294967295),c.stencilFunc(519,0,4294967295),c.stencilOp(7680,7680,7680),c.clearStencil(0),c.cullFace(1029),c.frontFace(2305),c.polygonOffset(0,0),c.activeTexture(33984),c.bindFramebuffer(36160,null),!0===i&&(c.bindFramebuffer(36009,null),c.bindFramebuffer(36008,null)),c.useProgram(null),c.lineWidth(1),c.scissor(0,0,c.canvas.width,c.canvas.height),c.viewport(0,0,c.canvas.width,c.canvas.height),t={},E=null,A={},o=null,a={},l=null,h=!1,u=null,d=null,p=null,m=null,f=null,g=null,v=null,y=!1,x=null,w=null,b=null,M=null,_=null,C.set(0,0,c.canvas.width,c.canvas.height),R.set(0,0,c.canvas.width,c.canvas.height),n.reset(),r.reset(),s.reset()}}}function Ml(d,s,p,m,u,f,g){const v=u.isWebGL2,t=u.maxTextures,y=u.maxCubemapSize,c=u.maxTextureSize,B=u.maxSamples,o=new WeakMap;let a,i=!1;try{i="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(d){}function l(e,t){return i?new OffscreenCanvas(e,t):En("canvas")}function x(e,t,i,n){let r=1;if((r=e.width>n||e.height>n?n/Math.max(e.width,e.height):r)<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const n=t?bn:Math.floor,s=n(r*e.width),o=n(r*e.height);void 0===a&&(a=l(s,o));t=i?l(s,o):a;return t.width=s,t.height=o,t.getContext("2d").drawImage(e,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+o+")."),t}"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+").")}return e}function w(e){return xn(e.width)&&xn(e.height)}function b(e,t){return e.generateMipmaps&&t&&e.minFilter!==Re&&e.minFilter!==F}function M(e,t,i,n,r=1){d.generateMipmap(e),m.get(t).__maxMipLevel=Math.log2(Math.max(i,n,r))}function _(e,t,i,n){if(!1===v)return t;if(null!==e){if(void 0!==d[e])return d[e];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+e+"'")}let r=t;return 6403===t&&(5126===i&&(r=33326),5131===i&&(r=33325),5121===i)&&(r=33321),6407===t&&(5126===i&&(r=34837),5131===i&&(r=34843),5121===i)&&(r=32849),33325!==(r=6408===t&&(5126===i&&(r=34836),5131===i&&(r=34842),5121===i)?n===Ti?35907:32856:r)&&33326!==r&&34842!==r&&34836!==r||s.get("EXT_color_buffer_float"),r}function n(e){return e===Re||e===Xe||e===Ye?9728:9729}function r(e){var t,i,e=e.target;e.removeEventListener("dispose",r),t=e,void 0!==(i=m.get(t)).__webglInit&&(d.deleteTexture(i.__webglTexture),m.remove(t)),e.isVideoTexture&&o.delete(e),g.memory.textures--}function S(e){e=e.target;e.removeEventListener("dispose",S);{const i=e.texture,n=m.get(e),t=m.get(i);if(e){if(void 0!==t.__webglTexture&&(d.deleteTexture(t.__webglTexture),g.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)d.deleteFramebuffer(n.__webglFramebuffer[e]),n.__webglDepthbuffer&&d.deleteRenderbuffer(n.__webglDepthbuffer[e]);else d.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&d.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&d.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&d.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&d.deleteRenderbuffer(n.__webglDepthRenderbuffer);if(e.isWebGLMultipleRenderTargets)for(let e=0,t=i.length;e<t;e++){const n=m.get(i[e]);n.__webglTexture&&(d.deleteTexture(n.__webglTexture),g.memory.textures--),m.remove(i[e])}m.remove(i),m.remove(e)}}}let h=0;function T(e,t){var i,n,r=m.get(e);if(e.isVideoTexture&&(i=e,n=g.render.frame,o.get(i)!==n&&(o.set(i,n),i.update())),0<e.version&&r.__version!==e.version){const p=e.image;if(void 0===p)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==p.complete)return void P(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}p.activeTexture(33984+t),p.bindTexture(3553,r.__webglTexture)}function E(e,t){var i=m.get(e);if(0<e.version&&i.__version!==e.version){var n=i,r=e,s=t;if(6===r.image.length){L(n,r),p.activeTexture(33984+s),p.bindTexture(34067,n.__webglTexture),d.pixelStorei(37440,r.flipY),d.pixelStorei(37441,r.premultiplyAlpha),d.pixelStorei(3317,r.unpackAlignment),d.pixelStorei(37443,0);var o=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),a=r.image[0]&&r.image[0].isDataTexture,l=[];for(let e=0;e<6;e++)l[e]=o||a?a?r.image[e].image:r.image[e]:x(r.image[e],!1,!0,y);var s=l[0],e=w(s)||v,h=f.convert(r.format),c=f.convert(r.type),u=_(r.internalFormat,h,c,r.encoding);let i;if(R(34067,r,e),o){for(let t=0;t<6;t++){i=l[t].mipmaps;for(let e=0;e<i.length;e++){const s=i[e];r.format!==Le&&r.format!==pt?null!==h?p.compressedTexImage2D(34069+t,e,u,s.width,s.height,0,s.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):p.texImage2D(34069+t,e,u,s.width,s.height,0,h,c,s.data)}}n.__maxMipLevel=i.length-1}else{i=r.mipmaps;for(let t=0;t<6;t++)if(a){p.texImage2D(34069+t,0,u,l[t].width,l[t].height,0,h,c,l[t].data);for(let e=0;e<i.length;e++){const r=i[e].image[t].image;p.texImage2D(34069+t,e+1,u,r.width,r.height,0,h,c,r.data)}}else{p.texImage2D(34069+t,0,u,h,c,l[t]);for(let e=0;e<i.length;e++){const r=i[e];p.texImage2D(34069+t,e+1,u,h,c,r.image[t])}}n.__maxMipLevel=i.length}b(r,e)&&M(34067,r,s.width,s.height),n.__version=r.version,r.onUpdate&&r.onUpdate(r)}}else p.activeTexture(33984+t),p.bindTexture(34067,i.__webglTexture)}const A={[Ve]:10497,[Ce]:33071,[je]:33648},C={[Re]:9728,[Xe]:9984,[Ye]:9986,[F]:9729,[Ze]:9985,[Ke]:9987};function R(e,t,i){if(i?(d.texParameteri(e,10242,A[t.wrapS]),d.texParameteri(e,10243,A[t.wrapT]),32879!==e&&35866!==e||d.texParameteri(e,32882,A[t.wrapR]),d.texParameteri(e,10240,C[t.magFilter]),d.texParameteri(e,10241,C[t.minFilter])):(d.texParameteri(e,10242,33071),d.texParameteri(e,10243,33071),32879!==e&&35866!==e||d.texParameteri(e,32882,33071),t.wrapS===Ce&&t.wrapT===Ce||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),d.texParameteri(e,10240,n(t.magFilter)),d.texParameteri(e,10241,n(t.minFilter)),t.minFilter!==Re&&t.minFilter!==F&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===s.has("EXT_texture_filter_anisotropic")){const i=s.get("EXT_texture_filter_anisotropic");t.type===ot&&!1===s.has("OES_texture_float_linear")||!1===v&&t.type===at&&!1===s.has("OES_texture_half_float_linear")||(1<t.anisotropy||m.get(t).__currentAnisotropy)&&(d.texParameterf(e,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,u.getMaxAnisotropy())),m.get(t).__currentAnisotropy=t.anisotropy)}}function L(e,t){void 0===e.__webglInit&&(e.__webglInit=!0,t.addEventListener("dispose",r),e.__webglTexture=d.createTexture(),g.memory.textures++)}function P(e,i,t){let n=3553;i.isDataTexture2DArray&&(n=35866),i.isDataTexture3D&&(n=32879),L(e,i),p.activeTexture(33984+t),p.bindTexture(n,e.__webglTexture),d.pixelStorei(37440,i.flipY),d.pixelStorei(37441,i.premultiplyAlpha),d.pixelStorei(3317,i.unpackAlignment),d.pixelStorei(37443,0);t=i;var t=!v&&(t.wrapS!==Ce||t.wrapT!==Ce||t.minFilter!==Re&&t.minFilter!==F)&&!1===w(i.image),t=x(i.image,t,!1,c),r=w(t)||v,s=f.convert(i.format);let o,a=f.convert(i.type),l=_(i.internalFormat,s,a,i.encoding);R(n,i,r);var h=i.mipmaps;if(i.isDepthTexture)l=6402,v?l=i.type===ot?36012:i.type===st?33190:i.type===ut?35056:33189:i.type===ot&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===vt&&6402===l&&i.type!==nt&&i.type!==st&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=nt,a=f.convert(i.type)),i.format===yt&&6402===l&&(l=34041,i.type!==ut)&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=ut,a=f.convert(i.type)),p.texImage2D(3553,0,l,t.width,t.height,0,s,a,null);else if(i.isDataTexture)if(0<h.length&&r){for(let e=0,t=h.length;e<t;e++)o=h[e],p.texImage2D(3553,e,l,o.width,o.height,0,s,a,o.data);i.generateMipmaps=!1,e.__maxMipLevel=h.length-1}else p.texImage2D(3553,0,l,t.width,t.height,0,s,a,t.data),e.__maxMipLevel=0;else if(i.isCompressedTexture){for(let e=0,t=h.length;e<t;e++)o=h[e],i.format!==Le&&i.format!==pt?null!==s?p.compressedTexImage2D(3553,e,l,o.width,o.height,0,o.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):p.texImage2D(3553,e,l,o.width,o.height,0,s,a,o.data);e.__maxMipLevel=h.length-1}else if(i.isDataTexture2DArray)p.texImage3D(35866,0,l,t.width,t.height,t.depth,0,s,a,t.data),e.__maxMipLevel=0;else if(i.isDataTexture3D)p.texImage3D(32879,0,l,t.width,t.height,t.depth,0,s,a,t.data),e.__maxMipLevel=0;else if(0<h.length&&r){for(let e=0,t=h.length;e<t;e++)o=h[e],p.texImage2D(3553,e,l,s,a,o);i.generateMipmaps=!1,e.__maxMipLevel=h.length-1}else p.texImage2D(3553,0,l,s,a,t),e.__maxMipLevel=0;b(i,r)&&M(n,i,t.width,t.height),e.__version=i.version,i.onUpdate&&i.onUpdate(i)}function z(e,t,i,n,r){var s=f.convert(i.format),o=f.convert(i.type),a=_(i.internalFormat,s,o,i.encoding);32879===r||35866===r?p.texImage3D(r,0,a,t.width,t.height,t.depth,0,s,o,null):p.texImage2D(r,0,a,t.width,t.height,0,s,o,null),p.bindFramebuffer(36160,e),d.framebufferTexture2D(36160,n,r,m.get(i).__webglTexture,0),p.bindFramebuffer(36160,null)}function D(t,i,n){if(d.bindRenderbuffer(36161,t),i.depthBuffer&&!i.stencilBuffer){let e=33189;if(n){const t=i.depthTexture,n=(t&&t.isDepthTexture&&(t.type===ot?e=36012:t.type===st&&(e=33190)),I(i));d.renderbufferStorageMultisample(36161,n,e,i.width,i.height)}else d.renderbufferStorage(36161,e,i.width,i.height);d.framebufferRenderbuffer(36160,36096,36161,t)}else if(i.depthBuffer&&i.stencilBuffer){if(n){const t=I(i);d.renderbufferStorageMultisample(36161,t,35056,i.width,i.height)}else d.renderbufferStorage(36161,34041,i.width,i.height);d.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=!0===i.isWebGLMultipleRenderTargets?i.texture[0]:i.texture,e=f.convert(t.format),r=f.convert(t.type),s=_(t.internalFormat,e,r,t.encoding);if(n){const t=I(i);d.renderbufferStorageMultisample(36161,t,s,i.width,i.height)}else d.renderbufferStorage(36161,s,i.width,i.height)}d.bindRenderbuffer(36161,null)}function I(e){return v&&e.isWebGLMultisampleRenderTarget?Math.min(B,e.samples):0}let O=!1,N=!1;this.allocateTextureUnit=function(){var e=h;return e>=t&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+t),h+=1,e},this.resetTextureUnits=function(){h=0},this.setTexture2D=T,this.setTexture2DArray=function(e,t){var i=m.get(e);0<e.version&&i.__version!==e.version?P(i,e,t):(p.activeTexture(33984+t),p.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=m.get(e);0<e.version&&i.__version!==e.version?P(i,e,t):(p.activeTexture(33984+t),p.bindTexture(32879,i.__webglTexture))},this.setTextureCube=E,this.setupRenderTarget=function(i){var t=i.texture,n=m.get(i),r=m.get(t),e=(i.addEventListener("dispose",S),!0!==i.isWebGLMultipleRenderTargets&&(r.__webglTexture=d.createTexture(),r.__version=t.version,g.memory.textures++),!0===i.isWebGLCubeRenderTarget),s=!0===i.isWebGLMultipleRenderTargets,o=!0===i.isWebGLMultisampleRenderTarget,a=t.isDataTexture3D||t.isDataTexture2DArray,l=w(i)||v;if(!v||t.format!==pt||t.type!==ot&&t.type!==at||(t.format=Le,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),e){n.__webglFramebuffer=[];for(let e=0;e<6;e++)n.__webglFramebuffer[e]=d.createFramebuffer()}else if(n.__webglFramebuffer=d.createFramebuffer(),s)if(u.drawBuffers){const p=i.texture;for(let e=0,t=p.length;e<t;e++){const u=m.get(p[e]);void 0===u.__webglTexture&&(u.__webglTexture=d.createTexture(),g.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(o)if(v){n.__webglMultisampledFramebuffer=d.createFramebuffer(),n.__webglColorRenderbuffer=d.createRenderbuffer(),d.bindRenderbuffer(36161,n.__webglColorRenderbuffer);const m=f.convert(t.format),u=f.convert(t.type),g=_(t.internalFormat,m,u,t.encoding),v=I(i);d.renderbufferStorageMultisample(36161,v,g,i.width,i.height),p.bindFramebuffer(36160,n.__webglMultisampledFramebuffer),d.framebufferRenderbuffer(36160,36064,36161,n.__webglColorRenderbuffer),d.bindRenderbuffer(36161,null),i.depthBuffer&&(n.__webglDepthRenderbuffer=d.createRenderbuffer(),D(n.__webglDepthRenderbuffer,i,!0)),p.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(e){p.bindTexture(34067,r.__webglTexture),R(34067,t,l);for(let e=0;e<6;e++)z(n.__webglFramebuffer[e],i,t,36064,34069+e);b(t,l)&&M(34067,t,i.width,i.height)}else if(s){const d=i.texture;for(let e=0,t=d.length;e<t;e++){const f=d[e],g=m.get(f);p.bindTexture(3553,g.__webglTexture),R(3553,f,l),z(n.__webglFramebuffer,i,f,36064+e,3553),b(f,l)&&M(3553,f,i.width,i.height)}}else{let e=3553;a&&(v?e=t.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),p.bindTexture(e,r.__webglTexture),R(e,t,l),z(n.__webglFramebuffer,i,t,36064,e),b(t,l)&&M(e,t,i.width,i.height,i.depth)}if(p.unbindTexture(),i.depthBuffer){var h=i,c=m.get(h),o=!0===h.isWebGLCubeRenderTarget;if(h.depthTexture){if(o)throw new Error("target.depthTexture not supported in Cube render targets");e=c.__webglFramebuffer,s=h;if(s&&s.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(p.bindFramebuffer(36160,e),!s.depthTexture||!s.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(m.get(s.depthTexture).__webglTexture&&s.depthTexture.image.width===s.width&&s.depthTexture.image.height===s.height||(s.depthTexture.image.width=s.width,s.depthTexture.image.height=s.height,s.depthTexture.needsUpdate=!0),T(s.depthTexture,0),e=m.get(s.depthTexture).__webglTexture,s.depthTexture.format===vt)d.framebufferTexture2D(36160,36096,3553,e,0);else{if(s.depthTexture.format!==yt)throw new Error("Unknown depthTexture format");d.framebufferTexture2D(36160,33306,3553,e,0)}}else if(o){c.__webglDepthbuffer=[];for(let e=0;e<6;e++)p.bindFramebuffer(36160,c.__webglFramebuffer[e]),c.__webglDepthbuffer[e]=d.createRenderbuffer(),D(c.__webglDepthbuffer[e],h,!1)}else p.bindFramebuffer(36160,c.__webglFramebuffer),c.__webglDepthbuffer=d.createRenderbuffer(),D(c.__webglDepthbuffer,h,!1);p.bindFramebuffer(36160,null)}},this.updateRenderTargetMipmap=function(i){const n=w(i)||v,r=!0===i.isWebGLMultipleRenderTargets?i.texture:[i.texture];for(let e=0,t=r.length;e<t;e++){var s=r[e];if(b(s,n)){const n=i.isWebGLCubeRenderTarget?34067:3553,r=m.get(s).__webglTexture;p.bindTexture(n,r),M(n,s,i.width,i.height),p.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(v){var i=t.width,n=t.height;let e=16384;t.depthBuffer&&(e|=256),t.stencilBuffer&&(e|=1024);const v=m.get(t);p.bindFramebuffer(36008,v.__webglMultisampledFramebuffer),p.bindFramebuffer(36009,v.__webglFramebuffer),d.blitFramebuffer(0,0,i,n,0,0,i,n,e,9728),p.bindFramebuffer(36008,null),p.bindFramebuffer(36009,v.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===O&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),O=!0),e=e.texture),T(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===N&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),N=!0),e=e.texture),E(e,t)}}function _l(e,i,t){const n=t.isWebGL2;return{convert:function(e){let t;if(e===et)return 5121;if(e===lt)return 32819;if(e===ht)return 32820;if(e===ct)return 33635;if(e===tt)return 5120;if(e===it)return 5122;if(e===nt)return 5123;if(e===rt)return 5124;if(e===st)return 5125;if(e===ot)return 5126;if(e===at)return n?5131:null!==(t=i.get("OES_texture_half_float"))?t.HALF_FLOAT_OES:null;if(e===dt)return 6406;if(e===pt)return 6407;if(e===Le)return 6408;if(e===mt)return 6409;if(e===ft)return 6410;if(e===vt)return 6402;if(e===yt)return 34041;if(e===xt)return 6403;if(e===wt)return 36244;if(e===bt)return 33319;if(e===Mt)return 33320;if(e===_t)return 36248;if(e===St)return 36249;if(e===Tt||e===Et||e===At||e===Ct){if(null===(t=i.get("WEBGL_compressed_texture_s3tc")))return null;if(e===Tt)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Et)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===At)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Ct)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===Rt||e===Lt||e===Pt||e===zt){if(null===(t=i.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===Rt)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===Lt)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===Pt)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===zt)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===Dt)return null!==(t=i.get("WEBGL_compressed_texture_etc1"))?t.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===It||e===Ot)&&null!==(t=i.get("WEBGL_compressed_texture_etc"))){if(e===It)return t.COMPRESSED_RGB8_ETC2;if(e===Ot)return t.COMPRESSED_RGBA8_ETC2_EAC}return e===Nt||e===Bt||e===Ft||e===Ht||e===Ut||e===Gt||e===Wt||e===kt||e===Vt||e===jt||e===Xt||e===qt||e===Yt||e===Jt||e===Qt||e===Kt||e===$t||e===ei||e===ti||e===ii||e===ni||e===ri||e===si||e===oi||e===ai||e===li||e===hi||e===ci?null!==(t=i.get("WEBGL_compressed_texture_astc"))?e:null:e===Zt?null!==(t=i.get("EXT_texture_compression_bptc"))?e:null:e===ut?n?34042:null!==(t=i.get("WEBGL_depth_texture"))?t.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}xl.prototype.isMeshDistanceMaterial=!0;class Sl extends B{constructor(e=[]){super(),this.cameras=e}}Sl.prototype.isArrayCamera=!0;class Tl extends u{constructor(){super(),this.type="Group"}}Tl.prototype.isGroup=!0;const El={type:"move"};class Al{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Tl,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Tl,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new De,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new De),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Tl,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new De,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new De),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,i){let n=null,r=null,s=null;const o=this._targetRay,a=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==o&&null!==(n=t.getPose(e.targetRaySpace,i))&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(El)),l&&e.hand){s=!0;for(const n of e.hand.values()){const e=t.getJointPose(n,i);if(void 0===l.joints[n.jointName]){const e=new Tl;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[n.jointName]=e,l.add(e)}const r=l.joints[n.jointName];null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=e.radius),r.visible=null!==e}const n=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],o=n.position.distanceTo(r.position),a=.02;l.inputState.pinching&&.025<o?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==a&&e.gripSpace&&null!==(r=t.getPose(e.gripSpace,i))&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1);return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==s),this}}class Cl extends cn{constructor(e,o){super();const i=this,a=e.state;let m=null,n=1,l=null,r="local-floor",h,c=null,u=null,d=null,p=null,f=!1,g=null,s=null,v=null,y=null,x=null,w=null;const b=[],M=new Map,_=new B,S=(_.layers.enable(1),_.viewport=new ze,new B),T=(S.layers.enable(2),S.viewport=new ze,[_,S]),E=new Sl;E.layers.enable(1),E.layers.enable(2);let A=null,C=null;function R(e){var t=M.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function L(){M.forEach(function(e,t){e.disconnect(t)}),M.clear(),A=null,C=null,a.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),u&&o.deleteFramebuffer(u),g&&o.deleteFramebuffer(g),s&&o.deleteRenderbuffer(s),v&&o.deleteRenderbuffer(v),u=null,g=null,s=null,v=null,p=null,d=null,c=null,m=null,N.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function P(t){var i=m.inputSources;for(let e=0;e<b.length;e++)M.set(i[e],b[e]);for(let e=0;e<t.removed.length;e++){var n=t.removed[e],r=M.get(n);r&&(r.dispatchEvent({type:"disconnected",data:n}),M.delete(n))}for(let e=0;e<t.added.length;e++){var s=t.added[e],o=M.get(s);o&&o.dispatchEvent({type:"connected",data:s})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return void 0===t&&(t=new Al,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return void 0===t&&(t=new Al,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return void 0===t&&(t=new Al,b[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){n=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){r=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l},this.getBaseLayer=function(){return null!==d?d:p},this.getBinding=function(){return c},this.getFrame=function(){return y},this.getSession=function(){return m},this.setSession=async function(t){if(null!==(m=t)){m.addEventListener("select",R),m.addEventListener("selectstart",R),m.addEventListener("selectend",R),m.addEventListener("squeeze",R),m.addEventListener("squeezestart",R),m.addEventListener("squeezeend",R),m.addEventListener("end",L),m.addEventListener("inputsourceschange",P);const t=o.getContextAttributes();if(!0!==t.xrCompatible&&await o.makeXRCompatible(),void 0===m.renderState.layers){const i={antialias:t.antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:n};p=new XRWebGLLayer(m,o,i),m.updateRenderState({baseLayer:p})}else if(o instanceof WebGLRenderingContext){const i={antialias:!0,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:n};p=new XRWebGLLayer(m,o,i),m.updateRenderState({layers:[p]})}else{f=t.antialias;let e=null;t.depth&&(w=256,t.stencil&&(w|=1024),x=t.stencil?33306:36096,e=t.stencil?35056:33190);const l={colorFormat:t.alpha?32856:32849,depthFormat:e,scaleFactor:n};c=new XRWebGLBinding(m,o),d=c.createProjectionLayer(l),u=o.createFramebuffer(),m.updateRenderState({layers:[d]}),f&&(g=o.createFramebuffer(),s=o.createRenderbuffer(),o.bindRenderbuffer(36161,s),o.renderbufferStorageMultisample(36161,4,32856,d.textureWidth,d.textureHeight),a.bindFramebuffer(36160,g),o.framebufferRenderbuffer(36160,36064,36161,s),o.bindRenderbuffer(36161,null),null!==e&&(v=o.createRenderbuffer(),o.bindRenderbuffer(36161,v),o.renderbufferStorageMultisample(36161,4,e,d.textureWidth,d.textureHeight),o.framebufferRenderbuffer(36160,x,36161,v),o.bindRenderbuffer(36161,null)),a.bindFramebuffer(36160,null))}l=await m.requestReferenceSpace(r),N.setContext(m),N.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};const z=new De,D=new De;function I(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null!==m){E.near=S.near=_.near=e.near,E.far=S.far=_.far=e.far,A===E.near&&C===E.far||(m.updateRenderState({depthNear:E.near,depthFar:E.far}),A=E.near,C=E.far);var t=e.parent,i=E.cameras;I(E,t);for(let e=0;e<i.length;e++)I(i[e],t);E.matrixWorld.decompose(E.position,E.quaternion,E.scale),e.position.copy(E.position),e.quaternion.copy(E.quaternion),e.scale.copy(E.scale),e.matrix.copy(E.matrix),e.matrixWorld.copy(E.matrixWorld);var n,r,s,o,a,l,h,c,u,d,p=e.children;for(let e=0,t=p.length;e<t;e++)p[e].updateMatrixWorld(!0);2===i.length?(e=E,n=_,r=S,z.setFromMatrixPosition(n.matrixWorld),D.setFromMatrixPosition(r.matrixWorld),s=z.distanceTo(D),o=n.projectionMatrix.elements,r=r.projectionMatrix.elements,a=o[14]/(o[10]-1),l=o[14]/(o[10]+1),h=(o[9]+1)/o[5],c=(o[9]-1)/o[5],o=(o[8]-1)/o[0],r=(r[8]+1)/r[0],u=a*o,d=a*r,o=(r=s/(r-o))*-o,n.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(o),e.translateZ(r),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),n=a+r,a=l+r,e.projectionMatrix.makePerspective(u-o,s-o+d,h*l/a*n,c*l/a*n,n,a)):E.projectionMatrix.copy(_.projectionMatrix)}},this.getCamera=function(){return E},this.getFoveation=function(){return null!==d?d.fixedFoveation:null!==p?p.fixedFoveation:void 0},this.setFoveation=function(e){null!==d&&(d.fixedFoveation=e),null!==p&&void 0!==p.fixedFoveation&&(p.fixedFoveation=e)};let O=null;const N=new Zs;N.setAnimationLoop(function(n,t){if(h=t.getViewerPose(l),y=t,null!==h){const n=h.views;null!==p&&a.bindXRFramebuffer(p.framebuffer);let i=!1;n.length!==E.cameras.length&&(E.cameras.length=0,i=!0);for(let t=0;t<n.length;t++){const s=n[t];let e=null;if(null!==p)e=p.getViewport(s);else{const n=c.getViewSubImage(d,s);a.bindXRFramebuffer(u),void 0!==n.depthStencilTexture&&o.framebufferTexture2D(36160,x,3553,n.depthStencilTexture,0),o.framebufferTexture2D(36160,36064,3553,n.colorTexture,0),e=n.viewport}var r=T[t];r.matrix.fromArray(s.transform.matrix),r.projectionMatrix.fromArray(s.projectionMatrix),r.viewport.set(e.x,e.y,e.width,e.height),0===t&&E.matrix.copy(r.matrix),!0===i&&E.cameras.push(r)}f&&(a.bindXRFramebuffer(g),null!==w)&&o.clear(w)}const s=m.inputSources;for(let e=0;e<b.length;e++){const o=b[e],a=s[e];o.update(a,t,l)}if(O&&O(n,t),f){const n=d.textureWidth,t=d.textureHeight;a.bindFramebuffer(36008,g),a.bindFramebuffer(36009,u),o.invalidateFramebuffer(36008,[x]),o.invalidateFramebuffer(36009,[x]),o.blitFramebuffer(0,0,n,t,0,0,n,t,16384,9728),o.invalidateFramebuffer(36008,[36064]),a.bindFramebuffer(36008,null),a.bindFramebuffer(36009,null),a.bindFramebuffer(36160,g)}y=null}),this.setAnimationLoop=function(e){O=e},this.dispose=function(){}}}function Rl(s){function d(e,t){e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),0<t.alphaTest&&(e.alphaTest.value=t.alphaTest);var i=s.get(t).envMap;if(i){e.envMap.value=i,e.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,e.reflectivity.value=t.reflectivity,e.ior.value=t.ior,e.refractionRatio.value=t.refractionRatio;const n=s.get(i).__maxMipLevel;void 0!==n&&(e.maxMipLevel.value=n)}let n,r;t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap?n=t.emissiveMap:t.clearcoatMap?n=t.clearcoatMap:t.clearcoatNormalMap?n=t.clearcoatNormalMap:t.clearcoatRoughnessMap?n=t.clearcoatRoughnessMap:t.specularIntensityMap?n=t.specularIntensityMap:t.specularColorMap?n=t.specularColorMap:t.transmissionMap?n=t.transmissionMap:t.thicknessMap?n=t.thicknessMap:t.sheenColorMap?n=t.sheenColorMap:t.sheenRoughnessMap&&(n=t.sheenRoughnessMap),void 0!==n&&(!0===(n=n.isWebGLRenderTarget?n.texture:n).matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix)),t.aoMap?r=t.aoMap:t.lightMap&&(r=t.lightMap),void 0!==r&&(!0===(r=r.isWebGLRenderTarget?r.texture:r).matrixAutoUpdate&&r.updateMatrix(),e.uv2Transform.value.copy(r.matrix))}function p(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===Ae)&&(e.bumpScale.value*=-1),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===Ae)&&e.normalScale.value.negate(),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),s.get(t).envMap&&(e.envMapIntensity.value=t.envMapIntensity)}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(t,i,n,r,s){if(i.isMeshBasicMaterial)d(t,i);else if(i.isMeshLambertMaterial)d(t,i),u=t,i.emissiveMap&&(u.emissiveMap.value=i.emissiveMap);else if(i.isMeshToonMaterial)d(t,i),u=t,(c=i).gradientMap&&(u.gradientMap.value=c.gradientMap),c.emissiveMap&&(u.emissiveMap.value=c.emissiveMap),c.bumpMap&&(u.bumpMap.value=c.bumpMap,u.bumpScale.value=c.bumpScale,c.side===Ae)&&(u.bumpScale.value*=-1),c.normalMap&&(u.normalMap.value=c.normalMap,u.normalScale.value.copy(c.normalScale),c.side===Ae)&&u.normalScale.value.negate(),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);else if(i.isMeshPhongMaterial)d(t,i),c=i,(h=t).specular.value.copy(c.specular),h.shininess.value=Math.max(c.shininess,1e-4),c.emissiveMap&&(h.emissiveMap.value=c.emissiveMap),c.bumpMap&&(h.bumpMap.value=c.bumpMap,h.bumpScale.value=c.bumpScale,c.side===Ae)&&(h.bumpScale.value*=-1),c.normalMap&&(h.normalMap.value=c.normalMap,h.normalScale.value.copy(c.normalScale),c.side===Ae)&&h.normalScale.value.negate(),c.displacementMap&&(h.displacementMap.value=c.displacementMap,h.displacementScale.value=c.displacementScale,h.displacementBias.value=c.displacementBias);else if(i.isMeshStandardMaterial)d(t,i),i.isMeshPhysicalMaterial?(h=s,p(s=t,l=i),s.ior.value=l.ior,0<l.sheen&&(s.sheenColor.value.copy(l.sheenColor).multiplyScalar(l.sheen),s.sheenRoughness.value=l.sheenRoughness,l.sheenColorMap&&(s.sheenColorMap.value=l.sheenColorMap),l.sheenRoughnessMap)&&(s.sheenRoughnessMap.value=l.sheenRoughnessMap),0<l.clearcoat&&(s.clearcoat.value=l.clearcoat,s.clearcoatRoughness.value=l.clearcoatRoughness,l.clearcoatMap&&(s.clearcoatMap.value=l.clearcoatMap),l.clearcoatRoughnessMap&&(s.clearcoatRoughnessMap.value=l.clearcoatRoughnessMap),l.clearcoatNormalMap)&&(s.clearcoatNormalScale.value.copy(l.clearcoatNormalScale),s.clearcoatNormalMap.value=l.clearcoatNormalMap,l.side===Ae)&&s.clearcoatNormalScale.value.negate(),0<l.transmission&&(s.transmission.value=l.transmission,s.transmissionSamplerMap.value=h.texture,s.transmissionSamplerSize.value.set(h.width,h.height),l.transmissionMap&&(s.transmissionMap.value=l.transmissionMap),s.thickness.value=l.thickness,l.thicknessMap&&(s.thicknessMap.value=l.thicknessMap),s.attenuationDistance.value=l.attenuationDistance,s.attenuationColor.value.copy(l.attenuationColor)),s.specularIntensity.value=l.specularIntensity,s.specularColor.value.copy(l.specularColor),l.specularIntensityMap&&(s.specularIntensityMap.value=l.specularIntensityMap),l.specularColorMap&&(s.specularColorMap.value=l.specularColorMap)):p(t,i);else if(i.isMeshMatcapMaterial)d(t,i),s=t,(l=i).matcap&&(s.matcap.value=l.matcap),l.bumpMap&&(s.bumpMap.value=l.bumpMap,s.bumpScale.value=l.bumpScale,l.side===Ae)&&(s.bumpScale.value*=-1),l.normalMap&&(s.normalMap.value=l.normalMap,s.normalScale.value.copy(l.normalScale),l.side===Ae)&&s.normalScale.value.negate(),l.displacementMap&&(s.displacementMap.value=l.displacementMap,s.displacementScale.value=l.displacementScale,s.displacementBias.value=l.displacementBias);else if(i.isMeshDepthMaterial)d(t,i),s=t,(a=i).displacementMap&&(s.displacementMap.value=a.displacementMap,s.displacementScale.value=a.displacementScale,s.displacementBias.value=a.displacementBias);else if(i.isMeshDistanceMaterial)d(t,i),s=t,(a=i).displacementMap&&(s.displacementMap.value=a.displacementMap,s.displacementScale.value=a.displacementScale,s.displacementBias.value=a.displacementBias),s.referencePosition.value.copy(a.referencePosition),s.nearDistance.value=a.nearDistance,s.farDistance.value=a.farDistance;else if(i.isMeshNormalMaterial)d(t,i),s=t,(e=i).bumpMap&&(s.bumpMap.value=e.bumpMap,s.bumpScale.value=e.bumpScale,e.side===Ae)&&(s.bumpScale.value*=-1),e.normalMap&&(s.normalMap.value=e.normalMap,s.normalScale.value.copy(e.normalScale),e.side===Ae)&&s.normalScale.value.negate(),e.displacementMap&&(s.displacementMap.value=e.displacementMap,s.displacementScale.value=e.displacementScale,s.displacementBias.value=e.displacementBias);else if(i.isLineBasicMaterial)s=i,(e=t).diffuse.value.copy(s.color),e.opacity.value=s.opacity,i.isLineDashedMaterial&&(s=i,(o=t).dashSize.value=s.dashSize,o.totalSize.value=s.dashSize+s.gapSize,o.scale.value=s.scale);else if(i.isPointsMaterial){s=i,(o=t).diffuse.value.copy(s.color),o.opacity.value=s.opacity,o.size.value=s.size*n,o.scale.value=.5*r,s.map&&(o.map.value=s.map),s.alphaMap&&(o.alphaMap.value=s.alphaMap),0<s.alphaTest&&(o.alphaTest.value=s.alphaTest);let e;s.map?e=s.map:s.alphaMap&&(e=s.alphaMap),void 0!==e&&(!0===e.matrixAutoUpdate&&e.updateMatrix(),o.uvTransform.value.copy(e.matrix))}else if(i.isSpriteMaterial){r=i,(n=t).diffuse.value.copy(r.color),n.opacity.value=r.opacity,n.rotation.value=r.rotation,r.map&&(n.map.value=r.map),r.alphaMap&&(n.alphaMap.value=r.alphaMap),0<r.alphaTest&&(n.alphaTest.value=r.alphaTest);let e;r.map?e=r.map:r.alphaMap&&(e=r.alphaMap),void 0!==e&&(!0===e.matrixAutoUpdate&&e.updateMatrix(),n.uvTransform.value.copy(e.matrix))}else i.isShadowMaterial?(t.color.value.copy(i.color),t.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1);var o,e,a,l,h,c,u}}}function s(e={}){const r=void 0!==e.canvas?e.canvas:((j=En("canvas")).style.display="block",j),N=void 0!==e.context?e.context:null,B=void 0!==e.alpha&&e.alpha,F=void 0===e.depth||e.depth,H=void 0===e.stencil||e.stencil,U=void 0!==e.antialias&&e.antialias,G=void 0===e.premultipliedAlpha||e.premultipliedAlpha,W=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,k=void 0!==e.powerPreference?e.powerPreference:"default",V=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;var j;let c=null,w=null;const t=[],s=[],b=(this.domElement=r,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=Pe,this.physicallyCorrectLights=!1,this.toneMapping=Be,this.toneMappingExposure=1,this);let X=!1,q=0,Y=0,M=null,_=-1,S=null;const u=new ze,J=new ze;let Z=null,n=r.width,T=r.height,E=1,Q=null,K=null;const a=new ze(0,0,n,T),l=new ze(0,0,n,T);let $=!1;const h=[],ee=new Js;let te=!1,ie=!1,A=null;const ne=new Ie,C=new De,re={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function se(){return null===M?E:1}let d,R,L,p,P,z,D,oe,ae,le,m,f,he,ce,ue,I,o,g,de,pe,me,v,y,O=N;function fe(t,i){for(let e=0;e<t.length;e++){var n=t[e],n=r.getContext(n,i);if(null!==n)return n}return null}try{const e={alpha:B,depth:F,stencil:H,antialias:U,premultipliedAlpha:G,preserveDrawingBuffer:W,powerPreference:k,failIfMajorPerformanceCaveat:V};if(r.addEventListener("webglcontextlost",ve,!1),r.addEventListener("webglcontextrestored",ye,!1),null===O){const r=["webgl2","webgl","experimental-webgl"];if(!0===b.isWebGL1Renderer&&r.shift(),null===(O=fe(r,e)))throw fe(r)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===O.getShaderPrecisionFormat&&(O.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function ge(){d=new Lo(O),R=new no(O,d,e),d.init(R),v=new _l(O,d,R),L=new bl(O,d,R),h[0]=1029,p=new Do(O),P=new al,z=new Ml(O,d,L,P,R,v,p),D=new so(b),oe=new Ro(b),ae=new Qs(O,R),y=new to(O,d,ae,R),le=new Po(O,ae,p,y),m=new Ho(O,le,ae,p),de=new Fo(O,R,z),I=new ro(P),f=new ol(b,D,oe,d,R,y,I),he=new Rl(P),ce=new ul(P),ue=new vl(d,R),g=new eo(b,D,L,m,G),o=new wl(b,m,R),pe=new io(O,d,p,R),me=new zo(O,d,p,R),p.programs=f.programs,b.capabilities=R,b.extensions=d,b.properties=P,b.renderLists=ce,b.shadowMap=o,b.state=L,b.info=p}ge();const x=new Cl(b,O);function ve(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),X=!0}function ye(){console.log("THREE.WebGLRenderer: Context Restored."),X=!1;var e=p.autoReset,t=o.enabled,i=o.autoUpdate,n=o.needsUpdate,r=o.type;ge(),p.autoReset=e,o.enabled=t,o.autoUpdate=i,o.needsUpdate=n,o.type=r}function xe(e){var t,e=e.target;e.removeEventListener("dispose",xe),t=e=e,void 0!==(t=P.get(t).programs)&&t.forEach(function(e){f.releaseProgram(e)}),P.remove(e)}this.xr=x,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){var e=d.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=d.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return E},this.setPixelRatio=function(e){void 0!==e&&(E=e,this.setSize(n,T,!1))},this.getSize=function(e){return e.set(n,T)},this.setSize=function(e,t,i){x.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(n=e,T=t,r.width=Math.floor(e*E),r.height=Math.floor(t*E),!1!==i&&(r.style.width=e+"px",r.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(n*E,T*E).floor()},this.setDrawingBufferSize=function(e,t,i){n=e,T=t,E=i,r.width=Math.floor(e*i),r.height=Math.floor(t*i),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return e.copy(u)},this.getViewport=function(e){return e.copy(a)},this.setViewport=function(e,t,i,n){e.isVector4?a.set(e.x,e.y,e.z,e.w):a.set(e,t,i,n),L.viewport(u.copy(a).multiplyScalar(E).floor())},this.getScissor=function(e){return e.copy(l)},this.setScissor=function(e,t,i,n){e.isVector4?l.set(e.x,e.y,e.z,e.w):l.set(e,t,i,n),L.scissor(J.copy(l).multiplyScalar(E).floor())},this.getScissorTest=function(){return $},this.setScissorTest=function(e){L.setScissorTest($=e)},this.setOpaqueSort=function(e){Q=e},this.setTransparentSort=function(e){K=e},this.getClearColor=function(e){return e.copy(g.getClearColor())},this.setClearColor=function(){g.setClearColor.apply(g,arguments)},this.getClearAlpha=function(){return g.getClearAlpha()},this.setClearAlpha=function(){g.setClearAlpha.apply(g,arguments)},this.clear=function(e,t,i){let n=0;void 0!==e&&!e||(n|=16384),void 0!==t&&!t||(n|=256),void 0!==i&&!i||(n|=1024),O.clear(n)},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(){r.removeEventListener("webglcontextlost",ve,!1),r.removeEventListener("webglcontextrestored",ye,!1),ce.dispose(),ue.dispose(),P.dispose(),D.dispose(),oe.dispose(),m.dispose(),y.dispose(),x.dispose(),x.removeEventListener("sessionstart",be),x.removeEventListener("sessionend",Me),A&&(A.dispose(),A=null),i.stop()},this.renderBufferDirect=function(e,t,i,n,r,s){null===t&&(t=re);var o=r.isMesh&&r.matrixWorld.determinant()<0,e=function(e,t,i,n,r){!0!==t.isScene&&(t=re),z.resetTextureUnits();var s=t.fog,o=n.isMeshStandardMaterial?t.environment:null,a=null===M?b.outputEncoding:M.texture.encoding,o=(n.isMeshStandardMaterial?oe:D).get(n.envMap||o),l=!0===n.vertexColors&&!!i.attributes.color&&4===i.attributes.color.itemSize,h=!!n.normalMap&&!!i.attributes.tangent,c=!!i.morphAttributes.position,u=!!i.morphAttributes.normal,d=i.morphAttributes.position?i.morphAttributes.position.length:0,p=P.get(n),m=w.state.lights;if(!0===te&&(!0===ie||e!==S)){const t=e===S&&n.id===_;I.setState(n,e,t)}let f=!1,g=(n.version===p.__version?(p.needsLights&&p.lightsStateVersion!==m.state.version||p.outputEncoding!==a||r.isInstancedMesh&&!1===p.instancing||!r.isInstancedMesh&&!0===p.instancing||r.isSkinnedMesh&&!1===p.skinning||!r.isSkinnedMesh&&!0===p.skinning||p.envMap!==o||n.fog&&p.fog!==s||void 0!==p.numClippingPlanes&&(p.numClippingPlanes!==I.numPlanes||p.numIntersection!==I.numIntersection)||p.vertexAlphas!==l||p.vertexTangents!==h||p.morphTargets!==c||p.morphNormals!==u||!0===R.isWebGL2&&p.morphTargetsCount!==d)&&(f=!0):(f=!0,p.__version=n.version),p.currentProgram),v=!1,y=!1,x=!1;m=(g=!0===f?Te(n,t,r):g).getUniforms(),a=p.uniforms;if(L.useProgram(g.program)&&(v=!0,y=!0,x=!0),n.id!==_&&(_=n.id,y=!0),v||S!==e){if(m.setValue(O,"projectionMatrix",e.projectionMatrix),R.logarithmicDepthBuffer&&m.setValue(O,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),S!==e&&(S=e,y=!0,x=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const t=m.map.cameraPosition;void 0!==t&&t.setValue(O,C.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&m.setValue(O,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||r.isSkinnedMesh)&&m.setValue(O,"viewMatrix",e.matrixWorldInverse)}if(r.isSkinnedMesh){m.setOptional(O,r,"bindMatrix"),m.setOptional(O,r,"bindMatrixInverse");const e=r.skeleton;e&&(R.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),m.setValue(O,"boneTexture",e.boneTexture,z),m.setValue(O,"boneTextureSize",e.boneTextureSize)):m.setOptional(O,e,"boneMatrices"))}return!i||void 0===i.morphAttributes.position&&void 0===i.morphAttributes.normal||de.update(r,i,n,g),!y&&p.receiveShadow===r.receiveShadow||(p.receiveShadow=r.receiveShadow,m.setValue(O,"receiveShadow",r.receiveShadow)),y&&(m.setValue(O,"toneMappingExposure",b.toneMappingExposure),p.needsLights&&(o=x,(l=a).ambientLightColor.needsUpdate=o,l.lightProbe.needsUpdate=o,l.directionalLights.needsUpdate=o,l.directionalLightShadows.needsUpdate=o,l.pointLights.needsUpdate=o,l.pointLightShadows.needsUpdate=o,l.spotLights.needsUpdate=o,l.spotLightShadows.needsUpdate=o,l.rectAreaLights.needsUpdate=o,l.hemisphereLights.needsUpdate=o),s&&n.fog&&he.refreshFogUniforms(a,s),he.refreshMaterialUniforms(a,n,E,T,A),Ga.upload(O,p.uniformsList,a,z)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Ga.upload(O,p.uniformsList,a,z),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&m.setValue(O,"center",r.center),m.setValue(O,"modelViewMatrix",r.modelViewMatrix),m.setValue(O,"normalMatrix",r.normalMatrix),m.setValue(O,"modelMatrix",r.matrixWorld),g}(e,t,i,n,r);L.setMaterial(n,o);let a=i.index;t=i.attributes.position;if(null===a){if(void 0===t||0===t.count)return}else if(0===a.count)return;let l,h=1,c=(!0===n.wireframe&&(a=le.getWireframeAttribute(i),h=2),y.setup(r,n,e,i,a),pe);null!==a&&(l=ae.get(a),(c=me).setIndex(l));var o=(null!==a?a:t).count,e=i.drawRange.start*h,t=i.drawRange.count*h,u=null!==s?s.start*h:0,s=null!==s?s.count*h:1/0,d=Math.max(e,u),o=Math.min(o,e+t,u+s)-1,t=Math.max(0,o-d+1);if(0!==t){if(r.isMesh)!0===n.wireframe?(L.setLineWidth(n.wireframeLinewidth*se()),c.setMode(1)):c.setMode(4);else if(r.isLine){let e=n.linewidth;void 0===e&&(e=1),L.setLineWidth(e*se()),r.isLineSegments?c.setMode(1):r.isLineLoop?c.setMode(2):c.setMode(3)}else r.isPoints?c.setMode(0):r.isSprite&&c.setMode(4);if(r.isInstancedMesh)c.renderInstances(d,t,r.count);else if(i.isInstancedBufferGeometry){const e=Math.min(i.instanceCount,i._maxInstanceCount);c.renderInstances(d,t,e)}else c.render(d,t)}},this.compile=function(n,t){(w=ue.get(n)).init(),s.push(w),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(w.pushLight(e),e.castShadow)&&w.pushShadow(e)}),w.setupLights(b.physicallyCorrectLights),n.traverse(function(t){var i=t.material;if(i)if(Array.isArray(i))for(let e=0;e<i.length;e++)Te(i[e],n,t);else Te(i,n,t)}),s.pop(),w=null};let we=null;function be(){i.stop()}function Me(){i.start()}const i=new Zs;function _e(e,t,i,n){var r=e.opaque,s=e.transmissive,e=e.transparent;if(w.setupLightsView(i),0<s.length){var o=r,a=t,l=i;if(null===A){const o=!0===U&&!0===R.isWebGL2;A=new(o?In:zn)(1024,1024,{generateMipmaps:!0,type:null!==v.convert(at)?at:et,minFilter:Ke,magFilter:Re,wrapS:Ce,wrapT:Ce})}var h=b.getRenderTarget(),c=(b.setRenderTarget(A),b.clear(),b.toneMapping);b.toneMapping=Be,Se(o,a,l),b.toneMapping=c,z.updateMultisampleRenderTarget(A),z.updateRenderTargetMipmap(A),b.setRenderTarget(h)}n&&L.viewport(u.copy(n)),0<r.length&&Se(r,t,i),0<s.length&&Se(s,t,i),0<e.length&&Se(e,t,i)}function Se(i,n,r){var s,o,a=!0===n.isScene?n.overrideMaterial:null;for(let e=0,t=i.length;e<t;e++){var l=i[e],h=l.object,c=l.geometry,u=null===a?l.material:a,l=l.group;h.layers.test(r.layers)&&(s=n,o=r,c=c,u=u,l=l,(h=h).onBeforeRender(b,s,o,c,u,l),h.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,h.matrixWorld),h.normalMatrix.getNormalMatrix(h.modelViewMatrix),u.onBeforeRender(b,s,o,c,h,l),!0===u.transparent&&u.side===Ne?(u.side=Ae,u.needsUpdate=!0,b.renderBufferDirect(o,s,c,u,h,l),u.side=Oe,u.needsUpdate=!0,b.renderBufferDirect(o,s,c,u,h,l),u.side=Ne):b.renderBufferDirect(o,s,c,u,h,l),h.onAfterRender(b,s,o,c,u,l))}}function Te(e,t,i){!0!==t.isScene&&(t=re);var n=P.get(e),r=w.state.lights,s=w.state.shadowsArray,o=r.state.version,s=f.getParameters(e,r.state,s,t,i),a=f.getProgramCacheKey(s);let l=n.programs,h=(n.environment=e.isMeshStandardMaterial?t.environment:null,n.fog=t.fog,n.envMap=(e.isMeshStandardMaterial?oe:D).get(e.envMap||n.environment),void 0===l&&(e.addEventListener("dispose",xe),l=new Map,n.programs=l),l.get(a));if(void 0!==h){if(n.currentProgram===h&&n.lightsStateVersion===o)return Ee(e,s),h}else s.uniforms=f.getUniforms(e),e.onBuild(i,s,b),e.onBeforeCompile(s,b),h=f.acquireProgram(s,a),l.set(a,h),n.uniforms=s.uniforms;t=n.uniforms,(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(t.clippingPlanes=I.uniform),Ee(e,s),n.needsLights=e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights,n.lightsStateVersion=o,n.needsLights&&(t.ambientLightColor.value=r.state.ambient,t.lightProbe.value=r.state.probe,t.directionalLights.value=r.state.directional,t.directionalLightShadows.value=r.state.directionalShadow,t.spotLights.value=r.state.spot,t.spotLightShadows.value=r.state.spotShadow,t.rectAreaLights.value=r.state.rectArea,t.ltc_1.value=r.state.rectAreaLTC1,t.ltc_2.value=r.state.rectAreaLTC2,t.pointLights.value=r.state.point,t.pointLightShadows.value=r.state.pointShadow,t.hemisphereLights.value=r.state.hemi,t.directionalShadowMap.value=r.state.directionalShadowMap,t.directionalShadowMatrix.value=r.state.directionalShadowMatrix,t.spotShadowMap.value=r.state.spotShadowMap,t.spotShadowMatrix.value=r.state.spotShadowMatrix,t.pointShadowMap.value=r.state.pointShadowMap,t.pointShadowMatrix.value=r.state.pointShadowMatrix),i=h.getUniforms(),a=Ga.seqWithValue(i.seq,t);return n.currentProgram=h,n.uniformsList=a,h}function Ee(e,t){e=P.get(e);e.outputEncoding=t.outputEncoding,e.instancing=t.instancing,e.skinning=t.skinning,e.morphTargets=t.morphTargets,e.morphNormals=t.morphNormals,e.morphTargetsCount=t.morphTargetsCount,e.numClippingPlanes=t.numClippingPlanes,e.numIntersection=t.numClipIntersection,e.vertexAlphas=t.vertexAlphas,e.vertexTangents=t.vertexTangents}i.setAnimationLoop(function(e){we&&we(e)}),"undefined"!=typeof window&&i.setContext(window),this.setAnimationLoop=function(e){we=e,x.setAnimationLoop(e),null===e?i.stop():i.start()},x.addEventListener("sessionstart",be),x.addEventListener("sessionend",Me),this.render=function(i,e){if(void 0!==e&&!0!==e.isCamera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else if(!0!==X){!0===i.autoUpdate&&i.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===x.enabled&&!0===x.isPresenting&&(!0===x.cameraAutoUpdate&&x.updateCamera(e),e=x.getCamera()),!0===i.isScene&&i.onBeforeRender(b,i,e,M),(w=ue.get(i,s.length)).init(),s.push(w),ne.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),ee.setFromProjectionMatrix(ne),ie=this.localClippingEnabled,te=I.init(this.clippingPlanes,ie,e),(c=ce.get(i,t.length)).init(),t.push(c),function i(n,r,s,o){if(!1!==n.visible){if(n.layers.test(r.layers))if(n.isGroup)s=n.renderOrder;else if(n.isLOD)!0===n.autoUpdate&&n.update(r);else if(n.isLight)w.pushLight(n),n.castShadow&&w.pushShadow(n);else if(n.isSprite){if(!n.frustumCulled||ee.intersectsSprite(n)){o&&C.setFromMatrixPosition(n.matrixWorld).applyMatrix4(ne);const i=m.update(n),r=n.material;r.visible&&c.push(n,i,r,s,C.z,null)}}else if((n.isMesh||n.isLine||n.isPoints)&&(n.isSkinnedMesh&&n.skeleton.frame!==p.render.frame&&(n.skeleton.update(),n.skeleton.frame=p.render.frame),!n.frustumCulled||ee.intersectsObject(n))){o&&C.setFromMatrixPosition(n.matrixWorld).applyMatrix4(ne);const i=m.update(n),r=n.material;if(Array.isArray(r)){const o=i.groups;for(let e=0,t=o.length;e<t;e++){var a=o[e],l=r[a.materialIndex];l&&l.visible&&c.push(n,i,l,s,C.z,a)}}else r.visible&&c.push(n,i,r,s,C.z,null)}var h=n.children;for(let e=0,t=h.length;e<t;e++)i(h[e],r,s,o)}}(i,e,0,b.sortObjects),c.finish(),!0===b.sortObjects&&c.sort(Q,K),!0===te&&I.beginShadows();const r=w.state.shadowsArray;if(o.render(r,i,e),!0===te&&I.endShadows(),!0===this.info.autoReset&&this.info.reset(),g.render(c,i),w.setupLights(b.physicallyCorrectLights),e.isArrayCamera){const r=e.cameras;for(let e=0,t=r.length;e<t;e++){var n=r[e];_e(c,i,n,n.viewport)}}else _e(c,i,e);null!==M&&(z.updateMultisampleRenderTarget(M),z.updateRenderTargetMipmap(M)),!0===i.isScene&&i.onAfterRender(b,i,e),L.buffers.depth.setTest(!0),L.buffers.depth.setMask(!0),L.buffers.color.setMask(!0),L.setPolygonOffset(!1),y.resetDefaultState(),_=-1,S=null,s.pop(),w=0<s.length?s[s.length-1]:null,t.pop(),c=0<t.length?t[t.length-1]:null}},this.getActiveCubeFace=function(){return q},this.getActiveMipmapLevel=function(){return Y},this.getRenderTarget=function(){return M},this.setRenderTarget=function(t,e=0,i=0){M=t,q=e,Y=i,t&&void 0===P.get(t).__webglFramebuffer&&z.setupRenderTarget(t);let n=null,r=!1,s=!1;if(t){const i=t.texture;(i.isDataTexture3D||i.isDataTexture2DArray)&&(s=!0);var o=P.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=o[e],r=!0):n=t.isWebGLMultisampleRenderTarget?P.get(t).__webglMultisampledFramebuffer:o,u.copy(t.viewport),J.copy(t.scissor),Z=t.scissorTest}else u.copy(a).multiplyScalar(E).floor(),J.copy(l).multiplyScalar(E).floor(),Z=$;if(L.bindFramebuffer(36160,n)&&R.drawBuffers){let e=!1;if(t)if(t.isWebGLMultipleRenderTargets){const i=t.texture;if(h.length!==i.length||36064!==h[0]){for(let e=0,t=i.length;e<t;e++)h[e]=36064+e;h.length=i.length,e=!0}}else 1===h.length&&36064===h[0]||(h[0]=36064,h.length=1,e=!0);else 1===h.length&&1029===h[0]||(h[0]=1029,h.length=1,e=!0);e&&(R.isWebGL2?O.drawBuffers(h):d.get("WEBGL_draw_buffers").drawBuffersWEBGL(h))}if(L.viewport(u),L.scissor(J),L.setScissorTest(Z),r){const n=P.get(t.texture);O.framebufferTexture2D(36160,36064,34069+e,n.__webglTexture,i)}else if(s){const n=P.get(t.texture),r=e||0;O.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}_=-1},this.readRenderTargetPixels=function(t,i,n,r,s,o,a){if(t&&t.isWebGLRenderTarget){let e=P.get(t).__webglFramebuffer;if(e=t.isWebGLCubeRenderTarget&&void 0!==a?e[a]:e){L.bindFramebuffer(36160,e);try{const a=t.texture,e=a.format,h=a.type;var l;e!==Le&&v.convert(e)!==O.getParameter(35739)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):(l=h===at&&(d.has("EXT_color_buffer_half_float")||R.isWebGL2&&d.has("EXT_color_buffer_float")),h===et||v.convert(h)===O.getParameter(35738)||h===ot&&(R.isWebGL2||d.has("OES_texture_float")||d.has("WEBGL_color_buffer_float"))||l?36053===O.checkFramebufferStatus(36160)?0<=i&&i<=t.width-r&&0<=n&&n<=t.height-s&&O.readPixels(i,n,r,s,v.convert(e),v.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."))}finally{const t=null!==M?P.get(M).__webglFramebuffer:null;L.bindFramebuffer(36160,t)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,i=0){var n=Math.pow(2,-i),r=Math.floor(t.image.width*n),n=Math.floor(t.image.height*n);let s=v.convert(t.format);R.isWebGL2&&6408===(s=6407===s?32849:s)&&(s=32856),z.setTexture2D(t,0),O.copyTexImage2D(3553,i,s,e.x,e.y,r,n,0),L.unbindTexture()},this.copyTextureToTexture=function(e,t,i,n=0){var r=t.image.width,s=t.image.height,o=v.convert(i.format),a=v.convert(i.type);z.setTexture2D(i,0),O.pixelStorei(37440,i.flipY),O.pixelStorei(37441,i.premultiplyAlpha),O.pixelStorei(3317,i.unpackAlignment),t.isDataTexture?O.texSubImage2D(3553,n,e.x,e.y,r,s,o,a,t.image.data):t.isCompressedTexture?O.compressedTexSubImage2D(3553,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):O.texSubImage2D(3553,n,e.x,e.y,o,a,t.image),0===n&&i.generateMipmaps&&O.generateMipmap(3553),L.unbindTexture()},this.copyTextureToTexture3D=function(t,i,n,r,s=0){if(b.isWebGL1Renderer)console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");else{var o=t.max.x-t.min.x+1,a=t.max.y-t.min.y+1,l=t.max.z-t.min.z+1,h=v.convert(r.format),c=v.convert(r.type);let e;if(r.isDataTexture3D)z.setTexture3D(r,0),e=32879;else{if(!r.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");z.setTexture2DArray(r,0),e=35866}O.pixelStorei(37440,r.flipY),O.pixelStorei(37441,r.premultiplyAlpha),O.pixelStorei(3317,r.unpackAlignment);var u=O.getParameter(3314),d=O.getParameter(32878),p=O.getParameter(3316),m=O.getParameter(3315),f=O.getParameter(32877),g=n.isCompressedTexture?n.mipmaps[0]:n.image;O.pixelStorei(3314,g.width),O.pixelStorei(32878,g.height),O.pixelStorei(3316,t.min.x),O.pixelStorei(3315,t.min.y),O.pixelStorei(32877,t.min.z),n.isDataTexture||n.isDataTexture3D?O.texSubImage3D(e,s,i.x,i.y,i.z,o,a,l,h,c,g.data):n.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),O.compressedTexSubImage3D(e,s,i.x,i.y,i.z,o,a,l,h,g.data)):O.texSubImage3D(e,s,i.x,i.y,i.z,o,a,l,h,c,g),O.pixelStorei(3314,u),O.pixelStorei(32878,d),O.pixelStorei(3316,p),O.pixelStorei(3315,m),O.pixelStorei(32877,f),0===s&&r.generateMipmaps&&O.generateMipmap(e),L.unbindTexture()}},this.initTexture=function(e){z.setTexture2D(e,0),L.unbindTexture()},this.resetState=function(){q=0,Y=0,M=null,L.reset(),y.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}s.prototype.isWebGLRenderer=!0;class Ll extends s{}Ll.prototype.isWebGL1Renderer=!0;class Pl{constructor(e,t=25e-5){this.name="",this.color=new g(e),this.density=t}clone(){return new Pl(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Pl.prototype.isFogExp2=!0;class zl{constructor(e,t=1,i=1e3){this.name="",this.color=new g(e),this.near=t,this.far=i}clone(){return new zl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}zl.prototype.isFog=!0;class Dl extends u{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){e=super.toJSON(e);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}Dl.prototype.isScene=!0;class Il{constructor(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Ki,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fn()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(i,n,r){i*=this.stride,r*=n.stride;for(let e=0,t=this.stride;e<t;e++)this.array[i+e]=n.array[r+e];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=fn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);e=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),e=new this.constructor(e,this.stride);return e.setUsage(this.usage),e}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=fn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}Il.prototype.isInterleavedBuffer=!0;const o=new De;class Ol{constructor(e,t,i,n=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=!0===n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(i){for(let e=0,t=this.data.count;e<t;e++)o.x=this.getX(e),o.y=this.getY(e),o.z=this.getZ(e),o.applyMatrix4(i),this.setXYZ(e,o.x,o.y,o.z);return this}applyNormalMatrix(i){for(let e=0,t=this.count;e<t;e++)o.x=this.getX(e),o.y=this.getY(e),o.z=this.getZ(e),o.applyNormalMatrix(i),this.setXYZ(e,o.x,o.y,o.z);return this}transformDirection(i){for(let e=0,t=this.count;e<t;e++)o.x=this.getX(e),o.y=this.getY(e),o.z=this.getZ(e),o.transformDirection(i),this.setXYZ(e,o.x,o.y,o.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this.data.array[e+3]=r,this}clone(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new Ol(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){var i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new T(new this.array.constructor(t),this.itemSize,this.normalized)}}toJSON(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};{console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){var i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}}}Ol.prototype.isInterleavedBufferAttribute=!0;class Nl extends i{constructor(e){super(),this.type="SpriteMaterial",this.color=new g(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}let Bl;Nl.prototype.isSpriteMaterial=!0;const Fl=new De,Hl=new De,Ul=new De,Gl=new W,Wl=new W,kl=new Ie,Vl=new De,jl=new De,Xl=new De,ql=new W,Yl=new W,Jl=new W;class Zl extends u{constructor(e){if(super(),this.type="Sprite",void 0===Bl){Bl=new _;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Il(e,5);Bl.setIndex([0,1,2,0,2,3]),Bl.setAttribute("position",new Ol(t,3,0,!1)),Bl.setAttribute("uv",new Ol(t,2,3,!1))}this.geometry=Bl,this.material=void 0!==e?e:new Nl,this.center=new W(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Hl.setFromMatrixScale(this.matrixWorld),kl.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Ul.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Hl.multiplyScalar(-Ul.z);var i=this.material.rotation;let n,r;0!==i&&(r=Math.cos(i),n=Math.sin(i));var i=this.center,s=(Ql(Vl.set(-.5,-.5,0),Ul,i,Hl,n,r),Ql(jl.set(.5,-.5,0),Ul,i,Hl,n,r),Ql(Xl.set(.5,.5,0),Ul,i,Hl,n,r),ql.set(0,0),Yl.set(1,0),Jl.set(1,1),e.ray.intersectTriangle(Vl,jl,Xl,!1,Fl));null===s&&(Ql(jl.set(-.5,.5,0),Ul,i,Hl,n,r),Yl.set(0,1),null===(s=e.ray.intersectTriangle(Vl,Xl,jl,!1,Fl)))||(i=e.ray.origin.distanceTo(Fl))<e.near||i>e.far||t.push({distance:i,point:Fl.clone(),uv:p.getUV(Fl,Vl,jl,Xl,ql,Yl,Jl,new W),face:null,object:this})}copy(e){return super.copy(e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function Ql(e,t,i,n,r,s){Gl.subVectors(e,i).addScalar(.5).multiply(n),void 0!==r?(Wl.x=s*Gl.x-r*Gl.y,Wl.y=r*Gl.x+s*Gl.y):Wl.copy(Gl),e.copy(t),e.x+=Wl.x,e.y+=Wl.y,e.applyMatrix4(kl)}Zl.prototype.isSprite=!0;const Kl=new De,$l=new De;class eh extends u{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);var i=e.levels;for(let e=0,t=i.length;e<t;e++){var n=i[e];this.addLevel(n.object.clone(),n.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);var i=this.levels;let n;for(n=0;n<i.length&&!(t<i[n].distance);n++);return i.splice(n,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(i){var n=this.levels;if(0<n.length){let e,t;for(e=1,t=n.length;e<t&&!(i<n[e].distance);e++);return n[e-1].object}return null}raycast(e,t){var i;0<this.levels.length&&(Kl.setFromMatrixPosition(this.matrixWorld),i=e.ray.origin.distanceTo(Kl),this.getObjectForDistance(i).raycast(e,t))}update(i){var n=this.levels;if(1<n.length){Kl.setFromMatrixPosition(i.matrixWorld),$l.setFromMatrixPosition(this.matrixWorld);var r=Kl.distanceTo($l)/i.zoom;let e,t;for(n[0].object.visible=!0,e=1,t=n.length;e<t&&r>=n[e].distance;e++)n[e-1].object.visible=!1,n[e].object.visible=!0;for(this._currentLevel=e-1;e<t;e++)n[e].object.visible=!1}}toJSON(e){var i=super.toJSON(e),n=(!1===this.autoUpdate&&(i.object.autoUpdate=!1),i.object.levels=[],this.levels);for(let e=0,t=n.length;e<t;e++){var r=n[e];i.object.levels.push({object:r.object.uuid,distance:r.distance})}return i}}const th=new De,ih=new ze,nh=new ze,rh=new De,sh=new Ie;class oh extends S{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ie,this.bindMatrixInverse=new Ie}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){var i=new ze,n=this.geometry.attributes.skinWeight;for(let e=0,t=n.count;e<t;e++){i.x=n.getX(e),i.y=n.getY(e),i.z=n.getZ(e),i.w=n.getW(e);var r=1/i.manhattanLength();r!=1/0?i.multiplyScalar(r):i.set(1,0,0,0),n.setXYZW(e,i.x,i.y,i.z,i.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,n=this.geometry;ih.fromBufferAttribute(n.attributes.skinIndex,e),nh.fromBufferAttribute(n.attributes.skinWeight,e),th.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const n=nh.getComponent(e);var r;0!==n&&(r=ih.getComponent(e),sh.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),t.addScaledVector(rh.copy(th).applyMatrix4(sh),n))}return t.applyMatrix4(this.bindMatrixInverse)}}oh.prototype.isSkinnedMesh=!0;class ah extends u{constructor(){super(),this.type="Bone"}}ah.prototype.isBone=!0;class lh extends c{constructor(e=null,t=1,i=1,n,r,s,o,a,l=Re,h=Re,c,u){super(null,s,o,a,l,h,n,r,c,u),this.image={data:e,width:t,height:i},this.magFilter=l,this.minFilter=h,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}lh.prototype.isDataTexture=!0;const hh=new Ie,ch=new Ie;class uh{constructor(e=[],t=[]){this.uuid=fn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){var e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Ie)}}calculateInverses(){for(let e=this.boneInverses.length=0,t=this.bones.length;e<t;e++){var i=new Ie;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){var i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){var n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){var i=this.bones,n=this.boneInverses,r=this.boneMatrices,e=this.boneTexture;for(let e=0,t=i.length;e<t;e++){var s=i[e]?i[e].matrixWorld:ch;hh.multiplyMatrices(s,n[e]),hh.toArray(r,16*e)}null!==e&&(e.needsUpdate=!0)}clone(){return new uh(this.bones,this.boneInverses)}computeBoneTexture(){var e=wn(Math.sqrt(4*this.bones.length)),t=(e=Math.max(e,4),new Float32Array(e*e*4)),i=(t.set(this.boneMatrices),new lh(t,e,e,Le,ot));return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(i){for(let e=0,t=this.bones.length;e<t;e++){var n=this.bones[e];if(n.name===i)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(i,n){this.uuid=i.uuid;for(let t=0,e=i.bones.length;t<e;t++){var r=i.bones[t];let e=n[r];void 0===e&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),e=new ah),this.bones.push(e),this.boneInverses.push((new Ie).fromArray(i.boneInverses[t]))}return this.init(),this}toJSON(){var i={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]},n=(i.uuid=this.uuid,this.bones),r=this.boneInverses;for(let e=0,t=n.length;e<t;e++){var s=n[e],s=(i.bones.push(s.uuid),r[e]);i.boneInverses.push(s.toArray())}return i}}class dh extends T{constructor(e,t,i,n=1){"number"==typeof i&&(n=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){var e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}dh.prototype.isInstancedBufferAttribute=!0;const ph=new Ie,mh=new Ie,fh=[],gh=new S;class vh extends S{constructor(e,t,i){super(e,t),this.instanceMatrix=new dh(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,n){const r=this.matrixWorld,t=this.count;if(gh.geometry=this.geometry,gh.material=this.material,void 0!==gh.material)for(let i=0;i<t;i++){this.getMatrixAt(i,ph),mh.multiplyMatrices(r,ph),gh.matrixWorld=mh,gh.raycast(e,fh);for(let e=0,t=fh.length;e<t;e++){const r=fh[e];r.instanceId=i,r.object=this,n.push(r)}fh.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new dh(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}vh.prototype.isInstancedMesh=!0;class y extends i{constructor(e){super(),this.type="LineBasicMaterial",this.color=new g(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}y.prototype.isLineBasicMaterial=!0;const yh=new De,xh=new De,wh=new Ie,bh=new ur,Mh=new nr;class _h extends u{constructor(e=new _,t=new y){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){var i=e.attributes.position,n=[0];for(let e=1,t=i.count;e<t;e++)yh.fromBufferAttribute(i,e-1),xh.fromBufferAttribute(i,e),n[e]=n[e-1],n[e]+=yh.distanceTo(xh);e.setAttribute("lineDistance",new k(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(i,n){const e=this.geometry,r=this.matrixWorld,s=i.params.Line.threshold,o=e.drawRange;if(null===e.boundingSphere&&e.computeBoundingSphere(),Mh.copy(e.boundingSphere),Mh.applyMatrix4(r),Mh.radius+=s,!1!==i.ray.intersectsSphere(Mh)){wh.copy(r).invert(),bh.copy(i.ray).applyMatrix4(wh);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,h=new De,c=new De,u=new De,d=new De,p=this.isLineSegments?2:1;if(e.isBufferGeometry){const r=e.index,s=e.attributes.position;if(null!==r)for(let e=Math.max(0,o.start),t=Math.min(r.count,o.start+o.count)-1;e<t;e+=p){const o=r.getX(e),a=r.getX(e+1);if(h.fromBufferAttribute(s,o),c.fromBufferAttribute(s,a),!(bh.distanceSqToSegment(h,c,d,u)>l)){d.applyMatrix4(this.matrixWorld);const p=i.ray.origin.distanceTo(d);p<i.near||p>i.far||n.push({distance:p,point:u.clone().applyMatrix4(this.matrixWorld),index:e,face:null,faceIndex:null,object:this})}}else for(let e=Math.max(0,o.start),t=Math.min(s.count,o.start+o.count)-1;e<t;e+=p)if(h.fromBufferAttribute(s,e),c.fromBufferAttribute(s,e+1),!(bh.distanceSqToSegment(h,c,d,u)>l)){d.applyMatrix4(this.matrixWorld);const r=i.ray.origin.distanceTo(d);r<i.near||r>i.far||n.push({distance:r,point:u.clone().applyMatrix4(this.matrixWorld),index:e,face:null,faceIndex:null,object:this})}}else e.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){const i=this.geometry;if(i.isBufferGeometry){var e=i.morphAttributes,t=Object.keys(e);if(0<t.length){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){var n=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{e=i.morphTargets;void 0!==e&&0<e.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}_h.prototype.isLine=!0;const Sh=new De,Th=new De;class Eh extends _h{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){var i=e.attributes.position,n=[];for(let e=0,t=i.count;e<t;e+=2)Sh.fromBufferAttribute(i,e),Th.fromBufferAttribute(i,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+Sh.distanceTo(Th);e.setAttribute("lineDistance",new k(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Eh.prototype.isLineSegments=!0;class Ah extends _h{constructor(e,t){super(e,t),this.type="LineLoop"}}Ah.prototype.isLineLoop=!0;class Ch extends i{constructor(e){super(),this.type="PointsMaterial",this.color=new g(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}Ch.prototype.isPointsMaterial=!0;const Rh=new Ie,Lh=new ur,Ph=new nr,zh=new De;class Dh extends u{constructor(e=new _,t=new Ch){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(i,n){const e=this.geometry,r=this.matrixWorld,s=i.params.Points.threshold,o=e.drawRange;if(null===e.boundingSphere&&e.computeBoundingSphere(),Ph.copy(e.boundingSphere),Ph.applyMatrix4(r),Ph.radius+=s,!1!==i.ray.intersectsSphere(Ph)){Rh.copy(r).invert(),Lh.copy(i.ray).applyMatrix4(Rh);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(e.isBufferGeometry){const s=e.index,a=e.attributes.position;if(null!==s)for(let e=Math.max(0,o.start),t=Math.min(s.count,o.start+o.count);e<t;e++){const o=s.getX(e);zh.fromBufferAttribute(a,o),Ih(zh,o,l,r,i,n,this)}else for(let e=Math.max(0,o.start),t=Math.min(a.count,o.start+o.count);e<t;e++)zh.fromBufferAttribute(a,e),Ih(zh,e,l,r,i,n,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){const i=this.geometry;if(i.isBufferGeometry){var e=i.morphAttributes,t=Object.keys(e);if(0<t.length){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){var n=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{e=i.morphTargets;void 0!==e&&0<e.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function Ih(e,t,i,n,r,s,o){var a=Lh.distanceSqToPoint(e);if(a<i){const i=new De;Lh.closestPointToPoint(e,i),i.applyMatrix4(n);e=r.ray.origin.distanceTo(i);e<r.near||e>r.far||s.push({distance:e,distanceToRay:Math.sqrt(a),point:i,index:t,face:null,object:o})}}Dh.prototype.isPoints=!0;class Oh extends c{constructor(t,e,i,n,r,s,o,a,l){super(t,e,i,n,r,s,o,a,l),this.format=void 0!==o?o:pt,this.minFilter=void 0!==s?s:F,this.magFilter=void 0!==r?r:F,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(function e(){h.needsUpdate=!0,t.requestVideoFrameCallback(e)})}clone(){return new this.constructor(this.image).copy(this)}update(){var e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Oh.prototype.isVideoTexture=!0;class Nh extends c{constructor(e,t,i,n,r,s,o,a,l,h,c,u){super(null,s,o,a,l,h,n,r,c,u),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}Nh.prototype.isCompressedTexture=!0;class Bh extends c{constructor(e,t,i,n,r,s,o,a,l){super(e,t,i,n,r,s,o,a,l),this.needsUpdate=!0}}Bh.prototype.isCanvasTexture=!0;class Fh extends c{constructor(e,t,i,n,r,s,o,a,l,h){if((h=void 0!==h?h:vt)!==vt&&h!==yt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,n,r,s,o,a,h,i=void 0===(i=void 0===i&&h===vt?nt:i)&&h===yt?ut:i,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:Re,this.minFilter=void 0!==a?a:Re,this.flipY=!1,this.generateMipmaps=!1}}Fh.prototype.isDepthTexture=!0;class Hh extends _{constructor(i=1,n=8,r=0,s=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:i,segments:n,thetaStart:r,thetaLength:s},n=Math.max(3,n);var t=[],o=[],a=[],l=[],h=new De,c=new W;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let e=0,t=3;e<=n;e++,t+=3){var u=r+e/n*s;h.x=i*Math.cos(u),h.y=i*Math.sin(u),o.push(h.x,h.y,h.z),a.push(0,0,1),c.x=(o[t]/i+1)/2,c.y=(o[t+1]/i+1)/2,l.push(c.x,c.y)}for(let e=1;e<=n;e++)t.push(e,e+1,0);this.setIndex(t),this.setAttribute("position",new k(o,3)),this.setAttribute("normal",new k(a,3)),this.setAttribute("uv",new k(l,2))}static fromJSON(e){return new Hh(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Uh extends _{constructor(h=1,c=1,n=1,u=8,r=1,e=!1,d=0,p=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:h,radiusBottom:c,height:n,radialSegments:u,heightSegments:r,openEnded:e,thetaStart:d,thetaLength:p};const m=this,f=(u=Math.floor(u),r=Math.floor(r),[]),g=[],v=[],y=[];let x=0;const s=[],w=n/2;let b=0;function t(t){const i=x,n=new W,r=new De;let s=0;var o=!0===t?h:c,a=!0===t?1:-1;for(let e=1;e<=u;e++)g.push(0,w*a,0),v.push(0,a,0),y.push(.5,.5),x++;var l=x;for(let e=0;e<=u;e++){const c=e/u*p+d,t=Math.cos(c),i=Math.sin(c);r.x=o*i,r.y=w*a,r.z=o*t,g.push(r.x,r.y,r.z),v.push(0,a,0),n.x=.5*t+.5,n.y=.5*i*a+.5,y.push(n.x,n.y),x++}for(let e=0;e<u;e++){const c=i+e,u=l+e;!0===t?f.push(u,u+1,c):f.push(u+1,u,c),s+=3}m.addGroup(b,s,!0===t?1:2),b+=s}{const a=new De,l=new De;let i=0;var o=(c-h)/n;for(let e=0;e<=r;e++){const f=[],b=e/r,t=b*(c-h)+h;for(let e=0;e<=u;e++){const c=e/u,r=c*p+d,m=Math.sin(r),s=Math.cos(r);l.x=t*m,l.y=-b*n+w,l.z=t*s,g.push(l.x,l.y,l.z),a.set(m,o,s).normalize(),v.push(a.x,a.y,a.z),y.push(c,1-b),f.push(x++)}s.push(f)}for(let t=0;t<u;t++)for(let e=0;e<r;e++){const n=s[e][t],u=s[e+1][t],r=s[e+1][t+1],a=s[e][t+1];f.push(n,u,a),f.push(u,r,a),i+=6}m.addGroup(b,i,0),b+=i}!1===e&&(0<h&&t(!0),0<c)&&t(!1),this.setIndex(f),this.setAttribute("position",new k(g,3)),this.setAttribute("normal",new k(v,3)),this.setAttribute("uv",new k(y,2))}static fromJSON(e){return new Uh(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Gh extends Uh{constructor(e=1,t=1,i=8,n=1,r=!1,s=0,o=2*Math.PI){super(0,e,t,i,n,r,s,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:s,thetaLength:o}}static fromJSON(e){return new Gh(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Wh extends _{constructor(i=[],t=[],e=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:i,indices:t,radius:e,detail:n};const r=[],s=[];function o(e){r.push(e.x,e.y,e.z)}function a(e,t){e*=3;t.x=i[0+e],t.y=i[1+e],t.z=i[2+e]}function l(e,t,i,n){n<0&&1===e.x&&(s[t]=e.x-1),0===i.x&&0===i.z&&(s[t]=n/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}var c=n,u=new De,d=new De,p=new De;for(let e=0;e<t.length;e+=3){a(t[e+0],u),a(t[e+1],d),a(t[e+2],p);{m=void 0;f=void 0;g=void 0;v=void 0;y=void 0;x=void 0;var m=u;var f=d;var g=p;var v=c;var y=v+1,x=[];for(let t=0;t<=y;t++){x[t]=[];const I=m.clone().lerp(g,t/y),o=f.clone().lerp(g,t/y),O=y-t;for(let e=0;e<=O;e++)x[t][e]=0===e&&t===y?I:I.clone().lerp(o,e/O)}for(let t=0;t<y;t++)for(let e=0;e<2*(y-t)-1;e++){const g=Math.floor(e/2);e%2==0?(o(x[t][g+1]),o(x[t+1][g]),o(x[t][g])):(o(x[t][g+1]),o(x[t+1][g+1]),o(x[t+1][g]))}}}var w=e,b=new De;for(let e=0;e<r.length;e+=3)b.x=r[e+0],b.y=r[e+1],b.z=r[e+2],b.normalize().multiplyScalar(w),r[e+0]=b.x,r[e+1]=b.y,r[e+2]=b.z;var M=new De;for(let e=0;e<r.length;e+=3){M.x=r[e+0],M.y=r[e+1],M.z=r[e+2];var N=h(M)/2/Math.PI+.5,B=Math.atan2(-M.y,Math.sqrt(M.x*M.x+M.z*M.z))/Math.PI+.5;s.push(N,1-B)}var _=new De,S=new De,T=new De,E=new De,A=new W,C=new W,R=new W;for(let e=0,t=0;e<r.length;e+=9,t+=6){_.set(r[e+0],r[e+1],r[e+2]),S.set(r[e+3],r[e+4],r[e+5]),T.set(r[e+6],r[e+7],r[e+8]),A.set(s[t+0],s[t+1]),C.set(s[t+2],s[t+3]),R.set(s[t+4],s[t+5]),E.copy(_).add(S).add(T).divideScalar(3);var L=h(E);l(A,t+0,_,L),l(C,t+2,S,L),l(R,t+4,T,L)}for(let e=0;e<s.length;e+=6){var P=s[e+0],z=s[e+2],D=s[e+4],F=Math.max(P,z,D),H=Math.min(P,z,D);.9<F&&H<.1&&(P<.2&&(s[e+0]+=1),z<.2&&(s[e+2]+=1),D<.2)&&(s[e+4]+=1)}this.setAttribute("position",new k(r,3)),this.setAttribute("normal",new k(r.slice(),3)),this.setAttribute("uv",new k(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new Wh(e.vertices,e.indices,e.radius,e.details)}}class kh extends Wh{constructor(e=1,t=0){var i=(1+Math.sqrt(5))/2,n=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new kh(e.radius,e.detail)}}const Vh=new De,jh=new De,Xh=new De,qh=new p;class Yh extends _{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){var i=Math.pow(10,4),n=Math.cos(dn*t),r=e.getIndex(),s=e.getAttribute("position"),o=(r||s).count,a=[0,0,0],l=["a","b","c"],h=new Array(3),c={},u=[];for(let e=0;e<o;e+=3){r?(a[0]=r.getX(e),a[1]=r.getX(e+1),a[2]=r.getX(e+2)):(a[0]=e,a[1]=e+1,a[2]=e+2);const{a:t,b:d,c:p}=qh;if(t.fromBufferAttribute(s,a[0]),d.fromBufferAttribute(s,a[1]),p.fromBufferAttribute(s,a[2]),qh.getNormal(Xh),h[0]=`${Math.round(t.x*i)},${Math.round(t.y*i)},`+Math.round(t.z*i),h[1]=`${Math.round(d.x*i)},${Math.round(d.y*i)},`+Math.round(d.z*i),h[2]=`${Math.round(p.x*i)},${Math.round(p.y*i)},`+Math.round(p.z*i),h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let e=0;e<3;e++){const t=(e+1)%3,m=h[e],f=h[t],g=qh[l[e]],v=qh[l[t]],y=m+"_"+f,x=f+"_"+m;x in c&&c[x]?(Xh.dot(c[x].normal)<=n&&(u.push(g.x,g.y,g.z),u.push(v.x,v.y,v.z)),c[x]=null):y in c||(c[y]={index0:a[e],index1:a[t],normal:Xh.clone()})}}for(const e in c)if(c[e]){const{index0:t,index1:w}=c[e];Vh.fromBufferAttribute(s,t),jh.fromBufferAttribute(s,w),u.push(Vh.x,Vh.y,Vh.z),u.push(jh.x,jh.y,jh.z)}this.setAttribute("position",new k(u,3))}}}class Jh{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){e=this.getUtoTmapping(e);return this.getPoint(e,t)}getPoints(t=5){var i=[];for(let e=0;e<=t;e++)i.push(this.getPoint(e/t));return i}getSpacedPoints(t=5){var i=[];for(let e=0;e<=t;e++)i.push(this.getPointAt(e/t));return i}getLength(){var e=this.getLengths();return e[e.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var i=[];let n,r=this.getPoint(0),s=0;i.push(0);for(let e=1;e<=t;e++)n=this.getPoint(e/t),s+=n.distanceTo(r),i.push(s),r=n;return this.cacheArcLengths=i}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){var i=this.getLengths();let n=0;var r=i.length,s=t||e*i[r-1];let o,a=0,l=r-1;for(;a<=l;)if((o=i[n=Math.floor(a+(l-a)/2)]-s)<0)a=n+1;else{if(!(0<o)){l=n;break}l=n-1}return i[n=l]===s?n/(r-1):(t=i[n],(n+(s-t)/(i[n+1]-t))/(r-1))}getTangent(e,t){let i=e-1e-4,n=e+1e-4;i<0&&(i=0),1<n&&(n=1);var e=this.getPoint(i),r=this.getPoint(n),t=t||new(e.isVector2?W:De);return t.copy(r).sub(e).normalize(),t}getTangentAt(e,t){e=this.getUtoTmapping(e);return this.getTangent(e,t)}computeFrenetFrames(i,e){const t=new De,n=[],r=[],s=[],o=new De,a=new Ie;for(let e=0;e<=i;e++){const t=e/i;n[e]=this.getTangentAt(t,new De)}r[0]=new De,s[0]=new De;let l=Number.MAX_VALUE;var h=Math.abs(n[0].x),c=Math.abs(n[0].y),u=Math.abs(n[0].z);h<=l&&(l=h,t.set(1,0,0)),c<=l&&(l=c,t.set(0,1,0)),u<=l&&t.set(0,0,1),o.crossVectors(n[0],t).normalize(),r[0].crossVectors(n[0],o),s[0].crossVectors(n[0],r[0]);for(let e=1;e<=i;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(n[e-1],n[e]),o.length()>Number.EPSILON){o.normalize();const i=Math.acos(gn(n[e-1].dot(n[e]),-1,1));r[e].applyMatrix4(a.makeRotationAxis(o,i))}s[e].crossVectors(n[e],r[e])}if(!0===e){let t=Math.acos(gn(r[0].dot(r[i]),-1,1));t/=i,0<n[0].dot(o.crossVectors(r[0],r[i]))&&(t=-t);for(let e=1;e<=i;e++)r[e].applyMatrix4(a.makeRotationAxis(n[e],t*e)),s[e].crossVectors(n[e],r[e])}return{tangents:n,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Zh extends Jh{constructor(e=0,t=0,i=1,n=1,r=0,s=2*Math.PI,o=!1,a=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(e,t){const i=t||new W,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;for(t=Math.abs(r)<Number.EPSILON;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=t?0:n),!0!==this.aClockwise||t||(r===n?r=-n:r-=n);t=this.aStartAngle+e*r;let s=this.aX+this.xRadius*Math.cos(t),o=this.aY+this.yRadius*Math.sin(t);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),i=s-this.aX,n=o-this.aY;s=i*e-n*t+this.aX,o=i*t+n*e+this.aY}return i.set(s,o)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){var e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}Zh.prototype.isEllipseCurve=!0;class Qh extends Zh{constructor(e,t,i,n,r,s){super(e,t,i,i,n,r,s),this.type="ArcCurve"}}function Kh(){let r=0,s=0,o=0,a=0;function l(e,t,i,n){r=e,s=i,o=-3*e+3*t-2*i-n,a=2*e-2*t+i+n}return{initCatmullRom:function(e,t,i,n,r){l(t,i,r*(i-e),r*(n-t))},initNonuniformCatmullRom:function(e,t,i,n,r,s,o){e=(t-e)/r-(i-e)/(r+s)+(i-t)/s,r=(i-t)/s-(n-t)/(s+o)+(n-i)/o;l(t,i,e*=s,r*=s)},calc:function(e){var t=e*e;return r+s*e+o*t+a*(t*e)}}}Qh.prototype.isArcCurve=!0;const $h=new De,ec=new Kh,tc=new Kh,ic=new Kh;class nc extends Jh{constructor(e=[],t=!1,i="centripetal",n=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=n}getPoint(n,e=new De){var t=this.points,i=t.length,n=(i-(this.closed?0:1))*n;let r,s,o=Math.floor(n),a=n-o;this.closed?o+=0<o?0:(Math.floor(Math.abs(o)/i)+1)*i:0===a&&o===i-1&&(o=i-2,a=1),r=this.closed||0<o?t[(o-1)%i]:($h.subVectors(t[0],t[1]).add(t[0]),$h);var l=t[o%i],h=t[(o+1)%i];if(s=this.closed||o+2<i?t[(o+2)%i]:($h.subVectors(t[i-1],t[i-2]).add(t[i-1]),$h),"centripetal"===this.curveType||"chordal"===this.curveType){const n="chordal"===this.curveType?.5:.25;let e=Math.pow(r.distanceToSquared(l),n),t=Math.pow(l.distanceToSquared(h),n),i=Math.pow(h.distanceToSquared(s),n);t<1e-4&&(t=1),e<1e-4&&(e=t),i<1e-4&&(i=t),ec.initNonuniformCatmullRom(r.x,l.x,h.x,s.x,e,t,i),tc.initNonuniformCatmullRom(r.y,l.y,h.y,s.y,e,t,i),ic.initNonuniformCatmullRom(r.z,l.z,h.z,s.z,e,t,i)}else"catmullrom"===this.curveType&&(ec.initCatmullRom(r.x,l.x,h.x,s.x,this.tension),tc.initCatmullRom(r.y,l.y,h.y,s.y,this.tension),ic.initCatmullRom(r.z,l.z,h.z,s.z,this.tension));return e.set(ec.calc(a),tc.calc(a),ic.calc(a)),e}copy(i){super.copy(i),this.points=[];for(let e=0,t=i.points.length;e<t;e++){var n=i.points[e];this.points.push(n.clone())}return this.closed=i.closed,this.curveType=i.curveType,this.tension=i.tension,this}toJSON(){var i=super.toJSON();i.points=[];for(let e=0,t=this.points.length;e<t;e++){var n=this.points[e];i.points.push(n.toArray())}return i.closed=this.closed,i.curveType=this.curveType,i.tension=this.tension,i}fromJSON(i){super.fromJSON(i),this.points=[];for(let e=0,t=i.points.length;e<t;e++){var n=i.points[e];this.points.push((new De).fromArray(n))}return this.closed=i.closed,this.curveType=i.curveType,this.tension=i.tension,this}}function rc(e,t,i,n,r){var t=.5*(n-t),r=.5*(r-i),s=e*e;return e*s*(2*i-2*n+t+r)+(-3*i+3*n-2*t-r)*s+t*e+i}function sc(e,t,i,n){return(r=1-e)*r*t+2*(1-e)*e*i+e*e*n;var r}function oc(e,t,i,n,r){return(s=1-e)*s*s*t+3*(s=1-e)*s*e*i+3*(1-e)*e*e*n+e*e*e*r;var s}nc.prototype.isCatmullRomCurve3=!0;class ac extends Jh{constructor(e=new W,t=new W,i=new W,n=new W){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e,t=new W){var i=this.v0,n=this.v1,r=this.v2,s=this.v3;return t.set(oc(e,i.x,n.x,r.x,s.x),oc(e,i.y,n.y,r.y,s.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){var e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}ac.prototype.isCubicBezierCurve=!0;class lc extends Jh{constructor(e=new De,t=new De,i=new De,n=new De){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e,t=new De){var i=this.v0,n=this.v1,r=this.v2,s=this.v3;return t.set(oc(e,i.x,n.x,r.x,s.x),oc(e,i.y,n.y,r.y,s.y),oc(e,i.z,n.z,r.z,s.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){var e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}lc.prototype.isCubicBezierCurve3=!0;class hc extends Jh{constructor(e=new W,t=new W){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new W){return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){t=t||new W;return t.copy(this.v2).sub(this.v1).normalize(),t}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){var e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}hc.prototype.isLineCurve=!0;class cc extends Jh{constructor(e=new De,t=new De){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new De){return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){var e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class uc extends Jh{constructor(e=new W,t=new W,i=new W){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new W){var i=this.v0,n=this.v1,r=this.v2;return t.set(sc(e,i.x,n.x,r.x),sc(e,i.y,n.y,r.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){var e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}uc.prototype.isQuadraticBezierCurve=!0;class dc extends Jh{constructor(e=new De,t=new De,i=new De){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new De){var i=this.v0,n=this.v1,r=this.v2;return t.set(sc(e,i.x,n.x,r.x),sc(e,i.y,n.y,r.y),sc(e,i.z,n.z,r.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){var e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}dc.prototype.isQuadraticBezierCurve3=!0;class pc extends Jh{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new W){var i=this.points,e=(i.length-1)*e,n=Math.floor(e),e=e-n,r=i[0===n?n:n-1],s=i[n],o=i[n>i.length-2?i.length-1:n+1],i=i[n>i.length-3?i.length-1:n+2];return t.set(rc(e,r.x,s.x,o.x,i.x),rc(e,r.y,s.y,o.y,i.y)),t}copy(i){super.copy(i),this.points=[];for(let e=0,t=i.points.length;e<t;e++){var n=i.points[e];this.points.push(n.clone())}return this}toJSON(){var i=super.toJSON();i.points=[];for(let e=0,t=this.points.length;e<t;e++){var n=this.points[e];i.points.push(n.toArray())}return i}fromJSON(i){super.fromJSON(i),this.points=[];for(let e=0,t=i.points.length;e<t;e++){var n=i.points[e];this.points.push((new W).fromArray(n))}return this}}pc.prototype.isSplineCurve=!0;var mc=Object.freeze({__proto__:null,ArcCurve:Qh,CatmullRomCurve3:nc,CubicBezierCurve:ac,CubicBezierCurve3:lc,EllipseCurve:Zh,LineCurve:hc,LineCurve3:cc,QuadraticBezierCurve:uc,QuadraticBezierCurve3:dc,SplineCurve:pc});class fc extends Jh{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new hc(t,e))}getPoint(e,t){var i=e*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=i){const e=n[r]-i,s=this.curves[r],o=s.getLength(),a=0===o?0:1-e/o;return s.getPointAt(a,t)}r++}return null}getLength(){var e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;var i=[];let n=0;for(let e=0,t=this.curves.length;e<t;e++)n+=this.curves[e].getLength(),i.push(n);return this.cacheLengths=i}getSpacedPoints(t=40){var i=[];for(let e=0;e<=t;e++)i.push(this.getPoint(e/t));return this.autoClose&&i.push(i[0]),i}getPoints(i=12){var n=[];let r;for(let e=0,t=this.curves;e<t.length;e++){var s=t[e],o=s&&s.isEllipseCurve?2*i:s&&(s.isLineCurve||s.isLineCurve3)?1:s&&s.isSplineCurve?i*s.points.length:i,a=s.getPoints(o);for(let e=0;e<a.length;e++){var l=a[e];r&&r.equals(l)||(n.push(l),r=l)}}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(i){super.copy(i),this.curves=[];for(let e=0,t=i.curves.length;e<t;e++){var n=i.curves[e];this.curves.push(n.clone())}return this.autoClose=i.autoClose,this}toJSON(){var i=super.toJSON();i.autoClose=this.autoClose,i.curves=[];for(let e=0,t=this.curves.length;e<t;e++){var n=this.curves[e];i.curves.push(n.toJSON())}return i}fromJSON(i){super.fromJSON(i),this.autoClose=i.autoClose,this.curves=[];for(let e=0,t=i.curves.length;e<t;e++){var n=i.curves[e];this.curves.push((new mc[n.type]).fromJSON(n))}return this}}class gc extends fc{constructor(e){super(),this.type="Path",this.currentPoint=new W,e&&this.setFromPoints(e)}setFromPoints(i){this.moveTo(i[0].x,i[0].y);for(let e=1,t=i.length;e<t;e++)this.lineTo(i[e].x,i[e].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){var i=new hc(this.currentPoint.clone(),new W(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,n){e=new uc(this.currentPoint.clone(),new W(e,t),new W(i,n));return this.curves.push(e),this.currentPoint.set(i,n),this}bezierCurveTo(e,t,i,n,r,s){e=new ac(this.currentPoint.clone(),new W(e,t),new W(i,n),new W(r,s));return this.curves.push(e),this.currentPoint.set(r,s),this}splineThru(e){var t=[this.currentPoint.clone()].concat(e),t=new pc(t);return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,n,r,s){var o=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(e+o,t+a,i,n,r,s),this}absarc(e,t,i,n,r,s){return this.absellipse(e,t,i,i,n,r,s),this}ellipse(e,t,i,n,r,s,o,a){var l=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+l,t+h,i,n,r,s,o,a),this}absellipse(e,t,i,n,r,s,o,a){t=new Zh(e,t,i,n,r,s,o,a);if(0<this.curves.length){const e=t.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(t);e=t.getPoint(1);return this.currentPoint.copy(e),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){var e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class vc extends gc{constructor(e){super(e),this.uuid=fn(),this.type="Shape",this.holes=[]}getPointsHoles(i){var n=[];for(let e=0,t=this.holes.length;e<t;e++)n[e]=this.holes[e].getPoints(i);return n}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(i){super.copy(i),this.holes=[];for(let e=0,t=i.holes.length;e<t;e++){var n=i.holes[e];this.holes.push(n.clone())}return this}toJSON(){var i=super.toJSON();i.uuid=this.uuid,i.holes=[];for(let e=0,t=this.holes.length;e<t;e++){var n=this.holes[e];i.holes.push(n.toJSON())}return i}fromJSON(i){super.fromJSON(i),this.uuid=i.uuid,this.holes=[];for(let e=0,t=i.holes.length;e<t;e++){var n=i.holes[e];this.holes.push((new gc).fromJSON(n))}return this}}function yc(a,l,h=2){var c=l&&l.length,u=c?l[0]*h:a.length;let d=xc(a,0,u,h,!0);var p=[];if(d&&d.next!==d.prev){let t,i,n,r,s,o,e;if(c&&(d=function(e,t,i,n){var r,s,o=[];let a,l,h,c,u;for(a=0,l=t.length;a<l;a++)h=t[a]*n,c=a<l-1?t[a+1]*n:e.length,(u=xc(e,h,c,n,!1))===u.next&&(u.steiner=!0),o.push(function(e){let t=e,i=e;for(;(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next,t!==e;);return i}(u));for(o.sort(Mc),a=0;a<o.length;a++)r=o[a],(s=function(i,e){let n=e;var r=i.x,s=i.y;let o,a=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){const i=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(i<=r&&i>a){if((a=i)===r){if(s===n.y)return n;if(s===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}}while((n=n.next)!==e);if(!o)return null;if(r!==a){var l,h,c=o,u=o.x,d=o.y;let e,t=1/0;for(n=o;r>=n.x&&n.x>=u&&r!==n.x&&Sc(s<d?r:a,s,u,d,s<d?a:r,s,n.x,n.y)&&(e=Math.abs(s-n.y)/(r-n.x),Rc(n,i))&&(e<t||e===t&&(n.x>o.x||n.x===o.x&&(l=o,h=n,f(l.prev,l,h.prev)<0)&&f(h.next,l,l.next)<0))&&(o=n,t=e),(n=n.next)!==c;);}return o}(r,s=i))&&(r=Lc(s,r),wc(s,s.next),wc(r,r.next)),i=wc(i,i.next);return i}(a,l,d,h)),a.length>80*h){t=n=a[0],i=r=a[1];for(let e=h;e<u;e+=h)s=a[e],o=a[e+1],s<t&&(t=s),o<i&&(i=o),s>n&&(n=s),o>r&&(r=o);e=0!==(e=Math.max(n-t,r-i))?1/e:0}bc(d,p,h,t,i,e)}return p}function xc(e,o,t,i,n){let r,s;if(n===0<function(i,n,r){let s=0;for(let e=o,t=n-r;e<n;e+=r)s+=(i[t]-i[e])*(i[e+1]+i[t+1]),t=e;return s}(e,t,i))for(r=o;r<t;r+=i)s=Pc(r,e[r],e[r+1],s);else for(r=t-i;r>=o;r-=i)s=Pc(r,e[r],e[r+1],s);return s&&Tc(s,s.next)&&(zc(s),s=s.next),s}function wc(e,t){if(!e)return e;t=t||e;let i,n=e;do{if(i=!1,n.steiner||!Tc(n,n.next)&&0!==f(n.prev,n,n.next))n=n.next;else{if(zc(n),(n=t=n.prev)===n.next)break;i=!0}}while(i||n!==t);return t}function bc(n,r,s,o,a,l,h){if(n){if(!h&&l){var c=n;var u=o;var d=a;var p=l;let h=c;for(;null===h.z&&(h.z=_c(h.x,h.y,u,d,p)),h.prevZ=h.prev,h.nextZ=h.next,(h=h.next)!==c;);h.prevZ.nextZ=null,h.prevZ=null;{var m=h;let e,t,i,n,r,s,o,a,l=1;do{for(t=m,m=null,r=null,s=0;t;){for(s++,i=t,o=0,e=0;e<l&&(o++,i=i.nextZ);e++);for(a=l;0<o||0<a&&i;)0!==o&&(0===a||!i||t.z<=i.z)?(t=(n=t).nextZ,o--):(i=(n=i).nextZ,a--),r?r.nextZ=n:m=n,n.prevZ=r,r=n;t=i}}while(r.nextZ=null,l*=2,1<s)}}let e,t,i=n;for(;n.prev!==n.next;)if(e=n.prev,t=n.next,l?function(e,t,i,n){var r=e.prev,s=e,o=e.next;if(0<=f(r,s,o))return;var a=(r.x<s.x?r.x<o.x?r:o:s.x<o.x?s:o).x,l=(r.y<s.y?r.y<o.y?r:o:s.y<o.y?s:o).y,h=(r.x>s.x?r.x>o.x?r:o:s.x>o.x?s:o).x,c=(r.y>s.y?r.y>o.y?r:o:s.y>o.y?s:o).y,u=_c(a,l,t,i,n),d=_c(h,c,t,i,n);let p=e.prevZ,m=e.nextZ;for(;p&&p.z>=u&&m&&m.z<=d;){if(p!==e.prev&&p!==e.next&&Sc(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&0<=f(p.prev,p,p.next))return;if(p=p.prevZ,m!==e.prev&&m!==e.next&&Sc(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&0<=f(m.prev,m,m.next))return;m=m.nextZ}for(;p&&p.z>=u;){if(p!==e.prev&&p!==e.next&&Sc(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&0<=f(p.prev,p,p.next))return;p=p.prevZ}for(;m&&m.z<=d;){if(m!==e.prev&&m!==e.next&&Sc(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&0<=f(m.prev,m,m.next))return;m=m.nextZ}return 1}(n,o,a,l):function(e){var t=e.prev,i=e,n=e.next;if(0<=f(t,i,n))return;let r=e.next.next;for(;r!==e.prev;){if(Sc(t.x,t.y,i.x,i.y,n.x,n.y,r.x,r.y)&&0<=f(r.prev,r,r.next))return;r=r.next}return 1}(n))r.push(e.i/s),r.push(n.i/s),r.push(t.i/s),zc(n),n=t.next,i=t.next;else if((n=t)===i){h?1===h?bc(n=function(e,t,i){let n=e;do{var r=n.prev,s=n.next.next;!Tc(r,s)&&Ec(r,n,n.next,s)&&Rc(r,s)&&Rc(s,r)&&(t.push(r.i/i),t.push(n.i/i),t.push(s.i/i),zc(n),zc(n.next),n=e=s),n=n.next}while(n!==e);return wc(n)}(wc(n),r,s),r,s,o,a,l,2):2===h&&function(e,t,i,n,r,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){var a;if(o.i!==e.i&&function(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&Ec(i,i.next,e,t))return 1}while((i=i.next)!==e)}(e,t)&&(Rc(e,t)&&Rc(t,e)&&function(e,t){let i=e,n=!1;for(var r=(e.x+t.x)/2,s=(e.y+t.y)/2;i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),(i=i.next)!==e;);return n}(e,t)&&(f(e.prev,e,t.prev)||f(e,t.prev,t))||Tc(e,t)&&0<f(e.prev,e,e.next)&&0<f(t.prev,t,t.next))}(o,e))return a=Lc(o,e),o=wc(o,o.next),a=wc(a,a.next),bc(o,t,i,n,r,s),bc(a,t,i,n,r,s);e=e.next}}while(o=o.next,o!==e)}(n,r,s,o,a,l):bc(wc(n),r,s,o,a,l,1);break}}}function Mc(e,t){return e.x-t.x}function _c(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Sc(e,t,i,n,r,s,o,a){return 0<=(r-o)*(t-a)-(e-o)*(s-a)&&0<=(e-o)*(n-a)-(i-o)*(t-a)&&0<=(i-o)*(s-a)-(r-o)*(n-a)}function f(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function Tc(e,t){return e.x===t.x&&e.y===t.y}function Ec(e,t,i,n){var r=Cc(f(e,t,i)),s=Cc(f(e,t,n)),o=Cc(f(i,n,e)),a=Cc(f(i,n,t));return r!==s&&o!==a||0===r&&Ac(e,i,t)||0===s&&Ac(e,n,t)||0===o&&Ac(i,e,n)||0===a&&Ac(i,t,n)}function Ac(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function Cc(e){return 0<e?1:e<0?-1:0}function Rc(e,t){return f(e.prev,e,e.next)<0?0<=f(e,t,e.next)&&0<=f(e,e.prev,t):f(e,t,e.prev)<0||f(e,e.next,t)<0}function Lc(e,t){var i=new Dc(e.i,e.x,e.y),n=new Dc(t.i,t.x,t.y),r=e.next,s=t.prev;return(e.next=t).prev=e,(i.next=r).prev=i,(n.next=i).prev=n,(s.next=n).prev=s,n}function Pc(e,t,i,n){e=new Dc(e,t,i);return n?(e.next=n.next,(e.prev=n).next.prev=e,n.next=e):(e.prev=e).next=e,e}function zc(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 Dc(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Ic{static area(i){var n=i.length;let r=0;for(let e=n-1,t=0;t<n;e=t++)r+=i[e].x*i[t].y-i[t].x*i[e].y;return.5*r}static isClockWise(e){return Ic.area(e)<0}static triangulateShape(e,t){var i=[],n=[],r=[];Oc(e),Nc(i,e);let s=e.length;t.forEach(Oc);for(let e=0;e<t.length;e++)n.push(s),s+=t[e].length,Nc(i,t[e]);var o=yc(i,n);for(let e=0;e<o.length;e+=3)r.push(o.slice(e,e+3));return r}}function Oc(e){var t=e.length;2<t&&e[t-1].equals(e[0])&&e.pop()}function Nc(t,i){for(let e=0;e<i.length;e++)t.push(i[e].x),t.push(i[e].y)}class Bc extends _{constructor(i=new vc([new W(.5,.5),new W(-.5,.5),new W(-.5,-.5),new W(.5,-.5)]),F={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:i,options:F},i=Array.isArray(i)?i:[i];const H=this,U=[],G=[];for(let e=0,t=i.length;e<t;e++)!function(e){const n=[],N=void 0!==F.curveSegments?F.curveSegments:12,u=void 0!==F.steps?F.steps:1;let i=void 0!==F.depth?F.depth:1,r=void 0===F.bevelEnabled||F.bevelEnabled,t=void 0!==F.bevelThickness?F.bevelThickness:.2,s=void 0!==F.bevelSize?F.bevelSize:t-.1,o=void 0!==F.bevelOffset?F.bevelOffset:0,d=void 0!==F.bevelSegments?F.bevelSegments:3;const a=F.extrudePath,p=void 0!==F.UVGenerator?F.UVGenerator:Fc;void 0!==F.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),i=F.amount);let l,h,c,m,f,g=!1;a&&(l=a.getSpacedPoints(u),g=!0,r=!1,h=a.computeFrenetFrames(u,!1),c=new De,m=new De,f=new De),r||(d=0,t=0,s=0,o=0);e=e.extractPoints(N);let v=e.shape;const y=e.holes;if(!Ic.isClockWise(v)){v=v.reverse();for(let e=0,t=y.length;e<t;e++){const F=y[e];Ic.isClockWise(F)&&(y[e]=F.reverse())}}const x=Ic.triangulateShape(v,y),w=v;for(let e=0,t=y.length;e<t;e++){const F=y[e];v=v.concat(F)}function b(e,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(e)}const M=v.length,_=x.length;function S(e,t,i){let n,r,s;const o=e.x-t.x,a=e.y-t.y,l=i.x-e.x,h=i.y-e.y,c=o*o+a*a,u=o*h-a*l;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(c),d=Math.sqrt(l*l+h*h),p=t.x-a/u,m=t.y+o/u,f=((i.x-h/d-p)*h-(i.y+l/d-m)*l)/(o*h-a*l);n=p+o*f-e.x,r=m+a*f-e.y;t=n*n+r*r;if(t<=2)return new W(n,r);s=Math.sqrt(t/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(h)&&(e=!0),s=e?(n=-a,r=o,Math.sqrt(c)):(n=o,r=a,Math.sqrt(c/2))}return new W(n/s,r/s)}var T=[];for(let e=0,t=w.length,i=t-1,n=e+1;e<t;e++,i++,n++)i===t&&(i=0),n===t&&(n=0),T[e]=S(w[e],w[i],w[n]);var E=[];let A,C=T.concat();for(let e=0,t=y.length;e<t;e++){const F=y[e];A=[];for(let e=0,t=F.length,i=t-1,n=e+1;e<t;e++,i++,n++)i===t&&(i=0),n===t&&(n=0),A[e]=S(F[e],F[i],F[n]);E.push(A),C=C.concat(A)}for(let e=0;e<d;e++){const F=e/d,H=t*Math.cos(F*Math.PI/2),U=s*Math.sin(F*Math.PI/2)+o;for(let e=0,t=w.length;e<t;e++){const F=b(w[e],T[e],U);L(F.x,F.y,-H)}for(let e=0,t=y.length;e<t;e++){const F=y[e];A=E[e];for(let e=0,t=F.length;e<t;e++){const G=b(F[e],A[e],U);L(G.x,G.y,-H)}}}var R=s+o;for(let e=0;e<M;e++){const F=r?b(v[e],C[e],R):v[e];g?(m.copy(h.normals[0]).multiplyScalar(F.x),c.copy(h.binormals[0]).multiplyScalar(F.y),f.copy(l[0]).add(m).add(c),L(f.x,f.y,f.z)):L(F.x,F.y,0)}for(let t=1;t<=u;t++)for(let e=0;e<M;e++){const H=r?b(v[e],C[e],R):v[e];g?(m.copy(h.normals[t]).multiplyScalar(H.x),c.copy(h.binormals[t]).multiplyScalar(H.y),f.copy(l[t]).add(m).add(c),L(f.x,f.y,f.z)):L(H.x,H.y,i/u*t)}for(let e=d-1;0<=e;e--){const F=e/d,H=t*Math.cos(F*Math.PI/2),U=s*Math.sin(F*Math.PI/2)+o;for(let e=0,t=w.length;e<t;e++){const F=b(w[e],T[e],U);L(F.x,F.y,i+H)}for(let e=0,t=y.length;e<t;e++){const F=y[e];A=E[e];for(let e=0,t=F.length;e<t;e++){const G=b(F[e],A[e],U);g?L(G.x,G.y+l[u-1].y,l[u-1].x+H):L(G.x,G.y,i+H)}}}function B(e,n){let r=e.length;for(;0<=--r;){var s=r;let i=r-1;i<0&&(i=e.length-1);for(let e=0,t=u+2*d;e<t;e++){const r=M*e,c=M*(e+1);h=l=a=o=void 0;var o=n+s+r,a=n+i+r,l=n+i+c,h=n+s+c;z(o),z(a),z(h),z(a),z(l),z(h),o=U.length/3,D((a=p.generateSideWallUV(H,U,o-6,o-3,o-2,o-1))[0]),D(a[1]),D(a[3]),D(a[1]),D(a[2]),D(a[3])}}}function L(e,t,i){n.push(e),n.push(t),n.push(i)}function P(e,t,i){z(e),z(t),z(i);e=U.length/3,t=p.generateTopUV(H,U,e-3,e-2,e-1);D(t[0]),D(t[1]),D(t[2])}function z(e){U.push(n[3*e+0]),U.push(n[3*e+1]),U.push(n[3*e+2])}function D(e){G.push(e.x),G.push(e.y)}{e=U.length/3;if(r){let e=0,t=0*M;for(let e=0;e<_;e++){const H=x[e];P(H[2]+t,H[1]+t,H[0]+t)}e=u+2*d,t=M*e;for(let e=0;e<_;e++){const H=x[e];P(H[0]+t,H[1]+t,H[2]+t)}}else{for(let e=0;e<_;e++){var I=x[e];P(I[2],I[1],I[0])}for(let e=0;e<_;e++){var O=x[e];P(O[0]+M*u,O[1]+M*u,O[2]+M*u)}}H.addGroup(e,U.length/3-e,0)}{e=U.length/3;let i=0;B(w,i),i+=w.length;for(let e=0,t=y.length;e<t;e++){const H=y[e];B(H,i),i+=H.length}H.addGroup(e,U.length/3-e,1)}}(i[e]);this.setAttribute("position",new k(U,3)),this.setAttribute("uv",new k(G,2)),this.computeVertexNormals()}toJSON(){var e=super.toJSON(),i=this.parameters.shapes,t=this.parameters.options,n=e;if(n.shapes=[],Array.isArray(i))for(let e=0,t=i.length;e<t;e++){var r=i[e];n.shapes.push(r.uuid)}else n.shapes.push(i.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}static fromJSON(i,n){var r=[];for(let e=0,t=i.shapes.length;e<t;e++){var s=n[i.shapes[e]];r.push(s)}var e=i.options.extrudePath;return void 0!==e&&(i.options.extrudePath=(new mc[e.type]).fromJSON(e)),new Bc(r,i.options)}}const Fc={generateTopUV:function(e,t,i,n,r){var s=t[3*i],i=t[3*i+1],o=t[3*n],n=t[3*n+1],a=t[3*r],t=t[3*r+1];return[new W(s,i),new W(o,n),new W(a,t)]},generateSideWallUV:function(e,t,i,n,r,s){var o=t[3*i],a=t[3*i+1],i=t[3*i+2],l=t[3*n],h=t[3*n+1],n=t[3*n+2],c=t[3*r],u=t[3*r+1],r=t[3*r+2],d=t[3*s],p=t[3*s+1],t=t[3*s+2];return Math.abs(a-h)<Math.abs(o-l)?[new W(o,1-i),new W(l,1-n),new W(c,1-r),new W(d,1-t)]:[new W(a,1-i),new W(h,1-n),new W(u,1-r),new W(p,1-t)]}};class Hc extends Wh{constructor(e=1,t=0){var i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Hc(e.radius,e.detail)}}class Uc extends _{constructor(i=[new W(0,.5),new W(.5,0),new W(0,-.5)],n=12,r=0,s=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:i,segments:n,phiStart:r,phiLength:s},n=Math.floor(n),s=gn(s,0,2*Math.PI);const o=[],a=[],l=[],h=1/n,c=new De,u=new W;for(let t=0;t<=n;t++){var e=r+t*h*s,d=Math.sin(e),p=Math.cos(e);for(let e=0;e<=i.length-1;e++)c.x=i[e].x*d,c.y=i[e].y,c.z=i[e].x*p,a.push(c.x,c.y,c.z),u.x=t/n,u.y=e/(i.length-1),l.push(u.x,u.y)}for(let t=0;t<n;t++)for(let e=0;e<i.length-1;e++){const s=e+t*i.length,a=s,l=s+i.length,h=s+i.length+1,c=s+1;o.push(a,l,c),o.push(l,h,c)}if(this.setIndex(o),this.setAttribute("position",new k(a,3)),this.setAttribute("uv",new k(l,2)),this.computeVertexNormals(),s===2*Math.PI){const r=this.attributes.normal.array,s=new De,o=new De,a=new De,l=n*i.length*3;for(let e=0,t=0;e<i.length;e++,t+=3)s.x=r[t+0],s.y=r[t+1],s.z=r[t+2],o.x=r[l+t+0],o.y=r[l+t+1],o.z=r[l+t+2],a.addVectors(s,o).normalize(),r[t+0]=r[l+t+0]=a.x,r[t+1]=r[l+t+1]=a.y,r[t+2]=r[l+t+2]=a.z}}static fromJSON(e){return new Uc(e.points,e.segments,e.phiStart,e.phiLength)}}class Gc extends Wh{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Gc(e.radius,e.detail)}}class Wc extends _{constructor(e=.5,t=1,i=8,n=1,r=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:s},i=Math.max(3,i);const o=[],a=[],l=[],h=[];let c=e;var u=(t-e)/(n=Math.max(1,n)),d=new De,p=new W;for(let e=0;e<=n;e++){for(let e=0;e<=i;e++){const n=r+e/i*s;d.x=c*Math.cos(n),d.y=c*Math.sin(n),a.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/t+1)/2,p.y=(d.y/t+1)/2,h.push(p.x,p.y)}c+=u}for(let e=0;e<n;e++){const t=e*(i+1);for(let e=0;e<i;e++){const n=e+t,r=n,s=n+i+1,a=n+i+2,l=n+1;o.push(r,s,l),o.push(s,a,l)}}this.setIndex(o),this.setAttribute("position",new k(a,3)),this.setAttribute("normal",new k(l,3)),this.setAttribute("uv",new k(h,2))}static fromJSON(e){return new Wc(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class kc extends _{constructor(t=new vc([new W(0,.5),new W(-.5,-.5),new W(.5,-.5)]),o=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:o};const a=[],l=[],h=[],c=[];let i=0,u=0;if(!1===Array.isArray(t))n(t);else for(let e=0;e<t.length;e++)n(t[e]),this.addGroup(i,u,e),i+=u,u=0;function n(e){var i=l.length/3,e=e.extractPoints(o);let n=e.shape;var r=e.holes;!1===Ic.isClockWise(n)&&(n=n.reverse());for(let e=0,t=r.length;e<t;e++){const o=r[e];!0===Ic.isClockWise(o)&&(r[e]=o.reverse())}var s=Ic.triangulateShape(n,r);for(let e=0,t=r.length;e<t;e++){const o=r[e];n=n.concat(o)}for(let e=0,t=n.length;e<t;e++){const o=n[e];l.push(o.x,o.y,0),h.push(0,0,1),c.push(o.x,o.y)}for(let e=0,t=s.length;e<t;e++){const o=s[e],l=o[0]+i,h=o[1]+i,c=o[2]+i;a.push(l,h,c),u+=3}}this.setIndex(a),this.setAttribute("position",new k(l,3)),this.setAttribute("normal",new k(h,3)),this.setAttribute("uv",new k(c,2))}toJSON(){var e=super.toJSON(),i=this.parameters.shapes,n=e;if(n.shapes=[],Array.isArray(i))for(let e=0,t=i.length;e<t;e++){var r=i[e];n.shapes.push(r.uuid)}else n.shapes.push(i.uuid);return n}static fromJSON(i,n){var r=[];for(let e=0,t=i.shapes.length;e<t;e++){var s=n[i.shapes[e]];r.push(s)}return new kc(r,i.curveSegments)}}class Vc extends _{constructor(i=1,n=32,r=16,s=0,o=2*Math.PI,a=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:i,widthSegments:n,heightSegments:r,phiStart:s,phiLength:o,thetaStart:a,thetaLength:l},n=Math.max(3,Math.floor(n)),r=Math.max(2,Math.floor(r));const h=Math.min(a+l,Math.PI);let c=0;var u=[],d=new De,p=new De,m=[],f=[],g=[],v=[];for(let e=0;e<=r;e++){var y=[],x=e/r;let t=0;0==e&&0==a?t=.5/n:e==r&&h==Math.PI&&(t=-.5/n);for(let e=0;e<=n;e++){const h=e/n;d.x=-i*Math.cos(s+h*o)*Math.sin(a+x*l),d.y=i*Math.cos(a+x*l),d.z=i*Math.sin(s+h*o)*Math.sin(a+x*l),f.push(d.x,d.y,d.z),p.copy(d).normalize(),g.push(p.x,p.y,p.z),v.push(h+t,1-x),y.push(c++)}u.push(y)}for(let t=0;t<r;t++)for(let e=0;e<n;e++){const n=u[t][e+1],o=u[t][e],l=u[t+1][e],c=u[t+1][e+1];(0!==t||0<a)&&m.push(n,o,c),(t!==r-1||h<Math.PI)&&m.push(o,l,c)}this.setIndex(m),this.setAttribute("position",new k(f,3)),this.setAttribute("normal",new k(g,3)),this.setAttribute("uv",new k(v,2))}static fromJSON(e){return new Vc(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class jc extends Wh{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new jc(e.radius,e.detail)}}class Xc extends _{constructor(i=1,n=.4,r=8,s=6,o=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:i,tube:n,radialSegments:r,tubularSegments:s,arc:o},r=Math.floor(r),s=Math.floor(s);const a=[],l=[],h=[],c=[],u=new De,d=new De,p=new De;for(let t=0;t<=r;t++)for(let e=0;e<=s;e++){var m=e/s*o,f=t/r*Math.PI*2;d.x=(i+n*Math.cos(f))*Math.cos(m),d.y=(i+n*Math.cos(f))*Math.sin(m),d.z=n*Math.sin(f),l.push(d.x,d.y,d.z),u.x=i*Math.cos(m),u.y=i*Math.sin(m),p.subVectors(d,u).normalize(),h.push(p.x,p.y,p.z),c.push(e/s),c.push(t/r)}for(let t=1;t<=r;t++)for(let e=1;e<=s;e++){const r=(s+1)*t+e-1,o=(s+1)*(t-1)+e-1,l=(s+1)*(t-1)+e,h=(s+1)*t+e;a.push(r,o,h),a.push(o,l,h)}this.setIndex(a),this.setAttribute("position",new k(l,3)),this.setAttribute("normal",new k(h,3)),this.setAttribute("uv",new k(c,2))}static fromJSON(e){return new Xc(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class qc extends _{constructor(e=1,i=.4,n=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:i,tubularSegments:n,radialSegments:r,p:s,q:o},n=Math.floor(n),r=Math.floor(r);const a=[],l=[],h=[],c=[],u=new De,d=new De,p=new De,m=new De,f=new De,g=new De,v=new De;for(let t=0;t<=n;++t){var y=t/n*s*Math.PI*2;x(y,s,o,e,p),x(.01+y,s,o,e,m),g.subVectors(m,p),v.addVectors(m,p),f.crossVectors(g,v),v.crossVectors(f,g),f.normalize(),v.normalize();for(let e=0;e<=r;++e){const s=e/r*Math.PI*2,o=-i*Math.cos(s),m=i*Math.sin(s);u.x=p.x+(o*v.x+m*f.x),u.y=p.y+(o*v.y+m*f.y),u.z=p.z+(o*v.z+m*f.z),l.push(u.x,u.y,u.z),d.subVectors(u,p).normalize(),h.push(d.x,d.y,d.z),c.push(t/n),c.push(e/r)}}for(let t=1;t<=n;t++)for(let e=1;e<=r;e++){const n=(r+1)*(t-1)+(e-1),s=(r+1)*t+(e-1),o=(r+1)*t+e,l=(r+1)*(t-1)+e;a.push(n,s,l),a.push(s,o,l)}function x(e,t,i,n,r){var s=Math.cos(e),o=Math.sin(e),i=i/t*e,t=Math.cos(i);r.x=n*(2+t)*.5*s,r.y=n*(2+t)*o*.5,r.z=n*Math.sin(i)*.5}this.setIndex(a),this.setAttribute("position",new k(l,3)),this.setAttribute("normal",new k(h,3)),this.setAttribute("uv",new k(c,2))}static fromJSON(e){return new qc(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Yc extends _{constructor(e=new dc(new De(-1,-1,0),new De(-1,1,0),new De(1,1,0)),r=64,s=1,o=8,t=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:r,radius:s,radialSegments:o,closed:t};const a=e.computeFrenetFrames(r,t),l=(this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,new De),h=new De,i=new W;let c=new De;const u=[],d=[],n=[],p=[];function m(t){c=e.getPointAt(t/r,c);var i=a.normals[t],n=a.binormals[t];for(let e=0;e<=o;e++){const r=e/o*Math.PI*2,t=Math.sin(r),a=-Math.cos(r);h.x=a*i.x+t*n.x,h.y=a*i.y+t*n.y,h.z=a*i.z+t*n.z,h.normalize(),d.push(h.x,h.y,h.z),l.x=c.x+s*h.x,l.y=c.y+s*h.y,l.z=c.z+s*h.z,u.push(l.x,l.y,l.z)}}for(let e=0;e<r;e++)m(e);m(!1===t?r:0);for(let t=0;t<=r;t++)for(let e=0;e<=o;e++)i.x=t/r,i.y=e/o,n.push(i.x,i.y);for(let t=1;t<=r;t++)for(let e=1;e<=o;e++){var f=(o+1)*(t-1)+(e-1),g=(o+1)*t+(e-1),v=(o+1)*t+e,y=(o+1)*(t-1)+e;p.push(f,g,y),p.push(g,v,y)}this.setIndex(p),this.setAttribute("position",new k(u,3)),this.setAttribute("normal",new k(d,3)),this.setAttribute("uv",new k(n,2))}toJSON(){var e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Yc((new mc[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Jc extends _{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){var n=[],r=new Set,s=new De,o=new De;if(null!==e.index){var a=e.attributes.position,l=e.index;let i=e.groups;for(let e=0,t=(i=0===i.length?[{start:0,count:l.count,materialIndex:0}]:i).length;e<t;++e){var h=i[e],c=h.start;for(let t=c,e=c+h.count;t<e;t+=3)for(let e=0;e<3;e++){var u=l.getX(t+e),d=l.getX(t+(e+1)%3);s.fromBufferAttribute(a,u),o.fromBufferAttribute(a,d),!0===Zc(s,o,r)&&(n.push(s.x,s.y,s.z),n.push(o.x,o.y,o.z))}}}else{var i=e.attributes.position;for(let t=0,e=i.count/3;t<e;t++)for(let e=0;e<3;e++){var p=3*t+e,m=3*t+(e+1)%3;s.fromBufferAttribute(i,p),o.fromBufferAttribute(i,m),!0===Zc(s,o,r)&&(n.push(s.x,s.y,s.z),n.push(o.x,o.y,o.z))}}this.setAttribute("position",new k(n,3))}}}function Zc(e,t,i){var n=`${e.x},${e.y},${e.z}-${t.x},${t.y},`+t.z,t=`${t.x},${t.y},${t.z}-${e.x},${e.y},`+e.z;return!0!==i.has(n)&&!0!==i.has(t)&&(i.add(n,t),!0)}var Qc=Object.freeze({__proto__:null,BoxGeometry:Is,BoxBufferGeometry:Is,CircleGeometry:Hh,CircleBufferGeometry:Hh,ConeGeometry:Gh,ConeBufferGeometry:Gh,CylinderGeometry:Uh,CylinderBufferGeometry:Uh,DodecahedronGeometry:kh,DodecahedronBufferGeometry:kh,EdgesGeometry:Yh,ExtrudeGeometry:Bc,ExtrudeBufferGeometry:Bc,IcosahedronGeometry:Hc,IcosahedronBufferGeometry:Hc,LatheGeometry:Uc,LatheBufferGeometry:Uc,OctahedronGeometry:Gc,OctahedronBufferGeometry:Gc,PlaneGeometry:Ks,PlaneBufferGeometry:Ks,PolyhedronGeometry:Wh,PolyhedronBufferGeometry:Wh,RingGeometry:Wc,RingBufferGeometry:Wc,ShapeGeometry:kc,ShapeBufferGeometry:kc,SphereGeometry:Vc,SphereBufferGeometry:Vc,TetrahedronGeometry:jc,TetrahedronBufferGeometry:jc,TorusGeometry:Xc,TorusBufferGeometry:Xc,TorusKnotGeometry:qc,TorusKnotBufferGeometry:qc,TubeGeometry:Yc,TubeBufferGeometry:Yc,WireframeGeometry:Jc});class Kc extends i{constructor(e){super(),this.type="ShadowMaterial",this.color=new g(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Kc.prototype.isShadowMaterial=!0;class $c extends i{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new g(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 g(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ii,this.normalScale=new W(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.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}$c.prototype.isMeshStandardMaterial=!0;class eu extends $c{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new W(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return gn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.sheenColor=new g(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new g(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new g(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){0<this._sheen!=0<e&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){0<this._clearcoat!=0<e&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){0<this._transmission!=0<e&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}eu.prototype.isMeshPhysicalMaterial=!0;class tu extends i{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new g(16777215),this.specular=new g(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new g(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ii,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=O,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}tu.prototype.isMeshPhongMaterial=!0;class iu extends i{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new g(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new g(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ii,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}iu.prototype.isMeshToonMaterial=!0;class nu extends i{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ii,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}nu.prototype.isMeshNormalMaterial=!0;class ru extends i{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new g(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new g(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=O,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}ru.prototype.isMeshLambertMaterial=!0;class su extends i{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new g(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ii,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}}su.prototype.isMeshMatcapMaterial=!0;class ou extends y{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}ou.prototype.isLineDashedMaterial=!0;var au=Object.freeze({__proto__:null,ShadowMaterial:Kc,SpriteMaterial:Nl,RawShaderMaterial:ao,ShaderMaterial:Fs,PointsMaterial:Ch,MeshPhysicalMaterial:eu,MeshStandardMaterial:$c,MeshPhongMaterial:tu,MeshToonMaterial:iu,MeshNormalMaterial:nu,MeshLambertMaterial:ru,MeshDepthMaterial:yl,MeshDistanceMaterial:xl,MeshBasicMaterial:$r,MeshMatcapMaterial:su,LineDashedMaterial:ou,LineBasicMaterial:y,Material:i});const m={arraySlice:function(e,t,i){return m.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==i?i:e.length)):e.slice(t,i)},convertArray:function(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(i){var t=i.length,n=new Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort(function(e,t){return i[e]-i[t]}),n},sortedArray:function(i,n,r){const s=i.length,o=new i.constructor(s);for(let e=0,t=0;t!==s;++e){const s=r[e]*n;for(let e=0;e!==n;++e)o[t++]=i[s+e]}return o},flattenJSON:function(t,i,n,r){let s=1,o=t[0];for(;void 0!==o&&void 0===o[r];)o=t[s++];if(void 0!==o){let e=o[r];if(void 0!==e)if(Array.isArray(e))for(;void 0!==(e=o[r])&&(i.push(o.time),n.push.apply(n,e)),void 0!==(o=t[s++]););else if(void 0!==e.toArray)for(;void 0!==(e=o[r])&&(i.push(o.time),e.toArray(n,n.length)),void 0!==(o=t[s++]););else for(;void 0!==(e=o[r])&&(i.push(o.time),n.push(e)),void 0!==(o=t[s++]););}},subclip:function(e,i,n,r,s=30){const o=e.clone();o.name=i;var t=[];for(let e=0;e<o.tracks.length;++e){const i=o.tracks[e],a=i.getValueSize(),l=[],h=[];for(let t=0;t<i.times.length;++t){const o=i.times[t]*s;if(!(o<n||o>=r)){l.push(i.times[t]);for(let e=0;e<a;++e)h.push(i.values[t*a+e])}}0!==l.length&&(i.times=m.convertArray(l,i.times.constructor),i.values=m.convertArray(h,i.values.constructor),t.push(i))}o.tracks=t;let a=1/0;for(let e=0;e<o.tracks.length;++e)a>o.tracks[e].times[0]&&(a=o.tracks[e].times[0]);for(let e=0;e<o.tracks.length;++e)o.tracks[e].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(n,r=0,s=n,o=30){const a=s.tracks.length,l=r/(o=o<=0?30:o);for(let e=0;e<a;++e){const o=s.tracks[e],a=o.ValueTypeName;if("bool"!==a&&"string"!==a){var h=n.tracks.find(function(e){return e.name===o.name&&e.ValueTypeName===a});if(void 0!==h){let e=0;var c=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(e=c/3);let t=0;var u=h.getValueSize(),d=(h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(t=u/3),o.times.length-1);let i;if(l<=o.times[0]){const n=e,r=c-e;i=m.arraySlice(o.values,n,r)}else if(l>=o.times[d]){const n=d*c+e,r=n+c-e;i=m.arraySlice(o.values,n,r)}else{const n=o.createInterpolant(),r=e,s=c-e;n.evaluate(l),i=m.arraySlice(n.resultBuffer,r,s)}"quaternion"===a&&(new On).fromArray(i).normalize().conjugate().toArray(i);var p=h.times.length;for(let e=0;e<p;++e){const r=e*u+t;if("quaternion"===a)On.multiplyQuaternionsFlat(h.values,r,i,0,h.values,r);else{const n=u-2*t;for(let e=0;e<n;++e)h.values[r+e]-=i[e]}}}}}return n.blendMode=bi,n}};class lu{constructor(e,t,i,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){var i=this.parameterPositions;let n=this._cachedIndex,r=i[n],s=i[n-1];e:{t:{let e;i:{n:if(!(t<r)){for(var o=n+2;;){if(void 0===r){if(t<s)break n;return n=i.length,this._cachedIndex=n,this.afterEnd_(n-1,t,s)}if(n===o)break;if(s=r,t<(r=i[++n]))break t}e=i.length;break i}if(t>=s)break e;var a=i[1];t<a&&(n=2,s=a);for(var l=n-2;;){if(void 0===s)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===l)break;if(r=s,t>=(s=i[--n-1]))break t}e=n,n=0}for(;n<e;){const r=n+e>>>1;t<i[r]?e=r:n=1+r}if(r=i[n],void 0===(s=i[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return n=i.length,this._cachedIndex=n,this.afterEnd_(n-1,s,t)}this._cachedIndex=n,this.intervalChanged_(n,s,r)}return this.interpolate_(n,s,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){var t=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=e*n;for(let e=0;e!==n;++e)t[e]=i[r+e];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}lu.prototype.beforeStart_=lu.prototype.copySampleValue_,lu.prototype.afterEnd_=lu.prototype.copySampleValue_;class hu extends lu{constructor(e,t,i,n){super(e,t,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:vi,endingEnd:vi}}intervalChanged_(e,t,i){var n=this.parameterPositions;let r=e-2,s=e+1,o=n[r],a=n[s];if(void 0===o)switch(this.getSettings_().endingStart){case yi:r=e,o=2*t-i;break;case xi:r=n.length-2,o=t+n[r]-n[r+1];break;default:r=e,o=i}if(void 0===a)switch(this.getSettings_().endingEnd){case yi:s=e,a=2*i-t;break;case xi:s=1,a=i+n[1]-n[0];break;default:s=e-1,a=t}var l=.5*(i-t),h=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(a-i),this._offsetPrev=r*h,this._offsetNext=s*h}interpolate_(e,t,i,n){var r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=e*o,l=a-o,h=this._offsetPrev,c=this._offsetNext,e=this._weightPrev,u=this._weightNext,i=(i-t)/(n-t),n=i*i,t=n*i,d=-e*t+2*e*n-e*i,p=(1+e)*t+(-1.5-2*e)*n+(-.5+e)*i+1,m=(-1-u)*t+(1.5+u)*n+.5*i,f=u*t-u*n;for(let e=0;e!==o;++e)r[e]=d*s[h+e]+p*s[l+e]+m*s[a+e]+f*s[c+e];return r}}class cu extends lu{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){var r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=e*o,l=a-o,h=(i-t)/(n-t),c=1-h;for(let e=0;e!==o;++e)r[e]=s[l+e]*c+s[a+e]*h;return r}}class uu extends lu{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e){return this.copySampleValue_(e-1)}}class du{constructor(e,t,i,n){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=m.convertArray(t,this.TimeBufferType),this.values=m.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:m.convertArray(e.times,Array),values:m.convertArray(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(i.interpolation=t)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new uu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new cu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new hu(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case mi:t=this.InterpolantFactoryMethodDiscrete;break;case fi:t=this.InterpolantFactoryMethodLinear;break;case gi:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}console.warn("THREE.KeyframeTrack:",t)}else this.createInterpolant=t;return this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return mi;case this.InterpolantFactoryMethodLinear:return fi;case this.InterpolantFactoryMethodSmooth:return gi}}getValueSize(){return this.values.length/this.times.length}shift(i){if(0!==i){var n=this.times;for(let e=0,t=n.length;e!==t;++e)n[e]+=i}return this}scale(i){if(1!==i){var n=this.times;for(let e=0,t=n.length;e!==t;++e)n[e]*=i}return this}trim(e,t){var i=this.times,n=i.length;let r=0,s=n-1;for(;r!==n&&i[r]<e;)++r;for(;-1!==s&&i[s]>t;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);const e=this.getValueSize();this.times=m.arraySlice(i,r,s),this.values=m.arraySlice(this.values,r*e,s*e)}return this}validate(){let i=!0;var e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),i=!1);const n=this.times,r=this.values,t=n.length;0===t&&(console.error("THREE.KeyframeTrack: Track is empty.",this),i=!1);let s=null;for(let e=0;e!==t;e++){const r=n[e];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,r),i=!1;break}if(null!==s&&s>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,r,s),i=!1;break}s=r}if(void 0!==r&&m.isTypedArray(r))for(let e=0,t=r.length;e!==t;++e){const n=r[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),i=!1;break}}return i}optimize(){const i=m.arraySlice(this.times),n=m.arraySlice(this.values),r=this.getValueSize(),s=this.getInterpolation()===gi,o=i.length-1;let a=1;for(let e=1;e<o;++e){let t=!1;var l=i[e];if(l!==i[e+1]&&(1!==e||l!==i[0]))if(s)t=!0;else{const i=e*r,s=i-r,a=i+r;for(let e=0;e!==r;++e){const r=n[i+e];if(r!==n[s+e]||r!==n[a+e]){t=!0;break}}}if(t){if(e!==a){i[a]=i[e];const s=e*r,o=a*r;for(let e=0;e!==r;++e)n[o+e]=n[s+e]}++a}}if(0<o){i[a]=i[o];for(let e=o*r,t=a*r,i=0;i!==r;++i)n[t+i]=n[e+i];++a}return a!==i.length?(this.times=m.arraySlice(i,0,a),this.values=m.arraySlice(n,0,a*r)):(this.times=i,this.values=n),this}clone(){var e=m.arraySlice(this.times,0),t=m.arraySlice(this.values,0),e=new this.constructor(this.name,e,t);return e.createInterpolant=this.createInterpolant,e}}du.prototype.TimeBufferType=Float32Array,du.prototype.ValueBufferType=Float32Array,du.prototype.DefaultInterpolation=fi;class pu extends du{}pu.prototype.ValueTypeName="bool",pu.prototype.ValueBufferType=Array,pu.prototype.DefaultInterpolation=mi,pu.prototype.InterpolantFactoryMethodLinear=void 0,pu.prototype.InterpolantFactoryMethodSmooth=void 0;class mu extends du{}mu.prototype.ValueTypeName="color";class fu extends du{}fu.prototype.ValueTypeName="number";class gu extends lu{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){var r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(i-t)/(n-t);let l=e*o;for(var h=l+o;l!==h;l+=4)On.slerpFlat(r,0,s,l-o,s,l,a);return r}}class vu extends du{InterpolantFactoryMethodLinear(e){return new gu(this.times,this.values,this.getValueSize(),e)}}vu.prototype.ValueTypeName="quaternion",vu.prototype.DefaultInterpolation=fi,vu.prototype.InterpolantFactoryMethodSmooth=void 0;class yu extends du{}yu.prototype.ValueTypeName="string",yu.prototype.ValueBufferType=Array,yu.prototype.DefaultInterpolation=mi,yu.prototype.InterpolantFactoryMethodLinear=void 0,yu.prototype.InterpolantFactoryMethodSmooth=void 0;class xu extends du{}class wu{constructor(e,t=-1,i,n=wi){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=fn(),this.duration<0&&this.resetDuration()}static parse(e){var i=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,t=n.length;e!==t;++e)i.push(function(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return fu;case"vector":case"vector2":case"vector3":case"vector4":return xu;case"color":return mu;case"quaternion":return vu;case"bool":case"boolean":return pu;case"string":return yu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],i=[];m.flattenJSON(e.keys,t,i,"value"),e.times=t,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}(n[e]).scale(r));var t=new this(e.name,e.duration,i,e.blendMode);return t.uuid=e.uuid,t}static toJSON(e){var i=[],n=e.tracks,e={name:e.name,duration:e.duration,tracks:i,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,t=n.length;e!==t;++e)i.push(du.toJSON(n[e]));return e}static CreateFromMorphTargetSequence(e,n,r,s){var o=n.length,a=[];for(let i=0;i<o;i++){let e=[],t=[];e.push((i+o-1)%o,i,(i+1)%o),t.push(0,1,0);var l=m.getKeyframeOrder(e);e=m.sortedArray(e,1,l),t=m.sortedArray(t,1,l),s||0!==e[0]||(e.push(o),t.push(t[0])),a.push(new fu(".morphTargetInfluences["+n[i].name+"]",e,t).scale(1/r))}return new this(e,-1,a)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const t=e;i=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<i.length;e++)if(i[e].name===t)return i[e];return null}static CreateClipsFromMorphTargetSequences(i,e,n){var r={},s=/^([\w-]*?)([\d]+)$/;for(let e=0,t=i.length;e<t;e++){const n=i[e],o=n.name.match(s);if(o&&1<o.length){const i=o[1];let e=r[i];e||(r[i]=e=[]),e.push(n)}}const o=[];for(const i in r)o.push(this.CreateFromMorphTargetSequence(i,r[i],e,n));return o}static parseAnimation(i,t){if(!i)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,i,n,r){var s,o;0!==i.length&&(s=[],o=[],m.flattenJSON(i,s,o,n),0!==s.length)&&r.push(new e(t,s,o))},r=[],s=i.name||"default",o=i.fps||30,e=i.blendMode;let a=i.length||-1;var l=i.hierarchy||[];for(let e=0;e<l.length;e++){const s=l[e].keys;if(s&&0!==s.length)if(s[0].morphTargets){const i={};let t;for(t=0;t<s.length;t++)if(s[t].morphTargets)for(let e=0;e<s[t].morphTargets.length;e++)i[s[t].morphTargets[e]]=-1;for(const n in i){const i=[],o=[];for(let e=0;e!==s[t].morphTargets.length;++e){const r=s[t];i.push(r.time),o.push(r.morphTarget===n?1:0)}r.push(new fu(".morphTargetInfluence["+n+"]",i,o))}a=i.length*(o||1)}else{const o=".bones["+t[e].name+"]";n(xu,o+".position",s,"pos",r),n(vu,o+".quaternion",s,"rot",r),n(xu,o+".scale",s,"scl",r)}}return 0===r.length?null:new this(s,a,r,e)}resetDuration(){let i=0;for(let e=0,t=this.tracks.length;e!==t;++e){var n=this.tracks[e];i=Math.max(i,n.times[n.times.length-1])}return this.duration=i,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){var t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}const bu={enabled:!(xu.prototype.ValueTypeName="vector"),files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class Mu{constructor(e,t,i){const n=this;let r=!1,s=0,o=0,a=void 0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){o++,!1===r&&void 0!==n.onStart&&n.onStart(e,s,o),r=!0},this.itemEnd=function(e){s++,void 0!==n.onProgress&&n.onProgress(e,s,o),s===o&&(r=!1,void 0!==n.onLoad)&&n.onLoad()},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return a?a(e):e},this.setURLModifier=function(e){return a=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){e=l.indexOf(e);return-1!==e&&l.splice(e,2),this},this.getHandler=function(i){for(let e=0,t=l.length;e<t;e+=2){var n=l[e],r=l[e+1];if(n.global&&(n.lastIndex=0),n.test(i))return r}return null}}}const _u=new Mu;class Su{constructor(e){this.manager=void 0!==e?e:_u,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(i,n){const r=this;return new Promise(function(e,t){r.load(i,e,n,t)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Tu={};class Eu extends Su{constructor(e){super(e)}load(l,e,t,i){void 0===l&&(l=""),void 0!==this.path&&(l=this.path+l),l=this.manager.resolveURL(l);const n=bu.get(l);if(void 0!==n)return this.manager.itemStart(l),setTimeout(()=>{e&&e(n),this.manager.itemEnd(l)},0),n;void 0!==Tu[l]?Tu[l].push({onLoad:e,onProgress:t,onError:i}):(Tu[l]=[],Tu[l].push({onLoad:e,onProgress:t,onError:i}),t=new Request(l,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),fetch(t).then(e=>{if(200!==e.status&&0!==e.status)throw Error(`fetch for "${e.url}" responded with ${e.status}: `+e.statusText);{0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");const s=Tu[l],i=e.body.getReader(),t=e.headers.get("Content-Length"),o=t?parseInt(t):0,a=0!==o;let r=0;return new ReadableStream({start(t){!function n(){i.read().then(({done:i,value:e})=>{if(i)t.close();else{r+=e.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:r,total:o});for(let e=0,t=s.length;e<t;e++){const n=s[e];n.onProgress&&n.onProgress(i)}t.enqueue(e),n()}})}()}})}}).then(e=>{var t=new Response(e);switch(this.responseType){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(e=>(new DOMParser).parseFromString(e,this.mimeType));case"json":return t.json();default:return t.text()}}).then(i=>{bu.add(l,i);var n=Tu[l];delete Tu[l];for(let e=0,t=n.length;e<t;e++){var r=n[e];r.onLoad&&r.onLoad(i)}this.manager.itemEnd(l)}).catch(i=>{var n=Tu[l];delete Tu[l];for(let e=0,t=n.length;e<t;e++){var r=n[e];r.onError&&r.onError(i)}this.manager.itemError(l),this.manager.itemEnd(l)}),this.manager.itemStart(l))}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Au extends Su{constructor(e){super(e)}load(t,i,e,n){const r=this,s=new Eu(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(e){try{i(r.parse(JSON.parse(e)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},e,n)}parse(t){var i=[];for(let e=0;e<t.length;e++){var n=wu.parse(t[e]);i.push(n)}return i}}class Cu extends Su{constructor(e){super(e)}load(i,n,r,s){const o=this,a=[],l=new Nh,h=new Eu(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(o.withCredentials);let c=0;if(Array.isArray(i))for(let e=0,t=i.length;e<t;++e)!function(t){h.load(i[t],function(e){e=o.parse(e,!0);a[t]={width:e.width,height:e.height,format:e.format,mipmaps:e.mipmaps},6===(c+=1)&&(1===e.mipmapCount&&(l.minFilter=F),l.image=a,l.format=e.format,l.needsUpdate=!0,n)&&n(l)},r,s)}(e);else h.load(i,function(e){var i=o.parse(e,!0);if(i.isCubemap){const e=i.mipmaps.length/i.mipmapCount;for(let t=0;t<e;t++){a[t]={mipmaps:[]};for(let e=0;e<i.mipmapCount;e++)a[t].mipmaps.push(i.mipmaps[t*i.mipmapCount+e]),a[t].format=i.format,a[t].width=i.width,a[t].height=i.height}l.image=a}else l.image.width=i.width,l.image.height=i.height,l.mipmaps=i.mipmaps;1===i.mipmapCount&&(l.minFilter=F),l.format=i.format,l.needsUpdate=!0,n&&n(l)},r,s);return l}}class Ru extends Su{constructor(e){super(e)}load(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=bu.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout(function(){e&&e(s),r.manager.itemEnd(t)},0),s;const o=En("img");function a(){h(),bu.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){h(),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}function h(){o.removeEventListener("load",a,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}class Lu extends Su{constructor(e){super(e)}load(i,n,e,r){const s=new Gs,o=new Ru(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;for(let e=0;e<i.length;++e)!function(t){o.load(i[t],function(e){s.images[t]=e,6===++a&&(s.needsUpdate=!0,n)&&n(s)},void 0,r)}(e);return s}}class Pu extends Su{constructor(e){super(e)}load(e,t,i,n){const r=this,s=new lh,o=new Eu(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,function(e){e=r.parse(e);e&&(void 0!==e.image?s.image=e.image:void 0!==e.data&&(s.image.width=e.width,s.image.height=e.height,s.image.data=e.data),s.wrapS=void 0!==e.wrapS?e.wrapS:Ce,s.wrapT=void 0!==e.wrapT?e.wrapT:Ce,s.magFilter=void 0!==e.magFilter?e.magFilter:F,s.minFilter=void 0!==e.minFilter?e.minFilter:F,s.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.encoding&&(s.encoding=e.encoding),void 0!==e.flipY&&(s.flipY=e.flipY),void 0!==e.format&&(s.format=e.format),void 0!==e.type&&(s.type=e.type),void 0!==e.mipmaps&&(s.mipmaps=e.mipmaps,s.minFilter=Ke),1===e.mipmapCount&&(s.minFilter=F),void 0!==e.generateMipmaps&&(s.generateMipmaps=e.generateMipmaps),s.needsUpdate=!0,t)&&t(s,e)},i,n),s}}class zu extends Su{constructor(e){super(e)}load(e,t,i,n){const r=new c,s=new Ru(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(e){r.image=e,r.needsUpdate=!0,void 0!==t&&t(r)},i,n),r}}class Du extends u{constructor(e,t=1){super(),this.type="Light",this.color=new g(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){e=super.toJSON(e);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}Du.prototype.isLight=!0;class Iu extends Du{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy(u.DefaultUp),this.updateMatrix(),this.groundColor=new g(t)}copy(e){return Du.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Iu.prototype.isHemisphereLight=!0;const Ou=new Ie,Nu=new De,Bu=new De;class Fu{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new W(512,512),this.map=null,this.mapPass=null,this.matrix=new Ie,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Js,this._frameExtents=new W(1,1),this._viewportCount=1,this._viewports=[new ze(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){var t=this.camera,i=this.matrix;Nu.setFromMatrixPosition(e.matrixWorld),t.position.copy(Nu),Bu.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Bu),t.updateMatrixWorld(),Ou.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ou),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){var e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Hu extends Fu{constructor(){super(new B(50,1,.5,500)),this.focus=1}updateMatrices(e){var t=this.camera,i=2*pn*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;i===t.fov&&n===t.aspect&&r===t.far||(t.fov=i,t.aspect=n,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}Hu.prototype.isSpotLightShadow=!0;class Uu extends Du{constructor(e,t,i=0,n=Math.PI/3,r=0,s=1){super(e,t),this.type="SpotLight",this.position.copy(u.DefaultUp),this.updateMatrix(),this.target=new u,this.distance=i,this.angle=n,this.penumbra=r,this.decay=s,this.shadow=new Hu}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Uu.prototype.isSpotLight=!0;const Gu=new Ie,Wu=new De,ku=new De;class Vu extends Fu{constructor(){super(new B(90,1,.5,500)),this._frameExtents=new W(4,2),this._viewportCount=6,this._viewports=[new ze(2,1,1,1),new ze(0,1,1,1),new ze(3,1,1,1),new ze(1,1,1,1),new ze(3,0,1,1),new ze(1,0,1,1)],this._cubeDirections=[new De(1,0,0),new De(-1,0,0),new De(0,0,1),new De(0,0,-1),new De(0,1,0),new De(0,-1,0)],this._cubeUps=[new De(0,1,0),new De(0,1,0),new De(0,1,0),new De(0,1,0),new De(0,0,1),new De(0,0,-1)]}updateMatrices(e,t=0){var i=this.camera,n=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),Wu.setFromMatrixPosition(e.matrixWorld),i.position.copy(Wu),ku.copy(i.position),ku.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(ku),i.updateMatrixWorld(),n.makeTranslation(-Wu.x,-Wu.y,-Wu.z),Gu.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Gu)}}Vu.prototype.isPointLightShadow=!0;class ju extends Du{constructor(e,t,i=0,n=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new Vu}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}ju.prototype.isPointLight=!0;class Xu extends Fu{constructor(){super(new oo(-5,5,5,-5,.5,500))}}Xu.prototype.isDirectionalLightShadow=!0;class qu extends Du{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(u.DefaultUp),this.updateMatrix(),this.target=new u,this.shadow=new Xu}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}qu.prototype.isDirectionalLight=!0;class Yu extends Du{constructor(e,t){super(e,t),this.type="AmbientLight"}}Yu.prototype.isAmbientLight=!0;class Ju extends Du{constructor(e,t,i=10,n=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){e=super.toJSON(e);return e.object.width=this.width,e.object.height=this.height,e}}Ju.prototype.isRectAreaLight=!0;class Zu{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new De)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){var i=e.x,n=e.y,e=e.z,r=this.coefficients;return t.copy(r[0]).multiplyScalar(.282095),t.addScaledVector(r[1],.488603*n),t.addScaledVector(r[2],.488603*e),t.addScaledVector(r[3],.488603*i),t.addScaledVector(r[4],i*n*1.092548),t.addScaledVector(r[5],n*e*1.092548),t.addScaledVector(r[6],.315392*(3*e*e-1)),t.addScaledVector(r[7],i*e*1.092548),t.addScaledVector(r[8],.546274*(i*i-n*n)),t}getIrradianceAt(e,t){var i=e.x,n=e.y,e=e.z,r=this.coefficients;return t.copy(r[0]).multiplyScalar(.886227),t.addScaledVector(r[1],1.023328*n),t.addScaledVector(r[2],1.023328*e),t.addScaledVector(r[3],1.023328*i),t.addScaledVector(r[4],.858086*i*n),t.addScaledVector(r[5],.858086*n*e),t.addScaledVector(r[6],.743125*e*e-.247708),t.addScaledVector(r[7],.858086*i*e),t.addScaledVector(r[8],.429043*(i*i-n*n)),t}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,i){for(let e=0;e<9;e++)this.coefficients[e].addScaledVector(t.coefficients[e],i);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,i){for(let e=0;e<9;e++)this.coefficients[e].lerp(t.coefficients[e],i);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,i=0){var n=this.coefficients;for(let e=0;e<9;e++)n[e].fromArray(t,i+3*e);return this}toArray(t=[],i=0){var n=this.coefficients;for(let e=0;e<9;e++)n[e].toArray(t,i+3*e);return t}static getBasisAt(e,t){var i=e.x,n=e.y,e=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*e,t[3]=.488603*i,t[4]=1.092548*i*n,t[5]=1.092548*n*e,t[6]=.315392*(3*e*e-1),t[7]=1.092548*i*e,t[8]=.546274*(i*i-n*n)}}Zu.prototype.isSphericalHarmonics3=!0;class Qu extends Du{constructor(e=new Zu,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){e=super.toJSON(e);return e.object.sh=this.sh.toArray(),e}}Qu.prototype.isLightProbe=!0;class Ku extends Su{constructor(e){super(e),this.textures={}}load(t,i,e,n){const r=this,s=new Eu(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,function(e){try{i(r.parse(JSON.parse(e)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},e,n)}parse(t){const i=this.textures;function e(e){return void 0===i[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),i[e]}var n=new au[t.type];if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&void 0!==n.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.sheen&&(n.sheen=t.sheen),void 0!==t.sheenColor&&(n.sheenColor=(new g).setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(n.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==n.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==n.specular&&n.specular.setHex(t.specular),void 0!==t.specularIntensity&&(n.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==n.specularColor&&n.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.clearcoat&&(n.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(n.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.transmission&&(n.transmission=t.transmission),void 0!==t.thickness&&(n.thickness=t.thickness),void 0!==t.attenuationDistance&&(n.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==n.attenuationColor&&n.attenuationColor.setHex(t.attenuationColor),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.flatShading&&(n.flatShading=t.flatShading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.combine&&(n.combine=t.combine),void 0!==t.side&&(n.side=t.side),void 0!==t.shadowSide&&(n.shadowSide=t.shadowSide),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.format&&(n.format=t.format),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(n.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(n.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(n.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(n.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(n.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(n.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(n.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(n.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(n.rotation=t.rotation),1!==t.linewidth&&(n.linewidth=t.linewidth),void 0!==t.dashSize&&(n.dashSize=t.dashSize),void 0!==t.gapSize&&(n.gapSize=t.gapSize),void 0!==t.scale&&(n.scale=t.scale),void 0!==t.polygonOffset&&(n.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(n.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(n.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(n.dithering=t.dithering),void 0!==t.alphaToCoverage&&(n.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(n.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.toneMapped&&(n.toneMapped=t.toneMapped),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?n.vertexColors=0<t.vertexColors:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const i in t.uniforms){var r=t.uniforms[i];switch(n.uniforms[i]={},r.type){case"t":n.uniforms[i].value=e(r.value);break;case"c":n.uniforms[i].value=(new g).setHex(r.value);break;case"v2":n.uniforms[i].value=(new W).fromArray(r.value);break;case"v3":n.uniforms[i].value=(new De).fromArray(r.value);break;case"v4":n.uniforms[i].value=(new ze).fromArray(r.value);break;case"m3":n.uniforms[i].value=(new v).fromArray(r.value);break;case"m4":n.uniforms[i].value=(new Ie).fromArray(r.value);break;default:n.uniforms[i].value=r.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const i in t.extensions)n.extensions[i]=t.extensions[i];if(void 0!==t.shading&&(n.flatShading=1===t.shading),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=e(t.map)),void 0!==t.matcap&&(n.matcap=e(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=e(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=e(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),n.normalScale=(new W).fromArray(e)}return void 0!==t.displacementMap&&(n.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=e(t.specularMap)),void 0!==t.specularIntensityMap&&(n.specularIntensityMap=e(t.specularIntensityMap)),void 0!==t.specularColorMap&&(n.specularColorMap=e(t.specularColorMap)),void 0!==t.envMap&&(n.envMap=e(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=e(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=e(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=e(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=e(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new W).fromArray(t.clearcoatNormalScale)),void 0!==t.transmissionMap&&(n.transmissionMap=e(t.transmissionMap)),void 0!==t.thicknessMap&&(n.thicknessMap=e(t.thicknessMap)),void 0!==t.sheenColorMap&&(n.sheenColorMap=e(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(n.sheenRoughnessMap=e(t.sheenRoughnessMap)),n}setTextures(e){return this.textures=e,this}}class $u{static decodeText(i){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(i);let n="";for(let e=0,t=i.length;e<t;e++)n+=String.fromCharCode(i[e]);try{return decodeURIComponent(escape(n))}catch(i){return n}}static extractUrlBase(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class ed extends _{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){var e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}ed.prototype.isInstancedBufferGeometry=!0;class td extends Su{constructor(e){super(e)}load(t,i,e,n){const r=this,s=new Eu(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,function(e){try{i(r.parse(JSON.parse(e)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},e,n)}parse(i){const r={},s={};function n(e,t){var i,n;return void 0!==r[t]?r[t]:(i=e.interleavedBuffers[t],e=e,n=i.buffer,n=void 0!==s[n]?s[n]:(e=e.arrayBuffers[n],e=new Uint32Array(e).buffer,s[n]=e),e=Tn(i.type,n),(n=new Il(e,i.stride)).uuid=i.uuid,r[t]=n)}const o=new(i.isInstancedBufferGeometry?ed:_),a=i.data.index;if(void 0!==a){const i=Tn(a.type,a.array);o.setIndex(new T(i,1))}var t=i.data.attributes;for(const r in t){const s=t[r];let e;if(s.isInterleavedBufferAttribute){const r=n(i.data,s.data);e=new Ol(r,s.itemSize,s.offset,s.normalized)}else{const i=Tn(s.type,s.array);e=new(s.isInstancedBufferAttribute?dh:T)(i,s.itemSize,s.normalized)}void 0!==s.name&&(e.name=s.name),void 0!==s.usage&&e.setUsage(s.usage),void 0!==s.updateRange&&(e.updateRange.offset=s.updateRange.offset,e.updateRange.count=s.updateRange.count),o.setAttribute(r,e)}var e=i.data.morphAttributes;if(e)for(const r in e){const s=e[r],a=[];for(let t=0,e=s.length;t<e;t++){const o=s[t];let e;if(o.isInterleavedBufferAttribute){const r=n(i.data,o.data);e=new Ol(r,o.itemSize,o.offset,o.normalized)}else{const i=Tn(o.type,o.array);e=new T(i,o.itemSize,o.normalized)}void 0!==o.name&&(e.name=o.name),a.push(e)}o.morphAttributes[r]=a}i.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);var l=i.data.groups||i.data.drawcalls||i.data.offsets;if(void 0!==l)for(let e=0,t=l.length;e!==t;++e){const r=l[e];o.addGroup(r.start,r.count,r.materialIndex)}var h=i.data.boundingSphere;if(void 0!==h){const i=new De;void 0!==h.center&&i.fromArray(h.center),o.boundingSphere=new nr(i,h.radius)}return i.name&&(o.name=i.name),i.userData&&(o.userData=i.userData),o}}class id extends Su{constructor(e){super(e)}load(i,n,e,r){const s=this,t=""===this.path?$u.extractUrlBase(i):this.path;this.resourcePath=this.resourcePath||t;var o=new Eu(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(i,function(e){let t=null;try{t=JSON.parse(e)}catch(e){return void 0!==r&&r(e),void console.error("THREE:ObjectLoader: Can't parse "+i+".",e.message)}e=t.metadata;void 0!==e&&void 0!==e.type&&"geometry"!==e.type.toLowerCase()?s.parse(t,n):console.error("THREE.ObjectLoader: Can't load "+i)},e,r)}async loadAsync(e,t){var i=""===this.path?$u.extractUrlBase(e):this.path,i=(this.resourcePath=this.resourcePath||i,new Eu(this.manager)),i=(i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),await i.loadAsync(e,t)),t=JSON.parse(i),i=t.metadata;if(void 0===i||void 0===i.type||"geometry"===i.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return this.parseAsync(t)}parse(e,t){const i=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),s=this.parseImages(e.images,function(){void 0!==t&&t(l)}),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,r,a,o,i),h=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,h),void 0!==t){let e=!1;for(const t in s)if(s[t]instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){var t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,i),n=await this.parseImagesAsync(e.images),n=this.parseTextures(e.textures,n),r=this.parseMaterials(e.materials,n),i=this.parseObject(e.object,i,r,n,t),r=this.parseSkeletons(e.skeletons,i);return this.bindSkeletons(i,r),i}parseShapes(i){var n={};if(void 0!==i)for(let e=0,t=i.length;e<t;e++){var r=(new vc).fromJSON(i[e]);n[r.uuid]=r}return n}parseSkeletons(i,e){const n={},r={};if(e.traverse(function(e){e.isBone&&(r[e.uuid]=e)}),void 0!==i)for(let e=0,t=i.length;e<t;e++){var s=(new uh).fromJSON(i[e],r);n[s.uuid]=s}return n}parseGeometries(i,n){var r={};if(void 0!==i){var s=new td;for(let t=0,e=i.length;t<e;t++){let e;var o=i[t];switch(o.type){case"BufferGeometry":case"InstancedBufferGeometry":e=s.parse(o);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:o.type in Qc?e=Qc[o.type].fromJSON(o,n):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${o.type}"`)}e.uuid=o.uuid,void 0!==o.name&&(e.name=o.name),!0===e.isBufferGeometry&&void 0!==o.userData&&(e.userData=o.userData),r[o.uuid]=e}}return r}parseMaterials(i,e){const n={},r={};if(void 0!==i){var s=new Ku;s.setTextures(e);for(let e=0,t=i.length;e<t;e++){var o=i[e];if("MultiMaterial"===o.type){const i=[];for(let e=0;e<o.materials.length;e++){const r=o.materials[e];void 0===n[r.uuid]&&(n[r.uuid]=s.parse(r)),i.push(n[r.uuid])}r[o.uuid]=i}else void 0===n[o.uuid]&&(n[o.uuid]=s.parse(o)),r[o.uuid]=n[o.uuid]}}return r}parseAnimations(t){var i={};if(void 0!==t)for(let e=0;e<t.length;e++){var n=t[e],n=wu.parse(n);i[n.uuid]=n}return i}parseImages(i,n){const r=this,s={};let o;function a(e){var t,i;return"string"==typeof e?(i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t=e)?t:r.resourcePath+t,r.manager.itemStart(i),o.load(i,function(){r.manager.itemEnd(i)},void 0,function(){r.manager.itemError(i),r.manager.itemEnd(i)})):e.data?{data:Tn(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==i&&0<i.length){const r=new Mu(n);(o=new Ru(r)).setCrossOrigin(this.crossOrigin);for(let e=0,t=i.length;e<t;e++){const r=i[e],o=r.url;if(Array.isArray(o)){s[r.uuid]=[];for(let e=0,t=o.length;e<t;e++){const n=a(o[e]);null!==n&&(n instanceof HTMLImageElement?s[r.uuid].push(n):s[r.uuid].push(new lh(n.data,n.width,n.height)))}}else{const i=a(r.url);null!==i&&(s[r.uuid]=i)}}}return s}async parseImagesAsync(i){const n=this,r={};let s;async function o(e){var t;return"string"==typeof e?(t=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t=e)?t:n.resourcePath+t,s.loadAsync(t)):e.data?{data:Tn(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==i&&0<i.length){(s=new Ru(this.manager)).setCrossOrigin(this.crossOrigin);for(let e=0,t=i.length;e<t;e++){const s=i[e],a=s.url;if(Array.isArray(a)){r[s.uuid]=[];for(let e=0,t=a.length;e<t;e++){const n=a[e],l=await o(n);null!==l&&(l instanceof HTMLImageElement?r[s.uuid].push(l):r[s.uuid].push(new lh(l.data,l.width,l.height)))}}else{const i=await o(s.url);null!==i&&(r[s.uuid]=i)}}}return r}parseTextures(i,n){function r(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var s={};if(void 0!==i)for(let t=0,e=i.length;t<e;t++){var o=i[t];let e;void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===n[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var a=n[o.image];Array.isArray(a)?(e=new Gs(a),6===a.length&&(e.needsUpdate=!0)):(e=a&&a.data?new lh(a.data,a.width,a.height):new c(a),a&&(e.needsUpdate=!0)),e.uuid=o.uuid,void 0!==o.name&&(e.name=o.name),void 0!==o.mapping&&(e.mapping=r(o.mapping,nd)),void 0!==o.offset&&e.offset.fromArray(o.offset),void 0!==o.repeat&&e.repeat.fromArray(o.repeat),void 0!==o.center&&e.center.fromArray(o.center),void 0!==o.rotation&&(e.rotation=o.rotation),void 0!==o.wrap&&(e.wrapS=r(o.wrap[0],rd),e.wrapT=r(o.wrap[1],rd)),void 0!==o.format&&(e.format=o.format),void 0!==o.type&&(e.type=o.type),void 0!==o.encoding&&(e.encoding=o.encoding),void 0!==o.minFilter&&(e.minFilter=r(o.minFilter,sd)),void 0!==o.magFilter&&(e.magFilter=r(o.magFilter,sd)),void 0!==o.anisotropy&&(e.anisotropy=o.anisotropy),void 0!==o.flipY&&(e.flipY=o.flipY),void 0!==o.premultiplyAlpha&&(e.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(e.unpackAlignment=o.unpackAlignment),void 0!==o.userData&&(e.userData=o.userData),s[o.uuid]=e}return s}parseObject(e,t,s,i,n){let r,o,a;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function h(i){if(void 0!==i){if(Array.isArray(i)){var n=[];for(let e=0,t=i.length;e<t;e++){var r=i[e];void 0===s[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),n.push(s[r])}return n}return void 0===s[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),s[i]}}function c(e){return void 0===i[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),i[e]}switch(e.type){case"Scene":r=new Dl,void 0!==e.background&&(Number.isInteger(e.background)?r.background=new g(e.background):r.background=c(e.background)),void 0!==e.environment&&(r.environment=c(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new zl(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new Pl(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new B(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new oo(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"AmbientLight":r=new Yu(e.color,e.intensity);break;case"DirectionalLight":r=new qu(e.color,e.intensity);break;case"PointLight":r=new ju(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new Ju(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new Uu(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new Iu(e.color,e.groundColor,e.intensity);break;case"LightProbe":r=(new Qu).fromJSON(e);break;case"SkinnedMesh":o=l(e.geometry),a=h(e.material),r=new oh(o,a),void 0!==e.bindMode&&(r.bindMode=e.bindMode),void 0!==e.bindMatrix&&r.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(r.skeleton=e.skeleton);break;case"Mesh":o=l(e.geometry),a=h(e.material),r=new S(o,a);break;case"InstancedMesh":o=l(e.geometry),a=h(e.material);const t=e.count,s=e.instanceMatrix,i=e.instanceColor;(r=new vh(o,a,t)).instanceMatrix=new dh(new Float32Array(s.array),16),void 0!==i&&(r.instanceColor=new dh(new Float32Array(i.array),i.itemSize));break;case"LOD":r=new eh;break;case"Line":r=new _h(l(e.geometry),h(e.material));break;case"LineLoop":r=new Ah(l(e.geometry),h(e.material));break;case"LineSegments":r=new Eh(l(e.geometry),h(e.material));break;case"PointCloud":case"Points":r=new Dh(l(e.geometry),h(e.material));break;case"Sprite":r=new Zl(h(e.material));break;case"Group":r=new Tl;break;case"Bone":r=new ah;break;default:r=new u}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(r.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera)&&(r.shadow.camera=this.parseObject(e.shadow.camera)),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.frustumCulled&&(r.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(r.renderOrder=e.renderOrder),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.layers&&(r.layers.mask=e.layers),void 0!==e.children){const o=e.children;for(let e=0;e<o.length;e++)r.add(this.parseObject(o[e],t,s,i,n))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const s=t[e];r.animations.push(n[s])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(r.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const s=t[e],i=r.getObjectByProperty("uuid",s.object);void 0!==i&&r.addLevel(i,s.distance)}}return r}bindSkeletons(e,i){0!==Object.keys(i).length&&e.traverse(function(e){var t;!0===e.isSkinnedMesh&&void 0!==e.skeleton&&(void 0===(t=i[e.skeleton])?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(t,e.bindMatrix))})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const nd={UVMapping:Ee,CubeReflectionMapping:Fe,CubeRefractionMapping:He,EquirectangularReflectionMapping:Ue,EquirectangularRefractionMapping:Ge,CubeUVReflectionMapping:We,CubeUVRefractionMapping:ke},rd={RepeatWrapping:Ve,ClampToEdgeWrapping:Ce,MirroredRepeatWrapping:je},sd={NearestFilter:Re,NearestMipmapNearestFilter:Xe,NearestMipmapLinearFilter:Ye,LinearFilter:F,LinearMipmapNearestFilter:Ze,LinearMipmapLinearFilter:Ke};class od extends Su{constructor(e){super(e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(t,i,e,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=bu.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout(function(){i&&i(s),r.manager.itemEnd(t)},0),s;var o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader,fetch(t,o).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(e){bu.add(t,e),i&&i(e),r.manager.itemEnd(t)}).catch(function(e){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}),r.manager.itemStart(t)}}let ad;od.prototype.isImageBitmapLoader=!0;const ld={getContext:function(){return ad=void 0===ad?new(window.AudioContext||window.webkitAudioContext):ad},setContext:function(e){ad=e}};class hd extends Su{constructor(e){super(e)}load(t,i,e,n){const r=this,s=new Eu(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(e){try{const t=e.slice(0);ld.getContext().decodeAudioData(t,function(e){i(e)})}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},e,n)}}class cd extends Qu{constructor(e,t,i=1){super(void 0,i);var i=(new g).set(e),e=(new g).set(t),t=new De(i.r,i.g,i.b),i=new De(e.r,e.g,e.b),e=Math.sqrt(Math.PI),n=e*Math.sqrt(.75);this.sh.coefficients[0].copy(t).add(i).multiplyScalar(e),this.sh.coefficients[1].copy(t).sub(i).multiplyScalar(n)}}cd.prototype.isHemisphereLightProbe=!0;class ud extends Qu{constructor(e,t=1){super(void 0,t);t=(new g).set(e);this.sh.coefficients[0].set(t.r,t.g,t.b).multiplyScalar(2*Math.sqrt(Math.PI))}}ud.prototype.isAmbientLightProbe=!0;const dd=new Ie,pd=new Ie;class md{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new B,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new B,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){var t,i,n,r,s,o=this._cache;o.focus===e.focus&&o.fov===e.fov&&o.aspect===e.aspect*this.aspect&&o.near===e.near&&o.far===e.far&&o.zoom===e.zoom&&o.eyeSep===this.eyeSep||(o.focus=e.focus,o.fov=e.fov,o.aspect=e.aspect*this.aspect,o.near=e.near,o.far=e.far,o.zoom=e.zoom,o.eyeSep=this.eyeSep,t=e.projectionMatrix.clone(),i=(r=o.eyeSep/2)*o.near/o.focus,n=o.near*Math.tan(dn*o.fov*.5)/o.zoom,pd.elements[12]=-r,dd.elements[12]=r,r=-n*o.aspect+i,s=n*o.aspect+i,t.elements[0]=2*o.near/(s-r),t.elements[8]=(s+r)/(s-r),this.cameraL.projectionMatrix.copy(t),r=-n*o.aspect-i,s=n*o.aspect-i,t.elements[0]=2*o.near/(s-r),t.elements[8]=(s+r)/(s-r),this.cameraR.projectionMatrix.copy(t)),this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(pd),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(dd)}}class fd{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=gd(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;var t;return this.autoStart&&!this.running?(this.start(),0):(this.running&&(t=gd(),e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e),e)}}function gd(){return("undefined"==typeof performance?Date:performance).now()}const vd=new De,yd=new On,xd=new De,wd=new De;class bd extends u{constructor(){super(),this.type="AudioListener",this.context=ld.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new fd}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return(null!==this.filter?(this.gain.disconnect(this.filter),this.filter):this.gain).disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);var t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(vd,yd,xd),wd.set(0,0,-1).applyQuaternion(yd),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(vd.x,e),t.positionY.linearRampToValueAtTime(vd.y,e),t.positionZ.linearRampToValueAtTime(vd.z,e),t.forwardX.linearRampToValueAtTime(wd.x,e),t.forwardY.linearRampToValueAtTime(wd.y,e),t.forwardZ.linearRampToValueAtTime(wd.z,e),t.upX.linearRampToValueAtTime(i.x,e),t.upY.linearRampToValueAtTime(i.y,e),t.upZ.linearRampToValueAtTime(i.z,e)}else t.setPosition(vd.x,vd.y,vd.z),t.setOrientation(wd.x,wd.y,wd.z,i.x,i.y,i.z)}}class Md extends u{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else{if(!1!==this.hasPlaybackControl)return this._startedAt=this.context.currentTime+e,(e=this.context.createBufferSource()).buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect();console.warn("THREE.Audio: this Audio has no playback control.")}}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e=e||[],!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const _d=new De,Sd=new On,Td=new De,Ed=new De;class Ad extends Md{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(_d,Sd,Td),Ed.set(0,0,1).applyQuaternion(Sd);var t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(_d.x,e),t.positionY.linearRampToValueAtTime(_d.y,e),t.positionZ.linearRampToValueAtTime(_d.z,e),t.orientationX.linearRampToValueAtTime(Ed.x,e),t.orientationY.linearRampToValueAtTime(Ed.y,e),t.orientationZ.linearRampToValueAtTime(Ed.z,e)}else t.setPosition(_d.x,_d.y,_d.z),t.setOrientation(Ed.x,Ed.y,Ed.z)}}}class Cd{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;var i=this.getFrequencyData();for(let e=0;e<i.length;e++)t+=i[e];return t/i.length}}class Rd{constructor(e,t,i){let n,r,s;switch(this.binding=e,this.valueSize=i,t){case"quaternion":n=this._slerp,r=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){var i=this.buffer,n=this.valueSize,r=e*n+n;let s=this.cumulativeWeight;if(0===s){for(let e=0;e!==n;++e)i[r+e]=i[e];s=t}else{const e=t/(s+=t);this._mixBufferRegion(i,r,0,e,n)}this.cumulativeWeight=s}accumulateAdditive(e){var t=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,n,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){var i=this.valueSize,n=this.buffer,r=e*i+i,t=this.cumulativeWeight,e=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,t<1){const e=i*this._origIndex;this._mixBufferRegion(n,r,e,1-t,i)}0<e&&this._mixBufferRegionAdditive(n,r,this._addIndex*i,1,i);for(let e=i,t=i+i;e!==t;++e)if(n[e]!==n[e+i]){s.setValue(n,r);break}}saveOriginalState(){var e=this.binding,i=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(i,r);for(let e=n,t=r;e!==t;++e)i[e]=i[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){var t=this._addIndex*this.valueSize,i=t+this.valueSize;for(let e=t;e<i;e++)this.buffer[e]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){var t=this._origIndex*this.valueSize,i=this._addIndex*this.valueSize;for(let e=0;e<this.valueSize;e++)this.buffer[i+e]=this.buffer[t+e]}_select(t,i,n,e,r){if(.5<=e)for(let e=0;e!==r;++e)t[i+e]=t[n+e]}_slerp(e,t,i,n){On.slerpFlat(e,t,e,t,e,i,n)}_slerpAdditive(e,t,i,n,r){r=this._workIndex*r;On.multiplyQuaternionsFlat(e,r,e,t,e,i),On.slerpFlat(e,t,e,t,e,r,n)}_lerp(t,i,n,r,s){var o=1-r;for(let e=0;e!==s;++e){const s=i+e;t[s]=t[s]*o+t[n+e]*r}}_lerpAdditive(t,i,n,r,s){for(let e=0;e!==s;++e){const s=i+e;t[s]=t[s]+t[n+e]*r}}}const Ld=new RegExp("[\\[\\]\\.:\\/]","g"),Pd="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",zd=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Dd=/(WCOD+)?/.source.replace("WCOD",Pd),Id=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Od=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Nd=new RegExp("^"+zd+Dd+Id+Od+"$"),Bd=["material","materials","bones"];class x{constructor(e,t,i){this.path=t,this.parsedPath=i||x.parseTrackName(t),this.node=x.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return new(e&&e.isAnimationObjectGroup?x.Composite:x)(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Ld,"")}static parseTrackName(e){var t=Nd.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var t={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=t.nodeName&&t.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const e=t.nodeName.substring(i+1);-1!==Bd.indexOf(e)&&(t.nodeName=t.nodeName.substring(0,i),t.objectName=e)}if(null===t.propertyName||0===t.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return t}static findNode(e,n){if(!n||""===n||"."===n||-1===n||n===e.name||n===e.uuid)return e;if(e.skeleton){var t=e.skeleton.getBoneByName(n);if(void 0!==t)return t}if(e.children){const r=function(t){for(let e=0;e<t.length;e++){var i=t[e];if(i.name===n||i.uuid===n)return i;i=r(i.children);if(i)return i}return null},i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(i,n){var r=this.resolvedProperty;for(let e=0,t=r.length;e!==t;++e)i[n++]=r[e]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(i,n){var r=this.resolvedProperty;for(let e=0,t=r.length;e!==t;++e)r[e]=i[n++]}_setValue_array_setNeedsUpdate(i,n){var r=this.resolvedProperty;for(let e=0,t=r.length;e!==t;++e)r[e]=i[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(i,n){var r=this.resolvedProperty;for(let e=0,t=r.length;e!==t;++e)r[e]=i[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let i=this.node;const e=this.parsedPath,n=e.objectName,r=e.propertyName;let s=e.propertyIndex;if(i||(i=x.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=i),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,i){if(n){let t=e.objectIndex;switch(n){case"materials":if(!i.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!i.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);i=i.material.materials;break;case"bones":if(!i.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);i=i.skeleton.bones;for(let e=0;e<i.length;e++)if(i[e].name===t){t=e;break}break;default:if(void 0===i[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);i=i[n]}if(void 0!==t){if(void 0===i[t])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,i);i=i[t]}}var o=i[r];if(void 0===o){const n=e.nodeName;void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",i)}else{let e=this.Versioning.None,t=(void 0!==(this.targetObject=i).needsUpdate?e=this.Versioning.NeedsUpdate:void 0!==i.matrixWorldNeedsUpdate&&(e=this.Versioning.MatrixWorldNeedsUpdate),this.BindingType.Direct);if(void 0!==s){if("morphTargetInfluences"===r){if(!i.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!i.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!i.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==i.morphTargetDictionary[s]&&(s=i.morphTargetDictionary[s])}t=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else void 0!==o.fromArray&&void 0!==o.toArray?(t=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(t=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[t],this.setValue=this.SetterByBindingTypeAndVersioning[t][e]}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}x.Composite=class{constructor(e,t,i){i=i||x.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();var i=this._targetGroup.nCachedObjects_,i=this._bindings[i];void 0!==i&&i.getValue(e,t)}setValue(i,n){var r=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=r.length;e!==t;++e)r[e].setValue(i,n)}bind(){var i=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=i.length;e!==t;++e)i[e].bind()}unbind(){var i=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=i.length;e!==t;++e)i[e].unbind()}},x.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},x.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},x.prototype.GetterByBindingType=[x.prototype._getValue_direct,x.prototype._getValue_array,x.prototype._getValue_arrayElement,x.prototype._getValue_toArray],x.prototype.SetterByBindingTypeAndVersioning=[[x.prototype._setValue_direct,x.prototype._setValue_direct_setNeedsUpdate,x.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[x.prototype._setValue_array,x.prototype._setValue_array_setNeedsUpdate,x.prototype._setValue_array_setMatrixWorldNeedsUpdate],[x.prototype._setValue_arrayElement,x.prototype._setValue_arrayElement_setNeedsUpdate,x.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[x.prototype._setValue_fromArray,x.prototype._setValue_fromArray_setNeedsUpdate,x.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Fd{constructor(){this.uuid=fn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var i={};this._indicesByUUID=i;for(let e=0,t=arguments.length;e!==t;++e)i[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}add(){const n=this._objects,r=this._indicesByUUID,s=this._paths,o=this._parsedPaths,a=this._bindings,l=a.length;let h=void 0,c=n.length,u=this.nCachedObjects_;for(let e=0,t=arguments.length;e!==t;++e){var d=arguments[e],p=d.uuid;let i=r[p];if(void 0===i){i=c++,r[p]=i,n.push(d);for(let e=0,t=l;e!==t;++e)a[e].push(new x(d,s[e],o[e]))}else if(i<u){h=n[i];const c=--u,m=n[c];r[m.uuid]=i,n[i]=m,r[p]=c,n[c]=d;for(let t=0,e=l;t!==e;++t){const r=a[t],l=r[c];let e=r[i];r[i]=l,void 0===e&&(e=new x(d,s[t],o[t])),r[c]=e}}else n[i]!==h&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=u}remove(){const i=this._objects,n=this._indicesByUUID,r=this._bindings,s=r.length;let o=this.nCachedObjects_;for(let e=0,t=arguments.length;e!==t;++e){var a=arguments[e],l=a.uuid,h=n[l];if(void 0!==h&&h>=o){var c=o++,u=i[c];n[u.uuid]=h,i[h]=u,n[l]=c,i[c]=a;for(let e=0,t=s;e!==t;++e){const n=r[e],s=n[c],o=n[h];n[h]=s,n[c]=o}}}this.nCachedObjects_=o}uncache(){const i=this._objects,n=this._indicesByUUID,r=this._bindings,s=r.length;let o=this.nCachedObjects_,a=i.length;for(let e=0,t=arguments.length;e!==t;++e){var l=arguments[e].uuid,h=n[l];if(void 0!==h)if(delete n[l],h<o){var c=--o,l=i[c],u=--a,d=i[u];n[l.uuid]=h,i[h]=l,n[d.uuid]=c,i[c]=d,i.pop();for(let e=0,t=s;e!==t;++e){const n=r[e],s=n[c],o=n[u];n[h]=s,n[c]=o,n.pop()}}else{const o=--a,p=i[o];0<o&&(n[p.uuid]=h),i[h]=p,i.pop();for(let e=0,t=s;e!==t;++e){const n=r[e];n[h]=n[o],n.pop()}}}this.nCachedObjects_=o}subscribe_(i,n){var e=this._bindingsIndicesByPath;let r=e[i];var t=this._bindings;if(void 0!==r)return t[r];var s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,h=this.nCachedObjects_,c=new Array(l);r=t.length,e[i]=r,s.push(i),o.push(n),t.push(c);for(let e=h,t=a.length;e!==t;++e){const r=a[e];c[e]=new x(r,i,n)}return c}unsubscribe_(e){var t,i,n,r,s,o=this._bindingsIndicesByPath,a=o[e];void 0!==a&&(t=this._paths,i=this._parsedPaths,s=(n=this._bindings)[r=n.length-1],n[o[e[r]]=a]=s,n.pop(),i[a]=i[r],i.pop(),t[a]=t[r],t.pop())}}Fd.prototype.isAnimationObjectGroup=!0;class Hd{constructor(e,t,i=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=n;var r=t.tracks,s=r.length,o=new Array(s),a={endingStart:vi,endingEnd:vi};for(let e=0;e!==s;++e){const t=r[e].createInterpolant(null);(o[e]=t).settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=di,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const i=this._clip.duration,n=e._clip.duration,r=n/i,s=i/n;e.warp(1,r,t),this.warp(s,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){var n=this._mixer,r=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);var n=o.parameterPositions,a=o.sampleValues;return n[0]=r,n[1]=r+i,a[0]=e/s,a[1]=t/s,this}stopWarping(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(i,n,e,r){if(this.enabled){var t=this._startTime;if(null!==t){const r=(i-t)*e;if(r<0||0===e)return;this._startTime=null,n=e*r}n*=this._updateTimeScale(i);var s=this._updateTime(n),o=this._updateWeight(i);if(0<o){const i=this._interpolants,n=this._propertyBindings;if(this.blendMode===bi)for(let e=0,t=i.length;e!==t;++e)i[e].evaluate(s),n[e].accumulateAdditive(o);else{wi;for(let e=0,t=i.length;e!==t;++e)i[e].evaluate(s),n[e].accumulate(r,o)}}}else this._updateWeight(i)}_updateWeight(e){let t=0;var i,n;return this.enabled&&(t=this.weight,null!==(i=this._weightInterpolant))&&(n=i.evaluate(e)[0],t*=n,e>i.parameterPositions[1])&&(this.stopFading(),0===n)&&(this.enabled=!1),this._effectiveWeight=t}_updateTimeScale(e){let t=0;var i;return this.paused||(t=this.timeScale,null!==(i=this._timeScaleInterpolant)&&(t*=i.evaluate(e)[0],e>i.parameterPositions[1])&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)),this._effectiveTimeScale=t}_updateTime(e){const t=this._clip.duration,i=this.loop;let n=this.time+e,r=this._loopCount;var s=i===pi;if(0===e)return-1!==r&&s&&1==(1&r)?t-n:n;if(i===ui){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(0<=e?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=t||n<0){const i=Math.floor(n/t);n-=t*i,r+=Math.abs(i);var o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=0<e?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<e?1:-1});else{if(1==o){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&1==(1&r))return t-n}return n}_setEndings(e,t,i){var n=this._interpolantSettings;i?(n.endingStart=yi,n.endingEnd=yi):(n.endingStart=e?this.zeroSlopeAtStart?yi:vi:xi,n.endingEnd=t?this.zeroSlopeAtEnd?yi:vi:xi)}_scheduleFading(e,t,i){var n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);var n=s.parameterPositions,o=s.sampleValues;return n[0]=r,o[0]=t,n[1]=r+e,o[1]=i,this}}class Ud extends cn{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,i){const n=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,h=this._bindingsByRootAndName;let c=h[l];void 0===c&&(c={},h[l]=c);for(let t=0;t!==s;++t){const s=r[t],h=s.name;let e=c[h];if(void 0===e){if(void 0!==(e=o[t])){null===e._cacheIndex&&(++e.referenceCount,this._addInactiveBinding(e,l,h));continue}const r=i&&i._propertyBindings[t].binding.parsedPath;++(e=new Rd(x.create(n,h,r),s.ValueTypeName,s.getValueSize())).referenceCount,this._addInactiveBinding(e,l,h)}o[t]=e,a[t].resultBuffer=e.buffer}}_activateAction(e){if(!this._isActiveAction(e)){null===e._cacheIndex&&(t=(e._localRoot||this._root).uuid,i=e._clip.uuid,n=this._actionsByClip[i],this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,i,t));var t,i,n,r=e._propertyBindings;for(let e=0,t=r.length;e!==t;++e){var s=r[e];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){var i=e._propertyBindings;for(let e=0,t=i.length;e!==t;++e){var n=i[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){e=e._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(e,t,i){var n=this._actions,r=this._actionsByClip;let s=r[t];if(void 0===s)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=s;else{const t=s.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=n.length,n.push(e),s.actionByRoot[i]=e}_removeInactiveAction(e){var t=this._actions,i=t[t.length-1],n=e._cacheIndex,n=(t[i._cacheIndex=n]=i,t.pop(),e._cacheIndex=null,e._clip.uuid),i=this._actionsByClip,t=i[n],r=t.knownActions,s=r[r.length-1],o=e._byClipCacheIndex;r[s._byClipCacheIndex=o]=s,r.pop(),e._byClipCacheIndex=null,delete t.actionByRoot[(e._localRoot||this._root).uuid],0===r.length&&delete i[n],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){var i=e._propertyBindings;for(let e=0,t=i.length;e!==t;++e){var n=i[e];0==--n.referenceCount&&this._removeInactiveBinding(n)}}_lendAction(e){var t=this._actions,i=e._cacheIndex,n=this._nActiveActions++,r=t[n];t[e._cacheIndex=n]=e,t[r._cacheIndex=i]=r}_takeBackAction(e){var t=this._actions,i=e._cacheIndex,n=--this._nActiveActions,r=t[n];t[e._cacheIndex=n]=e,t[r._cacheIndex=i]=r}_addInactiveBinding(e,t,i){var n=this._bindingsByRootAndName,r=this._bindings;let s=n[t];void 0===s&&(s={},n[t]=s),(s[i]=e)._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){var t=this._bindings,i=e.binding,n=i.rootNode.uuid,i=i.path,r=this._bindingsByRootAndName,s=r[n],o=t[t.length-1],e=e._cacheIndex;t[o._cacheIndex=e]=o,t.pop(),delete s[i],0===Object.keys(s).length&&delete r[n]}_lendBinding(e){var t=this._bindings,i=e._cacheIndex,n=this._nActiveBindings++,r=t[n];t[e._cacheIndex=n]=e,t[r._cacheIndex=i]=r}_takeBackBinding(e){var t=this._bindings,i=e._cacheIndex,n=--this._nActiveBindings,r=t[n];t[e._cacheIndex=n]=e,t[r._cacheIndex=i]=r}_lendControlInterpolant(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return void 0===i&&(e[(i=new cu(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t]=i),i}_takeBackControlInterpolant(e){var t=this._controlInterpolants,i=e.__cacheIndex,n=--this._nActiveControlInterpolants,r=t[n];t[e.__cacheIndex=n]=e,t[r.__cacheIndex=i]=r}clipAction(e,t,i){var n=t||this._root,r=n.uuid;let s="string"==typeof e?wu.findByName(n,e):e;var n=null!==s?s.uuid:e,o=this._actionsByClip[n];let a=null;if(void 0===i&&(i=null!==s?s.blendMode:wi),void 0!==o){const e=o.actionByRoot[r];if(void 0!==e&&e.blendMode===i)return e;a=o.knownActions[0],null===s&&(s=a._clip)}return null===s?null:(e=new Hd(this,s,t,i),this._bindAction(e,a),this._addInactiveAction(e,n,r),e)}existingAction(e,t){var t=t||this._root,i=t.uuid,t="string"==typeof e?wu.findByName(t,e):e,t=t?t.uuid:e,e=this._actionsByClip[t];return void 0!==e&&e.actionByRoot[i]||null}stopAllAction(){var t=this._actions;for(let e=this._nActiveActions-1;0<=e;--e)t[e].stop();return this}update(t){t*=this.timeScale;var i=this._actions,n=this._nActiveActions,r=this.time+=t,s=Math.sign(t),o=this._accuIndex^=1;for(let e=0;e!==n;++e)i[e]._update(r,t,s,o);var a=this._bindings,l=this._nActiveBindings;for(let e=0;e!==l;++e)a[e].apply(o);return this}setTime(e){for(let e=this.time=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(i){const n=this._actions,e=i.uuid,r=this._actionsByClip,s=r[e];if(void 0!==s){const i=s.knownActions;for(let e=0,t=i.length;e!==t;++e){const r=i[e],s=(this._deactivateAction(r),r._cacheIndex),o=n[n.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,o._cacheIndex=s,n[s]=o,n.pop(),this._removeInactiveBindingsForAction(r)}delete r[e]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const e in i){const n=i[e].actionByRoot[t];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[t];if(void 0!==n)for(const e in n){const t=n[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){e=this.existingAction(e,t);null!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}}Ud.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class Gd{constructor(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Gd(void 0===this.value.clone?this.value:this.value.clone())}}class Wd extends Il{constructor(e,t,i=1){super(e,t),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){e=super.clone(e);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(e){e=super.toJSON(e);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}Wd.prototype.isInstancedInterleavedBuffer=!0;class kd{constructor(e,t,i,n,r){this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=n,this.count=r,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}kd.prototype.isGLBufferAttribute=!0;class Vd{constructor(e,t,i=0,n=1/0){this.ray=new ur(e,t),this.near=i,this.far=n,this.camera=null,this.layers=new Mr,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,i=[]){return Xd(e,this,i,t),i.sort(jd),i}intersectObjects(i,n=!0,r=[]){for(let e=0,t=i.length;e<t;e++)Xd(i[e],this,r,n);return r.sort(jd),r}}function jd(e,t){return e.distance-t.distance}function Xd(e,i,n,r){if(e.layers.test(i.layers)&&e.raycast(i,n),!0===r){const r=e.children;for(let e=0,t=r.length;e<t;e++)Xd(r[e],i,n,!0)}}class qd{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(gn(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class Yd{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return(new this.constructor).copy(this)}}const Jd=new W;class Zd{constructor(e=new W(1/0,1/0),t=new W(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(i){this.makeEmpty();for(let e=0,t=i.length;e<t;e++)this.expandByPoint(i[e]);return this}setFromCenterAndSize(e,t){t=Jd.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(t),this.max.copy(e).add(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Jd.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}Zd.prototype.isBox2=!0;const Qd=new De,Kd=new De;class $d{constructor(e=new De,t=new De){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Qd.subVectors(e,this.start),Kd.subVectors(this.end,this.start);e=Kd.dot(Kd);let i=Kd.dot(Qd)/e;return i=t?gn(i,0,1):i}closestPointToPoint(e,t,i){e=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(e).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const ep=new De;class tp extends u{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;var e=new _,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1;e<32;e++,t++){const n=e/32*Math.PI*2,r=t/32*Math.PI*2;i.push(Math.cos(n),Math.sin(n),1,Math.cos(r),Math.sin(r),1)}e.setAttribute("position",new k(i,3));const n=new y({fog:!1,toneMapped:!1});this.cone=new Eh(e,n),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();var e=this.light.distance||1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),ep.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(ep),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const ip=new De,np=new Ie,rp=new Ie;class sp extends Eh{constructor(e){const t=function t(i){var n=[];i&&i.isBone&&n.push(i);for(let e=0;e<i.children.length;e++)n.push.apply(n,t(i.children[e]));return n}(e),i=new _,n=[],r=[],s=new g(0,0,1),o=new g(0,1,0);for(let e=0;e<t.length;e++){const i=t[e];i.parent&&i.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(s.r,s.g,s.b),r.push(o.r,o.g,o.b))}i.setAttribute("position",new k(n,3)),i.setAttribute("color",new k(r,3)),super(i,new y({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){var i=this.bones,t=this.geometry,n=t.getAttribute("position");rp.copy(this.root.matrixWorld).invert();for(let e=0,t=0;e<i.length;e++){var r=i[e];r.parent&&r.parent.isBone&&(np.multiplyMatrices(rp,r.matrixWorld),ip.setFromMatrixPosition(np),n.setXYZ(t,ip.x,ip.y,ip.z),np.multiplyMatrices(rp,r.parent.matrixWorld),ip.setFromMatrixPosition(np),n.setXYZ(t+1,ip.x,ip.y,ip.z),t+=2)}t.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}class op extends S{constructor(e,t,i){super(new Vc(t,4,2),new $r({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const ap=new De,lp=new g,hp=new g;class cp extends u{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;e=new Gc(t),e.rotateY(.5*Math.PI),this.material=new $r({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0),i=e.getAttribute("position"),t=new Float32Array(3*i.count);e.setAttribute("color",new T(t,3)),this.add(new S(e,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var i=e.geometry.getAttribute("color");lp.copy(this.light.color),hp.copy(this.light.groundColor);for(let e=0,t=i.count;e<t;e++){var n=e<t/2?lp:hp;i.setXYZ(e,n.r,n.g,n.b)}i.needsUpdate=!0}e.lookAt(ap.setFromMatrixPosition(this.light.matrixWorld).negate())}}class up extends Eh{constructor(e=10,n=10,r=4473924,s=8947848){r=new g(r),s=new g(s);var o=n/2,a=e/n,l=e/2,h=[],c=[];for(let e=0,t=0,i=-l;e<=n;e++,i+=a){h.push(-l,0,i,l,0,i),h.push(i,0,-l,i,0,l);const n=e===o?r:s;n.toArray(c,t),t+=3,n.toArray(c,t),t+=3,n.toArray(c,t),t+=3,n.toArray(c,t),t+=3}e=new _;e.setAttribute("position",new k(h,3)),e.setAttribute("color",new k(c,3)),super(e,new y({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class dp extends Eh{constructor(t=10,i=16,n=8,r=64,s=4473924,o=8947848){s=new g(s),o=new g(o);var a=[],l=[];for(let e=0;e<=i;e++){const r=e/i*(2*Math.PI),p=Math.sin(r)*t,m=Math.cos(r)*t;a.push(0,0,0),a.push(p,0,m);var h=1&e?s:o;l.push(h.r,h.g,h.b),l.push(h.r,h.g,h.b)}for(let e=0;e<=n;e++){const p=1&e?s:o,f=t-t/n*e;for(let e=0;e<r;e++){var c=e/r*(2*Math.PI),u=Math.sin(c)*f,d=Math.cos(c)*f;a.push(u,0,d),l.push(p.r,p.g,p.b),c=(e+1)/r*(2*Math.PI),u=Math.sin(c)*f,d=Math.cos(c)*f,a.push(u,0,d),l.push(p.r,p.g,p.b)}}const p=new _;p.setAttribute("position",new k(a,3)),p.setAttribute("color",new k(l,3)),super(p,new y({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const pp=new De,mp=new De,fp=new De;class gp extends u{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===t&&(t=1);let n=new _;n.setAttribute("position",new k([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));e=new y({fog:!1,toneMapped:!1});this.lightPlane=new _h(n,e),this.add(this.lightPlane),(n=new _).setAttribute("position",new k([0,0,0,0,0,1],3)),this.targetLine=new _h(n,e),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){pp.setFromMatrixPosition(this.light.matrixWorld),mp.setFromMatrixPosition(this.light.target.matrixWorld),fp.subVectors(mp,pp),this.lightPlane.lookAt(mp),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(mp),this.targetLine.scale.z=fp.length()}}const vp=new De,a=new Hs;class yp extends Eh{constructor(e){const t=new _,i=new y({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],s={},o=new g(16755200),a=new g(16711680),l=new g(43775),h=new g(16777215),c=new g(3355443);function u(e,t,i){d(e,i),d(t,i)}function d(e,t){n.push(0,0,0),r.push(t.r,t.g,t.b),void 0===s[e]&&(s[e]=[]),s[e].push(n.length/3-1)}u("n1","n2",o),u("n2","n4",o),u("n4","n3",o),u("n3","n1",o),u("f1","f2",o),u("f2","f4",o),u("f4","f3",o),u("f3","f1",o),u("n1","f1",o),u("n2","f2",o),u("n3","f3",o),u("n4","f4",o),u("p","n1",a),u("p","n2",a),u("p","n3",a),u("p","n4",a),u("u1","u2",l),u("u2","u3",l),u("u3","u1",l),u("c","t",h),u("p","c",c),u("cn1","cn2",c),u("cn3","cn4",c),u("cf1","cf2",c),u("cf3","cf4",c),t.setAttribute("position",new k(n,3)),t.setAttribute("color",new k(r,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}update(){var e=this.geometry,t=this.pointMap;a.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),l("c",t,e,a,0,0,-1),l("t",t,e,a,0,0,1),l("n1",t,e,a,-1,-1,-1),l("n2",t,e,a,1,-1,-1),l("n3",t,e,a,-1,1,-1),l("n4",t,e,a,1,1,-1),l("f1",t,e,a,-1,-1,1),l("f2",t,e,a,1,-1,1),l("f3",t,e,a,-1,1,1),l("f4",t,e,a,1,1,1),l("u1",t,e,a,.7,1.1,-1),l("u2",t,e,a,-.7,1.1,-1),l("u3",t,e,a,0,2,-1),l("cf1",t,e,a,-1,0,1),l("cf2",t,e,a,1,0,1),l("cf3",t,e,a,0,-1,1),l("cf4",t,e,a,0,1,1),l("cn1",t,e,a,-1,0,-1),l("cn2",t,e,a,1,0,-1),l("cn3",t,e,a,0,-1,-1),l("cn4",t,e,a,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function l(i,e,t,n,r,s,o){vp.set(r,s,o).unproject(n);var a=e[i];if(void 0!==a){const i=t.getAttribute("position");for(let e=0,t=a.length;e<t;e++)i.setXYZ(a[e],vp.x,vp.y,vp.z)}}const xp=new Fn;class wp extends Eh{constructor(e,t=16776960){var i=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]),n=new Float32Array(24),r=new _;r.setIndex(new T(i,1)),r.setAttribute("position",new T(n,3)),super(r,new y({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){var t,i,n;void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&xp.setFromObject(this.object),xp.isEmpty()||(e=xp.min,t=xp.max,(n=(i=this.geometry.attributes.position).array)[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=e.x,n[4]=t.y,n[5]=t.z,n[6]=e.x,n[7]=e.y,n[8]=t.z,n[9]=t.x,n[10]=e.y,n[11]=t.z,n[12]=t.x,n[13]=t.y,n[14]=e.z,n[15]=e.x,n[16]=t.y,n[17]=e.z,n[18]=e.x,n[19]=e.y,n[20]=e.z,n[21]=t.x,n[22]=e.y,n[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere())}setFromObject(e){return this.object=e,this.update(),this}copy(e){return Eh.prototype.copy.call(this,e),this.object=e.object,this}}class bp extends Eh{constructor(e,t=16776960){var i=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]),n=new _;n.setIndex(new T(i,1)),n.setAttribute("position",new k([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new y({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class Mp extends _h{constructor(e,t=1,i=16776960){var n=new _,n=(n.setAttribute("position",new k([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),n.computeBoundingSphere(),super(n,new y({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t,new _);n.setAttribute("position",new k([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),n.computeBoundingSphere(),this.add(new S(n,new $r({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?Ae:Oe,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const _p=new De;let Sp,Tp;class Ep extends u{constructor(e=new De(0,0,1),t=new De(0,0,0),i=1,n=16776960,r=.2*i,s=.2*r){super(),this.type="ArrowHelper",void 0===Sp&&((Sp=new _).setAttribute("position",new k([0,0,0,0,1,0],3)),(Tp=new Uh(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new _h(Sp,new y({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new S(Tp,new $r({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,r,s)}setDirection(e){.99999<e.y?this.quaternion.set(0,0,0,1):e.y<-.99999?this.quaternion.set(1,0,0,0):(_p.set(e.z,0,-e.x).normalize(),e=Math.acos(e.y),this.quaternion.setFromAxisAngle(_p,e))}setLength(e,t=.2*e,i=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class Ap extends Eh{constructor(e=1){var e=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],t=new _;t.setAttribute("position",new k(e,3)),t.setAttribute("color",new k([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(t,new y({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,i){var n=new g,r=this.geometry.attributes.color.array;return n.set(e),n.toArray(r,0),n.toArray(r,3),n.set(t),n.toArray(r,6),n.toArray(r,9),n.set(i),n.toArray(r,12),n.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Cp{constructor(){this.type="ShapePath",this.color=new g,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new gc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,n){return this.currentPath.quadraticCurveTo(e,t,i,n),this}bezierCurveTo(e,t,i,n,r,s){return this.currentPath.bezierCurveTo(e,t,i,n,r,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(o,a){function e(i){var n=[];for(let e=0,t=i.length;e<t;e++){var r=i[e],s=new vc;s.curves=r.curves,n.push(s)}return n}const l=Ic.isClockWise,h=this.subPaths;if(0===h.length)return[];if(!0===a)return e(h);let c,u,d;var t=[];if(1===h.length)u=h[0],(d=new vc).curves=u.curves,t.push(d);else{var p=!l(h[0].getPoints()),p=o?!p:p,m=[],f=[];let i,n,s=[],r=0;f[r]=void 0,s[r]=[];for(let e=0,t=h.length;e<t;e++)i=(u=h[e]).getPoints(),c=l(i),(c=o?!c:c)?(!p&&f[r]&&r++,f[r]={s:new vc,p:i},f[r].s.curves=u.curves,p&&r++,s[r]=[]):s[r].push({h:u,p:i[0]});if(!f[0])return e(h);if(1<f.length){let r=!1;const a=[];for(let e=0,t=f.length;e<t;e++)m[e]=[];for(let n=0,e=f.length;n<e;n++){const l=s[n];for(let i=0;i<l.length;i++){const c=l[i];let t=!0;for(let e=0;e<f.length;e++)!function(o,a){var e=a.length;let l=!1;for(let r=e-1,s=0;s<e;r=s++){let e=a[r],t=a[s],i=t.x-e.x,n=t.y-e.y;if(Math.abs(n)>Number.EPSILON){if(n<0&&(e=a[s],i=-i,t=a[r],n=-n),!(o.y<e.y||o.y>t.y))if(o.y===e.y){if(o.x===e.x)return 1}else{const a=n*(o.x-e.x)-i*(o.y-e.y);if(0==a)return 1;a<0||(l=!l)}}else if(o.y===e.y&&(t.x<=o.x&&o.x<=e.x||e.x<=o.x&&o.x<=t.x))return 1}return l}(c.p,f[e].p)||(n!==e&&a.push({froms:n,tos:e,hole:i}),t?(t=!1,m[e].push(c)):r=!0);t&&m[n].push(c)}}0<a.length&&(r||(s=m))}for(let i=0,e=f.length;i<e;i++){d=f[i].s,t.push(d);for(let e=0,t=(n=s[i]).length;e<t;e++)d.holes.push(n[e].h)}}return t}}const Rp=new Float32Array(1),Lp=new Int32Array(Rp.buffer);class Pp{static toHalfFloat(e){65504<e&&(console.warn("THREE.DataUtils.toHalfFloat(): value exceeds 65504."),e=65504),Rp[0]=e;e=Lp[0];let t=e>>16&32768,i=e>>12&2047;var n=e>>23&255;return n<103||(142<n?t=t|31744|((255==n?0:1)&&8388607&e):n<113?(i|=2048,t|=(i>>114-n)+(i>>113-n&1)):t=(t|=n-112<<10|i>>1)+(1&i)),t}}const zp=0,Dp=1,Ip=0,Op=1,Np=2;function Bp(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function Fp(e=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,(e.materials=e).clone=function(){return e.slice()},e}function Hp(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Dh(e,t)}function Up(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Zl(e)}function Gp(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Dh(e,t)}function Wp(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Ch(e)}function kp(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Ch(e)}function Vp(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Ch(e)}function jp(e,t,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new De(e,t,i)}function Xp(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new T(e,t).setUsage($i)}function qp(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new ts(e,t)}function Yp(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new is(e,t)}function Jp(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new ns(e,t)}function Zp(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new rs(e,t)}function Qp(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new ss(e,t)}function Kp(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new os(e,t)}function $p(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new as(e,t)}function em(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new k(e,t)}function tm(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new hs(e,t)}function im(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Ap(e)}function nm(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new wp(e,t)}function rm(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Eh(new Yh(e.geometry),new y({color:void 0!==t?t:16777215}))}function sm(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Eh(new Jc(e.geometry),new y({color:void 0!==t?t:16777215}))}function om(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Eu(e)}function am(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Pu(e)}function lm(e,t,i){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Ws(e,i)}function hm(){console.error("THREE.CanvasRenderer has been removed")}function cm(){console.error("THREE.JSONLoader has been removed.")}Jh.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Jh.prototype),(e.prototype.constructor=e).prototype.getPoint=t,e},gc.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},up.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},sp.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Su.prototype.extractUrlBase=function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),$u.extractUrlBase(e)},Su.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.")}},Zd.prototype.center=function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},Zd.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Zd.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},Zd.prototype.size=function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)},Fn.prototype.center=function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Fn.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Fn.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},Fn.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},Fn.prototype.size=function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)},nr.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Js.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},$d.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},v.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},v.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},v.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},v.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},v.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},v.prototype.getInverse=function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Ie.prototype.extractPosition=function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},Ie.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},Ie.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new De).setFromMatrixColumn(this,3)},Ie.prototype.setRotationFromQuaternion=function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},Ie.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Ie.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Ie.prototype.multiplyVector4=function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Ie.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Ie.prototype.rotateAxis=function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},Ie.prototype.crossVector=function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Ie.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Ie.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Ie.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Ie.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Ie.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Ie.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Ie.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Ie.prototype.makeFrustum=function(e,t,i,n,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,n,i,r,s)},Ie.prototype.getInverse=function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Xs.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},On.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},On.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},ur.prototype.isIntersectionBox=function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},ur.prototype.isIntersectionPlane=function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},ur.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},p.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},p.prototype.barycoordFromPoint=function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},p.prototype.midpoint=function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},p.prototypenormal=function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},p.prototype.plane=function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)},p.barycoordFromPoint=function(e,t,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),p.getBarycoord(e,t,i,n,r)},p.normal=function(e,t,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),p.getNormal(e,t,i,n)},vc.prototype.extractAllPoints=function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},vc.prototype.extrude=function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Bc(this,e)},vc.prototype.makeGeometry=function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new kc(this,e)},W.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},W.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},W.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},De.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},De.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},De.prototype.getPositionFromMatrix=function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},De.prototype.getScaleFromMatrix=function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},De.prototype.getColumnFromMatrix=function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},De.prototype.applyProjection=function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},De.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},De.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},De.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},ze.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},ze.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},u.prototype.getChildByName=function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},u.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},u.prototype.translate=function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},u.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},u.prototype.applyMatrix=function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(u.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.")}}}),S.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(S.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),Mi},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.")}}}),oh.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},B.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Du.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(T.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===$i},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage($i)}}}),T.prototype.setDynamic=function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?$i:Ki),this},T.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},T.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},_.prototype.addIndex=function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},_.prototype.addAttribute=function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new T(t,arguments[2])))},_.prototype.addDrawCall=function(e,t,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},_.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},_.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},_.prototype.removeAttribute=function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},_.prototype.applyMatrix=function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(_.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}}}),Il.prototype.setDynamic=function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?$i:Ki),this},Il.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Bc.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Bc.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Bc.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},Dl.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Gd.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(i.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 g}},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===D}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}}),Object.defineProperties(Fs.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}}}),s.prototype.clearTarget=function(e,t,i,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,i,n)},s.prototype.animate=function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},s.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},s.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},s.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},s.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},s.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},s.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},s.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},s.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},s.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},s.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},s.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},s.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},s.prototype.enableScissorTest=function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},s.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},s.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},s.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},s.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},s.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},s.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},s.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},s.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},s.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},s.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(s.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?Ti:Pe}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(wl.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(zn.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}}}),Md.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return(new hd).load(e,function(e){t.setBuffer(e)}),this},Cd.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Us.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},Us.prototype.clear=function(e,t,i,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,i,n)},Rn.crossOrigin=void 0,Rn.loadTexture=function(e,t,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new zu,r=(r.setCrossOrigin(this.crossOrigin),r.load(e,i,void 0,n));return t&&(r.mapping=t),r},Rn.loadTextureCube=function(e,t,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new Lu,r=(r.setCrossOrigin(this.crossOrigin),r.load(e,i,void 0,n));return t&&(r.mapping=t),r},Rn.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Rn.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const um={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function dm(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}function pm(){return console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),new _}function mm(){return console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),new _}function fm(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function gm(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function vm(){console.error("THREE.ImmediateRenderObject has been removed.")}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:w}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=w)},857:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};function t(){return"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)}n.r(e),n.d(e,{default:()=>c}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),t()&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var a=o.VantaBase;let l="object"==typeof window&&window.THREE,{Camera:d,ClampToEdgeWrapping:p,DataTexture:m,FloatType:f,Mesh:g,NearestFilter:v,PlaneBufferGeometry:y,RGBAFormat:x,Scene:w,ShaderMaterial:b,WebGLRenderTarget:M}=l||{};function _(l,h,c,e){e&&({Camera:d,ClampToEdgeWrapping:p,DataTexture:m,FloatType:f,Mesh:g,NearestFilter:v,PlaneBufferGeometry:y,RGBAFormat:x,Scene:w,ShaderMaterial:b,WebGLRenderTarget:M}=e),this.variables=[],this.currentTextureIndex=0;var o=f,n=new w,r=new d,i=(r.position.z=1,{passThruTexture:{value:null}}),s=t("uniform sampler2D passThruTexture;\n\nvoid main() {\n\n\tvec2 uv = gl_FragCoord.xy / resolution.xy;\n\n\tgl_FragColor = texture2D( passThruTexture, uv );\n\n}\n",i),a=new g(new y(2,2),s);function u(e){e.defines.resolution="vec2( "+l.toFixed(1)+", "+h.toFixed(1)+" )"}function t(e,t){t=new b({uniforms:t=t||{},vertexShader:"void main()\t{\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n",fragmentShader:e});return u(t),t}n.add(a),this.setDataType=function(e){return o=e,this},this.addVariable=function(e,t,i){e={name:e,initialValueTexture:i,material:this.createShaderMaterial(t),dependencies:null,renderTargets:[],wrapS:null,wrapT:null,minFilter:v,magFilter:v};return this.variables.push(e),e},this.setVariableDependencies=function(e,t){e.dependencies=t},this.init=function(){if(!c.capabilities.isWebGL2&&!c.extensions.get("OES_texture_float"))return"No OES_texture_float support for float textures.";if(0===c.capabilities.maxVertexTextures)return"No support for vertex shader textures.";for(var e=0;e<this.variables.length;e++){var t=this.variables[e],i=(t.renderTargets[0]=this.createRenderTarget(l,h,t.wrapS,t.wrapT,t.minFilter,t.magFilter),t.renderTargets[1]=this.createRenderTarget(l,h,t.wrapS,t.wrapT,t.minFilter,t.magFilter),this.renderTexture(t.initialValueTexture,t.renderTargets[0]),this.renderTexture(t.initialValueTexture,t.renderTargets[1]),t.material),n=i.uniforms;if(null!==t.dependencies)for(var r=0;r<t.dependencies.length;r++){var s=t.dependencies[r];if(s.name!==t.name){for(var o=!1,a=0;a<this.variables.length;a++)if(s.name===this.variables[a].name){o=!0;break}if(!o)return"Variable dependency not found. Variable="+t.name+", dependency="+s.name}n[s.name]={value:null},i.fragmentShader="\nuniform sampler2D "+s.name+";\n"+i.fragmentShader}}return this.currentTextureIndex=0,null},this.compute=function(){for(var e=this.currentTextureIndex,t=0===this.currentTextureIndex?1:0,i=0,n=this.variables.length;i<n;i++){var r=this.variables[i];if(null!==r.dependencies)for(var s=r.material.uniforms,o=0,a=r.dependencies.length;o<a;o++){var l=r.dependencies[o];s[l.name].value=l.renderTargets[e].texture}this.doRenderTarget(r.material,r.renderTargets[t])}this.currentTextureIndex=t},this.getCurrentRenderTarget=function(e){return e.renderTargets[this.currentTextureIndex]},this.getAlternateRenderTarget=function(e){return e.renderTargets[0===this.currentTextureIndex?1:0]},this.addResolutionDefine=u,this.createShaderMaterial=t,this.createRenderTarget=function(e,t,i,n,r,s){return new M(e=e||l,t=t||h,{wrapS:i=i||p,wrapT:n=n||p,minFilter:r=r||v,magFilter:s=s||v,format:x,type:o,stencilBuffer:!1,depthBuffer:!1})},this.createTexture=function(){var e=new Float32Array(l*h*4);return new m(e,l,h,x,f)},this.renderTexture=function(e,t){i.passThruTexture.value=e,this.doRenderTarget(s,t),i.passThruTexture.value=null},this.doRenderTarget=function(e,t){var i=c.getRenderTarget();a.material=e,c.setRenderTarget(t),c.render(n,r),a.material=s,c.setRenderTarget(i)}}let S="object"==typeof window&&window.THREE;const u=!t();let T=32,E=T*T;class A{constructor(e){var n,t,i=new S.Vector3,r=500,s=500,o=200,c=e;this.position=new S.Vector3,this.velocity=new S.Vector3,n=new S.Vector3,this.setGoal=function(e){t=e},this.setWorldSize=function(e,t,i){r=e,s=t,o=i},this.run=function(e){i.set(-r,this.position.y,this.position.z),(i=this.avoid(i)).multiplyScalar(5),n.add(i),i.set(r,this.position.y,this.position.z),(i=this.avoid(i)).multiplyScalar(5),n.add(i),i.set(this.position.x,-s,this.position.z),(i=this.avoid(i)).multiplyScalar(5),n.add(i),i.set(this.position.x,s,this.position.z),(i=this.avoid(i)).multiplyScalar(5),n.add(i),i.set(this.position.x,this.position.y,-o),(i=this.avoid(i)).multiplyScalar(5),n.add(i),i.set(this.position.x,this.position.y,o),(i=this.avoid(i)).multiplyScalar(5),n.add(i),.5<Math.random()&&this.flock(e),this.move()},this.flock=function(e){t&&n.add(this.reach(t,.005)),n.add(this.alignment(e)),n.add(this.cohesion(e)),n.add(this.separation(e))},this.move=function(){this.velocity.add(n);var e=this.velocity.length();2.5<e&&this.velocity.divideScalar(e/2.5),this.position.add(this.velocity),n.set(0,0,0)},this.checkBounds=function(){this.position.x>r&&(this.position.x=-r),this.position.x<-r&&(this.position.x=r),this.position.y>s&&(this.position.y=-s),this.position.y<-s&&(this.position.y=s),this.position.z>o&&(this.position.z=-o),this.position.z<-o&&(this.position.z=o)},this.avoid=function(e){var t=new S.Vector3;return t.copy(this.position),t.sub(e),t.multiplyScalar(1/this.position.distanceToSquared(e)),t},this.repulse=function(e){var t,i=this.position.distanceTo(e);i<150&&((t=new S.Vector3).subVectors(this.position,e),t.multiplyScalar(.5/i),n.add(t))},this.reach=function(e,t){var i=new S.Vector3;return i.subVectors(e,this.position),i.multiplyScalar(t),i},this.alignment=function(e){for(var t,i,n,r=new S.Vector3,s=0,o=100*c.alignment/20,a=0,l=e.length;a<l;a++).6<Math.random()||0<(i=(t=e[a]).position.distanceTo(this.position))&&i<=o&&(r.add(t.velocity),s++);return 0<s&&(r.divideScalar(s),.1<(n=r.length()))&&r.divideScalar(n/.1),r},this.cohesion=function(e){for(var t,i,n=new S.Vector3,r=new S.Vector3,s=0,o=100*c.cohesion/20,a=0,l=e.length;a<l;a++).6<Math.random()||0<(i=(t=e[a]).position.distanceTo(this.position))&&i<=o&&(n.add(t.position),s++);0<s&&n.divideScalar(s),r.subVectors(n,this.position);var h=r.length();return.1<h&&r.divideScalar(h/.1),r},this.separation=function(e){for(var t,i,n=new S.Vector3,r=new S.Vector3,s=100*c.separation/20,o=0,a=e.length;o<a;o++).6<Math.random()||0<(i=(t=e[o]).position.distanceTo(this.position))&&i<=s&&(r.subVectors(this.position,t.position),r.normalize(),r.divideScalar(i),n.add(r));return n}}}class h extends a{static initClass(){this.prototype.defaultOptions={backgroundColor:465199,color1:16711680,color2:53759,colorMode:"varianceGradient",birdSize:1,wingSpan:30,speedLimit:5,separation:20,alignment:20,cohesion:20,quantity:5}}constructor(e){S=e.THREE||S,super(e)}initComputeRenderer(){this.gpuCompute=new _(T,T,this.renderer,S);var t=this.gpuCompute.createTexture(),i=this.gpuCompute.createTexture();{const s=t.image.data;let e=0;const o=s.length;for(var n=[];e<o;){const o=800*Math.random()-400,a=800*Math.random()-400,l=800*Math.random()-400;s[e+0]=o,s[e+1]=a,s[e+2]=l,s[e+3]=1,n.push(e+=4)}}{const h=i.image.data;let e=0;const c=h.length;for(var r=[];e<c;){const c=Math.random()-.5,u=Math.random()-.5,d=Math.random()-.5;h[e+0]=10*c,h[e+1]=10*u,h[e+2]=10*d,h[e+3]=1,r.push(e+=4)}}this.velocityVariable=this.gpuCompute.addVariable("textureVelocity","uniform float time;\nuniform float testing;\nuniform float delta; // about 0.016\nuniform float separationDistance; // 20\nuniform float alignmentDistance; // 40\nuniform float cohesionDistance;\nuniform float speedLimit;\nuniform float freedomFactor;\nuniform vec3 predator;\n\nconst float width = resolution.x;\nconst float height = resolution.y;\n\nconst float PI = 3.141592653589793;\nconst float PI_2 = PI * 2.0;\n// const float VISION = PI * 0.55;\n\nfloat zoneRadius = 40.0;\nfloat zoneRadiusSquared = 1600.0;\n\nfloat separationThresh = 0.45;\nfloat alignmentThresh = 0.65;\n\nconst float UPPER_BOUNDS = BOUNDS;\nconst float LOWER_BOUNDS = -UPPER_BOUNDS;\n\nfloat rand(vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvoid main() {\n\n zoneRadius = separationDistance + alignmentDistance + cohesionDistance;\n separationThresh = separationDistance / zoneRadius;\n alignmentThresh = ( separationDistance + alignmentDistance ) / zoneRadius;\n zoneRadiusSquared = zoneRadius * zoneRadius;\n\n\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec3 birdPosition, birdVelocity;\n\n vec3 selfPosition = texture2D( texturePosition, uv ).xyz;\n vec3 selfVelocity = texture2D( textureVelocity, uv ).xyz;\n\n float dist;\n vec3 dir; // direction\n float distSquared;\n\n float separationSquared = separationDistance * separationDistance;\n float cohesionSquared = cohesionDistance * cohesionDistance;\n\n float f;\n float percent;\n\n vec3 velocity = selfVelocity;\n\n float limit = speedLimit;\n\n dir = predator * UPPER_BOUNDS - selfPosition;\n dir.z = 0.;\n // dir.z *= 0.6;\n dist = length( dir );\n distSquared = dist * dist;\n\n float preyRadius = 150.0;\n float preyRadiusSq = preyRadius * preyRadius;\n\n // move birds away from predator\n if (dist < preyRadius) {\n\n f = ( distSquared / preyRadiusSq - 1.0 ) * delta * 100.;\n velocity += normalize( dir ) * f;\n limit += 5.0;\n }\n\n // if (testing == 0.0) {}\n // if ( rand( uv + time ) < freedomFactor ) {}\n\n // Attract flocks to the center\n vec3 central = vec3( 0., 0., 0. );\n dir = selfPosition - central;\n dist = length( dir );\n\n dir.y *= 2.5;\n velocity -= normalize( dir ) * delta * 5.;\n\n for (float y=0.0;y<height;y++) {\n for (float x=0.0;x<width;x++) {\n\n vec2 ref = vec2( x + 0.5, y + 0.5 ) / resolution.xy;\n birdPosition = texture2D( texturePosition, ref ).xyz;\n\n dir = birdPosition - selfPosition;\n dist = length(dir);\n\n if (dist < 0.0001) continue;\n\n distSquared = dist * dist;\n\n if (distSquared > zoneRadiusSquared ) continue;\n\n percent = distSquared / zoneRadiusSquared;\n\n if ( percent < separationThresh ) { // low\n\n // Separation - Move apart for comfort\n f = (separationThresh / percent - 1.0) * delta;\n velocity -= normalize(dir) * f;\n\n } else if ( percent < alignmentThresh ) { // high\n\n // Alignment - fly the same direction\n float threshDelta = alignmentThresh - separationThresh;\n float adjustedPercent = ( percent - separationThresh ) / threshDelta;\n\n birdVelocity = texture2D( textureVelocity, ref ).xyz;\n\n f = ( 0.5 - cos( adjustedPercent * PI_2 ) * 0.5 + 0.5 ) * delta;\n velocity += normalize(birdVelocity) * f;\n\n } else {\n\n // Attraction / Cohesion - move closer\n float threshDelta = 1.0 - alignmentThresh;\n float adjustedPercent = ( percent - alignmentThresh ) / threshDelta;\n\n f = ( 0.5 - ( cos( adjustedPercent * PI_2 ) * -0.5 + 0.5 ) ) * delta;\n\n velocity += normalize(dir) * f;\n\n }\n }\n }\n\n // this make tends to fly around than down or up\n // if (velocity.y > 0.) velocity.y *= (1. - 0.2 * delta);\n\n // Speed Limits\n if ( length( velocity ) > limit ) {\n velocity = normalize( velocity ) * limit;\n }\n\n gl_FragColor = vec4( velocity, 1.0 );\n\n}",i),this.positionVariable=this.gpuCompute.addVariable("texturePosition","uniform float time;\nuniform float delta;\n\nvoid main() {\n\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec4 tmpPos = texture2D( texturePosition, uv );\n vec3 position = tmpPos.xyz;\n vec3 velocity = texture2D( textureVelocity, uv ).xyz;\n\n float phase = tmpPos.w;\n\n phase = mod( ( phase + delta +\n length( velocity.xz ) * delta * 3. +\n max( velocity.y, 0.0 ) * delta * 6. ), 62.83 );\n\n gl_FragColor = vec4( position + velocity * delta * 15. , phase );\n\n}",t),this.gpuCompute.setVariableDependencies(this.velocityVariable,[this.positionVariable,this.velocityVariable]),this.gpuCompute.setVariableDependencies(this.positionVariable,[this.positionVariable,this.velocityVariable]),this.positionUniforms=this.positionVariable.material.uniforms,this.velocityUniforms=this.velocityVariable.material.uniforms,this.positionUniforms.time={value:0},this.positionUniforms.delta={value:0},this.velocityUniforms.time={value:1},this.velocityUniforms.delta={value:0},this.velocityUniforms.testing={value:1},this.velocityUniforms.separationDistance={value:1},this.velocityUniforms.alignmentDistance={value:1},this.velocityUniforms.cohesionDistance={value:1},this.velocityUniforms.speedLimit={value:1},this.velocityUniforms.freedomFactor={value:1},this.velocityUniforms.predator={value:new S.Vector3},this.velocityVariable.material.defines.BOUNDS=800..toFixed(2),this.velocityVariable.wrapS=S.RepeatWrapping,this.velocityVariable.wrapT=S.RepeatWrapping,this.positionVariable.wrapS=S.RepeatWrapping,this.positionVariable.wrapT=S.RepeatWrapping;i=this.gpuCompute.init();null!==i&&console.error(i)}initGpgpuBirds(){var e=(e=>{const t=new S.BufferGeometry,i=(e.quantity&&(T=Math.pow(2,e.quantity),E=T*T),3*E),n=3*i,r=new S.BufferAttribute(new Float32Array(3*n),3),s=new S.BufferAttribute(new Float32Array(3*n),3),o=new S.BufferAttribute(new Float32Array(2*n),2),a=new S.BufferAttribute(new Float32Array(n),1);t.setAttribute||(t.setAttribute=t.addAttribute),t.setAttribute("position",r),t.setAttribute("birdColor",s),t.setAttribute("reference",o),t.setAttribute("birdVertex",a);let l=0;const h=function(){for(let e=0;e<arguments.length;e++)r.array[l++]=arguments[e]},c=e.wingSpan||20,u=e.birdSize||1;for(let e=0;e<E;e++)h(0,-0,-20*u,0,4*u,-20*u,0,0,30*u),h(0,0,-15*u,-c*u,0,0,0,0,15*u),h(0,0,15*u,c*u,0,0,0,0,-15*u);var d={};for(l=0;l<3*i;l++){const t=~~(l/3),i=t%T/T,n=~~(t/T)/T,r=~~(l/9)/E,h=r.toString(),c=-1!=e.colorMode.indexOf("Gradient");var p=!c&&d[h]?d[h]:e.effect.getNewCol(r);c||d[h]||(d[h]=p),s.array[3*l+0]=p.r,s.array[3*l+1]=p.g,s.array[3*l+2]=p.b,o.array[2*l]=i,o.array[2*l+1]=n,a.array[l]=l%9}return t.scale(.2,.2,.2)})(Object.assign({},this.options,{effect:this})),t=(this.birdUniforms={color:{value:new S.Color(16720384)},texturePosition:{value:null},textureVelocity:{value:null},time:{value:1},delta:{value:0},birdSize:{value:this.options.birdSize}},new S.ShaderMaterial({uniforms:this.birdUniforms,vertexShader:"attribute vec2 reference;\nattribute float birdVertex;\n\nattribute vec3 birdColor;\n\nuniform sampler2D texturePosition;\nuniform sampler2D textureVelocity;\n\nvarying vec4 vColor;\nvarying float z;\n\nuniform float time;\nuniform float birdSize;\n\nvoid main() {\n\n vec4 tmpPos = texture2D( texturePosition, reference );\n vec3 pos = tmpPos.xyz;\n vec3 velocity = normalize(texture2D( textureVelocity, reference ).xyz);\n\n vec3 newPosition = position;\n\n if ( birdVertex == 4.0 || birdVertex == 7.0 ) {\n // flap wings\n newPosition.y = sin( tmpPos.w ) * 5. * birdSize;\n }\n\n newPosition = mat3( modelMatrix ) * newPosition;\n\n velocity.z *= -1.;\n float xz = length( velocity.xz );\n float xyz = 1.;\n float x = sqrt( 1. - velocity.y * velocity.y );\n\n float cosry = velocity.x / xz;\n float sinry = velocity.z / xz;\n\n float cosrz = x / xyz;\n float sinrz = velocity.y / xyz;\n\n mat3 maty = mat3(\n cosry, 0, -sinry,\n 0 , 1, 0 ,\n sinry, 0, cosry\n );\n\n mat3 matz = mat3(\n cosrz , sinrz, 0,\n -sinrz, cosrz, 0,\n 0 , 0 , 1\n );\n newPosition = maty * matz * newPosition;\n newPosition += pos;\n z = newPosition.z;\n\n vColor = vec4( birdColor, 1.0 );\n gl_Position = projectionMatrix * viewMatrix * vec4( newPosition, 1.0 );\n}",fragmentShader:"varying vec4 vColor;\nvarying float z;\nuniform vec3 color;\nvoid main() {\n // Fake colors for now\n float rr = 0.2 + ( 1000. - z ) / 1000. * vColor.x;\n float gg = 0.2 + ( 1000. - z ) / 1000. * vColor.y;\n float bb = 0.2 + ( 1000. - z ) / 1000. * vColor.z;\n gl_FragColor = vec4( rr, gg, bb, 1. );\n}",side:S.DoubleSide})),e=new S.Mesh(e,t);return e.rotation.y=Math.PI/2,e.matrixAutoUpdate=!1,e.updateMatrix(),this.scene.add(e)}getNewCol(e){const t=this.options,i=null!=t.color1?t.color1:4456448,n=null!=t.color2?t.color2:6684672,r=new S.Color(i),s=new S.Color(n);let o,a;if(a=-1!=t.colorMode.indexOf("Gradient")?Math.random():e,0==t.colorMode.indexOf("variance")){const e=(r.r+Math.random()*s.r).clamp(0,1),t=(r.g+Math.random()*s.g).clamp(0,1),i=(r.b+Math.random()*s.b).clamp(0,1);o=new S.Color(e,t,i)}else o=0==t.colorMode.indexOf("mix")?new S.Color(i+a*n):r.lerp(s,a);return o}onInit(){this.camera=new S.PerspectiveCamera(75,this.width/this.height,1,3e3),this.camera.position.z=350,this.fog=new S.Fog(16777215,100,1e3),this.mouseX=this.mouseY=0;const e=this.birds=[],t=this.boids=[],i=this.options;if(u)try{this.initComputeRenderer(),this.valuesChanger=this.valuesChanger.bind(this),this.valuesChanger(),this.initGpgpuBirds()}catch(e){console.error("[vanta.js] birds init error: ",e)}else for(var n=6*Math.pow(2,i.quantity),r=0;r<n;r++){(s=t[r]=new A(i)).position.x=400*Math.random()-200,s.position.y=400*Math.random()-200,s.position.z=400*Math.random()-200,s.velocity.x=2*Math.random()-1,s.velocity.y=2*Math.random()-1,s.velocity.z=2*Math.random()-1,s.setWorldSize(500,500,300);var s=-1!=i.colorMode.indexOf("Gradient"),o=((r={})=>{const e=new S.BufferGeometry,s=[];function t(e,t,i){var n=1.5*(r.birdSize||1);s.push(new S.Vector3(e*n,t*n,i*n))}t(5,0,0),t(-5,-1,1),t(-5,0,0),t(-5,-2,-1),t(0,2,-6),t(0,2,6),t(2,0,0),t(-3,0,0),e.setFromPoints(s);var i=[];return i.push(0,2,1),i.push(4,7,6),i.push(5,6,7),e.setIndex(i),e})(i),a=o.attributes.position.length,l=new S.BufferAttribute(new Float32Array(a),3);if(s)for(var h=0;h<o.index.array.length;h+=3)for(var c=0;c<=2;c++){const e=o.index.array[h+c],t=this.getNewCol();l.array[3*e]=t.r,l.array[3*e+1]=t.g,l.array[3*e+2]=t.b}else{const e=this.getNewCol(r/n);for(h=0;h<l.array.length;h+=3)l.array[h]=e.r,l.array[h+1]=e.g,l.array[h+2]=e.b}o.setAttribute("color",l),(a=e[r]=new S.Mesh(o,new S.MeshBasicMaterial({color:16777215,side:S.DoubleSide,vertexColors:S.VertexColors}))).phase=Math.floor(62.83*Math.random()),a.position.x=t[r].position.x,a.position.y=t[r].position.y,a.position.z=t[r].position.z,this.scene.add(a)}}valuesChanger(){this.velocityUniforms&&(this.velocityUniforms.separationDistance.value=this.options.separation,this.velocityUniforms.alignmentDistance.value=this.options.alignment,this.velocityUniforms.speedLimit.value=this.options.speedLimit,this.velocityUniforms.cohesionDistance.value=this.options.cohesion)}onUpdate(){this.now=performance.now(),this.last||(this.last=this.now);let e=(this.now-this.last)/1e3;if(1<e&&(e=1),this.last=this.now,u)this.positionUniforms.time.value=this.now,this.positionUniforms.delta.value=e,this.velocityUniforms.time.value=this.now,this.velocityUniforms.delta.value=e,this.birdUniforms.time.value=this.now,this.birdUniforms.delta.value=e,this.velocityUniforms.predator.value.set(this.mouseX,-this.mouseY,0),this.mouseX=1e4,this.mouseY=1e4,this.gpuCompute.compute(),this.birdUniforms.texturePosition.value=this.gpuCompute.getCurrentRenderTarget(this.positionVariable).texture,this.birdUniforms.textureVelocity.value=this.gpuCompute.getCurrentRenderTarget(this.velocityVariable).texture;else{const e=this.birds,s=this.boids;for(var t,i,n=0,r=e.length;n<r;n++){(t=s[n]).run(s),(i=e[n]).rotation.y=Math.atan2(-t.velocity.z,t.velocity.x),i.rotation.z=Math.asin(t.velocity.y/t.velocity.length()),i.phase=(i.phase+(Math.max(0,i.rotation.z)+.1))%62.83;const r=16;i.geometry.attributes.position.array[16]=i.geometry.attributes.position.array[13]=5*Math.sin(i.phase)*this.options.birdSize,i.geometry.attributes.position.needsUpdate=!0,i.geometry.computeVertexNormals(),i.position.x=s[n].position.x,i.position.y=s[n].position.y,i.position.z=s[n].position.z}}}onMouseMove(e,t){if(this.mouseX=e-.5,this.mouseY=t-.5,!u){const e=this.boids;for(var i,n=new S.Vector3(this.mouseX*this.width,-this.mouseY*this.height,0),r=0,s=e.length;r<s;r++)i=e[r],n.z=i.position.z,i.repulse(n)}}onDestroy(){}onResize(){}}h.initClass();const c=o.register("BIRDS",h);return e})())()},858:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>c}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let a="object"==typeof window&&window.THREE;class l extends t{constructor(e){(a=e.THREE||a).Color.prototype.toVector=function(){return new a.Vector3(this.r,this.g,this.b)},super(e),this.updateUniforms=this.updateUniforms.bind(this)}init(){this.mode="shader",this.uniforms={iTime:{type:"f",value:1},iResolution:{type:"v2",value:new a.Vector2(1,1)},iDpr:{type:"f",value:window.devicePixelRatio||1},iMouse:{type:"v2",value:new a.Vector2(this.mouseX||0,this.mouseY||0)}},super.init(),this.fragmentShader&&this.initBasicShader()}setOptions(e){super.setOptions(e),this.updateUniforms()}initBasicShader(e=this.fragmentShader,t=this.vertexShader){t=t||"uniform float uTime;\nuniform vec2 uResolution;\nvoid main() {\n gl_Position = vec4( position, 1.0 );\n}",this.updateUniforms(),"function"==typeof this.valuesChanger&&this.valuesChanger();t=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t,fragmentShader:e}),e=this.options.texturePath,e&&(this.uniforms.iTex={type:"t",value:(new a.TextureLoader).load(e)}),e=new a.Mesh(new a.PlaneGeometry(2,2),t);this.scene.add(e),this.camera=new a.Camera,this.camera.position.z=1}updateUniforms(){var e={};let t,i;for(t in this.options)i=this.options[t],-1!==t.toLowerCase().indexOf("color")?e[t]={type:"v3",value:new a.Color(i).toVector()}:"number"==typeof i&&(e[t]={type:"f",value:i});return Object.assign(this.uniforms,e)}resize(){super.resize(),this.uniforms.iResolution.value.x=this.width/this.scale,this.uniforms.iResolution.value.y=this.height/this.scale}}class h extends l{}const c=o.register("FOG",h);return h.prototype.defaultOptions={highlightColor:16761600,midtoneColor:16719616,lowlightColor:2949375,baseColor:16772075,blurFactor:.6,speed:1,zoom:1,scale:2,scaleMobile:4},h.prototype.fragmentShader="uniform vec2 iResolution;\nuniform vec2 iMouse;\nuniform float iTime;\n\nuniform float blurFactor;\nuniform vec3 baseColor;\nuniform vec3 lowlightColor;\nuniform vec3 midtoneColor;\nuniform vec3 highlightColor;\nuniform float zoom;\n\nfloat random (in vec2 _st) {\n return fract(sin(dot(_st.xy,\n vec2(0.129898,0.78233)))*\n 437.585453123);\n}\n\n// Based on Morgan McGuire @morgan3d\n// https://www.shadertoy.com/view/4dS3Wd\nfloat noise (in vec2 _st) {\n vec2 i = floor(_st);\n vec2 f = fract(_st);\n\n // Four corners in 2D of a tile\n float a = random(i);\n float b = random(i + vec2(1.0, 0.0));\n float c = random(i + vec2(0.0, 1.0));\n float d = random(i + vec2(1.0, 1.0));\n\n vec2 u = f * f * (3.0 - 2.0 * f);\n\n return mix(a, b, u.x) +\n (c - a)* u.y * (1.0 - u.x) +\n (d - b) * u.x * u.y;\n}\n\n#define NUM_OCTAVES 6\n\nfloat fbm ( in vec2 _st) {\n float v = 0.0;\n float a = blurFactor;\n vec2 shift = vec2(100.0);\n // Rotate to reduce axial bias\n mat2 rot = mat2(cos(0.5), sin(0.5),\n -sin(0.5), cos(0.50));\n for (int i = 0; i < NUM_OCTAVES; ++i) {\n v += a * noise(_st);\n _st = rot * _st * 2.0 + shift;\n a *= (1. - blurFactor);\n }\n return v;\n}\n\nvoid main() {\n vec2 st = gl_FragCoord.xy / iResolution.xy*3.;\n st.x *= 0.7 * iResolution.x / iResolution.y ; // Still keep it more landscape than square\n st *= zoom;\n\n // st += st * abs(sin(iTime*0.1)*3.0);\n vec3 color = vec3(0.0);\n\n vec2 q = vec2(0.);\n q.x = fbm( st + 0.00*iTime);\n q.y = fbm( st + vec2(1.0));\n\n vec2 dir = vec2(0.15,0.126);\n vec2 r = vec2(0.);\n r.x = fbm( st + 1.0*q + vec2(1.7,9.2)+ dir.x*iTime );\n r.y = fbm( st + 1.0*q + vec2(8.3,2.8)+ dir.y*iTime);\n\n float f = fbm(st+r);\n\n color = mix(baseColor,\n lowlightColor,\n clamp((f*f)*4.0,0.0,1.0));\n\n color = mix(color,\n midtoneColor,\n clamp(length(q),0.0,1.0));\n\n color = mix(color,\n highlightColor,\n clamp(length(r.x),0.0,1.0));\n\n vec3 finalColor = mix(baseColor, color, f*f*f+.6*f*f+.5*f);\n gl_FragColor = vec4(finalColor,1.0);\n}\n",e})())()},859:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>l}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let d="object"==typeof window&&window.THREE;class a extends t{static initClass(){this.prototype.ww=100,this.prototype.hh=80,this.prototype.waveNoise=4}constructor(e){d=e.THREE||d,super(e)}getMaterial(){var e={color:this.options.color,shininess:this.options.shininess,flatShading:!0,side:d.DoubleSide};return new d.MeshPhongMaterial(e)}onInit(){let i,n;const e=this.getMaterial(),t=new d.BufferGeometry,r=(this.gg=[],[]);for(i=0;i<=this.ww;i++)for(this.gg[i]=[],n=0;n<=this.hh;n++){const u=r.length,e=new d.Vector3(18*(i-.5*this.ww),(null==(o=this.waveNoise)&&(o=1),(s=0)+Math.random()*(o-s)-10),18*(.5*this.hh-n));r.push(e),this.gg[i][n]=u}t.setFromPoints(r);var s,o,a,l,h=[];for(i=1;i<=this.ww;i++)for(n=1;n<=this.hh;n++){let e,t;const r=this.gg[i][n],s=this.gg[i][n-1],o=this.gg[i-1][n],d=this.gg[i-1][n-1];null==(a=0)&&(a=0),null==(l=1)&&(l=1),t=Math.floor(a+Math.random()*(l-a+1))?(e=[d,s,o],[s,o,r]):(e=[d,s,r],[d,o,r]),h.push(...e,...t)}t.setIndex(h),this.plane=new d.Mesh(t,e),this.scene.add(this.plane);var c=new d.AmbientLight(16777215,.9),c=(this.scene.add(c),new d.PointLight(16777215,.9));c.position.set(-100,250,-100),this.scene.add(c),this.camera=new d.PerspectiveCamera(35,this.width/this.height,50,1e4),this.cameraPosition=new d.Vector3(240,200,390),this.cameraTarget=new d.Vector3(140,-30,190),this.camera.position.copy(this.cameraPosition),this.scene.add(this.camera)}onUpdate(){let e;this.plane.material.color.set(this.options.color),this.plane.material.shininess=this.options.shininess,this.camera.ox=this.cameraPosition.x/this.options.zoom,this.camera.oy=this.cameraPosition.y/this.options.zoom,this.camera.oz=this.cameraPosition.z/this.options.zoom,null!=this.controls&&this.controls.update();const t=this.camera;.01<Math.abs(t.tx-t.position.x)&&(e=t.tx-t.position.x,t.position.x+=.02*e),.01<Math.abs(t.ty-t.position.y)&&(e=t.ty-t.position.y,t.position.y+=.02*e),.01<Math.abs(t.tz-t.position.z)&&(e=t.tz-t.position.z,t.position.z+=.02*e),t.lookAt(this.cameraTarget),this.oy=this.oy||{};for(let e=0;e<this.plane.geometry.attributes.position.array.length;e+=3){const t={x:this.plane.geometry.attributes.position.array[e],y:this.plane.geometry.attributes.position.array[e+1],z:this.plane.geometry.attributes.position.array[e+2],oy:this.oy[e]};var i,n;t.oy?(i=this.options.waveSpeed,n=Math.sqrt(i)*Math.cos(-t.x-.7*t.z),i=Math.sin(i*this.t*.02-i*t.x*.025+i*t.z*.015+n),n=Math.pow(i+1,2)/4,t.y=t.oy+n*this.options.waveHeight,this.plane.geometry.attributes.position.array[e+1]=t.y):this.oy[e]=t.y}this.plane.geometry.attributes.position.setUsage(d.DynamicDrawUsage),this.plane.geometry.computeVertexNormals(),this.plane.geometry.attributes.position.needsUpdate=!0,this.wireframe&&(this.wireframe.geometry.fromGeometry(this.plane.geometry),this.wireframe.geometry.computeFaceNormals())}onMouseMove(e,t){var i=this.camera;return i.oy||(i.oy=i.position.y,i.ox=i.position.x,i.oz=i.position.z),i.tx=i.ox+100*(e-.5)/this.options.zoom,i.ty=i.oy+-100*(t-.5)/this.options.zoom,i.tz=i.oz+-50*(e-.5)/this.options.zoom}}a.prototype.defaultOptions={color:21896,shininess:30,waveHeight:15,waveSpeed:1,zoom:1},a.initClass();const l=o.register("WAVES",a);return e})())()},860:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>c}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let a="object"==typeof window&&window.THREE;class l extends t{constructor(e){(a=e.THREE||a).Color.prototype.toVector=function(){return new a.Vector3(this.r,this.g,this.b)},super(e),this.updateUniforms=this.updateUniforms.bind(this)}init(){this.mode="shader",this.uniforms={iTime:{type:"f",value:1},iResolution:{type:"v2",value:new a.Vector2(1,1)},iDpr:{type:"f",value:window.devicePixelRatio||1},iMouse:{type:"v2",value:new a.Vector2(this.mouseX||0,this.mouseY||0)}},super.init(),this.fragmentShader&&this.initBasicShader()}setOptions(e){super.setOptions(e),this.updateUniforms()}initBasicShader(e=this.fragmentShader,t=this.vertexShader){t=t||"uniform float uTime;\nuniform vec2 uResolution;\nvoid main() {\n gl_Position = vec4( position, 1.0 );\n}",this.updateUniforms(),"function"==typeof this.valuesChanger&&this.valuesChanger();t=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t,fragmentShader:e}),e=this.options.texturePath,e&&(this.uniforms.iTex={type:"t",value:(new a.TextureLoader).load(e)}),e=new a.Mesh(new a.PlaneGeometry(2,2),t);this.scene.add(e),this.camera=new a.Camera,this.camera.position.z=1}updateUniforms(){var e={};let t,i;for(t in this.options)i=this.options[t],-1!==t.toLowerCase().indexOf("color")?e[t]={type:"v3",value:new a.Color(i).toVector()}:"number"==typeof i&&(e[t]={type:"f",value:i});return Object.assign(this.uniforms,e)}resize(){super.resize(),this.uniforms.iResolution.value.x=this.width/this.scale,this.uniforms.iResolution.value.y=this.height/this.scale}}class h extends l{}const c=o.register("CLOUDS",h);return h.prototype.defaultOptions={backgroundColor:16777215,skyColor:6863063,cloudColor:11387358,cloudShadowColor:1586512,sunColor:16750873,sunGlareColor:16737843,sunlightColor:16750899,scale:3,scaleMobile:12,speed:1,mouseEase:!0},h.prototype.fragmentShader="uniform vec2 iResolution;\nuniform vec2 iMouse;\nuniform float iTime;\nuniform sampler2D iTex;\n\nuniform float speed;\nuniform vec3 skyColor;\nuniform vec3 cloudColor;\nuniform vec3 cloudShadowColor;\nuniform vec3 sunColor;\nuniform vec3 sunlightColor;\nuniform vec3 sunGlareColor;\nuniform vec3 backgroundColor;\n\n// uniform vec4 iMouse; // mouse pixel coords. xy: current (if MLB down), zw: click\n// uniform samplerXX iChannel0..3; // input channel. XX = 2D/Cube\n\n\n// Volumetric clouds. It performs level of detail (LOD) for faster rendering\nfloat hash(float p) {\n p = fract(p * 0.011);\n p *= (p + 7.5);\n p *= (p + p);\n return fract(p);\n}\n\nfloat noise( vec3 x ){\n // The noise function returns a value in the range -1.0f -> 1.0f\n vec3 p = floor(x);\n vec3 f = fract(x);\n f = f*f*(3.0-2.0*f);\n float n = p.x + p.y*57.0 + 113.0*p.z;\n return mix(mix(mix( hash(n+0.0 ), hash(n+1.0 ),f.x),\n mix( hash(n+57.0 ), hash(n+58.0 ),f.x),f.y),\n mix(mix( hash(n+113.0), hash(n+114.0),f.x),\n mix( hash(n+170.0), hash(n+171.0),f.x),f.y),f.z);\n}\n\nconst float constantTime = 1000.;\nfloat map5( in vec3 p ){\n vec3 speed1 = vec3(0.5,0.01,1.0) * 0.5 * speed;\n vec3 q = p - speed1*(iTime + constantTime);\n float f;\n f = 0.50000*noise( q ); q = q*2.02;\n f += 0.25000*noise( q ); q = q*2.03;\n f += 0.12500*noise( q ); q = q*2.01;\n f += 0.06250*noise( q ); q = q*2.02;\n f += 0.03125*noise( q );\n return clamp( 1.5 - p.y - 2.0 + 1.75*f, 0.0, 1.0 );\n}\nfloat map4( in vec3 p ){\n vec3 speed1 = vec3(0.5,0.01,1.0) * 0.5 * speed;\n vec3 q = p - speed1*(iTime + constantTime);\n float f;\n f = 0.50000*noise( q ); q = q*2.02;\n f += 0.25000*noise( q ); q = q*2.03;\n f += 0.12500*noise( q ); q = q*2.01;\n f += 0.06250*noise( q );\n return clamp( 1.5 - p.y - 2.0 + 1.75*f, 0.0, 1.0 );\n}\nfloat map3( in vec3 p ){\n vec3 speed1 = vec3(0.5,0.01,1.0) * 0.5 * speed;\n vec3 q = p - speed1*(iTime + constantTime);\n float f;\n f = 0.50000*noise( q ); q = q*2.02;\n f += 0.25000*noise( q ); q = q*2.03;\n f += 0.12500*noise( q );\n return clamp( 1.5 - p.y - 2.0 + 1.75*f, 0.0, 1.0 );\n}\nfloat map2( in vec3 p ){\n vec3 speed1 = vec3(0.5,0.01,1.0) * 0.5 * speed;\n vec3 q = p - speed1*(iTime + constantTime);\n float f;\n f = 0.50000*noise( q ); q = q*2.02;\n f += 0.25000*noise( q );\n return clamp( 1.5 - p.y - 2.0 + 1.75*f, 0.0, 1.0 );\n}\n\nvec3 sundir = normalize( vec3(-1.0,0.0,-1.0) );\n\nvec4 integrate( in vec4 sum, in float dif, in float den, in vec3 bgcol, in float t ){\n // lighting\n vec3 lin = cloudColor*1.4 + sunlightColor*dif;\n vec4 col = vec4( mix( vec3(1.0,0.95,0.8), cloudShadowColor, den ), den );\n col.xyz *= lin;\n col.xyz = mix( col.xyz, bgcol, 1.0-exp(-0.003*t*t) );\n // front to back blending\n col.a *= 0.4;\n col.rgb *= col.a;\n return sum + col*(1.0-sum.a);\n}\n\n#define MARCH(STEPS,MAPLOD) for(int i=0; i<STEPS; i++) { vec3 pos = ro + t*rd; if( pos.y<-3.0 || pos.y>2.0 || sum.a > 0.99 ) break; float den = MAPLOD( pos ); if( den>0.01 ) { float dif = clamp((den - MAPLOD(pos+0.3*sundir))/0.6, 0.0, 1.0 ); sum = integrate( sum, dif, den, bgcol, t ); } t += max(0.075,0.02*t); }\n\nvec4 raymarch( in vec3 ro, in vec3 rd, in vec3 bgcol, in ivec2 px ){\n vec4 sum = vec4(0.0);\n\n float t = 0.0;\n\n MARCH(20,map5);\n MARCH(25,map4);\n MARCH(30,map3);\n MARCH(40,map2);\n\n return clamp( sum, 0.0, 1.0 );\n}\n\nmat3 setCamera( in vec3 ro, in vec3 ta, float cr ){\n vec3 cw = normalize(ta-ro);\n vec3 cp = vec3(sin(cr), cos(cr),0.0);\n vec3 cu = normalize( cross(cw,cp) );\n vec3 cv = normalize( cross(cu,cw) );\n return mat3( cu, cv, cw );\n}\n\nvec4 render( in vec3 ro, in vec3 rd, in ivec2 px ){\n // background sky\n float sun = clamp( dot(sundir,rd), 0.0, 1.0 );\n vec3 col = skyColor - rd.y*0.2*vec3(1.0,0.5,1.0) + 0.15*0.5;\n col += 0.2*sunColor*pow( sun, 8.0 );\n\n // clouds\n vec4 res = raymarch( ro, rd, col, px );\n col = col*(1.0-res.w) + res.xyz;\n\n // sun glare\n col += 0.2*sunGlareColor*pow( sun, 3.0 );\n\n return vec4( col, 1.0 );\n}\n\nvoid main(){\n vec2 p = (-iResolution.xy + 2.0*gl_FragCoord.xy)/ iResolution.y;\n\n vec2 m = iMouse.xy/iResolution.xy;\n m.y = (1.0 - m.y) * 0.33 + 0.28; // camera height\n\n m.x *= 0.25;\n m.x += sin(iTime * 0.1 + 3.1415) * 0.25 + 0.25;\n\n // camera\n vec3 ro = 4.0*normalize(vec3(sin(3.0*m.x), 0.4*m.y, cos(3.0*m.x))); // origin\n vec3 ta = vec3(0.0, -1.0, 0.0);\n mat3 ca = setCamera( ro, ta, 0.0 );\n // ray\n vec3 rd = ca * normalize( vec3(p.xy,1.5));\n\n gl_FragColor = render( ro, rd, ivec2(gl_FragCoord-0.5) );\n}\n",e})())()},861:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>c}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let a="object"==typeof window&&window.THREE;class l extends t{constructor(e){(a=e.THREE||a).Color.prototype.toVector=function(){return new a.Vector3(this.r,this.g,this.b)},super(e),this.updateUniforms=this.updateUniforms.bind(this)}init(){this.mode="shader",this.uniforms={iTime:{type:"f",value:1},iResolution:{type:"v2",value:new a.Vector2(1,1)},iDpr:{type:"f",value:window.devicePixelRatio||1},iMouse:{type:"v2",value:new a.Vector2(this.mouseX||0,this.mouseY||0)}},super.init(),this.fragmentShader&&this.initBasicShader()}setOptions(e){super.setOptions(e),this.updateUniforms()}initBasicShader(e=this.fragmentShader,t=this.vertexShader){t=t||"uniform float uTime;\nuniform vec2 uResolution;\nvoid main() {\n gl_Position = vec4( position, 1.0 );\n}",this.updateUniforms(),"function"==typeof this.valuesChanger&&this.valuesChanger();t=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t,fragmentShader:e}),e=this.options.texturePath,e&&(this.uniforms.iTex={type:"t",value:(new a.TextureLoader).load(e)}),e=new a.Mesh(new a.PlaneGeometry(2,2),t);this.scene.add(e),this.camera=new a.Camera,this.camera.position.z=1}updateUniforms(){var e={};let t,i;for(t in this.options)i=this.options[t],-1!==t.toLowerCase().indexOf("color")?e[t]={type:"v3",value:new a.Color(i).toVector()}:"number"==typeof i&&(e[t]={type:"f",value:i});return Object.assign(this.uniforms,e)}resize(){super.resize(),this.uniforms.iResolution.value.x=this.width/this.scale,this.uniforms.iResolution.value.y=this.height/this.scale}}class h extends l{}const c=o.register("CLOUDS2",h);return h.prototype.defaultOptions={backgroundColor:0,skyColor:6072010,cloudColor:3362176,lightColor:16777215,speed:1,texturePath:"./gallery/noise.png",scaleMobile:4},h.prototype.fragmentShader="uniform vec2 iResolution;\nuniform vec2 iMouse;\nuniform float iTime;\nuniform sampler2D iTex;\nuniform float speed;\nuniform vec3 skyColor;\nuniform vec3 cloudColor;\nuniform vec3 lightColor;\n\n# define T texture2D(iTex, fract((s*p.zw + ceil(s*p.x)) / 200.0)).y / (s += s) * 4.0\n\nvoid main(){\n vec2 coord = gl_FragCoord.xy;\n vec4 p, d = vec4(0.8, 0, coord / iResolution.y - 0.65);\n vec3 out1 = skyColor - d.w; // sky gradient\n float s, f, t = 200.0 + sin(dot(coord,coord));\n const float MAX_ITER = 100.0;\n for (float i = 1.0; i <= MAX_ITER; i += 1.0) {\n t -= 2.0; if (t < 0.0) { break; } // march step\n p = 0.05 * t * d;\n p.xz += iTime * 0.50000 * speed; // movement through space\n p.x += sin(iTime * 0.25 * speed) * 0.25;\n s = 2.0;\n f = p.w + 1.0-T-T-T-T;\n // f = p.w + 1.0 - 0.25*noise(p.xyz * 2.0) - 0.25*noise(p.zxy * 2.01) - 0.25*noise(p.yzx * 2.03);\n if (f < 0.0) {\n vec3 cloudColorShading = mix(lightColor, cloudColor, -f);\n out1 = mix(out1, cloudColorShading, -f * 0.4);\n }\n }\n gl_FragColor = vec4(out1, 1.0);\n}",e})())()},862:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};function g(e,t){return null==t&&(t=1),(e=null==e?0:e)+Math.random()*(t-e)}n.r(e),n.d(e,{default:()=>l}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const v=e=>.299*e.r+.587*e.g+.114*e.b,i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{},t=(o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24",o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}},o.VantaBase),m="object"==typeof window;let y=m&&window.THREE;class a extends t{static initClass(){this.prototype.defaultOptions={color:16727937,color2:16777215,size:1,backgroundColor:2299196,points:10,maxDistance:20,spacing:15,showDots:!0}}constructor(e){y=e.THREE||y,super(e)}genPoint(e,t,i){let n;if(this.points||(this.points=[]),this.options.showDots){const e=new y.SphereGeometry(.25,12,12),t=new y.MeshLambertMaterial({color:this.options.color});n=new y.Mesh(e,t)}else n=new y.Object3D;return this.cont.add(n),n.ox=e,n.oy=t,n.oz=i,n.position.set(e,t,i),n.r=0,this.points.push(n)}onInit(){this.cont=new y.Group,this.cont.position.set(-50,-20,0),this.scene.add(this.cont);let i=this.options.points,n=this.options["spacing"];const r=i*i*2,s=(this.linePositions=new Float32Array(r*r*3),this.lineColors=new Float32Array(r*r*3),v(new y.Color(this.options.color))),t=v(new y.Color(this.options.backgroundColor)),o=(this.blending=s>t?"additive":"subtractive",new y.BufferGeometry);o.setAttribute("position",new y.BufferAttribute(this.linePositions,3).setUsage(y.DynamicDrawUsage)),o.setAttribute("color",new y.BufferAttribute(this.lineColors,3).setUsage(y.DynamicDrawUsage)),o.computeBoundingSphere(),o.setDrawRange(0,0);var e=new y.LineBasicMaterial({vertexColors:y.VertexColors,blending:"additive"===this.blending?y.AdditiveBlending:null,transparent:!0});this.linesMesh=new y.LineSegments(o,e),this.cont.add(this.linesMesh);for(let t=0;t<=i;t++)for(let e=0;e<=i;e++){const r=0,s=(t-i/2)*n;var a=(e-i/2)*n;this.genPoint(s,0,a)}this.camera=new y.PerspectiveCamera(20,this.width/this.height,.01,1e4),this.camera.position.set(50,100,150),this.scene.add(this.camera);var e=new y.AmbientLight(16777215,.75),e=(this.scene.add(e),this.spot=new y.SpotLight(16777215,1),this.spot.position.set(0,200,0),this.spot.distance=400,this.spot.target=this.cont,this.scene.add(this.spot),this.cont2=new y.Group,this.cont2.position.set(0,15,0),this.scene.add(this.cont2),new y.LineBasicMaterial({color:this.options.color2})),l=[];for(let e=0;e<80;e++){const i=g(18,24),n=i+g(1,6),v=g(-1,1),r=Math.sqrt(1-v*v),s=g(0,2*Math.PI),t=Math.sin(s)*r,o=Math.cos(s)*r;l.push(new y.Vector3(o*i,t*i,v*i)),l.push(new y.Vector3(o*n,t*n,v*n))}var h=(new y.BufferGeometry).setFromPoints(l),h=(this.linesMesh2=new y.LineSegments(h,e),this.linesMesh2.position.set(0,0,0),this.cont2.add(this.linesMesh2),new y.LineBasicMaterial({color:this.options.color2,linewidth:2})),c=[];c.push(new y.Vector3(0,30,0)),c.push(new y.Vector3(0,-30,0));for(let e=0;e<4;e++){var u=.15*Math.cos(e/4*Math.PI*2),d=.15*Math.sin(e/4*Math.PI*2),p=[17.9,12,8,5,3,2,1.5,1.1,.8,.6,.45,.3,.2,.1,.05,.03,.02,.01];for(let e=0;e<p.length;e++){var m=p[e],f=6*(e+1);c.push(new y.Vector3(u*f,m,d*f)),c.push(new y.Vector3(u*f,-m,d*f))}}e=(new y.BufferGeometry).setFromPoints(c),this.linesMesh3=new y.LineSegments(e,h),this.linesMesh3.position.set(0,0,0),this.cont2.add(this.linesMesh3),e=new y.LineBasicMaterial({color:this.options.color}),h=new y.SphereGeometry(18*this.options.size,18,14),h=new y.EdgesGeometry(h);this.sphere=new y.LineSegments(h,e),this.sphere.position.set(0,0,0),this.cont2.add(this.sphere),this.cont2.rotation.x=-.25}onUpdate(){let i;null!=this.helper&&this.helper.update(),null!=this.controls&&this.controls.update();var e=this.camera;.01<Math.abs(e.tx-e.position.x)&&(i=e.tx-e.position.x,e.position.x+=.02*i),.01<Math.abs(e.ty-e.position.y)&&(i=e.ty-e.position.y,e.position.y+=.02*i),m&&window.innerWidth<480?e.lookAt(new y.Vector3(-10,0,0)):m&&window.innerWidth<720?e.lookAt(new y.Vector3(-20,0,0)):e.lookAt(new y.Vector3(-40,0,0));let n=0,r=0,s=0;var o,a=new y.Color(this.options.backgroundColor),l=new y.Color(this.options.color),e=new y.Color(this.options.color2),h=l.clone().sub(a);this.rayCaster&&this.rayCaster.setFromCamera(new y.Vector2(this.rcMouseX,this.rcMouseY),this.camera),this.linesMesh2&&(this.linesMesh2.rotation.z+=.002,this.linesMesh2.rotation.x+=8e-4,this.linesMesh2.rotation.y+=5e-4),this.sphere&&(this.sphere.rotation.y+=.002,this.linesMesh3.rotation.y-=.004);for(let t=0;t<this.points.length;t++){const m=this.points[t];var c=(this.rayCaster?this.rayCaster.ray.distanceToPoint(m.position):1e3).clamp(5,15);m.scale.z=(.25*(15-c)).clamp(1,100),m.scale.x=m.scale.y=m.scale.z,m.position.y=2*Math.sin(m.position.x/10+.01*this.t+m.position.z/10*.5);for(let e=t;e<this.points.length;e++){const i=this.points[e],u=m.position.x-i.position.x,d=m.position.y-i.position.y,p=m.position.z-i.position.z;if((o=Math.sqrt(u*u+d*d+p*p))<this.options.maxDistance){let e,t=2*(1-o/this.options.maxDistance);t=t.clamp(0,1),e="additive"===this.blending?new y.Color(0).lerp(h,t):a.clone().lerp(l,t),this.linePositions[n++]=m.position.x,this.linePositions[n++]=m.position.y,this.linePositions[n++]=m.position.z,this.linePositions[n++]=i.position.x,this.linePositions[n++]=i.position.y,this.linePositions[n++]=i.position.z,this.lineColors[r++]=e.r,this.lineColors[r++]=e.g,this.lineColors[r++]=e.b,this.lineColors[r++]=e.r,this.lineColors[r++]=e.g,this.lineColors[r++]=e.b,s++}}}return this.linesMesh.geometry.setDrawRange(0,2*s),this.linesMesh.geometry.attributes.position.needsUpdate=!0,this.linesMesh.geometry.attributes.color.needsUpdate=!0,this.sphere.material.color.set(l),this.linesMesh2.material.color.set(e),this.linesMesh3.material.color.set(e),.001*this.t}onMouseMove(e,t){var i=this.camera,n=(i.oy||(i.oy=i.position.y,i.ox=i.position.x,i.oz=i.position.z),Math.atan2(i.oz,i.ox)),r=Math.sqrt(i.oz*i.oz+i.ox*i.ox),n=n+1.5*(e-.5)*(this.options.mouseCoeffX||1);i.tz=r*Math.sin(n),i.tx=r*Math.cos(n),i.ty=i.oy+80*(t-.5)*(this.options.mouseCoeffY||1),this.rayCaster,this.rcMouseX=2*e-1,this.rcMouseY=2*-e+1}onRestart(){this.scene.remove(this.linesMesh),this.points=[]}}a.initClass();const l=o.register("GLOBE",a);return e})())()},863:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};function a(){return"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)}function l(e,t){return null==e&&(e=0),null==t&&(t=1),Math.floor(e+Math.random()*(t-e+1))}n.r(e),n.d(e,{default:()=>u}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const h=e=>.299*e.r+.587*e.g+.114*e.b,i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),a()&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let g="object"==typeof window&&window.THREE;class c extends t{static initClass(){this.prototype.defaultOptions={color:16727937,backgroundColor:2299196,points:10,maxDistance:20,spacing:15,showDots:!0}}constructor(e){g=e.THREE||g,super(e)}genPoint(e,t,i){let n;if(this.points||(this.points=[]),this.options.showDots){const e=new g.SphereGeometry(.25,12,12),t=new g.MeshLambertMaterial({color:this.options.color});n=new g.Mesh(e,t)}else n=new g.Object3D;return this.cont.add(n),n.ox=e,n.oy=t,n.oz=i,n.position.set(e,t,i),n.r=(t=-(e=2))+Math.random()*(e-t),this.points.push(n)}onInit(){this.cont=new g.Group,this.cont.position.set(0,0,0),this.scene.add(this.cont);let n=this.options.points,r=this.options["spacing"];a()&&(n=~~(.75*n),r=~~(.65*r));const s=n*n*2,o=(this.linePositions=new Float32Array(s*s*3),this.lineColors=new Float32Array(s*s*3),h(new g.Color(this.options.color))),e=h(new g.Color(this.options.backgroundColor));this.blending=o>e?"additive":"subtractive";var t=new g.BufferGeometry,i=(t.setAttribute("position",new g.BufferAttribute(this.linePositions,3).setUsage(g.DynamicDrawUsage)),t.setAttribute("color",new g.BufferAttribute(this.lineColors,3).setUsage(g.DynamicDrawUsage)),t.computeBoundingSphere(),t.setDrawRange(0,0),new g.LineBasicMaterial({vertexColors:g.VertexColors,blending:"additive"===this.blending?g.AdditiveBlending:null,transparent:!0}));this.linesMesh=new g.LineSegments(t,i),this.cont.add(this.linesMesh);for(let i=0;i<=n;i++)for(let t=0;t<=n;t++){const s=l(-3,3),o=(i-n/2)*r+l(-5,5);let e=(t-n/2)*r+l(-5,5);i%2&&(e+=.5*r),this.genPoint(o,s-l(5,15),e),this.genPoint(o+l(-5,5),s+l(5,15),e+l(-5,5))}this.camera=new g.PerspectiveCamera(25,this.width/this.height,.01,1e4),this.camera.position.set(50,100,150),this.scene.add(this.camera);t=new g.AmbientLight(16777215,.75);return this.scene.add(t),this.spot=new g.SpotLight(16777215,1),this.spot.position.set(0,200,0),this.spot.distance=400,this.spot.target=this.cont,this.scene.add(this.spot)}onDestroy(){this.scene&&this.scene.remove(this.linesMesh),this.spot=this.points=this.linesMesh=this.lineColors=this.linePositions=null}setOptions(t){super.setOptions(t),t.color&&this.points.forEach(e=>{e.material.color=new g.Color(t.color)})}onUpdate(){let n;var e=this.camera;.01<Math.abs(e.tx-e.position.x)&&(n=e.tx-e.position.x,e.position.x+=.02*n),.01<Math.abs(e.ty-e.position.y)&&(n=e.ty-e.position.y,e.position.y+=.02*n),e.lookAt(new g.Vector3(0,0,0));let r=0,s=0,o=0;var a=new g.Color(this.options.backgroundColor),l=new g.Color(this.options.color),h=l.clone().sub(a);this.rayCaster&&this.rayCaster.setFromCamera(new g.Vector2(this.rcMouseX,this.rcMouseY),this.camera);for(let i=0;i<this.points.length;i++){let t;var c,u=this.points[i],d=(this.rayCaster?this.rayCaster.ray.distanceToPoint(u.position):1e3).clamp(5,15);u.scale.x=u.scale.y=u.scale.z=(.25*(15-d)).clamp(1,100),0!==u.r&&(d=Math.atan2(u.position.z,u.position.x),t=Math.sqrt(u.position.z*u.position.z+u.position.x*u.position.x),d+=25e-5*u.r,u.position.x=t*Math.cos(d),u.position.z=t*Math.sin(d));for(let e=i;e<this.points.length;e++){const n=this.points[e],p=u.position.x-n.position.x,m=u.position.y-n.position.y,f=u.position.z-n.position.z;(t=Math.sqrt(p*p+m*m+f*f))<this.options.maxDistance&&(c=(2*(1-t/this.options.maxDistance)).clamp(0,1),c="additive"===this.blending?new g.Color(0).lerp(h,c):a.clone().lerp(l,c),this.linePositions[r++]=u.position.x,this.linePositions[r++]=u.position.y,this.linePositions[r++]=u.position.z,this.linePositions[r++]=n.position.x,this.linePositions[r++]=n.position.y,this.linePositions[r++]=n.position.z,this.lineColors[s++]=c.r,this.lineColors[s++]=c.g,this.lineColors[s++]=c.b,this.lineColors[s++]=c.r,this.lineColors[s++]=c.g,this.lineColors[s++]=c.b,o++)}}return this.linesMesh.geometry.setDrawRange(0,2*o),this.linesMesh.geometry.attributes.position.needsUpdate=!0,this.linesMesh.geometry.attributes.color.needsUpdate=!0,.001*this.t}onMouseMove(e,t){var i=this.camera,n=(i.oy||(i.oy=i.position.y,i.ox=i.position.x,i.oz=i.position.z),Math.atan2(i.oz,i.ox)),r=Math.sqrt(i.oz*i.oz+i.ox*i.ox),n=n+2*(e-.5)*(this.options.mouseCoeffX||1);i.tz=r*Math.sin(n),i.tx=r*Math.cos(n),i.ty=i.oy+50*(t-.5)*(this.options.mouseCoeffY||1),this.rayCaster,this.rcMouseX=2*e-1,this.rcMouseY=2*-e+1}onRestart(){this.scene&&this.scene.remove(this.linesMesh),this.points=[]}}c.initClass();const u=o.register("NET",c);return e})())()},864:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>c}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let a="object"==typeof window&&window.THREE;class l extends t{constructor(e){(a=e.THREE||a).Color.prototype.toVector=function(){return new a.Vector3(this.r,this.g,this.b)},super(e),this.updateUniforms=this.updateUniforms.bind(this)}init(){this.mode="shader",this.uniforms={iTime:{type:"f",value:1},iResolution:{type:"v2",value:new a.Vector2(1,1)},iDpr:{type:"f",value:window.devicePixelRatio||1},iMouse:{type:"v2",value:new a.Vector2(this.mouseX||0,this.mouseY||0)}},super.init(),this.fragmentShader&&this.initBasicShader()}setOptions(e){super.setOptions(e),this.updateUniforms()}initBasicShader(e=this.fragmentShader,t=this.vertexShader){t=t||"uniform float uTime;\nuniform vec2 uResolution;\nvoid main() {\n gl_Position = vec4( position, 1.0 );\n}",this.updateUniforms(),"function"==typeof this.valuesChanger&&this.valuesChanger();t=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t,fragmentShader:e}),e=this.options.texturePath,e&&(this.uniforms.iTex={type:"t",value:(new a.TextureLoader).load(e)}),e=new a.Mesh(new a.PlaneGeometry(2,2),t);this.scene.add(e),this.camera=new a.Camera,this.camera.position.z=1}updateUniforms(){var e={};let t,i;for(t in this.options)i=this.options[t],-1!==t.toLowerCase().indexOf("color")?e[t]={type:"v3",value:new a.Color(i).toVector()}:"number"==typeof i&&(e[t]={type:"f",value:i});return Object.assign(this.uniforms,e)}resize(){super.resize(),this.uniforms.iResolution.value.x=this.width/this.scale,this.uniforms.iResolution.value.y=this.height/this.scale}}class h extends l{}const c=o.register("CELLS",h);return h.prototype.defaultOptions={color1:35980,color2:15918901,backgroundColor:14155663,amplitudeFactor:1,ringFactor:1,rotationFactor:1,size:1.5,speed:1,scaleMobile:3},h.prototype.fragmentShader="uniform vec2 iResolution;\nuniform vec2 iMouse;\nuniform float iTime;\n\nuniform float blurFactor;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 backgroundColor;\nuniform float size;\nuniform float amplitudeFactor;\nuniform float ringFactor;\nuniform float rotationFactor;\n\nfloat length2(vec2 p) { return dot(p, p); }\n\nfloat noise(vec2 p){\n return fract(sin(fract(sin(p.x) * (43.13311)) + p.y) * 31.0011);\n}\n\nfloat worley(vec2 p) {\n float d = 1e30;\n for (int xo = -1; xo <= 1; ++xo) {\n for (int yo = -1; yo <= 1; ++yo) {\n vec2 tp = floor(p) + vec2(xo, yo);\n d = min(d, length2(p - tp - vec2(noise(tp))));\n }\n }\n vec2 uv = gl_FragCoord.xy / iResolution.xy;\n float timeOffset = 0.15 * sin(iTime * 2.0 + 10.0*(uv.x - uv.y));\n return 3.0*exp(-4.0*abs(2.0*d - 1.0 + timeOffset));\n}\n\nfloat fworley(vec2 p) {\n return sqrt(sqrt(sqrt(\n 1.1 * // light\n worley(p*5. + .3 + iTime*.0525) *\n sqrt(worley(p * 50. / size + 0.3 + iTime * -0.15)) *\n sqrt(sqrt(worley(p * -10. + 9.3))))));\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / iResolution.xy;\n float t = fworley(uv * iResolution.xy / 1500.0);\n t *= exp(-length2(abs(0.7*uv - 1.0)));\n\n float tExp = pow(t, 0.5 - t);\n vec3 c1 = color1 * (1.0 - t);\n vec3 c2 = color2 * tExp;\n\n gl_FragColor = vec4(pow(t, 1.0 - t) * (c1 + c2), 1.0);\n}\n",e})())()},865:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};function r(){return"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)}n.r(e),n.d(e,{default:()=>p}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const h=e=>e[Math.floor(Math.random()*e.length)];function c(e,t){return null==t&&(t=1),(e=null==e?0:e)+Math.random()*(t-e)}function u(e,t){return null==e&&(e=0),null==t&&(t=1),Math.floor(e+Math.random()*(t-e+1))}const i="object"==typeof window;let s=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function o(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const a=i&&window.VANTA||{};a.register=(e,t)=>a[e]=e=>new t(e),a.version="0.5.24";a.VantaBase=class{constructor(e={}){if(!i)return!1;(a.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(s=this.options.THREE),this.el=this.options.el,null==this.el)o('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void o("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return o("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){s.WebGLRenderer?(this.renderer=new s.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new s.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),r()&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),a.current===this&&(a.current=null)}};var t=a.VantaBase;let d="object"==typeof window&&window.THREE;class l extends t{static initClass(){this.prototype.defaultOptions={backgroundColor:2106408,color:8978176},this.prototype.colors=[16720469,16716185,16737996,8978176,7851025,16776960,16742195,1179647,1149149,16768290,2250188,7975100,5468283]}constructor(e){d=e.THREE||d,super(e)}material(e){return new d.MeshLambertMaterial({color:e})}genRing(e,t,i,n,r,s,o){null==n&&(n=0),null==r&&(r=1.4*Math.PI),null==s&&(s=0),null==o&&(o=1),this.rings||(this.rings=[]),t<1&&(t=1);var a={depth:.4,bevelEnabled:!1,steps:1,curveSegments:~~(64*r/6.14)},l=new d.Shape,l=(l.absarc(0,0,t+i,0,r,!1),l.lineTo(t*Math.cos(r),t*Math.sin(r)),l.absarc(0,0,t,r,0,!0),new d.ExtrudeGeometry(l,a)),a=this.material(e),l=((0===u(0,1)||60<t)&&(a.transparent=!0,a.opacity=Math.max(50/t+c(-.3,.3),.1)),new d.Mesh(l,a));if(l.rotation.x=Math.PI/2,l.rotation.z=n,l.position.y=s,l.speed=.001*o,l.receiveShadow=!0,l.castShadow=!0,this.rings.push(l),this.cont.add(l),t<20&&r<1.3*Math.PI&&u(0,2))try{this.genRing(h(this.colors),t+c(-1,3),i+c(-2,0),n+r,r+c(-.5,.5),s+c(-3,1),o)}catch(e){}return l}onInit(){let t;var{}=this;this.cont=new d.Group,this.cont.position.set(30,0,0),this.cont.rotation.x=.06667,this.cont.rotation.z=.16667,this.scene.add(this.cont);let i=r()?30:60;for(let e=0;e<i;e++){let e;t=u(0,3)?(e=c(2,4)+c(1,30)*c(1,2)*c(1,2)*c(1,2),r()&&(e*=.5),c(0,3.5)+c(0,3.5)-u(0,e/4)-e/50):(e=c(1,3)*c(2,4),c(1,2)*c(1,2)*c(1.1,1.5));const i=.05*Math.pow(2,u(0,4));t<i&&(t=i),this.genRing(h(this.colors),e,t,c(0,1e3),c(1,6),c(0,50/(e+1)+5)+5/t/(e+.5),.25*Math.max(-c(.5,2),c(1,50-e/2)-e/2))}this.camera=new d.PerspectiveCamera(25,this.width/this.height,10,1e4),this.camera.position.set(0,150,200),this.scene.add(this.camera);var e=new d.AmbientLight(16777215,.5);return this.scene.add(e),this.pointLight=new d.PointLight(16777215,.5),this.pointLight.position.set(0,150,200),this.scene.add(this.pointLight),this.spot=new d.SpotLight(16777215,1),this.spot.position.set(-15,50,100),this.spot.penumbra=1,this.spot.angle=.5,this.spot.decay=1,this.spot.distance=300,this.spot.target=this.cont,this.scene.add(this.spot)}onUpdate(){let e;null!=this.helper&&this.helper.update(),null!=this.controls&&this.controls.update();var t,i=this.camera;.01<Math.abs(i.tx-i.position.x)&&(e=i.tx-i.position.x,i.position.x+=.02*e),.01<Math.abs(i.ty-i.position.y)&&(e=i.ty-i.position.y,i.position.y+=.02*e),i.lookAt(new d.Vector3(0,25,7)),i.near=Math.max(.5*i.position.z-20,1),i.updateProjectionMatrix();for(t of Array.from(null!=this.rings?this.rings:[]))t.rotation.z+=t.speed;i=.001*this.t;return this.cont.rotation.x+=1e-4*Math.sin(i),this.cont.rotation.z+=7e-5*Math.cos(i)}onMouseMove(e,t){var i=this.camera;return i.oy||(i.oy=i.position.y,i.ox=i.position.x),i.tx=i.ox+50*(e-.5),i.ty=i.oy-50*t}}l.initClass();const p=a.register("RINGS",l);return e})())()},866:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>u}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let a="object"==typeof window&&window.THREE;class l extends t{constructor(e){(a=e.THREE||a).Color.prototype.toVector=function(){return new a.Vector3(this.r,this.g,this.b)},super(e),this.updateUniforms=this.updateUniforms.bind(this)}init(){this.mode="shader",this.uniforms={iTime:{type:"f",value:1},iResolution:{type:"v2",value:new a.Vector2(1,1)},iDpr:{type:"f",value:window.devicePixelRatio||1},iMouse:{type:"v2",value:new a.Vector2(this.mouseX||0,this.mouseY||0)}},super.init(),this.fragmentShader&&this.initBasicShader()}setOptions(e){super.setOptions(e),this.updateUniforms()}initBasicShader(e=this.fragmentShader,t=this.vertexShader){t=t||"uniform float uTime;\nuniform vec2 uResolution;\nvoid main() {\n gl_Position = vec4( position, 1.0 );\n}",this.updateUniforms(),"function"==typeof this.valuesChanger&&this.valuesChanger();t=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t,fragmentShader:e}),e=this.options.texturePath,e&&(this.uniforms.iTex={type:"t",value:(new a.TextureLoader).load(e)}),e=new a.Mesh(new a.PlaneGeometry(2,2),t);this.scene.add(e),this.camera=new a.Camera,this.camera.position.z=1}updateUniforms(){var e={};let t,i;for(t in this.options)i=this.options[t],-1!==t.toLowerCase().indexOf("color")?e[t]={type:"v3",value:new a.Color(i).toVector()}:"number"==typeof i&&(e[t]={type:"f",value:i});return Object.assign(this.uniforms,e)}resize(){super.resize(),this.uniforms.iResolution.value.x=this.width/this.scale,this.uniforms.iResolution.value.y=this.height/this.scale}}let h="object"==typeof window&&window.THREE;class c extends l{constructor(e){h=e.THREE||h,super(e)}getDefaultOptions(){return{baseColor:6745,color2:15918901,backgroundColor:1251907,amplitudeFactor:1,ringFactor:1,rotationFactor:1,xOffset:0,yOffset:0,size:1,speed:1,mouseEase:!0,scaleMobile:1,scale:1}}onInit(){var e={minFilter:h.LinearFilter,magFilter:h.LinearFilter,format:h.RGBFormat},t=this.width*window.devicePixelRatio/this.scale,i=this.height*window.devicePixelRatio/this.scale;this.bufferTarget=new h.WebGLRenderTarget(t,i,e),this.bufferFeedback=new h.WebGLRenderTarget(t,i,e)}initBasicShader(e,t){super.initBasicShader(e,t),this.uniforms.iBuffer={type:"t",value:this.bufferTarget.texture}}onUpdate(){this.uniforms.iBuffer.value=this.bufferFeedback.texture;var e=this.renderer,e=(e.setRenderTarget(this.bufferTarget),e.render(this.scene,this.camera),e.setRenderTarget(null),e.clear(),this.bufferTarget);this.bufferTarget=this.bufferFeedback,this.bufferFeedback=e}onResize(){var e,t;this.bufferTarget&&(e=this.width*window.devicePixelRatio/this.scale,t=this.height*window.devicePixelRatio/this.scale,this.bufferTarget.setSize(e,t),this.bufferFeedback.setSize(e,t))}onDestroy(){this.bufferTarget=null,this.bufferFeedback=null}}const u=o.register("HALO",c);return c.prototype.fragmentShader="uniform vec2 iResolution;\nuniform float iDpr;\nuniform vec2 iMouse;\nuniform float iTime;\n\nuniform float xOffset;\nuniform float yOffset;\nuniform vec3 baseColor;\nuniform vec3 color2;\nuniform vec3 backgroundColor;\nuniform float size;\nuniform float shape;\nuniform float ringFactor;\nuniform float rotationFactor;\nuniform float amplitudeFactor;\n\nuniform sampler2D iBuffer;\nuniform sampler2D iTex;\nconst float PI = 3.14159265359;\n\n// float length2(vec2 p) { return dot(p, p); }\n\n// float noise(vec2 p){\n// return fract(sin(fract(sin(p.x) * (43.13311)) + p.y) * 31.0011);\n// }\n\n// float worley(vec2 p) {\n// float d = 1e30;\n// for (int xo = -1; xo <= 1; ++xo) {\n// for (int yo = -1; yo <= 1; ++yo) {\n// vec2 tp = floor(p) + vec2(xo, yo);\n// d = min(d, length2(p - tp - vec2(noise(tp))));\n// }\n// }\n// vec2 uv = gl_FragCoord.xy / iResolution.xy;\n// float timeOffset = 0.15 * sin(iTime * 2.0 + 10.0*(uv.x - uv.y));\n// return 3.0*exp(-4.0*abs(2.0*d - 1.0 + timeOffset));\n// }\n\n// float fworley(vec2 p) {\n// return sqrt(\n// 1.1 * // light\n// worley(p*10. + .3 + iTime*.0525) *\n// sqrt(worley(p * 50. / size + 0.1 + iTime * -0.75)) *\n// 4.1 *\n// sqrt(sqrt(worley(p * -1. + 9.3))));\n// }\n\nvec4 j2hue(float c) {\n return .5+.5*cos(6.28*c+vec4(0,-2.1,2.1,0));\n}\n\nvec3 permute(vec3 x) { return mod(((x*34.0)+1.0)*x, 289.0); }\n\nfloat snoise(vec2 v){\n const vec4 C = vec4(0.211324865405187, 0.366025403784439,\n -0.577350269189626, 0.024390243902439);\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n i = mod(i, 289.0);\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy),\n dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\nvec2 sincos( float x ){return vec2(sin(x), cos(x));}\nvec2 rotate2d(vec2 uv, float phi){vec2 t = sincos(phi); return vec2(uv.x*t.y-uv.y*t.x, uv.x*t.x+uv.y*t.y);}\nvec3 rotate3d(vec3 p, vec3 v, float phi){ v = normalize(v); vec2 t = sincos(-phi); float s = t.x, c = t.y, x =-v.x, y =-v.y, z =-v.z; mat4 M = mat4(x*x*(1.-c)+c,x*y*(1.-c)-z*s,x*z*(1.-c)+y*s,0.,y*x*(1.-c)+z*s,y*y*(1.-c)+c,y*z*(1.-c)-x*s,0.,z*x*(1.-c)-y*s,z*y*(1.-c)+x*s,z*z*(1.-c)+c,0.,0.,0.,0.,1.);return (vec4(p,1.)*M).xyz;}\n\n// Classic Perlin 3D Noise\n// by Stefan Gustavson\nvec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}\nvec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}\nvec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}\nfloat p3d(vec3 P){\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod(Pi0, 289.0);\n Pi1 = mod(Pi1, 289.0);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 / 7.0;\n vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 / 7.0;\n vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\n\nvoid main() {\n vec2 res2 = iResolution.xy * iDpr;\n vec2 pixel = vec2(gl_FragCoord.xy - 0.5 * res2) / res2.y; // center-origin pixel coord\n pixel.x -= xOffset * res2.x / res2.y;\n pixel.y -= yOffset;\n\n vec2 uv = gl_FragCoord.xy / res2; // 0 to 1\n\n // float nn1 = snoise(uv * 0.25 + iTime * 0.005 + mixedColor.b * 0.01) * 0.1;\n // float nn2 = snoise(uv * 0.25 + iTime * 0.005 + mixedColor.b * 0.01 + 1000.) * 0.1;\n // uv += vec2(nn1, nn2);\n\n // PERLIN DISTORTION\n // float noiseScale = 10.;\n // float timeScale = 0.5;\n // uv += vec2( p3d(vec3(uv * noiseScale, iTime * timeScale)), p3d(vec3(1000. + uv * noiseScale , iTime * timeScale)) ) * 0.001;\n\n // uv = rotate2d(uv, 0.001);\n // pixel = rotate2d(pixel, 0.001);\n\n vec2 mouse2 = (iMouse * iDpr / res2 - 0.5) * vec2(1.,-1.);\n vec2 uvBig = (uv - 0.5) * 0.996 + 0.5;\n\n vec4 oldImage = texture2D(iBuffer, uv);\n vec3 mixedColor = oldImage.rgb - backgroundColor;\n\n // float spinDist = 0.002 + 0.002 * sin(iTime * 0.4);\n float cropDist = 0.01;\n float cropXOffset = 0.2;\n float cropYOffset = 0.2;\n // float cropXOffset = 0.4 + 0.1 * sin(iTime * 0.4);\n // float cropYOffset = 0.4 + 0.1 * cos(iTime * 0.6);\n\n vec2 offset = uv + vec2((mixedColor.g - cropXOffset) * cropDist, (mixedColor.r - cropYOffset) * cropDist);\n\n // float nn = snoise(uv * 10.) * 0.001;\n // offset += nn;\n\n float spinDist = 0.001;\n float spinSpeed = 0.2 + 0.15 * cos(iTime * 0.5);\n float timeFrac = mod(iTime, 6.5);\n vec2 offset2 = uvBig + vec2(cos(timeFrac * spinSpeed) * spinDist, sin(timeFrac * spinSpeed) * spinDist);\n\n mixedColor = texture2D(iBuffer, offset).rgb * 0.4\n + texture2D(iBuffer, offset2).rgb * 0.6\n - backgroundColor;\n\n\n // mixedColor *= .875;\n float fadeAmt = 0.0015; // fade this amount each frame // 0.002\n mixedColor = (mixedColor - fadeAmt) * .995;\n\n // float nn = snoise(uvBig * 10.) * 20.;\n // mixedColor *= clamp(nn, 0.98, 1.0);\n\n vec4 spectrum = abs( abs( .95*atan(uv.x, uv.y) -vec4(0,2,4,0) ) -3. )-1.;\n float angle = atan(pixel.x, pixel.y);\n float dist = length(pixel - mouse2*0.15) * 8. + sin(iTime) * .01;\n\n // mixedColor *= pow(1.-dist*0.002, 2.);\n\n\n // Flowery shapes\n // float edge = abs(dist * 0.5);\n float flowerPeaks = .05 * amplitudeFactor * size;\n float flowerPetals = 7.;\n float edge = abs((dist + sin(angle * flowerPetals + iTime * 0.5) * sin(iTime * 1.5) * flowerPeaks) * 0.65 / size);\n // float edge = abs((dist + sin(angle * 4. + iTime * 2.) * sin(iTime * 3.) * 0.75) * 1.);\n\n // vec4 rainbow = abs( abs( .95*mod(iTime * 1., 2. * PI) - vec4(0,2,4,0) ) -3. )-1.;\n // vec4 rainbow = vec4(0,2,4,0);\n\n float colorChangeSpeed = 0.75 + 0.05 * sin(iTime) * 1.5;\n float rainbowInput = timeFrac * colorChangeSpeed;\n // NOISE!\n // float nn = snoise(uv * 0.25 + iTime * 0.005 + mixedColor.b * 0.01) * 20.;\n // rainbowInput += nn;\n\n float brightness = 0.7;\n vec4 rainbow = sqrt(j2hue(cos(rainbowInput))) + vec4(baseColor,0) - 1.0 + brightness;\n float factor = smoothstep(1., .9, edge) * pow(edge, 2.);\n vec3 color = rainbow.rgb * smoothstep(1., .9, edge) * pow(edge, 20.);\n vec4 ring = vec4(\n backgroundColor + clamp( mixedColor + color, 0., 1.)\n , 1.0);\n\n // float t = fworley(uv * u_resolution.xy / 1500.0);\n // t *= exp(-length2(abs(0.7*uv - 1.0)));\n // float tExp = pow(t, 2. - t);\n // vec3 c1 = color1 * (1.0 - t);\n // vec3 c2 = color2 * tExp;\n // vec4 cells = vec4(mixedColor * 0.25, 1.) + vec4(pow(t, 1.0 - t) * (c1 + c2), 1.0);\n // gl_FragColor = clamp(ring + cells * 0.5, 0.0, 1.0);\n\n // float nn = snoise(uv * 10.) * 0.01; // creepy!\n gl_FragColor = ring;\n}\n",e})())()}}]);
121
+ `,blending:Y,depthTest:!1,depthWrite:!1})}function Ao(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function Co(){return"\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t"}function Ro(r){let s=new WeakMap,o=null;function a(e){var e=e.target,t=(e.removeEventListener("dispose",a),s.get(e));void 0!==t&&(s.delete(e),t.dispose())}return{get:function(e){if(e&&e.isTexture&&!1===e.isRenderTargetTexture){var t,i=e.mapping,n=i===Ue||i===Ge,i=i===Fe||i===He;if(n||i)return s.has(e)?s.get(e).texture:(t=e.image,n&&t&&0<t.height||i&&t&&function(t){let i=0;for(let e=0;e<6;e++)void 0!==t[e]&&i++;return 6===i}(t)?(i=r.getRenderTarget(),null===o&&(o=new Mo(r)),t=n?o.fromEquirectangular(e):o.fromCubemap(e),s.set(e,t),r.setRenderTarget(i),e.addEventListener("dispose",a),t.texture):null)}return e},dispose:function(){s=new WeakMap,null!==o&&(o.dispose(),o=null)}}}function Lo(i){const n={};function r(e){if(void 0!==n[e])return n[e];let t;switch(e){case"WEBGL_depth_texture":t=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":t=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":t=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":t=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:t=i.getExtension(e)}return n[e]=t}return{has:function(e){return null!==r(e)},init:function(e){e.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float")},get:function(e){var t=r(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Po(e,a,i,n){const r={},l=new WeakMap;function s(e){var t=e.target;null!==t.index&&a.remove(t.index);for(const e in t.attributes)a.remove(t.attributes[e]);t.removeEventListener("dispose",s),delete r[t.id];e=l.get(t);e&&(a.remove(e),l.delete(t)),n.releaseStatesOfGeometry(t),!0===t.isInstancedBufferGeometry&&delete t._maxInstanceCount,i.memory.geometries--}function o(i){const n=[],r=i.index,s=i.attributes.position;let e=0;if(null!==r){const i=r.array;e=r.version;for(let e=0,t=i.length;e<t;e+=3){const r=i[e+0],s=i[e+1],l=i[e+2];n.push(r,s,s,l,l,r)}}else{const i=s.array;e=s.version;for(let e=0,t=i.length/3-1;e<t;e+=3){const i=e+0,r=e+1,s=e+2;n.push(i,r,r,s,s,i)}}var t=new(65535<_n(n)?as:ss)(n,1),o=(t.version=e,l.get(i));o&&a.remove(o),l.set(i,t)}return{get:function(e,t){return!0!==r[t.id]&&(t.addEventListener("dispose",s),r[t.id]=!0,i.memory.geometries++),t},update:function(e){const i=e.attributes;for(const e in i)a.update(i[e],34962);var t=e.morphAttributes;for(const e in t){const i=t[e];for(let e=0,t=i.length;e<t;e++)a.update(i[e],34962)}},getWireframeAttribute:function(e){var t,i=l.get(e);return(!i||null!==(t=e.index)&&i.version<t.version)&&o(e),l.get(e)}}}function zo(s,o,a,e){const l=e.isWebGL2;let h,c,u;this.setMode=function(e){h=e},this.setIndex=function(e){c=e.type,u=e.bytesPerElement},this.render=function(e,t){s.drawElements(h,t,c,e*u),a.update(t,h,1)},this.renderInstances=function(i,n,r){if(0!==r){let e,t;if(l)e=s,t="drawElementsInstanced";else if(e=o.get("ANGLE_instanced_arrays"),t="drawElementsInstancedANGLE",null===e)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");e[t](h,n,c,i*u,r),a.update(n,h,r)}}}function Do(e){const n={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:n,programs:null,autoReset:!0,reset:function(){n.frame++,n.calls=0,n.triangles=0,n.points=0,n.lines=0},update:function(e,t,i){switch(n.calls++,t){case 4:n.triangles+=i*(e/3);break;case 1:n.lines+=i*(e/2);break;case 3:n.lines+=i*(e-1);break;case 2:n.lines+=i*e;break;case 0:n.points+=i*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",t)}}}}class Io extends c{constructor(e=null,t=1,i=1,n=1){super(null),this.image={data:e,width:t,height:i,depth:n},this.magFilter=Re,this.minFilter=Re,this.wrapR=Ce,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}function Oo(e,t){return e[0]-t[0]}function No(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Bo(e,t){let i=1;t=(t.isInterleavedBufferAttribute?t.data:t).array;t instanceof Int8Array?i=127:t instanceof Int16Array?i=32767:t instanceof Int32Array?i=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",t),e.divideScalar(i)}function Fo(h,c,u){const d={},p=new Float32Array(8),m=new WeakMap,f=new De,g=[];for(let e=0;e<8;e++)g[e]=[e,0];return{update:function(n,r,e,s){const o=n.morphTargetInfluences;if(!0===c.isWebGL2){const d=r.morphAttributes.position.length;let e=m.get(r);if(void 0===e||e.count!==d){void 0!==e&&e.texture.dispose();const h=void 0!==r.morphAttributes.normal,u=r.morphAttributes.position,g=r.morphAttributes.normal||[],n=!0==h?2:1;let t=r.attributes.position.count*n,i=1;t>c.maxTextureSize&&(i=Math.ceil(t/c.maxTextureSize),t=c.maxTextureSize);const o=new Float32Array(t*i*4*d),l=new Io(o,t,i,d);l.format=Le,l.type=ot;var a=4*n;for(let e=0;e<d;e++){const d=u[e],p=g[e],m=t*i*4*e;for(let e=0;e<d.count;e++){f.fromBufferAttribute(d,e),!0===d.normalized&&Bo(f,d);const u=e*a;o[m+u]=f.x,o[m+u+1]=f.y,o[m+u+2]=f.z,!(o[m+u+3]=0)==h&&(f.fromBufferAttribute(p,e),!0===p.normalized&&Bo(f,p),o[m+u+4]=f.x,o[m+u+5]=f.y,o[m+u+6]=f.z,o[m+u+7]=0)}}e={count:d,texture:l,size:new W(t,i)},m.set(r,e)}let t=0;for(let e=0;e<o.length;e++)t+=o[e];const n=r.morphTargetsRelative?1:1-t;s.getUniforms().setValue(h,"morphTargetBaseInfluence",n),s.getUniforms().setValue(h,"morphTargetInfluences",o),s.getUniforms().setValue(h,"morphTargetsTexture",e.texture,u),s.getUniforms().setValue(h,"morphTargetsTextureSize",e.size)}else{const c=void 0===o?0:o.length;let t=d[r.id];if(void 0===t||t.length!==c){t=[];for(let e=0;e<c;e++)t[e]=[e,0];d[r.id]=t}for(let e=0;e<c;e++){const c=t[e];c[0]=e,c[1]=o[e]}t.sort(No);for(let e=0;e<8;e++)e<c&&t[e][1]?(g[e][0]=t[e][0],g[e][1]=t[e][1]):(g[e][0]=Number.MAX_SAFE_INTEGER,g[e][1]=0);g.sort(Oo);const m=r.morphAttributes.position,f=r.morphAttributes.normal;let i=0;for(let e=0;e<8;e++){const c=g[e],u=c[0],d=c[1];u!==Number.MAX_SAFE_INTEGER&&d?(m&&r.getAttribute("morphTarget"+e)!==m[u]&&r.setAttribute("morphTarget"+e,m[u]),f&&r.getAttribute("morphNormal"+e)!==f[u]&&r.setAttribute("morphNormal"+e,f[u]),p[e]=d,i+=d):(m&&!0===r.hasAttribute("morphTarget"+e)&&r.deleteAttribute("morphTarget"+e),f&&!0===r.hasAttribute("morphNormal"+e)&&r.deleteAttribute("morphNormal"+e),p[e]=0)}const e=r.morphTargetsRelative?1:1-i;s.getUniforms().setValue(h,"morphTargetBaseInfluence",e),s.getUniforms().setValue(h,"morphTargetInfluences",p)}}}}function Ho(e,n,r,s){let o=new WeakMap;function a(e){e=e.target;e.removeEventListener("dispose",a),r.remove(e.instanceMatrix),null!==e.instanceColor&&r.remove(e.instanceColor)}return{update:function(e){var t=s.render.frame,i=e.geometry,i=n.get(e,i);return o.get(i)!==t&&(n.update(i),o.set(i,t)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",a)&&e.addEventListener("dispose",a),r.update(e.instanceMatrix,34962),null!==e.instanceColor)&&r.update(e.instanceColor,34962),i},dispose:function(){o=new WeakMap}}}Io.prototype.isDataTexture2DArray=!0;class Uo extends c{constructor(e=null,t=1,i=1,n=1){super(null),this.image={data:e,width:t,height:i,depth:n},this.magFilter=Re,this.minFilter=Re,this.wrapR=Ce,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Uo.prototype.isDataTexture3D=!0;const Go=new c,Wo=new Io,ko=new Uo,Vo=new Gs,jo=[],Xo=[],qo=new Float32Array(16),Yo=new Float32Array(9),Jo=new Float32Array(4);function Zo(i,n,r){var e=i[0];if(e<=0||0<e)return i;var t=n*r;let s=jo[t];if(void 0===s&&(s=new Float32Array(t),jo[t]=s),0!==n){e.toArray(s,0);for(let e=1,t=0;e!==n;++e)t+=r,i[e].toArray(s,t)}return s}function Qo(i,n){if(i.length===n.length){for(let e=0,t=i.length;e<t;e++)if(i[e]!==n[e])return;return 1}}function Ko(i,n){for(let e=0,t=n.length;e<t;e++)i[e]=n[e]}function $o(t,i){let n=Xo[i];void 0===n&&(n=new Int32Array(i),Xo[i]=n);for(let e=0;e!==i;++e)n[e]=t.allocateTextureUnit();return n}function ea(e,t){var i=this.cache;i[0]!==t&&(e.uniform1f(this.addr,t),i[0]=t)}function ta(e,t){var i=this.cache;void 0!==t.x?i[0]===t.x&&i[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y):Qo(i,t)||(e.uniform2fv(this.addr,t),Ko(i,t))}function ia(e,t){var i=this.cache;void 0!==t.x?i[0]===t.x&&i[1]===t.y&&i[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z):void 0!==t.r?i[0]===t.r&&i[1]===t.g&&i[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b):Qo(i,t)||(e.uniform3fv(this.addr,t),Ko(i,t))}function na(e,t){var i=this.cache;void 0!==t.x?i[0]===t.x&&i[1]===t.y&&i[2]===t.z&&i[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w):Qo(i,t)||(e.uniform4fv(this.addr,t),Ko(i,t))}function ra(e,t){var i=this.cache,n=t.elements;void 0===n?Qo(i,t)||(e.uniformMatrix2fv(this.addr,!1,t),Ko(i,t)):Qo(i,n)||(Jo.set(n),e.uniformMatrix2fv(this.addr,!1,Jo),Ko(i,n))}function sa(e,t){var i=this.cache,n=t.elements;void 0===n?Qo(i,t)||(e.uniformMatrix3fv(this.addr,!1,t),Ko(i,t)):Qo(i,n)||(Yo.set(n),e.uniformMatrix3fv(this.addr,!1,Yo),Ko(i,n))}function oa(e,t){var i=this.cache,n=t.elements;void 0===n?Qo(i,t)||(e.uniformMatrix4fv(this.addr,!1,t),Ko(i,t)):Qo(i,n)||(qo.set(n),e.uniformMatrix4fv(this.addr,!1,qo),Ko(i,n))}function aa(e,t){var i=this.cache;i[0]!==t&&(e.uniform1i(this.addr,t),i[0]=t)}function la(e,t){var i=this.cache;Qo(i,t)||(e.uniform2iv(this.addr,t),Ko(i,t))}function ha(e,t){var i=this.cache;Qo(i,t)||(e.uniform3iv(this.addr,t),Ko(i,t))}function ca(e,t){var i=this.cache;Qo(i,t)||(e.uniform4iv(this.addr,t),Ko(i,t))}function ua(e,t){var i=this.cache;i[0]!==t&&(e.uniform1ui(this.addr,t),i[0]=t)}function da(e,t){var i=this.cache;Qo(i,t)||(e.uniform2uiv(this.addr,t),Ko(i,t))}function pa(e,t){var i=this.cache;Qo(i,t)||(e.uniform3uiv(this.addr,t),Ko(i,t))}function ma(e,t){var i=this.cache;Qo(i,t)||(e.uniform4uiv(this.addr,t),Ko(i,t))}function fa(e,t,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.safeSetTexture2D(t||Go,r)}function ga(e,t,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(t||ko,r)}function va(e,t,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.safeSetTextureCube(t||Vo,r)}function ya(e,t,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(t||Wo,r)}function xa(e,t){e.uniform1fv(this.addr,t)}function wa(e,t){t=Zo(t,this.size,2);e.uniform2fv(this.addr,t)}function ba(e,t){t=Zo(t,this.size,3);e.uniform3fv(this.addr,t)}function Ma(e,t){t=Zo(t,this.size,4);e.uniform4fv(this.addr,t)}function _a(e,t){t=Zo(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,t)}function Sa(e,t){t=Zo(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,t)}function Ta(e,t){t=Zo(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,t)}function Ea(e,t){e.uniform1iv(this.addr,t)}function Aa(e,t){e.uniform2iv(this.addr,t)}function Ca(e,t){e.uniform3iv(this.addr,t)}function Ra(e,t){e.uniform4iv(this.addr,t)}function La(e,t){e.uniform1uiv(this.addr,t)}function Pa(e,t){e.uniform2uiv(this.addr,t)}function za(e,t){e.uniform3uiv(this.addr,t)}function Da(e,t){e.uniform4uiv(this.addr,t)}function Ia(e,t,i){var n=t.length,r=$o(i,n);e.uniform1iv(this.addr,r);for(let e=0;e!==n;++e)i.safeSetTexture2D(t[e]||Go,r[e])}function Oa(e,t,i){var n=t.length,r=$o(i,n);e.uniform1iv(this.addr,r);for(let e=0;e!==n;++e)i.safeSetTextureCube(t[e]||Vo,r[e])}function Na(e,t,i){this.id=e,this.addr=i,this.cache=[],this.setValue=function(){switch(t.type){case 5126:return ea;case 35664:return ta;case 35665:return ia;case 35666:return na;case 35674:return ra;case 35675:return sa;case 35676:return oa;case 5124:case 35670:return aa;case 35667:case 35671:return la;case 35668:case 35672:return ha;case 35669:case 35673:return ca;case 5125:return ua;case 36294:return da;case 36295:return pa;case 36296:return ma;case 35678:case 36198:case 36298:case 36306:case 35682:return fa;case 35679:case 36299:case 36307:return ga;case 35680:case 36300:case 36308:case 36293:return va;case 36289:case 36303:case 36311:case 36292:return ya}}()}function Ba(e,t,i){this.id=e,this.addr=i,this.cache=[],this.size=t.size,this.setValue=function(){switch(t.type){case 5126:return xa;case 35664:return wa;case 35665:return ba;case 35666:return Ma;case 35674:return _a;case 35675:return Sa;case 35676:return Ta;case 5124:case 35670:return Ea;case 35667:case 35671:return Aa;case 35668:case 35672:return Ca;case 35669:case 35673:return Ra;case 5125:return La;case 36294:return Pa;case 36295:return za;case 36296:return Da;case 35678:case 36198:case 36298:case 36306:case 35682:return Ia;case 35680:case 36300:case 36308:case 36293:return Oa}}()}function Fa(e){this.id=e,this.seq=[],this.map={}}Ba.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Ko(t,e)},Fa.prototype.setValue=function(i,n,r){var s=this.seq;for(let e=0,t=s.length;e!==t;++e){var o=s[e];o.setValue(i,n[o.id],r)}};const Ha=/(\w+)(\])?(\[|\.)?/g;function Ua(e,t){e.seq.push(t),e.map[t.id]=t}function Ga(t,i){this.seq=[],this.map={};const n=t.getProgramParameter(i,35718);for(let e=0;e<n;++e){const n=t.getActiveUniform(i,e);u=c=h=l=a=o=s=r=void 0;var r=n,s=t.getUniformLocation(i,n.name),o=this,a=r.name,l=a.length;for(Ha.lastIndex=0;;){var h=Ha.exec(a),c=Ha.lastIndex;let t=h[1];var u="]"===h[2],h=h[3];if(u&&(t|=0),void 0===h||"["===h&&c+2===l){Ua(o,new(void 0===h?Na:Ba)(t,r,s));break}{let e=o.map[t];void 0===e&&Ua(o,e=new Fa(t)),o=e}}}}function Wa(e,t,i){t=e.createShader(t);return e.shaderSource(t,i),e.compileShader(t),t}Ga.prototype.setValue=function(e,t,i,n){t=this.map[t];void 0!==t&&t.setValue(e,i,n)},Ga.prototype.setOptional=function(e,t,i){t=t[i];void 0!==t&&this.setValue(e,i,t)},Ga.upload=function(i,n,r,s){for(let e=0,t=n.length;e!==t;++e){var o=n[e],a=r[o.id];!1!==a.needsUpdate&&o.setValue(i,a.value,s)}},Ga.seqWithValue=function(i,n){var r=[];for(let e=0,t=i.length;e!==t;++e){var s=i[e];s.id in n&&r.push(s)}return r};let ka=0;function Va(e){switch(e){case Pe:return["Linear","( value )"];case Ti:return["sRGB","( value )"];case Ai:return["RGBE","( value )"];case Ri:return["RGBM","( value, 7.0 )"];case Li:return["RGBM","( value, 16.0 )"];case Pi:return["RGBD","( value, 256.0 )"];case Ei:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case Ci:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function ja(e,i,t){var n=e.getShaderParameter(i,35713),r=e.getShaderInfoLog(i).trim();return n&&""===r?"":t.toUpperCase()+"\n\n"+r+"\n\n"+function(){var t=e.getShaderSource(i).split("\n");for(let e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}()}function Xa(e,t){t=Va(t);return"vec4 "+e+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function qa(e){return""!==e}function Ya(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 Ja(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Za=/^[ \t]*#include +<([\w\d./]+)>/gm;function Qa(e){return e.replace(Za,Ka)}function Ka(e,t){var i=E[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return Qa(i)}const $a=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,el=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function tl(e){return e.replace(el,nl).replace($a,il)}function il(e,t,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),nl(0,t,i,n)}function nl(e,t,i,n){let r="";for(let e=parseInt(t);e<parseInt(i);e++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return r}function rl(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function sl(i,n,r,e){const s=i.getContext(),t=r.defines;var o=r.vertexShader,a=r.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===L?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===P?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===z&&(t="SHADOWMAP_TYPE_VSM"),t}(r),h=function(){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case Fe:case He:e="ENVMAP_TYPE_CUBE";break;case We:case ke:e="ENVMAP_TYPE_CUBE_UV"}return e}(),c=function(){let e="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case He:case ke:e="ENVMAP_MODE_REFRACTION"}return e}(),u=function(){let e="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case O:e="ENVMAP_BLENDING_MULTIPLY";break;case N:e="ENVMAP_BLENDING_MIX";break;case H:e="ENVMAP_BLENDING_ADD"}return e}(),d=0<i.gammaFactor?i.gammaFactor:1,p=r.isWebGL2?"":[r.extensionDerivatives||r.envMapCubeUV||r.bumpMap||r.tangentSpaceNormalMap||r.clearcoatNormalMap||r.flatShading||"physical"===r.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(qa).join("\n"),m=function(e){var t=[];for(const n in e){var i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(t),f=s.createProgram();let g,v,y=r.glslVersion?"#version "+r.glslVersion+"\n":"";r.isRawShaderMaterial?(0<(g=[m].filter(qa).join("\n")).length&&(g+="\n"),0<(v=[p,m].filter(qa).join("\n")).length&&(v+="\n")):(g=[rl(r),"#define SHADER_NAME "+r.shaderName,m,r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+r.maxBones,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+c:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",r.specularColorMap?"#define USE_SPECULARCOLORMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEENCOLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphTargets&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",r.morphTargets&&r.isWebGL2?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(qa).join("\n"),v=[p,rl(r),"#define SHADER_NAME "+r.shaderName,m,"#define GAMMA_FACTOR "+d,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.envMap?"#define "+c:"",r.envMap?"#define "+u:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",r.specularColorMap?"#define USE_SPECULARCOLORMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEENCOLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(r.extensionShaderTextureLOD||r.envMap)&&r.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==Be?"#define TONE_MAPPING":"",r.toneMapping!==Be?E.tonemapping_pars_fragment:"",r.toneMapping!==Be?function(e,t){let i;switch(t){case U:i="Linear";break;case G:i="Reinhard";break;case V:i="OptimizedCineon";break;case Se:i="ACESFilmic";break;case Te:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.format===pt?"#define OPAQUE":"",E.encodings_pars_fragment,r.map?Xa("mapTexelToLinear",r.mapEncoding):"",r.matcap?Xa("matcapTexelToLinear",r.matcapEncoding):"",r.envMap?Xa("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMap?Xa("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.specularColorMap?Xa("specularColorMapTexelToLinear",r.specularColorMapEncoding):"",r.sheenColorMap?Xa("sheenColorMapTexelToLinear",r.sheenColorMapEncoding):"",r.lightMap?Xa("lightMapTexelToLinear",r.lightMapEncoding):"",(x="linearToOutputTexel",w=Va(w=r.outputEncoding),"vec4 "+x+"( vec4 value ) { return LinearTo"+w[0]+w[1]+"; }"),r.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(qa).join("\n")),o=Ja(Ya(Qa(o),r),r),a=Ja(Ya(Qa(a),r),r),o=tl(o),a=tl(a),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(y="#version 300 es\n",g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in",r.glslVersion===hn?"":"out highp vec4 pc_fragColor;",r.glslVersion===hn?"":"#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"+v);var x=y+v+a,w=Wa(s,35633,y+g+o),a=Wa(s,35632,x);if(s.attachShader(f,w),s.attachShader(f,a),void 0!==r.index0AttributeName?s.bindAttribLocation(f,0,r.index0AttributeName):!0===r.morphTargets&&s.bindAttribLocation(f,0,"position"),s.linkProgram(f),i.debug.checkShaderErrors){const i=s.getProgramInfoLog(f).trim(),n=s.getShaderInfoLog(w).trim(),r=s.getShaderInfoLog(a).trim();let e=!0,t=!0;if(!1===s.getProgramParameter(f,35714)){e=!1;const n=ja(s,w,"vertex"),r=ja(s,a,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(f,35715)+"\n\nProgram Info Log: "+i+"\n"+n+"\n"+r)}else""!==i?console.warn("THREE.WebGLProgram: Program Info Log:",i):""!==n&&""!==r||(t=!1);t&&(this.diagnostics={runnable:e,programLog:i,vertexShader:{log:n,prefix:g},fragmentShader:{log:r,prefix:v}})}let b,M;return s.deleteShader(w),s.deleteShader(a),this.getUniforms=function(){return b=void 0===b?new Ga(s,f):b},this.getAttributes=function(){return M=void 0===M?function(i,n){const r={},s=i.getProgramParameter(n,35721);for(let t=0;t<s;t++){const s=i.getActiveAttrib(n,t),o=s.name;let e=1;35674===s.type&&(e=2),35675===s.type&&(e=3),35676===s.type&&(e=4),r[o]={type:s.type,location:i.getAttribLocation(n,o),locationSize:e}}return r}(s,f):M},this.destroy=function(){e.releaseStatesOfProgram(this),s.deleteProgram(f),this.program=void 0},this.name=r.shaderName,this.id=ka++,this.cacheKey=n,this.usedTimes=1,this.program=f,this.vertexShader=w,this.fragmentShader=a,this}function ol(p,m,f,g,v,e,y){const s=[],x=v.isWebGL2,w=v.logarithmicDepthBuffer,b=v.floatVertexTextures,M=v.maxVertexUniforms,_=v.vertexTextures;let S=v.precision;const T={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"},n=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoat","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap",,"roughnessMap","metalnessMap","gradientMap","alphaMap","alphaTest","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","morphTargetsCount","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","format","specularIntensityMap","specularColorMap","specularColorMapEncoding","transmission","transmissionMap","thicknessMap","sheen","sheenColorMap","sheenColorMapEncoding","sheenRoughnessMap"];function E(e){let t;return t=e&&e.isTexture?e.encoding:e&&e.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e.texture.encoding):Pe,t=x&&e&&e.isTexture&&e.format===Le&&e.type===et&&e.encoding===Ti?Pe:t}return{getParameters:function(e,t,i,n,r){var s=n.fog,n=e.isMeshStandardMaterial?n.environment:null,n=(e.isMeshStandardMaterial?f:m).get(e.envMap||n),o=T[e.type],a=r.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(b)return 1024;{const e=M,i=Math.floor((e-20)/4),n=Math.min(i,t.length);return n<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+n+"."),0):n}}(r):0;let l,h;if(null!==e.precision&&(S=v.getMaxPrecision(e.precision))!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",S,"instead."),o){const p=$s[o];l=p.vertexShader,h=p.fragmentShader}else l=e.vertexShader,h=e.fragmentShader;var c=p.getRenderTarget(),u=0<e.alphaTest,d=0<e.clearcoat;return{isWebGL2:x,shaderID:o,shaderName:e.type,vertexShader:l,fragmentShader:h,defines:e.defines,isRawShaderMaterial:!0===e.isRawShaderMaterial,glslVersion:e.glslVersion,precision:S,instancing:!0===r.isInstancedMesh,instancingColor:!0===r.isInstancedMesh&&null!==r.instanceColor,supportsVertexTextures:_,outputEncoding:null!==c?E(c.texture):p.outputEncoding,map:!!e.map,mapEncoding:E(e.map),matcap:!!e.matcap,matcapEncoding:E(e.matcap),envMap:!!n,envMapMode:n&&n.mapping,envMapEncoding:E(n),envMapCubeUV:!!n&&(n.mapping===We||n.mapping===ke),lightMap:!!e.lightMap,lightMapEncoding:E(e.lightMap),aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:E(e.emissiveMap),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:e.normalMapType===Oi,tangentSpaceNormalMap:e.normalMapType===Ii,clearcoat:d,clearcoatMap:d&&!!e.clearcoatMap,clearcoatRoughnessMap:d&&!!e.clearcoatRoughnessMap,clearcoatNormalMap:d&&!!e.clearcoatNormalMap,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,specularIntensityMap:!!e.specularIntensityMap,specularColorMap:!!e.specularColorMap,specularColorMapEncoding:E(e.specularColorMap),alphaMap:!!e.alphaMap,alphaTest:u,gradientMap:!!e.gradientMap,sheen:0<e.sheen,sheenColorMap:!!e.sheenColorMap,sheenColorMapEncoding:E(e.sheenColorMap),sheenRoughnessMap:!!e.sheenRoughnessMap,transmission:0<e.transmission,transmissionMap:!!e.transmissionMap,thicknessMap:!!e.thicknessMap,combine:e.combine,vertexTangents:!!e.normalMap&&!!r.geometry&&!!r.geometry.attributes.tangent,vertexColors:e.vertexColors,vertexAlphas:!0===e.vertexColors&&!!r.geometry&&!!r.geometry.attributes.color&&4===r.geometry.attributes.color.itemSize,vertexUvs:!!e.map||!!e.bumpMap||!!e.normalMap||!!e.specularMap||!!e.alphaMap||!!e.emissiveMap||!!e.roughnessMap||!!e.metalnessMap||!!e.clearcoatMap||!!e.clearcoatRoughnessMap||!!e.clearcoatNormalMap||!!e.displacementMap||!!e.transmissionMap||!!e.thicknessMap||!!e.specularIntensityMap||!!e.specularColorMap||!!e.sheenColorMap||e.sheenRoughnessMap,uvsVertexOnly:!(e.map||e.bumpMap||e.normalMap||e.specularMap||e.alphaMap||e.emissiveMap||e.roughnessMap||e.metalnessMap||e.clearcoatNormalMap||0<e.transmission||e.transmissionMap||e.thicknessMap||e.specularIntensityMap||e.specularColorMap||0<!!e.sheen||e.sheenColorMap||e.sheenRoughnessMap||!e.displacementMap),fog:!!s,useFog:e.fog,fogExp2:s&&s.isFogExp2,flatShading:!!e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:w,skinning:!0===r.isSkinnedMesh&&0<a,maxBones:a,useVertexTexture:b,morphTargets:!!r.geometry&&!!r.geometry.morphAttributes.position,morphNormals:!!r.geometry&&!!r.geometry.morphAttributes.normal,morphTargetsCount:r.geometry&&r.geometry.morphAttributes.position?r.geometry.morphAttributes.position.length:0,numDirLights:t.directional.length,numPointLights:t.point.length,numSpotLights:t.spot.length,numRectAreaLights:t.rectArea.length,numHemiLights:t.hemi.length,numDirLightShadows:t.directionalShadowMap.length,numPointLightShadows:t.pointShadowMap.length,numSpotLightShadows:t.spotShadowMap.length,numClippingPlanes:y.numPlanes,numClipIntersection:y.numIntersection,format:e.format,dithering:e.dithering,shadowMapEnabled:p.shadowMap.enabled&&0<i.length,shadowMapType:p.shadowMap.type,toneMapping:e.toneMapped?p.toneMapping:Be,physicallyCorrectLights:p.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,doubleSided:e.side===Ne,flipSided:e.side===Ae,depthPacking:void 0!==e.depthPacking&&e.depthPacking,index0AttributeName:e.index0AttributeName,extensionDerivatives:e.extensions&&e.extensions.derivatives,extensionFragDepth:e.extensions&&e.extensions.fragDepth,extensionDrawBuffers:e.extensions&&e.extensions.drawBuffers,extensionShaderTextureLOD:e.extensions&&e.extensions.shaderTextureLOD,rendererExtensionFragDepth:x||g.has("EXT_frag_depth"),rendererExtensionDrawBuffers:x||g.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:x||g.has("EXT_shader_texture_lod"),customProgramCacheKey:e.customProgramCacheKey()}},getProgramCacheKey:function(t){var i=[];if(t.shaderID?i.push(t.shaderID):(i.push(An(t.fragmentShader)),i.push(An(t.vertexShader))),void 0!==t.defines)for(const p in t.defines)i.push(p),i.push(t.defines[p]);if(!1===t.isRawShaderMaterial){for(let e=0;e<n.length;e++)i.push(t[n[e]]);i.push(p.outputEncoding),i.push(p.gammaFactor)}return i.push(t.customProgramCacheKey),i.join()},getUniforms:function(e){var t=T[e.type];let i;if(t){const e=$s[t];i=Bs.clone(e.uniforms)}else i=e.uniforms;return i},acquireProgram:function(i,n){let r;for(let e=0,t=s.length;e<t;e++){const i=s[e];if(i.cacheKey===n){++(r=i).usedTimes;break}}return void 0===r&&(r=new sl(p,n,i,e),s.push(r)),r},releaseProgram:function(e){var t;0==--e.usedTimes&&(t=s.indexOf(e),s[t]=s[s.length-1],s.pop(),e.destroy())},programs:s}}function al(){let n=new WeakMap;return{get:function(e){let t=n.get(e);return void 0===t&&(t={},n.set(e,t)),t},remove:function(e){n.delete(e)},update:function(e,t,i){n.get(e)[t]=i},dispose:function(){n=new WeakMap}}}function ll(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function hl(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function cl(l){const h=[];let c=0;const o=[],a=[],u=[],d={id:-1};function p(e,t,i,n,r,s){let o=h[c];var a=l.get(i);return void 0===o?(o={id:e.id,object:e,geometry:t,material:i,program:a.program||d,groupOrder:n,renderOrder:e.renderOrder,z:r,group:s},h[c]=o):(o.id=e.id,o.object=e,o.geometry=t,o.material=i,o.program=a.program||d,o.groupOrder=n,o.renderOrder=e.renderOrder,o.z=r,o.group=s),c++,o}return{opaque:o,transmissive:a,transparent:u,init:function(){c=0,o.length=0,a.length=0,u.length=0},push:function(e,t,i,n,r,s){e=p(e,t,i,n,r,s);(0<i.transmission?a:!0===i.transparent?u:o).push(e)},unshift:function(e,t,i,n,r,s){e=p(e,t,i,n,r,s);(0<i.transmission?a:!0===i.transparent?u:o).unshift(e)},finish:function(){for(let e=c,t=h.length;e<t;e++){const c=h[e];if(null===c.id)break;c.id=null,c.object=null,c.geometry=null,c.material=null,c.program=null,c.group=null}},sort:function(e,t){1<o.length&&o.sort(e||ll),1<a.length&&a.sort(t||hl),1<u.length&&u.sort(t||hl)}}}function ul(n){let r=new WeakMap;return{get:function(e,t){let i;return!1===r.has(e)?(i=new cl(n),r.set(e,[i])):t>=r.get(e).length?(i=new cl(n),r.get(e).push(i)):i=r.get(e)[t],i},dispose:function(){r=new WeakMap}}}function dl(){const i={};return{get:function(e){if(void 0!==i[e.id])return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new De,color:new g};break;case"SpotLight":t={position:new De,direction:new De,color:new g,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new De,color:new g,distance:0,decay:0};break;case"HemisphereLight":t={direction:new De,skyColor:new g,groundColor:new g};break;case"RectAreaLight":t={color:new g,position:new De,halfWidth:new De,halfHeight:new De}}return i[e.id]=t}}}let pl=0;function ml(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function fl(x,w){const b=new dl,M=function(){const i={};return{get:function(e){if(void 0!==i[e.id])return i[e.id];let t;switch(e.type){case"DirectionalLight":case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new W};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new W,shadowCameraNear:1,shadowCameraFar:1e3}}return i[e.id]=t}}}(),_={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)_.probe.push(new De);const c=new De,u=new Ie,d=new Ie;return{setup:function(i,n){let r=0,s=0,o=0;for(let e=0;e<9;e++)_.probe[e].set(0,0,0);let a=0,l=0,h=0,c=0,u=0,d=0,p=0,m=0;i.sort(ml);var f=!0!==n?Math.PI:1;for(let e=0,t=i.length;e<t;e++){const w=i[e],n=w.color,g=w.intensity,v=w.distance,y=w.shadow&&w.shadow.map?w.shadow.map.texture:null;if(w.isAmbientLight)r+=n.r*g*f,s+=n.g*g*f,o+=n.b*g*f;else if(w.isLightProbe)for(let e=0;e<9;e++)_.probe[e].addScaledVector(w.sh.coefficients[e],g);else if(w.isDirectionalLight){const x=b.get(w);if(x.color.copy(w.color).multiplyScalar(w.intensity*f),w.castShadow){const x=w.shadow,b=M.get(w);b.shadowBias=x.bias,b.shadowNormalBias=x.normalBias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize,_.directionalShadow[a]=b,_.directionalShadowMap[a]=y,_.directionalShadowMatrix[a]=w.shadow.matrix,d++}_.directional[a]=x,a++}else if(w.isSpotLight){const x=b.get(w);if(x.position.setFromMatrixPosition(w.matrixWorld),x.color.copy(n).multiplyScalar(g*f),x.distance=v,x.coneCos=Math.cos(w.angle),x.penumbraCos=Math.cos(w.angle*(1-w.penumbra)),x.decay=w.decay,w.castShadow){const x=w.shadow,b=M.get(w);b.shadowBias=x.bias,b.shadowNormalBias=x.normalBias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize,_.spotShadow[h]=b,_.spotShadowMap[h]=y,_.spotShadowMatrix[h]=w.shadow.matrix,m++}_.spot[h]=x,h++}else if(w.isRectAreaLight){const x=b.get(w);x.color.copy(n).multiplyScalar(g),x.halfWidth.set(.5*w.width,0,0),x.halfHeight.set(0,.5*w.height,0),_.rectArea[c]=x,c++}else if(w.isPointLight){const x=b.get(w);if(x.color.copy(w.color).multiplyScalar(w.intensity*f),x.distance=w.distance,x.decay=w.decay,w.castShadow){const x=w.shadow,b=M.get(w);b.shadowBias=x.bias,b.shadowNormalBias=x.normalBias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize,b.shadowCameraNear=x.camera.near,b.shadowCameraFar=x.camera.far,_.pointShadow[l]=b,_.pointShadowMap[l]=y,_.pointShadowMatrix[l]=w.shadow.matrix,p++}_.point[l]=x,l++}else if(w.isHemisphereLight){const x=b.get(w);x.skyColor.copy(w.color).multiplyScalar(g*f),x.groundColor.copy(w.groundColor).multiplyScalar(g*f),_.hemi[u]=x,u++}}0<c&&(w.isWebGL2||!0===x.has("OES_texture_float_linear")?(_.rectAreaLTC1=A.LTC_FLOAT_1,_.rectAreaLTC2=A.LTC_FLOAT_2):!0===x.has("OES_texture_half_float_linear")?(_.rectAreaLTC1=A.LTC_HALF_1,_.rectAreaLTC2=A.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),_.ambient[0]=r,_.ambient[1]=s,_.ambient[2]=o;const g=_.hash;g.directionalLength===a&&g.pointLength===l&&g.spotLength===h&&g.rectAreaLength===c&&g.hemiLength===u&&g.numDirectionalShadows===d&&g.numPointShadows===p&&g.numSpotShadows===m||(_.directional.length=a,_.spot.length=h,_.rectArea.length=c,_.point.length=l,_.hemi.length=u,_.directionalShadow.length=d,_.directionalShadowMap.length=d,_.pointShadow.length=p,_.pointShadowMap.length=p,_.spotShadow.length=m,_.spotShadowMap.length=m,_.directionalShadowMatrix.length=d,_.pointShadowMatrix.length=p,_.spotShadowMatrix.length=m,g.directionalLength=a,g.pointLength=l,g.spotLength=h,g.rectAreaLength=c,g.hemiLength=u,g.numDirectionalShadows=d,g.numPointShadows=p,g.numSpotShadows=m,_.version=pl++)},setupView:function(i,e){let n=0,r=0,s=0,o=0,a=0;var l=e.matrixWorldInverse;for(let e=0,t=i.length;e<t;e++){var h=i[e];if(h.isDirectionalLight){const i=_.directional[n];i.direction.setFromMatrixPosition(h.matrixWorld),c.setFromMatrixPosition(h.target.matrixWorld),i.direction.sub(c),i.direction.transformDirection(l),n++}else if(h.isSpotLight){const i=_.spot[s];i.position.setFromMatrixPosition(h.matrixWorld),i.position.applyMatrix4(l),i.direction.setFromMatrixPosition(h.matrixWorld),c.setFromMatrixPosition(h.target.matrixWorld),i.direction.sub(c),i.direction.transformDirection(l),s++}else if(h.isRectAreaLight){const i=_.rectArea[o];i.position.setFromMatrixPosition(h.matrixWorld),i.position.applyMatrix4(l),d.identity(),u.copy(h.matrixWorld),u.premultiply(l),d.extractRotation(u),i.halfWidth.set(.5*h.width,0,0),i.halfHeight.set(0,.5*h.height,0),i.halfWidth.applyMatrix4(d),i.halfHeight.applyMatrix4(d),o++}else if(h.isPointLight){const i=_.point[r];i.position.setFromMatrixPosition(h.matrixWorld),i.position.applyMatrix4(l),r++}else if(h.isHemisphereLight){const i=_.hemi[a];i.direction.setFromMatrixPosition(h.matrixWorld),i.direction.transformDirection(l),i.direction.normalize(),a++}}},state:_}}function gl(e,t){const i=new fl(e,t),n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:i},setupLights:function(e){i.setup(n,e)},setupLightsView:function(e){i.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){r.push(e)}}}function vl(n,r){let s=new WeakMap;return{get:function(e,t=0){let i;return!1===s.has(e)?(i=new gl(n,r),s.set(e,[i])):t>=s.get(e).length?(i=new gl(n,r),s.get(e).push(i)):i=s.get(e)[t],i},dispose:function(){s=new WeakMap}}}class yl extends i{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=zi,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.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}}yl.prototype.isMeshDepthMaterial=!0;class xl extends i{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new De,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function wl(d,p,e){let m=new Js;const f=new W,g=new W,v=new ze,l=new yl({depthPacking:Di}),h=new xl,c={},y=e.maxTextureSize,u={0:Ae,1:Oe,2:Ne},x=new Fs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new W},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),w=x.clone();w.defines.HORIZONTAL_PASS=1;e=new _;e.setAttribute("position",new T(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new S(e,x),t=this;function M(i,e,n,t,r,s,o){let a=null;i=!0===t.isPointLight?i.customDistanceMaterial:i.customDepthMaterial;if(a=void 0!==i?i:!0===t.isPointLight?h:l,d.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&0<n.alphaTest){const d=a.uuid,i=n.uuid;let e=c[d],t=(void 0===e&&(e={},c[d]=e),e[i]);void 0===t&&(t=a.clone(),e[i]=t),a=t}return a.visible=n.visible,a.wireframe=n.wireframe,a.side=o===z?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===t.isPointLight&&!0===a.isMeshDistanceMaterial&&(a.referencePosition.setFromMatrixPosition(t.matrixWorld),a.nearDistance=r,a.farDistance=s),a}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=L,this.render=function(i,n,r){if(!1!==t.enabled&&(!1!==t.autoUpdate||!1!==t.needsUpdate)&&0!==i.length){const e=d.getRenderTarget(),h=d.getActiveCubeFace(),c=d.getActiveMipmapLevel(),u=d.state;u.setBlending(Y),u.buffers.color.setClear(1,1,1,1),u.buffers.depth.setTest(!0),u.setScissorTest(!1);for(let e=0,t=i.length;e<t;e++){const h=i[e],c=h.shadow;if(void 0===c)console.warn("THREE.WebGLShadowMap:",h,"has no shadow.");else if(!1!==c.autoUpdate||!1!==c.needsUpdate){f.copy(c.mapSize);var s=c.getFrameExtents();if(f.multiply(s),g.copy(c.mapSize),(f.x>y||f.y>y)&&(f.x>y&&(g.x=Math.floor(y/s.x),f.x=g.x*s.x,c.mapSize.x=g.x),f.y>y)&&(g.y=Math.floor(y/s.y),f.y=g.y*s.y,c.mapSize.y=g.y),null===c.map&&!c.isPointLightShadow&&this.type===z){const d={minFilter:F,magFilter:F,format:Le};c.map=new zn(f.x,f.y,d),c.map.texture.name=h.name+".shadowMap",c.mapPass=new zn(f.x,f.y,d),c.camera.updateProjectionMatrix()}if(null===c.map){const d={minFilter:Re,magFilter:Re,format:Le};c.map=new zn(f.x,f.y,d),c.map.texture.name=h.name+".shadowMap",c.camera.updateProjectionMatrix()}d.setRenderTarget(c.map),d.clear();var o=c.getViewportCount();for(let e=0;e<o;e++){const i=c.getViewport(e);v.set(g.x*i.x,g.y*i.y,g.x*i.z,g.y*i.w),u.viewport(v),c.updateMatrices(h,e),m=c.getFrustum(),function i(n,r,s,o,a){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&a===z)&&(!n.frustumCulled||m.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const m=p.update(n),r=n.material;if(Array.isArray(r)){const p=m.groups;for(let e=0,t=p.length;e<t;e++){var l=p[e],h=r[l.materialIndex];if(h&&h.visible){const p=M(n,0,h,o,s.near,s.far,a);d.renderBufferDirect(s,null,m,p,n,l)}}}else if(r.visible){const p=M(n,0,r,o,s.near,s.far,a);d.renderBufferDirect(s,null,m,p,n,null)}}var c=n.children;for(let e=0,t=c.length;e<t;e++)i(c[e],r,s,o,a)}}(n,r,c.camera,h,this.type)}c.isPointLightShadow||this.type!==z||(s=c,a=r,l=void 0,l=p.update(b),x.defines.VSM_SAMPLES!==s.blurSamples&&(x.defines.VSM_SAMPLES=s.blurSamples,w.defines.VSM_SAMPLES=s.blurSamples,x.needsUpdate=!0,w.needsUpdate=!0),x.uniforms.shadow_pass.value=s.map.texture,x.uniforms.resolution.value=s.mapSize,x.uniforms.radius.value=s.radius,d.setRenderTarget(s.mapPass),d.clear(),d.renderBufferDirect(a,null,l,x,b,null),w.uniforms.shadow_pass.value=s.mapPass.texture,w.uniforms.resolution.value=s.mapSize,w.uniforms.radius.value=s.radius,d.setRenderTarget(s.map),d.clear(),d.renderBufferDirect(a,null,l,w,b,null)),c.needsUpdate=!1}}var a,l;t.needsUpdate=!1,d.setRenderTarget(e,h,c)}}}function bl(c,N,e){const i=e.isWebGL2,n=new function(){let t=!1;const s=new ze;let i=null;const o=new ze(0,0,0,0);return{setMask:function(e){i===e||t||(c.colorMask(e,e,e,e),i=e)},setLocked:function(e){t=e},setClear:function(e,t,i,n,r){!0===r&&(e*=n,t*=n,i*=n),s.set(e,t,i,n),!1===o.equals(s)&&(c.clearColor(e,t,i,n),o.copy(s))},reset:function(){t=!1,i=null,o.set(-1,0,0,0)}}},r=new function(){let t=!1,i=null,n=null,r=null;return{setTest:function(e){(e?P:z)(2929)},setMask:function(e){i===e||t||(c.depthMask(e),i=e)},setFunc:function(e){if(n!==e){if(e)switch(e){case ge:c.depthFunc(512);break;case ve:c.depthFunc(519);break;case ye:c.depthFunc(513);break;case xe:c.depthFunc(515);break;case we:c.depthFunc(514);break;case be:c.depthFunc(518);break;case Me:c.depthFunc(516);break;case _e:c.depthFunc(517);break;default:c.depthFunc(515)}else c.depthFunc(515);n=e}},setLocked:function(e){t=e},setClear:function(e){r!==e&&(c.clearDepth(e),r=e)},reset:function(){t=!1,i=null,n=null,r=null}}},s=new function(){let t=!1,i=null,n=null,r=null,s=null,o=null,a=null,l=null,h=null;return{setTest:function(e){t||(e?P:z)(2960)},setMask:function(e){i===e||t||(c.stencilMask(e),i=e)},setFunc:function(e,t,i){n===e&&r===t&&s===i||(c.stencilFunc(e,t,i),n=e,r=t,s=i)},setOp:function(e,t,i){o===e&&a===t&&l===i||(c.stencilOp(e,t,i),o=e,a=t,l=i)},setLocked:function(e){t=e},setClear:function(e){h!==e&&(c.clearStencil(e),h=e)},reset:function(){t=!1,i=null,n=null,r=null,s=null,o=null,a=null,l=null,h=null}}};let t={},o=null,a={},l=null,h=!1,u=null,d=null,p=null,m=null,f=null,g=null,v=null,y=!1,x=null,w=null,b=null,M=null,_=null;const B=c.getParameter(35661);let S=!1,T=0;e=c.getParameter(7938);-1!==e.indexOf("WebGL")?(T=parseFloat(/^WebGL (\d)/.exec(e)[1]),S=1<=T):-1!==e.indexOf("OpenGL ES")&&(T=parseFloat(/^OpenGL ES (\d)/.exec(e)[1]),S=2<=T);let E=null,A={};const F=c.getParameter(3088),H=c.getParameter(2978),C=(new ze).fromArray(F),R=(new ze).fromArray(H);function U(e,t,i){var n=new Uint8Array(4),r=c.createTexture();c.bindTexture(e,r),c.texParameteri(e,10241,9728),c.texParameteri(e,10240,9728);for(let e=0;e<i;e++)c.texImage2D(t+e,0,6408,1,1,0,6408,5121,n);return r}const L={};function P(e){!0!==t[e]&&(c.enable(e),t[e]=!0)}function z(e){!1!==t[e]&&(c.disable(e),t[e]=!1)}L[3553]=U(3553,3553,1),L[34067]=U(34067,34069,6),n.setClear(0,0,0,1),r.setClear(1),s.setClear(0),P(2929),r.setFunc(xe),G(!1),W(X),P(2884),O(Y);const D={[ee]:32774,[te]:32778,[ie]:32779};if(i)D[ne]=32775,D[re]=32776;else{const c=N.get("EXT_blend_minmax");null!==c&&(D[ne]=c.MIN_EXT,D[re]=c.MAX_EXT)}const I={[se]:0,[oe]:1,[ae]:768,[he]:770,[fe]:776,[pe]:774,[ue]:772,[le]:769,[ce]:771,[me]:775,[de]:773};function O(e,t,i,n,r,s,o,a){if(e!==Y){if(!1===h&&(P(3042),h=!0),e===$)r=r||t,s=s||i,o=o||n,t===d&&r===f||(c.blendEquationSeparate(D[t],D[r]),d=t,f=r),i===p&&n===m&&s===g&&o===v||(c.blendFuncSeparate(I[i],I[n],I[s],I[o]),p=i,m=n,g=s,v=o),u=e,y=null;else if(e!==u||a!==y){if(d===ee&&f===ee||(c.blendEquation(32774),d=ee,f=ee),a)switch(e){case J:c.blendFuncSeparate(1,771,1,771);break;case Z:c.blendFunc(1,1);break;case Q:c.blendFuncSeparate(0,0,769,771);break;case K:c.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case J:c.blendFuncSeparate(770,771,1,771);break;case Z:c.blendFunc(770,1);break;case Q:c.blendFunc(0,769);break;case K:c.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}p=null,m=null,g=null,v=null,u=e,y=a}}else!0===h&&(z(3042),h=!1)}function G(e){x!==e&&(e?c.frontFace(2304):c.frontFace(2305),x=e)}function W(e){e!==j?(P(2884),e!==w&&(e===X?c.cullFace(1029):e===q?c.cullFace(1028):c.cullFace(1032))):z(2884),w=e}function k(e,t,i){e?(P(32823),M===t&&_===i||(c.polygonOffset(t,i),M=t,_=i)):z(32823)}function V(e){void 0===e&&(e=33984+B-1),E!==e&&(c.activeTexture(e),E=e)}return{buffers:{color:n,depth:r,stencil:s},enable:P,disable:z,bindFramebuffer:function(e,t){return null===t&&null!==o&&(t=o),a[e]!==t&&(c.bindFramebuffer(e,t),a[e]=t,i&&(36009===e&&(a[36160]=t),36160===e)&&(a[36009]=t),!0)},bindXRFramebuffer:function(e){e!==o&&(c.bindFramebuffer(36160,e),o=e)},useProgram:function(e){return l!==e&&(c.useProgram(e),l=e,!0)},setBlending:O,setMaterial:function(e,t){(e.side===Ne?z:P)(2884);let i=e.side===Ae;G(i=t?!i:i),e.blending===J&&!1===e.transparent?O(Y):O(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),r.setFunc(e.depthFunc),r.setTest(e.depthTest),r.setMask(e.depthWrite),n.setMask(e.colorWrite);t=e.stencilWrite;s.setTest(t),t&&(s.setMask(e.stencilWriteMask),s.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),s.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),k(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),(!0===e.alphaToCoverage?P:z)(32926)},setFlipSided:G,setCullFace:W,setLineWidth:function(e){e!==b&&(S&&c.lineWidth(e),b=e)},setPolygonOffset:k,setScissorTest:function(e){(e?P:z)(3089)},activeTexture:V,bindTexture:function(e,t){null===E&&V();let i=A[E];void 0===i&&(i={type:void 0,texture:void 0},A[E]=i),i.type===e&&i.texture===t||(c.bindTexture(e,t||L[e]),i.type=e,i.texture=t)},unbindTexture:function(){var e=A[E];void 0!==e&&void 0!==e.type&&(c.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{c.compressedTexImage2D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{c.texImage2D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{c.texImage3D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(e){!1===C.equals(e)&&(c.scissor(e.x,e.y,e.z,e.w),C.copy(e))},viewport:function(e){!1===R.equals(e)&&(c.viewport(e.x,e.y,e.z,e.w),R.copy(e))},reset:function(){c.disable(3042),c.disable(2884),c.disable(2929),c.disable(32823),c.disable(3089),c.disable(2960),c.disable(32926),c.blendEquation(32774),c.blendFunc(1,0),c.blendFuncSeparate(1,0,1,0),c.colorMask(!0,!0,!0,!0),c.clearColor(0,0,0,0),c.depthMask(!0),c.depthFunc(513),c.clearDepth(1),c.stencilMask(4294967295),c.stencilFunc(519,0,4294967295),c.stencilOp(7680,7680,7680),c.clearStencil(0),c.cullFace(1029),c.frontFace(2305),c.polygonOffset(0,0),c.activeTexture(33984),c.bindFramebuffer(36160,null),!0===i&&(c.bindFramebuffer(36009,null),c.bindFramebuffer(36008,null)),c.useProgram(null),c.lineWidth(1),c.scissor(0,0,c.canvas.width,c.canvas.height),c.viewport(0,0,c.canvas.width,c.canvas.height),t={},E=null,A={},o=null,a={},l=null,h=!1,u=null,d=null,p=null,m=null,f=null,g=null,v=null,y=!1,x=null,w=null,b=null,M=null,_=null,C.set(0,0,c.canvas.width,c.canvas.height),R.set(0,0,c.canvas.width,c.canvas.height),n.reset(),r.reset(),s.reset()}}}function Ml(d,s,p,m,u,f,g){const v=u.isWebGL2,t=u.maxTextures,y=u.maxCubemapSize,c=u.maxTextureSize,B=u.maxSamples,o=new WeakMap;let a,i=!1;try{i="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(d){}function l(e,t){return i?new OffscreenCanvas(e,t):En("canvas")}function x(e,t,i,n){let r=1;if((r=e.width>n||e.height>n?n/Math.max(e.width,e.height):r)<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const n=t?bn:Math.floor,s=n(r*e.width),o=n(r*e.height);void 0===a&&(a=l(s,o));t=i?l(s,o):a;return t.width=s,t.height=o,t.getContext("2d").drawImage(e,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+o+")."),t}"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+").")}return e}function w(e){return xn(e.width)&&xn(e.height)}function b(e,t){return e.generateMipmaps&&t&&e.minFilter!==Re&&e.minFilter!==F}function M(e,t,i,n,r=1){d.generateMipmap(e),m.get(t).__maxMipLevel=Math.log2(Math.max(i,n,r))}function _(e,t,i,n){if(!1===v)return t;if(null!==e){if(void 0!==d[e])return d[e];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+e+"'")}let r=t;return 6403===t&&(5126===i&&(r=33326),5131===i&&(r=33325),5121===i)&&(r=33321),6407===t&&(5126===i&&(r=34837),5131===i&&(r=34843),5121===i)&&(r=32849),33325!==(r=6408===t&&(5126===i&&(r=34836),5131===i&&(r=34842),5121===i)?n===Ti?35907:32856:r)&&33326!==r&&34842!==r&&34836!==r||s.get("EXT_color_buffer_float"),r}function n(e){return e===Re||e===Xe||e===Ye?9728:9729}function r(e){var t,i,e=e.target;e.removeEventListener("dispose",r),t=e,void 0!==(i=m.get(t)).__webglInit&&(d.deleteTexture(i.__webglTexture),m.remove(t)),e.isVideoTexture&&o.delete(e),g.memory.textures--}function S(e){e=e.target;e.removeEventListener("dispose",S);{const i=e.texture,n=m.get(e),t=m.get(i);if(e){if(void 0!==t.__webglTexture&&(d.deleteTexture(t.__webglTexture),g.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)d.deleteFramebuffer(n.__webglFramebuffer[e]),n.__webglDepthbuffer&&d.deleteRenderbuffer(n.__webglDepthbuffer[e]);else d.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&d.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&d.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&d.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&d.deleteRenderbuffer(n.__webglDepthRenderbuffer);if(e.isWebGLMultipleRenderTargets)for(let e=0,t=i.length;e<t;e++){const n=m.get(i[e]);n.__webglTexture&&(d.deleteTexture(n.__webglTexture),g.memory.textures--),m.remove(i[e])}m.remove(i),m.remove(e)}}}let h=0;function T(e,t){var i,n,r=m.get(e);if(e.isVideoTexture&&(i=e,n=g.render.frame,o.get(i)!==n&&(o.set(i,n),i.update())),0<e.version&&r.__version!==e.version){const p=e.image;if(void 0===p)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==p.complete)return void P(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}p.activeTexture(33984+t),p.bindTexture(3553,r.__webglTexture)}function E(e,t){var i=m.get(e);if(0<e.version&&i.__version!==e.version){var n=i,r=e,s=t;if(6===r.image.length){L(n,r),p.activeTexture(33984+s),p.bindTexture(34067,n.__webglTexture),d.pixelStorei(37440,r.flipY),d.pixelStorei(37441,r.premultiplyAlpha),d.pixelStorei(3317,r.unpackAlignment),d.pixelStorei(37443,0);var o=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),a=r.image[0]&&r.image[0].isDataTexture,l=[];for(let e=0;e<6;e++)l[e]=o||a?a?r.image[e].image:r.image[e]:x(r.image[e],!1,!0,y);var s=l[0],e=w(s)||v,h=f.convert(r.format),c=f.convert(r.type),u=_(r.internalFormat,h,c,r.encoding);let i;if(R(34067,r,e),o){for(let t=0;t<6;t++){i=l[t].mipmaps;for(let e=0;e<i.length;e++){const s=i[e];r.format!==Le&&r.format!==pt?null!==h?p.compressedTexImage2D(34069+t,e,u,s.width,s.height,0,s.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):p.texImage2D(34069+t,e,u,s.width,s.height,0,h,c,s.data)}}n.__maxMipLevel=i.length-1}else{i=r.mipmaps;for(let t=0;t<6;t++)if(a){p.texImage2D(34069+t,0,u,l[t].width,l[t].height,0,h,c,l[t].data);for(let e=0;e<i.length;e++){const r=i[e].image[t].image;p.texImage2D(34069+t,e+1,u,r.width,r.height,0,h,c,r.data)}}else{p.texImage2D(34069+t,0,u,h,c,l[t]);for(let e=0;e<i.length;e++){const r=i[e];p.texImage2D(34069+t,e+1,u,h,c,r.image[t])}}n.__maxMipLevel=i.length}b(r,e)&&M(34067,r,s.width,s.height),n.__version=r.version,r.onUpdate&&r.onUpdate(r)}}else p.activeTexture(33984+t),p.bindTexture(34067,i.__webglTexture)}const A={[Ve]:10497,[Ce]:33071,[je]:33648},C={[Re]:9728,[Xe]:9984,[Ye]:9986,[F]:9729,[Ze]:9985,[Ke]:9987};function R(e,t,i){if(i?(d.texParameteri(e,10242,A[t.wrapS]),d.texParameteri(e,10243,A[t.wrapT]),32879!==e&&35866!==e||d.texParameteri(e,32882,A[t.wrapR]),d.texParameteri(e,10240,C[t.magFilter]),d.texParameteri(e,10241,C[t.minFilter])):(d.texParameteri(e,10242,33071),d.texParameteri(e,10243,33071),32879!==e&&35866!==e||d.texParameteri(e,32882,33071),t.wrapS===Ce&&t.wrapT===Ce||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),d.texParameteri(e,10240,n(t.magFilter)),d.texParameteri(e,10241,n(t.minFilter)),t.minFilter!==Re&&t.minFilter!==F&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===s.has("EXT_texture_filter_anisotropic")){const i=s.get("EXT_texture_filter_anisotropic");t.type===ot&&!1===s.has("OES_texture_float_linear")||!1===v&&t.type===at&&!1===s.has("OES_texture_half_float_linear")||(1<t.anisotropy||m.get(t).__currentAnisotropy)&&(d.texParameterf(e,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,u.getMaxAnisotropy())),m.get(t).__currentAnisotropy=t.anisotropy)}}function L(e,t){void 0===e.__webglInit&&(e.__webglInit=!0,t.addEventListener("dispose",r),e.__webglTexture=d.createTexture(),g.memory.textures++)}function P(e,i,t){let n=3553;i.isDataTexture2DArray&&(n=35866),i.isDataTexture3D&&(n=32879),L(e,i),p.activeTexture(33984+t),p.bindTexture(n,e.__webglTexture),d.pixelStorei(37440,i.flipY),d.pixelStorei(37441,i.premultiplyAlpha),d.pixelStorei(3317,i.unpackAlignment),d.pixelStorei(37443,0);t=i;var t=!v&&(t.wrapS!==Ce||t.wrapT!==Ce||t.minFilter!==Re&&t.minFilter!==F)&&!1===w(i.image),t=x(i.image,t,!1,c),r=w(t)||v,s=f.convert(i.format);let o,a=f.convert(i.type),l=_(i.internalFormat,s,a,i.encoding);R(n,i,r);var h=i.mipmaps;if(i.isDepthTexture)l=6402,v?l=i.type===ot?36012:i.type===st?33190:i.type===ut?35056:33189:i.type===ot&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===vt&&6402===l&&i.type!==nt&&i.type!==st&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=nt,a=f.convert(i.type)),i.format===yt&&6402===l&&(l=34041,i.type!==ut)&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=ut,a=f.convert(i.type)),p.texImage2D(3553,0,l,t.width,t.height,0,s,a,null);else if(i.isDataTexture)if(0<h.length&&r){for(let e=0,t=h.length;e<t;e++)o=h[e],p.texImage2D(3553,e,l,o.width,o.height,0,s,a,o.data);i.generateMipmaps=!1,e.__maxMipLevel=h.length-1}else p.texImage2D(3553,0,l,t.width,t.height,0,s,a,t.data),e.__maxMipLevel=0;else if(i.isCompressedTexture){for(let e=0,t=h.length;e<t;e++)o=h[e],i.format!==Le&&i.format!==pt?null!==s?p.compressedTexImage2D(3553,e,l,o.width,o.height,0,o.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):p.texImage2D(3553,e,l,o.width,o.height,0,s,a,o.data);e.__maxMipLevel=h.length-1}else if(i.isDataTexture2DArray)p.texImage3D(35866,0,l,t.width,t.height,t.depth,0,s,a,t.data),e.__maxMipLevel=0;else if(i.isDataTexture3D)p.texImage3D(32879,0,l,t.width,t.height,t.depth,0,s,a,t.data),e.__maxMipLevel=0;else if(0<h.length&&r){for(let e=0,t=h.length;e<t;e++)o=h[e],p.texImage2D(3553,e,l,s,a,o);i.generateMipmaps=!1,e.__maxMipLevel=h.length-1}else p.texImage2D(3553,0,l,s,a,t),e.__maxMipLevel=0;b(i,r)&&M(n,i,t.width,t.height),e.__version=i.version,i.onUpdate&&i.onUpdate(i)}function z(e,t,i,n,r){var s=f.convert(i.format),o=f.convert(i.type),a=_(i.internalFormat,s,o,i.encoding);32879===r||35866===r?p.texImage3D(r,0,a,t.width,t.height,t.depth,0,s,o,null):p.texImage2D(r,0,a,t.width,t.height,0,s,o,null),p.bindFramebuffer(36160,e),d.framebufferTexture2D(36160,n,r,m.get(i).__webglTexture,0),p.bindFramebuffer(36160,null)}function D(t,i,n){if(d.bindRenderbuffer(36161,t),i.depthBuffer&&!i.stencilBuffer){let e=33189;if(n){const t=i.depthTexture,n=(t&&t.isDepthTexture&&(t.type===ot?e=36012:t.type===st&&(e=33190)),I(i));d.renderbufferStorageMultisample(36161,n,e,i.width,i.height)}else d.renderbufferStorage(36161,e,i.width,i.height);d.framebufferRenderbuffer(36160,36096,36161,t)}else if(i.depthBuffer&&i.stencilBuffer){if(n){const t=I(i);d.renderbufferStorageMultisample(36161,t,35056,i.width,i.height)}else d.renderbufferStorage(36161,34041,i.width,i.height);d.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=!0===i.isWebGLMultipleRenderTargets?i.texture[0]:i.texture,e=f.convert(t.format),r=f.convert(t.type),s=_(t.internalFormat,e,r,t.encoding);if(n){const t=I(i);d.renderbufferStorageMultisample(36161,t,s,i.width,i.height)}else d.renderbufferStorage(36161,s,i.width,i.height)}d.bindRenderbuffer(36161,null)}function I(e){return v&&e.isWebGLMultisampleRenderTarget?Math.min(B,e.samples):0}let O=!1,N=!1;this.allocateTextureUnit=function(){var e=h;return e>=t&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+t),h+=1,e},this.resetTextureUnits=function(){h=0},this.setTexture2D=T,this.setTexture2DArray=function(e,t){var i=m.get(e);0<e.version&&i.__version!==e.version?P(i,e,t):(p.activeTexture(33984+t),p.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=m.get(e);0<e.version&&i.__version!==e.version?P(i,e,t):(p.activeTexture(33984+t),p.bindTexture(32879,i.__webglTexture))},this.setTextureCube=E,this.setupRenderTarget=function(i){var t=i.texture,n=m.get(i),r=m.get(t),e=(i.addEventListener("dispose",S),!0!==i.isWebGLMultipleRenderTargets&&(r.__webglTexture=d.createTexture(),r.__version=t.version,g.memory.textures++),!0===i.isWebGLCubeRenderTarget),s=!0===i.isWebGLMultipleRenderTargets,o=!0===i.isWebGLMultisampleRenderTarget,a=t.isDataTexture3D||t.isDataTexture2DArray,l=w(i)||v;if(!v||t.format!==pt||t.type!==ot&&t.type!==at||(t.format=Le,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),e){n.__webglFramebuffer=[];for(let e=0;e<6;e++)n.__webglFramebuffer[e]=d.createFramebuffer()}else if(n.__webglFramebuffer=d.createFramebuffer(),s)if(u.drawBuffers){const p=i.texture;for(let e=0,t=p.length;e<t;e++){const u=m.get(p[e]);void 0===u.__webglTexture&&(u.__webglTexture=d.createTexture(),g.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(o)if(v){n.__webglMultisampledFramebuffer=d.createFramebuffer(),n.__webglColorRenderbuffer=d.createRenderbuffer(),d.bindRenderbuffer(36161,n.__webglColorRenderbuffer);const m=f.convert(t.format),u=f.convert(t.type),g=_(t.internalFormat,m,u,t.encoding),v=I(i);d.renderbufferStorageMultisample(36161,v,g,i.width,i.height),p.bindFramebuffer(36160,n.__webglMultisampledFramebuffer),d.framebufferRenderbuffer(36160,36064,36161,n.__webglColorRenderbuffer),d.bindRenderbuffer(36161,null),i.depthBuffer&&(n.__webglDepthRenderbuffer=d.createRenderbuffer(),D(n.__webglDepthRenderbuffer,i,!0)),p.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(e){p.bindTexture(34067,r.__webglTexture),R(34067,t,l);for(let e=0;e<6;e++)z(n.__webglFramebuffer[e],i,t,36064,34069+e);b(t,l)&&M(34067,t,i.width,i.height)}else if(s){const d=i.texture;for(let e=0,t=d.length;e<t;e++){const f=d[e],g=m.get(f);p.bindTexture(3553,g.__webglTexture),R(3553,f,l),z(n.__webglFramebuffer,i,f,36064+e,3553),b(f,l)&&M(3553,f,i.width,i.height)}}else{let e=3553;a&&(v?e=t.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),p.bindTexture(e,r.__webglTexture),R(e,t,l),z(n.__webglFramebuffer,i,t,36064,e),b(t,l)&&M(e,t,i.width,i.height,i.depth)}if(p.unbindTexture(),i.depthBuffer){var h=i,c=m.get(h),o=!0===h.isWebGLCubeRenderTarget;if(h.depthTexture){if(o)throw new Error("target.depthTexture not supported in Cube render targets");e=c.__webglFramebuffer,s=h;if(s&&s.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(p.bindFramebuffer(36160,e),!s.depthTexture||!s.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(m.get(s.depthTexture).__webglTexture&&s.depthTexture.image.width===s.width&&s.depthTexture.image.height===s.height||(s.depthTexture.image.width=s.width,s.depthTexture.image.height=s.height,s.depthTexture.needsUpdate=!0),T(s.depthTexture,0),e=m.get(s.depthTexture).__webglTexture,s.depthTexture.format===vt)d.framebufferTexture2D(36160,36096,3553,e,0);else{if(s.depthTexture.format!==yt)throw new Error("Unknown depthTexture format");d.framebufferTexture2D(36160,33306,3553,e,0)}}else if(o){c.__webglDepthbuffer=[];for(let e=0;e<6;e++)p.bindFramebuffer(36160,c.__webglFramebuffer[e]),c.__webglDepthbuffer[e]=d.createRenderbuffer(),D(c.__webglDepthbuffer[e],h,!1)}else p.bindFramebuffer(36160,c.__webglFramebuffer),c.__webglDepthbuffer=d.createRenderbuffer(),D(c.__webglDepthbuffer,h,!1);p.bindFramebuffer(36160,null)}},this.updateRenderTargetMipmap=function(i){const n=w(i)||v,r=!0===i.isWebGLMultipleRenderTargets?i.texture:[i.texture];for(let e=0,t=r.length;e<t;e++){var s=r[e];if(b(s,n)){const n=i.isWebGLCubeRenderTarget?34067:3553,r=m.get(s).__webglTexture;p.bindTexture(n,r),M(n,s,i.width,i.height),p.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(v){var i=t.width,n=t.height;let e=16384;t.depthBuffer&&(e|=256),t.stencilBuffer&&(e|=1024);const v=m.get(t);p.bindFramebuffer(36008,v.__webglMultisampledFramebuffer),p.bindFramebuffer(36009,v.__webglFramebuffer),d.blitFramebuffer(0,0,i,n,0,0,i,n,e,9728),p.bindFramebuffer(36008,null),p.bindFramebuffer(36009,v.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===O&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),O=!0),e=e.texture),T(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===N&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),N=!0),e=e.texture),E(e,t)}}function _l(e,i,t){const n=t.isWebGL2;return{convert:function(e){let t;if(e===et)return 5121;if(e===lt)return 32819;if(e===ht)return 32820;if(e===ct)return 33635;if(e===tt)return 5120;if(e===it)return 5122;if(e===nt)return 5123;if(e===rt)return 5124;if(e===st)return 5125;if(e===ot)return 5126;if(e===at)return n?5131:null!==(t=i.get("OES_texture_half_float"))?t.HALF_FLOAT_OES:null;if(e===dt)return 6406;if(e===pt)return 6407;if(e===Le)return 6408;if(e===mt)return 6409;if(e===ft)return 6410;if(e===vt)return 6402;if(e===yt)return 34041;if(e===xt)return 6403;if(e===wt)return 36244;if(e===bt)return 33319;if(e===Mt)return 33320;if(e===_t)return 36248;if(e===St)return 36249;if(e===Tt||e===Et||e===At||e===Ct){if(null===(t=i.get("WEBGL_compressed_texture_s3tc")))return null;if(e===Tt)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Et)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===At)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Ct)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===Rt||e===Lt||e===Pt||e===zt){if(null===(t=i.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===Rt)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===Lt)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===Pt)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===zt)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===Dt)return null!==(t=i.get("WEBGL_compressed_texture_etc1"))?t.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===It||e===Ot)&&null!==(t=i.get("WEBGL_compressed_texture_etc"))){if(e===It)return t.COMPRESSED_RGB8_ETC2;if(e===Ot)return t.COMPRESSED_RGBA8_ETC2_EAC}return e===Nt||e===Bt||e===Ft||e===Ht||e===Ut||e===Gt||e===Wt||e===kt||e===Vt||e===jt||e===Xt||e===qt||e===Yt||e===Jt||e===Qt||e===Kt||e===$t||e===ei||e===ti||e===ii||e===ni||e===ri||e===si||e===oi||e===ai||e===li||e===hi||e===ci?null!==(t=i.get("WEBGL_compressed_texture_astc"))?e:null:e===Zt?null!==(t=i.get("EXT_texture_compression_bptc"))?e:null:e===ut?n?34042:null!==(t=i.get("WEBGL_depth_texture"))?t.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}xl.prototype.isMeshDistanceMaterial=!0;class Sl extends B{constructor(e=[]){super(),this.cameras=e}}Sl.prototype.isArrayCamera=!0;class Tl extends u{constructor(){super(),this.type="Group"}}Tl.prototype.isGroup=!0;const El={type:"move"};class Al{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Tl,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Tl,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new De,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new De),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Tl,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new De,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new De),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,i){let n=null,r=null,s=null;const o=this._targetRay,a=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==o&&null!==(n=t.getPose(e.targetRaySpace,i))&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(El)),l&&e.hand){s=!0;for(const n of e.hand.values()){const e=t.getJointPose(n,i);if(void 0===l.joints[n.jointName]){const e=new Tl;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[n.jointName]=e,l.add(e)}const r=l.joints[n.jointName];null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=e.radius),r.visible=null!==e}const n=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],o=n.position.distanceTo(r.position),a=.02;l.inputState.pinching&&.025<o?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==a&&e.gripSpace&&null!==(r=t.getPose(e.gripSpace,i))&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1);return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==s),this}}class Cl extends cn{constructor(e,o){super();const i=this,a=e.state;let m=null,n=1,l=null,r="local-floor",h,c=null,u=null,d=null,p=null,f=!1,g=null,s=null,v=null,y=null,x=null,w=null;const b=[],M=new Map,_=new B,S=(_.layers.enable(1),_.viewport=new ze,new B),T=(S.layers.enable(2),S.viewport=new ze,[_,S]),E=new Sl;E.layers.enable(1),E.layers.enable(2);let A=null,C=null;function R(e){var t=M.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function L(){M.forEach(function(e,t){e.disconnect(t)}),M.clear(),A=null,C=null,a.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),u&&o.deleteFramebuffer(u),g&&o.deleteFramebuffer(g),s&&o.deleteRenderbuffer(s),v&&o.deleteRenderbuffer(v),u=null,g=null,s=null,v=null,p=null,d=null,c=null,m=null,N.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function P(t){var i=m.inputSources;for(let e=0;e<b.length;e++)M.set(i[e],b[e]);for(let e=0;e<t.removed.length;e++){var n=t.removed[e],r=M.get(n);r&&(r.dispatchEvent({type:"disconnected",data:n}),M.delete(n))}for(let e=0;e<t.added.length;e++){var s=t.added[e],o=M.get(s);o&&o.dispatchEvent({type:"connected",data:s})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return void 0===t&&(t=new Al,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return void 0===t&&(t=new Al,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return void 0===t&&(t=new Al,b[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){n=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){r=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l},this.getBaseLayer=function(){return null!==d?d:p},this.getBinding=function(){return c},this.getFrame=function(){return y},this.getSession=function(){return m},this.setSession=async function(t){if(null!==(m=t)){m.addEventListener("select",R),m.addEventListener("selectstart",R),m.addEventListener("selectend",R),m.addEventListener("squeeze",R),m.addEventListener("squeezestart",R),m.addEventListener("squeezeend",R),m.addEventListener("end",L),m.addEventListener("inputsourceschange",P);const t=o.getContextAttributes();if(!0!==t.xrCompatible&&await o.makeXRCompatible(),void 0===m.renderState.layers){const i={antialias:t.antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:n};p=new XRWebGLLayer(m,o,i),m.updateRenderState({baseLayer:p})}else if(o instanceof WebGLRenderingContext){const i={antialias:!0,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:n};p=new XRWebGLLayer(m,o,i),m.updateRenderState({layers:[p]})}else{f=t.antialias;let e=null;t.depth&&(w=256,t.stencil&&(w|=1024),x=t.stencil?33306:36096,e=t.stencil?35056:33190);const l={colorFormat:t.alpha?32856:32849,depthFormat:e,scaleFactor:n};c=new XRWebGLBinding(m,o),d=c.createProjectionLayer(l),u=o.createFramebuffer(),m.updateRenderState({layers:[d]}),f&&(g=o.createFramebuffer(),s=o.createRenderbuffer(),o.bindRenderbuffer(36161,s),o.renderbufferStorageMultisample(36161,4,32856,d.textureWidth,d.textureHeight),a.bindFramebuffer(36160,g),o.framebufferRenderbuffer(36160,36064,36161,s),o.bindRenderbuffer(36161,null),null!==e&&(v=o.createRenderbuffer(),o.bindRenderbuffer(36161,v),o.renderbufferStorageMultisample(36161,4,e,d.textureWidth,d.textureHeight),o.framebufferRenderbuffer(36160,x,36161,v),o.bindRenderbuffer(36161,null)),a.bindFramebuffer(36160,null))}l=await m.requestReferenceSpace(r),N.setContext(m),N.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};const z=new De,D=new De;function I(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null!==m){E.near=S.near=_.near=e.near,E.far=S.far=_.far=e.far,A===E.near&&C===E.far||(m.updateRenderState({depthNear:E.near,depthFar:E.far}),A=E.near,C=E.far);var t=e.parent,i=E.cameras;I(E,t);for(let e=0;e<i.length;e++)I(i[e],t);E.matrixWorld.decompose(E.position,E.quaternion,E.scale),e.position.copy(E.position),e.quaternion.copy(E.quaternion),e.scale.copy(E.scale),e.matrix.copy(E.matrix),e.matrixWorld.copy(E.matrixWorld);var n,r,s,o,a,l,h,c,u,d,p=e.children;for(let e=0,t=p.length;e<t;e++)p[e].updateMatrixWorld(!0);2===i.length?(e=E,n=_,r=S,z.setFromMatrixPosition(n.matrixWorld),D.setFromMatrixPosition(r.matrixWorld),s=z.distanceTo(D),o=n.projectionMatrix.elements,r=r.projectionMatrix.elements,a=o[14]/(o[10]-1),l=o[14]/(o[10]+1),h=(o[9]+1)/o[5],c=(o[9]-1)/o[5],o=(o[8]-1)/o[0],r=(r[8]+1)/r[0],u=a*o,d=a*r,o=(r=s/(r-o))*-o,n.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(o),e.translateZ(r),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),n=a+r,a=l+r,e.projectionMatrix.makePerspective(u-o,s-o+d,h*l/a*n,c*l/a*n,n,a)):E.projectionMatrix.copy(_.projectionMatrix)}},this.getCamera=function(){return E},this.getFoveation=function(){return null!==d?d.fixedFoveation:null!==p?p.fixedFoveation:void 0},this.setFoveation=function(e){null!==d&&(d.fixedFoveation=e),null!==p&&void 0!==p.fixedFoveation&&(p.fixedFoveation=e)};let O=null;const N=new Zs;N.setAnimationLoop(function(n,t){if(h=t.getViewerPose(l),y=t,null!==h){const n=h.views;null!==p&&a.bindXRFramebuffer(p.framebuffer);let i=!1;n.length!==E.cameras.length&&(E.cameras.length=0,i=!0);for(let t=0;t<n.length;t++){const s=n[t];let e=null;if(null!==p)e=p.getViewport(s);else{const n=c.getViewSubImage(d,s);a.bindXRFramebuffer(u),void 0!==n.depthStencilTexture&&o.framebufferTexture2D(36160,x,3553,n.depthStencilTexture,0),o.framebufferTexture2D(36160,36064,3553,n.colorTexture,0),e=n.viewport}var r=T[t];r.matrix.fromArray(s.transform.matrix),r.projectionMatrix.fromArray(s.projectionMatrix),r.viewport.set(e.x,e.y,e.width,e.height),0===t&&E.matrix.copy(r.matrix),!0===i&&E.cameras.push(r)}f&&(a.bindXRFramebuffer(g),null!==w)&&o.clear(w)}const s=m.inputSources;for(let e=0;e<b.length;e++){const o=b[e],a=s[e];o.update(a,t,l)}if(O&&O(n,t),f){const n=d.textureWidth,t=d.textureHeight;a.bindFramebuffer(36008,g),a.bindFramebuffer(36009,u),o.invalidateFramebuffer(36008,[x]),o.invalidateFramebuffer(36009,[x]),o.blitFramebuffer(0,0,n,t,0,0,n,t,16384,9728),o.invalidateFramebuffer(36008,[36064]),a.bindFramebuffer(36008,null),a.bindFramebuffer(36009,null),a.bindFramebuffer(36160,g)}y=null}),this.setAnimationLoop=function(e){O=e},this.dispose=function(){}}}function Rl(s){function d(e,t){e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),0<t.alphaTest&&(e.alphaTest.value=t.alphaTest);var i=s.get(t).envMap;if(i){e.envMap.value=i,e.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,e.reflectivity.value=t.reflectivity,e.ior.value=t.ior,e.refractionRatio.value=t.refractionRatio;const n=s.get(i).__maxMipLevel;void 0!==n&&(e.maxMipLevel.value=n)}let n,r;t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap?n=t.emissiveMap:t.clearcoatMap?n=t.clearcoatMap:t.clearcoatNormalMap?n=t.clearcoatNormalMap:t.clearcoatRoughnessMap?n=t.clearcoatRoughnessMap:t.specularIntensityMap?n=t.specularIntensityMap:t.specularColorMap?n=t.specularColorMap:t.transmissionMap?n=t.transmissionMap:t.thicknessMap?n=t.thicknessMap:t.sheenColorMap?n=t.sheenColorMap:t.sheenRoughnessMap&&(n=t.sheenRoughnessMap),void 0!==n&&(!0===(n=n.isWebGLRenderTarget?n.texture:n).matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix)),t.aoMap?r=t.aoMap:t.lightMap&&(r=t.lightMap),void 0!==r&&(!0===(r=r.isWebGLRenderTarget?r.texture:r).matrixAutoUpdate&&r.updateMatrix(),e.uv2Transform.value.copy(r.matrix))}function p(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===Ae)&&(e.bumpScale.value*=-1),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===Ae)&&e.normalScale.value.negate(),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),s.get(t).envMap&&(e.envMapIntensity.value=t.envMapIntensity)}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(t,i,n,r,s){if(i.isMeshBasicMaterial)d(t,i);else if(i.isMeshLambertMaterial)d(t,i),u=t,i.emissiveMap&&(u.emissiveMap.value=i.emissiveMap);else if(i.isMeshToonMaterial)d(t,i),u=t,(c=i).gradientMap&&(u.gradientMap.value=c.gradientMap),c.emissiveMap&&(u.emissiveMap.value=c.emissiveMap),c.bumpMap&&(u.bumpMap.value=c.bumpMap,u.bumpScale.value=c.bumpScale,c.side===Ae)&&(u.bumpScale.value*=-1),c.normalMap&&(u.normalMap.value=c.normalMap,u.normalScale.value.copy(c.normalScale),c.side===Ae)&&u.normalScale.value.negate(),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);else if(i.isMeshPhongMaterial)d(t,i),c=i,(h=t).specular.value.copy(c.specular),h.shininess.value=Math.max(c.shininess,1e-4),c.emissiveMap&&(h.emissiveMap.value=c.emissiveMap),c.bumpMap&&(h.bumpMap.value=c.bumpMap,h.bumpScale.value=c.bumpScale,c.side===Ae)&&(h.bumpScale.value*=-1),c.normalMap&&(h.normalMap.value=c.normalMap,h.normalScale.value.copy(c.normalScale),c.side===Ae)&&h.normalScale.value.negate(),c.displacementMap&&(h.displacementMap.value=c.displacementMap,h.displacementScale.value=c.displacementScale,h.displacementBias.value=c.displacementBias);else if(i.isMeshStandardMaterial)d(t,i),i.isMeshPhysicalMaterial?(h=s,p(s=t,l=i),s.ior.value=l.ior,0<l.sheen&&(s.sheenColor.value.copy(l.sheenColor).multiplyScalar(l.sheen),s.sheenRoughness.value=l.sheenRoughness,l.sheenColorMap&&(s.sheenColorMap.value=l.sheenColorMap),l.sheenRoughnessMap)&&(s.sheenRoughnessMap.value=l.sheenRoughnessMap),0<l.clearcoat&&(s.clearcoat.value=l.clearcoat,s.clearcoatRoughness.value=l.clearcoatRoughness,l.clearcoatMap&&(s.clearcoatMap.value=l.clearcoatMap),l.clearcoatRoughnessMap&&(s.clearcoatRoughnessMap.value=l.clearcoatRoughnessMap),l.clearcoatNormalMap)&&(s.clearcoatNormalScale.value.copy(l.clearcoatNormalScale),s.clearcoatNormalMap.value=l.clearcoatNormalMap,l.side===Ae)&&s.clearcoatNormalScale.value.negate(),0<l.transmission&&(s.transmission.value=l.transmission,s.transmissionSamplerMap.value=h.texture,s.transmissionSamplerSize.value.set(h.width,h.height),l.transmissionMap&&(s.transmissionMap.value=l.transmissionMap),s.thickness.value=l.thickness,l.thicknessMap&&(s.thicknessMap.value=l.thicknessMap),s.attenuationDistance.value=l.attenuationDistance,s.attenuationColor.value.copy(l.attenuationColor)),s.specularIntensity.value=l.specularIntensity,s.specularColor.value.copy(l.specularColor),l.specularIntensityMap&&(s.specularIntensityMap.value=l.specularIntensityMap),l.specularColorMap&&(s.specularColorMap.value=l.specularColorMap)):p(t,i);else if(i.isMeshMatcapMaterial)d(t,i),s=t,(l=i).matcap&&(s.matcap.value=l.matcap),l.bumpMap&&(s.bumpMap.value=l.bumpMap,s.bumpScale.value=l.bumpScale,l.side===Ae)&&(s.bumpScale.value*=-1),l.normalMap&&(s.normalMap.value=l.normalMap,s.normalScale.value.copy(l.normalScale),l.side===Ae)&&s.normalScale.value.negate(),l.displacementMap&&(s.displacementMap.value=l.displacementMap,s.displacementScale.value=l.displacementScale,s.displacementBias.value=l.displacementBias);else if(i.isMeshDepthMaterial)d(t,i),s=t,(a=i).displacementMap&&(s.displacementMap.value=a.displacementMap,s.displacementScale.value=a.displacementScale,s.displacementBias.value=a.displacementBias);else if(i.isMeshDistanceMaterial)d(t,i),s=t,(a=i).displacementMap&&(s.displacementMap.value=a.displacementMap,s.displacementScale.value=a.displacementScale,s.displacementBias.value=a.displacementBias),s.referencePosition.value.copy(a.referencePosition),s.nearDistance.value=a.nearDistance,s.farDistance.value=a.farDistance;else if(i.isMeshNormalMaterial)d(t,i),s=t,(e=i).bumpMap&&(s.bumpMap.value=e.bumpMap,s.bumpScale.value=e.bumpScale,e.side===Ae)&&(s.bumpScale.value*=-1),e.normalMap&&(s.normalMap.value=e.normalMap,s.normalScale.value.copy(e.normalScale),e.side===Ae)&&s.normalScale.value.negate(),e.displacementMap&&(s.displacementMap.value=e.displacementMap,s.displacementScale.value=e.displacementScale,s.displacementBias.value=e.displacementBias);else if(i.isLineBasicMaterial)s=i,(e=t).diffuse.value.copy(s.color),e.opacity.value=s.opacity,i.isLineDashedMaterial&&(s=i,(o=t).dashSize.value=s.dashSize,o.totalSize.value=s.dashSize+s.gapSize,o.scale.value=s.scale);else if(i.isPointsMaterial){s=i,(o=t).diffuse.value.copy(s.color),o.opacity.value=s.opacity,o.size.value=s.size*n,o.scale.value=.5*r,s.map&&(o.map.value=s.map),s.alphaMap&&(o.alphaMap.value=s.alphaMap),0<s.alphaTest&&(o.alphaTest.value=s.alphaTest);let e;s.map?e=s.map:s.alphaMap&&(e=s.alphaMap),void 0!==e&&(!0===e.matrixAutoUpdate&&e.updateMatrix(),o.uvTransform.value.copy(e.matrix))}else if(i.isSpriteMaterial){r=i,(n=t).diffuse.value.copy(r.color),n.opacity.value=r.opacity,n.rotation.value=r.rotation,r.map&&(n.map.value=r.map),r.alphaMap&&(n.alphaMap.value=r.alphaMap),0<r.alphaTest&&(n.alphaTest.value=r.alphaTest);let e;r.map?e=r.map:r.alphaMap&&(e=r.alphaMap),void 0!==e&&(!0===e.matrixAutoUpdate&&e.updateMatrix(),n.uvTransform.value.copy(e.matrix))}else i.isShadowMaterial?(t.color.value.copy(i.color),t.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1);var o,e,a,l,h,c,u}}}function s(e={}){const r=void 0!==e.canvas?e.canvas:((j=En("canvas")).style.display="block",j),N=void 0!==e.context?e.context:null,B=void 0!==e.alpha&&e.alpha,F=void 0===e.depth||e.depth,H=void 0===e.stencil||e.stencil,U=void 0!==e.antialias&&e.antialias,G=void 0===e.premultipliedAlpha||e.premultipliedAlpha,W=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,k=void 0!==e.powerPreference?e.powerPreference:"default",V=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;var j;let c=null,w=null;const t=[],s=[],b=(this.domElement=r,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=Pe,this.physicallyCorrectLights=!1,this.toneMapping=Be,this.toneMappingExposure=1,this);let X=!1,q=0,Y=0,M=null,_=-1,S=null;const u=new ze,J=new ze;let Z=null,n=r.width,T=r.height,E=1,Q=null,K=null;const a=new ze(0,0,n,T),l=new ze(0,0,n,T);let $=!1;const h=[],ee=new Js;let te=!1,ie=!1,A=null;const ne=new Ie,C=new De,re={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function se(){return null===M?E:1}let d,R,L,p,P,z,D,oe,ae,le,m,f,he,ce,ue,I,o,g,de,pe,me,v,y,O=N;function fe(t,i){for(let e=0;e<t.length;e++){var n=t[e],n=r.getContext(n,i);if(null!==n)return n}return null}try{const e={alpha:B,depth:F,stencil:H,antialias:U,premultipliedAlpha:G,preserveDrawingBuffer:W,powerPreference:k,failIfMajorPerformanceCaveat:V};if(r.addEventListener("webglcontextlost",ve,!1),r.addEventListener("webglcontextrestored",ye,!1),null===O){const r=["webgl2","webgl","experimental-webgl"];if(!0===b.isWebGL1Renderer&&r.shift(),null===(O=fe(r,e)))throw fe(r)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===O.getShaderPrecisionFormat&&(O.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function ge(){d=new Lo(O),R=new no(O,d,e),d.init(R),v=new _l(O,d,R),L=new bl(O,d,R),h[0]=1029,p=new Do(O),P=new al,z=new Ml(O,d,L,P,R,v,p),D=new so(b),oe=new Ro(b),ae=new Qs(O,R),y=new to(O,d,ae,R),le=new Po(O,ae,p,y),m=new Ho(O,le,ae,p),de=new Fo(O,R,z),I=new ro(P),f=new ol(b,D,oe,d,R,y,I),he=new Rl(P),ce=new ul(P),ue=new vl(d,R),g=new eo(b,D,L,m,G),o=new wl(b,m,R),pe=new io(O,d,p,R),me=new zo(O,d,p,R),p.programs=f.programs,b.capabilities=R,b.extensions=d,b.properties=P,b.renderLists=ce,b.shadowMap=o,b.state=L,b.info=p}ge();const x=new Cl(b,O);function ve(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),X=!0}function ye(){console.log("THREE.WebGLRenderer: Context Restored."),X=!1;var e=p.autoReset,t=o.enabled,i=o.autoUpdate,n=o.needsUpdate,r=o.type;ge(),p.autoReset=e,o.enabled=t,o.autoUpdate=i,o.needsUpdate=n,o.type=r}function xe(e){var t,e=e.target;e.removeEventListener("dispose",xe),t=e=e,void 0!==(t=P.get(t).programs)&&t.forEach(function(e){f.releaseProgram(e)}),P.remove(e)}this.xr=x,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){var e=d.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=d.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return E},this.setPixelRatio=function(e){void 0!==e&&(E=e,this.setSize(n,T,!1))},this.getSize=function(e){return e.set(n,T)},this.setSize=function(e,t,i){x.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(n=e,T=t,r.width=Math.floor(e*E),r.height=Math.floor(t*E),!1!==i&&(r.style.width=e+"px",r.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(n*E,T*E).floor()},this.setDrawingBufferSize=function(e,t,i){n=e,T=t,E=i,r.width=Math.floor(e*i),r.height=Math.floor(t*i),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return e.copy(u)},this.getViewport=function(e){return e.copy(a)},this.setViewport=function(e,t,i,n){e.isVector4?a.set(e.x,e.y,e.z,e.w):a.set(e,t,i,n),L.viewport(u.copy(a).multiplyScalar(E).floor())},this.getScissor=function(e){return e.copy(l)},this.setScissor=function(e,t,i,n){e.isVector4?l.set(e.x,e.y,e.z,e.w):l.set(e,t,i,n),L.scissor(J.copy(l).multiplyScalar(E).floor())},this.getScissorTest=function(){return $},this.setScissorTest=function(e){L.setScissorTest($=e)},this.setOpaqueSort=function(e){Q=e},this.setTransparentSort=function(e){K=e},this.getClearColor=function(e){return e.copy(g.getClearColor())},this.setClearColor=function(){g.setClearColor.apply(g,arguments)},this.getClearAlpha=function(){return g.getClearAlpha()},this.setClearAlpha=function(){g.setClearAlpha.apply(g,arguments)},this.clear=function(e,t,i){let n=0;void 0!==e&&!e||(n|=16384),void 0!==t&&!t||(n|=256),void 0!==i&&!i||(n|=1024),O.clear(n)},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(){r.removeEventListener("webglcontextlost",ve,!1),r.removeEventListener("webglcontextrestored",ye,!1),ce.dispose(),ue.dispose(),P.dispose(),D.dispose(),oe.dispose(),m.dispose(),y.dispose(),x.dispose(),x.removeEventListener("sessionstart",be),x.removeEventListener("sessionend",Me),A&&(A.dispose(),A=null),i.stop()},this.renderBufferDirect=function(e,t,i,n,r,s){null===t&&(t=re);var o=r.isMesh&&r.matrixWorld.determinant()<0,e=function(e,t,i,n,r){!0!==t.isScene&&(t=re),z.resetTextureUnits();var s=t.fog,o=n.isMeshStandardMaterial?t.environment:null,a=null===M?b.outputEncoding:M.texture.encoding,o=(n.isMeshStandardMaterial?oe:D).get(n.envMap||o),l=!0===n.vertexColors&&!!i.attributes.color&&4===i.attributes.color.itemSize,h=!!n.normalMap&&!!i.attributes.tangent,c=!!i.morphAttributes.position,u=!!i.morphAttributes.normal,d=i.morphAttributes.position?i.morphAttributes.position.length:0,p=P.get(n),m=w.state.lights;if(!0===te&&(!0===ie||e!==S)){const t=e===S&&n.id===_;I.setState(n,e,t)}let f=!1,g=(n.version===p.__version?(p.needsLights&&p.lightsStateVersion!==m.state.version||p.outputEncoding!==a||r.isInstancedMesh&&!1===p.instancing||!r.isInstancedMesh&&!0===p.instancing||r.isSkinnedMesh&&!1===p.skinning||!r.isSkinnedMesh&&!0===p.skinning||p.envMap!==o||n.fog&&p.fog!==s||void 0!==p.numClippingPlanes&&(p.numClippingPlanes!==I.numPlanes||p.numIntersection!==I.numIntersection)||p.vertexAlphas!==l||p.vertexTangents!==h||p.morphTargets!==c||p.morphNormals!==u||!0===R.isWebGL2&&p.morphTargetsCount!==d)&&(f=!0):(f=!0,p.__version=n.version),p.currentProgram),v=!1,y=!1,x=!1;m=(g=!0===f?Te(n,t,r):g).getUniforms(),a=p.uniforms;if(L.useProgram(g.program)&&(v=!0,y=!0,x=!0),n.id!==_&&(_=n.id,y=!0),v||S!==e){if(m.setValue(O,"projectionMatrix",e.projectionMatrix),R.logarithmicDepthBuffer&&m.setValue(O,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),S!==e&&(S=e,y=!0,x=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const t=m.map.cameraPosition;void 0!==t&&t.setValue(O,C.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&m.setValue(O,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||r.isSkinnedMesh)&&m.setValue(O,"viewMatrix",e.matrixWorldInverse)}if(r.isSkinnedMesh){m.setOptional(O,r,"bindMatrix"),m.setOptional(O,r,"bindMatrixInverse");const e=r.skeleton;e&&(R.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),m.setValue(O,"boneTexture",e.boneTexture,z),m.setValue(O,"boneTextureSize",e.boneTextureSize)):m.setOptional(O,e,"boneMatrices"))}return!i||void 0===i.morphAttributes.position&&void 0===i.morphAttributes.normal||de.update(r,i,n,g),!y&&p.receiveShadow===r.receiveShadow||(p.receiveShadow=r.receiveShadow,m.setValue(O,"receiveShadow",r.receiveShadow)),y&&(m.setValue(O,"toneMappingExposure",b.toneMappingExposure),p.needsLights&&(o=x,(l=a).ambientLightColor.needsUpdate=o,l.lightProbe.needsUpdate=o,l.directionalLights.needsUpdate=o,l.directionalLightShadows.needsUpdate=o,l.pointLights.needsUpdate=o,l.pointLightShadows.needsUpdate=o,l.spotLights.needsUpdate=o,l.spotLightShadows.needsUpdate=o,l.rectAreaLights.needsUpdate=o,l.hemisphereLights.needsUpdate=o),s&&n.fog&&he.refreshFogUniforms(a,s),he.refreshMaterialUniforms(a,n,E,T,A),Ga.upload(O,p.uniformsList,a,z)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Ga.upload(O,p.uniformsList,a,z),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&m.setValue(O,"center",r.center),m.setValue(O,"modelViewMatrix",r.modelViewMatrix),m.setValue(O,"normalMatrix",r.normalMatrix),m.setValue(O,"modelMatrix",r.matrixWorld),g}(e,t,i,n,r);L.setMaterial(n,o);let a=i.index;t=i.attributes.position;if(null===a){if(void 0===t||0===t.count)return}else if(0===a.count)return;let l,h=1,c=(!0===n.wireframe&&(a=le.getWireframeAttribute(i),h=2),y.setup(r,n,e,i,a),pe);null!==a&&(l=ae.get(a),(c=me).setIndex(l));var o=(null!==a?a:t).count,e=i.drawRange.start*h,t=i.drawRange.count*h,u=null!==s?s.start*h:0,s=null!==s?s.count*h:1/0,d=Math.max(e,u),o=Math.min(o,e+t,u+s)-1,t=Math.max(0,o-d+1);if(0!==t){if(r.isMesh)!0===n.wireframe?(L.setLineWidth(n.wireframeLinewidth*se()),c.setMode(1)):c.setMode(4);else if(r.isLine){let e=n.linewidth;void 0===e&&(e=1),L.setLineWidth(e*se()),r.isLineSegments?c.setMode(1):r.isLineLoop?c.setMode(2):c.setMode(3)}else r.isPoints?c.setMode(0):r.isSprite&&c.setMode(4);if(r.isInstancedMesh)c.renderInstances(d,t,r.count);else if(i.isInstancedBufferGeometry){const e=Math.min(i.instanceCount,i._maxInstanceCount);c.renderInstances(d,t,e)}else c.render(d,t)}},this.compile=function(n,t){(w=ue.get(n)).init(),s.push(w),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(w.pushLight(e),e.castShadow)&&w.pushShadow(e)}),w.setupLights(b.physicallyCorrectLights),n.traverse(function(t){var i=t.material;if(i)if(Array.isArray(i))for(let e=0;e<i.length;e++)Te(i[e],n,t);else Te(i,n,t)}),s.pop(),w=null};let we=null;function be(){i.stop()}function Me(){i.start()}const i=new Zs;function _e(e,t,i,n){var r=e.opaque,s=e.transmissive,e=e.transparent;if(w.setupLightsView(i),0<s.length){var o=r,a=t,l=i;if(null===A){const o=!0===U&&!0===R.isWebGL2;A=new(o?In:zn)(1024,1024,{generateMipmaps:!0,type:null!==v.convert(at)?at:et,minFilter:Ke,magFilter:Re,wrapS:Ce,wrapT:Ce})}var h=b.getRenderTarget(),c=(b.setRenderTarget(A),b.clear(),b.toneMapping);b.toneMapping=Be,Se(o,a,l),b.toneMapping=c,z.updateMultisampleRenderTarget(A),z.updateRenderTargetMipmap(A),b.setRenderTarget(h)}n&&L.viewport(u.copy(n)),0<r.length&&Se(r,t,i),0<s.length&&Se(s,t,i),0<e.length&&Se(e,t,i)}function Se(i,n,r){var s,o,a=!0===n.isScene?n.overrideMaterial:null;for(let e=0,t=i.length;e<t;e++){var l=i[e],h=l.object,c=l.geometry,u=null===a?l.material:a,l=l.group;h.layers.test(r.layers)&&(s=n,o=r,c=c,u=u,l=l,(h=h).onBeforeRender(b,s,o,c,u,l),h.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,h.matrixWorld),h.normalMatrix.getNormalMatrix(h.modelViewMatrix),u.onBeforeRender(b,s,o,c,h,l),!0===u.transparent&&u.side===Ne?(u.side=Ae,u.needsUpdate=!0,b.renderBufferDirect(o,s,c,u,h,l),u.side=Oe,u.needsUpdate=!0,b.renderBufferDirect(o,s,c,u,h,l),u.side=Ne):b.renderBufferDirect(o,s,c,u,h,l),h.onAfterRender(b,s,o,c,u,l))}}function Te(e,t,i){!0!==t.isScene&&(t=re);var n=P.get(e),r=w.state.lights,s=w.state.shadowsArray,o=r.state.version,s=f.getParameters(e,r.state,s,t,i),a=f.getProgramCacheKey(s);let l=n.programs,h=(n.environment=e.isMeshStandardMaterial?t.environment:null,n.fog=t.fog,n.envMap=(e.isMeshStandardMaterial?oe:D).get(e.envMap||n.environment),void 0===l&&(e.addEventListener("dispose",xe),l=new Map,n.programs=l),l.get(a));if(void 0!==h){if(n.currentProgram===h&&n.lightsStateVersion===o)return Ee(e,s),h}else s.uniforms=f.getUniforms(e),e.onBuild(i,s,b),e.onBeforeCompile(s,b),h=f.acquireProgram(s,a),l.set(a,h),n.uniforms=s.uniforms;t=n.uniforms,(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(t.clippingPlanes=I.uniform),Ee(e,s),n.needsLights=e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights,n.lightsStateVersion=o,n.needsLights&&(t.ambientLightColor.value=r.state.ambient,t.lightProbe.value=r.state.probe,t.directionalLights.value=r.state.directional,t.directionalLightShadows.value=r.state.directionalShadow,t.spotLights.value=r.state.spot,t.spotLightShadows.value=r.state.spotShadow,t.rectAreaLights.value=r.state.rectArea,t.ltc_1.value=r.state.rectAreaLTC1,t.ltc_2.value=r.state.rectAreaLTC2,t.pointLights.value=r.state.point,t.pointLightShadows.value=r.state.pointShadow,t.hemisphereLights.value=r.state.hemi,t.directionalShadowMap.value=r.state.directionalShadowMap,t.directionalShadowMatrix.value=r.state.directionalShadowMatrix,t.spotShadowMap.value=r.state.spotShadowMap,t.spotShadowMatrix.value=r.state.spotShadowMatrix,t.pointShadowMap.value=r.state.pointShadowMap,t.pointShadowMatrix.value=r.state.pointShadowMatrix),i=h.getUniforms(),a=Ga.seqWithValue(i.seq,t);return n.currentProgram=h,n.uniformsList=a,h}function Ee(e,t){e=P.get(e);e.outputEncoding=t.outputEncoding,e.instancing=t.instancing,e.skinning=t.skinning,e.morphTargets=t.morphTargets,e.morphNormals=t.morphNormals,e.morphTargetsCount=t.morphTargetsCount,e.numClippingPlanes=t.numClippingPlanes,e.numIntersection=t.numClipIntersection,e.vertexAlphas=t.vertexAlphas,e.vertexTangents=t.vertexTangents}i.setAnimationLoop(function(e){we&&we(e)}),"undefined"!=typeof window&&i.setContext(window),this.setAnimationLoop=function(e){we=e,x.setAnimationLoop(e),null===e?i.stop():i.start()},x.addEventListener("sessionstart",be),x.addEventListener("sessionend",Me),this.render=function(i,e){if(void 0!==e&&!0!==e.isCamera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else if(!0!==X){!0===i.autoUpdate&&i.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===x.enabled&&!0===x.isPresenting&&(!0===x.cameraAutoUpdate&&x.updateCamera(e),e=x.getCamera()),!0===i.isScene&&i.onBeforeRender(b,i,e,M),(w=ue.get(i,s.length)).init(),s.push(w),ne.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),ee.setFromProjectionMatrix(ne),ie=this.localClippingEnabled,te=I.init(this.clippingPlanes,ie,e),(c=ce.get(i,t.length)).init(),t.push(c),function i(n,r,s,o){if(!1!==n.visible){if(n.layers.test(r.layers))if(n.isGroup)s=n.renderOrder;else if(n.isLOD)!0===n.autoUpdate&&n.update(r);else if(n.isLight)w.pushLight(n),n.castShadow&&w.pushShadow(n);else if(n.isSprite){if(!n.frustumCulled||ee.intersectsSprite(n)){o&&C.setFromMatrixPosition(n.matrixWorld).applyMatrix4(ne);const i=m.update(n),r=n.material;r.visible&&c.push(n,i,r,s,C.z,null)}}else if((n.isMesh||n.isLine||n.isPoints)&&(n.isSkinnedMesh&&n.skeleton.frame!==p.render.frame&&(n.skeleton.update(),n.skeleton.frame=p.render.frame),!n.frustumCulled||ee.intersectsObject(n))){o&&C.setFromMatrixPosition(n.matrixWorld).applyMatrix4(ne);const i=m.update(n),r=n.material;if(Array.isArray(r)){const o=i.groups;for(let e=0,t=o.length;e<t;e++){var a=o[e],l=r[a.materialIndex];l&&l.visible&&c.push(n,i,l,s,C.z,a)}}else r.visible&&c.push(n,i,r,s,C.z,null)}var h=n.children;for(let e=0,t=h.length;e<t;e++)i(h[e],r,s,o)}}(i,e,0,b.sortObjects),c.finish(),!0===b.sortObjects&&c.sort(Q,K),!0===te&&I.beginShadows();const r=w.state.shadowsArray;if(o.render(r,i,e),!0===te&&I.endShadows(),!0===this.info.autoReset&&this.info.reset(),g.render(c,i),w.setupLights(b.physicallyCorrectLights),e.isArrayCamera){const r=e.cameras;for(let e=0,t=r.length;e<t;e++){var n=r[e];_e(c,i,n,n.viewport)}}else _e(c,i,e);null!==M&&(z.updateMultisampleRenderTarget(M),z.updateRenderTargetMipmap(M)),!0===i.isScene&&i.onAfterRender(b,i,e),L.buffers.depth.setTest(!0),L.buffers.depth.setMask(!0),L.buffers.color.setMask(!0),L.setPolygonOffset(!1),y.resetDefaultState(),_=-1,S=null,s.pop(),w=0<s.length?s[s.length-1]:null,t.pop(),c=0<t.length?t[t.length-1]:null}},this.getActiveCubeFace=function(){return q},this.getActiveMipmapLevel=function(){return Y},this.getRenderTarget=function(){return M},this.setRenderTarget=function(t,e=0,i=0){M=t,q=e,Y=i,t&&void 0===P.get(t).__webglFramebuffer&&z.setupRenderTarget(t);let n=null,r=!1,s=!1;if(t){const i=t.texture;(i.isDataTexture3D||i.isDataTexture2DArray)&&(s=!0);var o=P.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=o[e],r=!0):n=t.isWebGLMultisampleRenderTarget?P.get(t).__webglMultisampledFramebuffer:o,u.copy(t.viewport),J.copy(t.scissor),Z=t.scissorTest}else u.copy(a).multiplyScalar(E).floor(),J.copy(l).multiplyScalar(E).floor(),Z=$;if(L.bindFramebuffer(36160,n)&&R.drawBuffers){let e=!1;if(t)if(t.isWebGLMultipleRenderTargets){const i=t.texture;if(h.length!==i.length||36064!==h[0]){for(let e=0,t=i.length;e<t;e++)h[e]=36064+e;h.length=i.length,e=!0}}else 1===h.length&&36064===h[0]||(h[0]=36064,h.length=1,e=!0);else 1===h.length&&1029===h[0]||(h[0]=1029,h.length=1,e=!0);e&&(R.isWebGL2?O.drawBuffers(h):d.get("WEBGL_draw_buffers").drawBuffersWEBGL(h))}if(L.viewport(u),L.scissor(J),L.setScissorTest(Z),r){const n=P.get(t.texture);O.framebufferTexture2D(36160,36064,34069+e,n.__webglTexture,i)}else if(s){const n=P.get(t.texture),r=e||0;O.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}_=-1},this.readRenderTargetPixels=function(t,i,n,r,s,o,a){if(t&&t.isWebGLRenderTarget){let e=P.get(t).__webglFramebuffer;if(e=t.isWebGLCubeRenderTarget&&void 0!==a?e[a]:e){L.bindFramebuffer(36160,e);try{const a=t.texture,e=a.format,h=a.type;var l;e!==Le&&v.convert(e)!==O.getParameter(35739)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):(l=h===at&&(d.has("EXT_color_buffer_half_float")||R.isWebGL2&&d.has("EXT_color_buffer_float")),h===et||v.convert(h)===O.getParameter(35738)||h===ot&&(R.isWebGL2||d.has("OES_texture_float")||d.has("WEBGL_color_buffer_float"))||l?36053===O.checkFramebufferStatus(36160)?0<=i&&i<=t.width-r&&0<=n&&n<=t.height-s&&O.readPixels(i,n,r,s,v.convert(e),v.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."))}finally{const t=null!==M?P.get(M).__webglFramebuffer:null;L.bindFramebuffer(36160,t)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,i=0){var n=Math.pow(2,-i),r=Math.floor(t.image.width*n),n=Math.floor(t.image.height*n);let s=v.convert(t.format);R.isWebGL2&&6408===(s=6407===s?32849:s)&&(s=32856),z.setTexture2D(t,0),O.copyTexImage2D(3553,i,s,e.x,e.y,r,n,0),L.unbindTexture()},this.copyTextureToTexture=function(e,t,i,n=0){var r=t.image.width,s=t.image.height,o=v.convert(i.format),a=v.convert(i.type);z.setTexture2D(i,0),O.pixelStorei(37440,i.flipY),O.pixelStorei(37441,i.premultiplyAlpha),O.pixelStorei(3317,i.unpackAlignment),t.isDataTexture?O.texSubImage2D(3553,n,e.x,e.y,r,s,o,a,t.image.data):t.isCompressedTexture?O.compressedTexSubImage2D(3553,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):O.texSubImage2D(3553,n,e.x,e.y,o,a,t.image),0===n&&i.generateMipmaps&&O.generateMipmap(3553),L.unbindTexture()},this.copyTextureToTexture3D=function(t,i,n,r,s=0){if(b.isWebGL1Renderer)console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");else{var o=t.max.x-t.min.x+1,a=t.max.y-t.min.y+1,l=t.max.z-t.min.z+1,h=v.convert(r.format),c=v.convert(r.type);let e;if(r.isDataTexture3D)z.setTexture3D(r,0),e=32879;else{if(!r.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");z.setTexture2DArray(r,0),e=35866}O.pixelStorei(37440,r.flipY),O.pixelStorei(37441,r.premultiplyAlpha),O.pixelStorei(3317,r.unpackAlignment);var u=O.getParameter(3314),d=O.getParameter(32878),p=O.getParameter(3316),m=O.getParameter(3315),f=O.getParameter(32877),g=n.isCompressedTexture?n.mipmaps[0]:n.image;O.pixelStorei(3314,g.width),O.pixelStorei(32878,g.height),O.pixelStorei(3316,t.min.x),O.pixelStorei(3315,t.min.y),O.pixelStorei(32877,t.min.z),n.isDataTexture||n.isDataTexture3D?O.texSubImage3D(e,s,i.x,i.y,i.z,o,a,l,h,c,g.data):n.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),O.compressedTexSubImage3D(e,s,i.x,i.y,i.z,o,a,l,h,g.data)):O.texSubImage3D(e,s,i.x,i.y,i.z,o,a,l,h,c,g),O.pixelStorei(3314,u),O.pixelStorei(32878,d),O.pixelStorei(3316,p),O.pixelStorei(3315,m),O.pixelStorei(32877,f),0===s&&r.generateMipmaps&&O.generateMipmap(e),L.unbindTexture()}},this.initTexture=function(e){z.setTexture2D(e,0),L.unbindTexture()},this.resetState=function(){q=0,Y=0,M=null,L.reset(),y.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}s.prototype.isWebGLRenderer=!0;class Ll extends s{}Ll.prototype.isWebGL1Renderer=!0;class Pl{constructor(e,t=25e-5){this.name="",this.color=new g(e),this.density=t}clone(){return new Pl(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Pl.prototype.isFogExp2=!0;class zl{constructor(e,t=1,i=1e3){this.name="",this.color=new g(e),this.near=t,this.far=i}clone(){return new zl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}zl.prototype.isFog=!0;class Dl extends u{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){e=super.toJSON(e);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}Dl.prototype.isScene=!0;class Il{constructor(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Ki,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fn()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(i,n,r){i*=this.stride,r*=n.stride;for(let e=0,t=this.stride;e<t;e++)this.array[i+e]=n.array[r+e];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=fn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);e=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),e=new this.constructor(e,this.stride);return e.setUsage(this.usage),e}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=fn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}Il.prototype.isInterleavedBuffer=!0;const o=new De;class Ol{constructor(e,t,i,n=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=!0===n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(i){for(let e=0,t=this.data.count;e<t;e++)o.x=this.getX(e),o.y=this.getY(e),o.z=this.getZ(e),o.applyMatrix4(i),this.setXYZ(e,o.x,o.y,o.z);return this}applyNormalMatrix(i){for(let e=0,t=this.count;e<t;e++)o.x=this.getX(e),o.y=this.getY(e),o.z=this.getZ(e),o.applyNormalMatrix(i),this.setXYZ(e,o.x,o.y,o.z);return this}transformDirection(i){for(let e=0,t=this.count;e<t;e++)o.x=this.getX(e),o.y=this.getY(e),o.z=this.getZ(e),o.transformDirection(i),this.setXYZ(e,o.x,o.y,o.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this.data.array[e+3]=r,this}clone(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new Ol(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){var i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new T(new this.array.constructor(t),this.itemSize,this.normalized)}}toJSON(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};{console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){var i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}}}Ol.prototype.isInterleavedBufferAttribute=!0;class Nl extends i{constructor(e){super(),this.type="SpriteMaterial",this.color=new g(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}let Bl;Nl.prototype.isSpriteMaterial=!0;const Fl=new De,Hl=new De,Ul=new De,Gl=new W,Wl=new W,kl=new Ie,Vl=new De,jl=new De,Xl=new De,ql=new W,Yl=new W,Jl=new W;class Zl extends u{constructor(e){if(super(),this.type="Sprite",void 0===Bl){Bl=new _;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Il(e,5);Bl.setIndex([0,1,2,0,2,3]),Bl.setAttribute("position",new Ol(t,3,0,!1)),Bl.setAttribute("uv",new Ol(t,2,3,!1))}this.geometry=Bl,this.material=void 0!==e?e:new Nl,this.center=new W(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Hl.setFromMatrixScale(this.matrixWorld),kl.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Ul.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Hl.multiplyScalar(-Ul.z);var i=this.material.rotation;let n,r;0!==i&&(r=Math.cos(i),n=Math.sin(i));var i=this.center,s=(Ql(Vl.set(-.5,-.5,0),Ul,i,Hl,n,r),Ql(jl.set(.5,-.5,0),Ul,i,Hl,n,r),Ql(Xl.set(.5,.5,0),Ul,i,Hl,n,r),ql.set(0,0),Yl.set(1,0),Jl.set(1,1),e.ray.intersectTriangle(Vl,jl,Xl,!1,Fl));null===s&&(Ql(jl.set(-.5,.5,0),Ul,i,Hl,n,r),Yl.set(0,1),null===(s=e.ray.intersectTriangle(Vl,Xl,jl,!1,Fl)))||(i=e.ray.origin.distanceTo(Fl))<e.near||i>e.far||t.push({distance:i,point:Fl.clone(),uv:p.getUV(Fl,Vl,jl,Xl,ql,Yl,Jl,new W),face:null,object:this})}copy(e){return super.copy(e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function Ql(e,t,i,n,r,s){Gl.subVectors(e,i).addScalar(.5).multiply(n),void 0!==r?(Wl.x=s*Gl.x-r*Gl.y,Wl.y=r*Gl.x+s*Gl.y):Wl.copy(Gl),e.copy(t),e.x+=Wl.x,e.y+=Wl.y,e.applyMatrix4(kl)}Zl.prototype.isSprite=!0;const Kl=new De,$l=new De;class eh extends u{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);var i=e.levels;for(let e=0,t=i.length;e<t;e++){var n=i[e];this.addLevel(n.object.clone(),n.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);var i=this.levels;let n;for(n=0;n<i.length&&!(t<i[n].distance);n++);return i.splice(n,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(i){var n=this.levels;if(0<n.length){let e,t;for(e=1,t=n.length;e<t&&!(i<n[e].distance);e++);return n[e-1].object}return null}raycast(e,t){var i;0<this.levels.length&&(Kl.setFromMatrixPosition(this.matrixWorld),i=e.ray.origin.distanceTo(Kl),this.getObjectForDistance(i).raycast(e,t))}update(i){var n=this.levels;if(1<n.length){Kl.setFromMatrixPosition(i.matrixWorld),$l.setFromMatrixPosition(this.matrixWorld);var r=Kl.distanceTo($l)/i.zoom;let e,t;for(n[0].object.visible=!0,e=1,t=n.length;e<t&&r>=n[e].distance;e++)n[e-1].object.visible=!1,n[e].object.visible=!0;for(this._currentLevel=e-1;e<t;e++)n[e].object.visible=!1}}toJSON(e){var i=super.toJSON(e),n=(!1===this.autoUpdate&&(i.object.autoUpdate=!1),i.object.levels=[],this.levels);for(let e=0,t=n.length;e<t;e++){var r=n[e];i.object.levels.push({object:r.object.uuid,distance:r.distance})}return i}}const th=new De,ih=new ze,nh=new ze,rh=new De,sh=new Ie;class oh extends S{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ie,this.bindMatrixInverse=new Ie}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){var i=new ze,n=this.geometry.attributes.skinWeight;for(let e=0,t=n.count;e<t;e++){i.x=n.getX(e),i.y=n.getY(e),i.z=n.getZ(e),i.w=n.getW(e);var r=1/i.manhattanLength();r!=1/0?i.multiplyScalar(r):i.set(1,0,0,0),n.setXYZW(e,i.x,i.y,i.z,i.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,n=this.geometry;ih.fromBufferAttribute(n.attributes.skinIndex,e),nh.fromBufferAttribute(n.attributes.skinWeight,e),th.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const n=nh.getComponent(e);var r;0!==n&&(r=ih.getComponent(e),sh.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),t.addScaledVector(rh.copy(th).applyMatrix4(sh),n))}return t.applyMatrix4(this.bindMatrixInverse)}}oh.prototype.isSkinnedMesh=!0;class ah extends u{constructor(){super(),this.type="Bone"}}ah.prototype.isBone=!0;class lh extends c{constructor(e=null,t=1,i=1,n,r,s,o,a,l=Re,h=Re,c,u){super(null,s,o,a,l,h,n,r,c,u),this.image={data:e,width:t,height:i},this.magFilter=l,this.minFilter=h,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}lh.prototype.isDataTexture=!0;const hh=new Ie,ch=new Ie;class uh{constructor(e=[],t=[]){this.uuid=fn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){var e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Ie)}}calculateInverses(){for(let e=this.boneInverses.length=0,t=this.bones.length;e<t;e++){var i=new Ie;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){var i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){var n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){var i=this.bones,n=this.boneInverses,r=this.boneMatrices,e=this.boneTexture;for(let e=0,t=i.length;e<t;e++){var s=i[e]?i[e].matrixWorld:ch;hh.multiplyMatrices(s,n[e]),hh.toArray(r,16*e)}null!==e&&(e.needsUpdate=!0)}clone(){return new uh(this.bones,this.boneInverses)}computeBoneTexture(){var e=wn(Math.sqrt(4*this.bones.length)),t=(e=Math.max(e,4),new Float32Array(e*e*4)),i=(t.set(this.boneMatrices),new lh(t,e,e,Le,ot));return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(i){for(let e=0,t=this.bones.length;e<t;e++){var n=this.bones[e];if(n.name===i)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(i,n){this.uuid=i.uuid;for(let t=0,e=i.bones.length;t<e;t++){var r=i.bones[t];let e=n[r];void 0===e&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),e=new ah),this.bones.push(e),this.boneInverses.push((new Ie).fromArray(i.boneInverses[t]))}return this.init(),this}toJSON(){var i={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]},n=(i.uuid=this.uuid,this.bones),r=this.boneInverses;for(let e=0,t=n.length;e<t;e++){var s=n[e],s=(i.bones.push(s.uuid),r[e]);i.boneInverses.push(s.toArray())}return i}}class dh extends T{constructor(e,t,i,n=1){"number"==typeof i&&(n=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){var e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}dh.prototype.isInstancedBufferAttribute=!0;const ph=new Ie,mh=new Ie,fh=[],gh=new S;class vh extends S{constructor(e,t,i){super(e,t),this.instanceMatrix=new dh(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,n){const r=this.matrixWorld,t=this.count;if(gh.geometry=this.geometry,gh.material=this.material,void 0!==gh.material)for(let i=0;i<t;i++){this.getMatrixAt(i,ph),mh.multiplyMatrices(r,ph),gh.matrixWorld=mh,gh.raycast(e,fh);for(let e=0,t=fh.length;e<t;e++){const r=fh[e];r.instanceId=i,r.object=this,n.push(r)}fh.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new dh(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}vh.prototype.isInstancedMesh=!0;class y extends i{constructor(e){super(),this.type="LineBasicMaterial",this.color=new g(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}y.prototype.isLineBasicMaterial=!0;const yh=new De,xh=new De,wh=new Ie,bh=new ur,Mh=new nr;class _h extends u{constructor(e=new _,t=new y){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){var i=e.attributes.position,n=[0];for(let e=1,t=i.count;e<t;e++)yh.fromBufferAttribute(i,e-1),xh.fromBufferAttribute(i,e),n[e]=n[e-1],n[e]+=yh.distanceTo(xh);e.setAttribute("lineDistance",new k(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(i,n){const e=this.geometry,r=this.matrixWorld,s=i.params.Line.threshold,o=e.drawRange;if(null===e.boundingSphere&&e.computeBoundingSphere(),Mh.copy(e.boundingSphere),Mh.applyMatrix4(r),Mh.radius+=s,!1!==i.ray.intersectsSphere(Mh)){wh.copy(r).invert(),bh.copy(i.ray).applyMatrix4(wh);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,h=new De,c=new De,u=new De,d=new De,p=this.isLineSegments?2:1;if(e.isBufferGeometry){const r=e.index,s=e.attributes.position;if(null!==r)for(let e=Math.max(0,o.start),t=Math.min(r.count,o.start+o.count)-1;e<t;e+=p){const o=r.getX(e),a=r.getX(e+1);if(h.fromBufferAttribute(s,o),c.fromBufferAttribute(s,a),!(bh.distanceSqToSegment(h,c,d,u)>l)){d.applyMatrix4(this.matrixWorld);const p=i.ray.origin.distanceTo(d);p<i.near||p>i.far||n.push({distance:p,point:u.clone().applyMatrix4(this.matrixWorld),index:e,face:null,faceIndex:null,object:this})}}else for(let e=Math.max(0,o.start),t=Math.min(s.count,o.start+o.count)-1;e<t;e+=p)if(h.fromBufferAttribute(s,e),c.fromBufferAttribute(s,e+1),!(bh.distanceSqToSegment(h,c,d,u)>l)){d.applyMatrix4(this.matrixWorld);const r=i.ray.origin.distanceTo(d);r<i.near||r>i.far||n.push({distance:r,point:u.clone().applyMatrix4(this.matrixWorld),index:e,face:null,faceIndex:null,object:this})}}else e.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){const i=this.geometry;if(i.isBufferGeometry){var e=i.morphAttributes,t=Object.keys(e);if(0<t.length){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){var n=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{e=i.morphTargets;void 0!==e&&0<e.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}_h.prototype.isLine=!0;const Sh=new De,Th=new De;class Eh extends _h{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){var i=e.attributes.position,n=[];for(let e=0,t=i.count;e<t;e+=2)Sh.fromBufferAttribute(i,e),Th.fromBufferAttribute(i,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+Sh.distanceTo(Th);e.setAttribute("lineDistance",new k(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Eh.prototype.isLineSegments=!0;class Ah extends _h{constructor(e,t){super(e,t),this.type="LineLoop"}}Ah.prototype.isLineLoop=!0;class Ch extends i{constructor(e){super(),this.type="PointsMaterial",this.color=new g(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}Ch.prototype.isPointsMaterial=!0;const Rh=new Ie,Lh=new ur,Ph=new nr,zh=new De;class Dh extends u{constructor(e=new _,t=new Ch){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(i,n){const e=this.geometry,r=this.matrixWorld,s=i.params.Points.threshold,o=e.drawRange;if(null===e.boundingSphere&&e.computeBoundingSphere(),Ph.copy(e.boundingSphere),Ph.applyMatrix4(r),Ph.radius+=s,!1!==i.ray.intersectsSphere(Ph)){Rh.copy(r).invert(),Lh.copy(i.ray).applyMatrix4(Rh);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(e.isBufferGeometry){const s=e.index,a=e.attributes.position;if(null!==s)for(let e=Math.max(0,o.start),t=Math.min(s.count,o.start+o.count);e<t;e++){const o=s.getX(e);zh.fromBufferAttribute(a,o),Ih(zh,o,l,r,i,n,this)}else for(let e=Math.max(0,o.start),t=Math.min(a.count,o.start+o.count);e<t;e++)zh.fromBufferAttribute(a,e),Ih(zh,e,l,r,i,n,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){const i=this.geometry;if(i.isBufferGeometry){var e=i.morphAttributes,t=Object.keys(e);if(0<t.length){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){var n=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{e=i.morphTargets;void 0!==e&&0<e.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function Ih(e,t,i,n,r,s,o){var a=Lh.distanceSqToPoint(e);if(a<i){const i=new De;Lh.closestPointToPoint(e,i),i.applyMatrix4(n);e=r.ray.origin.distanceTo(i);e<r.near||e>r.far||s.push({distance:e,distanceToRay:Math.sqrt(a),point:i,index:t,face:null,object:o})}}Dh.prototype.isPoints=!0;class Oh extends c{constructor(t,e,i,n,r,s,o,a,l){super(t,e,i,n,r,s,o,a,l),this.format=void 0!==o?o:pt,this.minFilter=void 0!==s?s:F,this.magFilter=void 0!==r?r:F,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(function e(){h.needsUpdate=!0,t.requestVideoFrameCallback(e)})}clone(){return new this.constructor(this.image).copy(this)}update(){var e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Oh.prototype.isVideoTexture=!0;class Nh extends c{constructor(e,t,i,n,r,s,o,a,l,h,c,u){super(null,s,o,a,l,h,n,r,c,u),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}Nh.prototype.isCompressedTexture=!0;class Bh extends c{constructor(e,t,i,n,r,s,o,a,l){super(e,t,i,n,r,s,o,a,l),this.needsUpdate=!0}}Bh.prototype.isCanvasTexture=!0;class Fh extends c{constructor(e,t,i,n,r,s,o,a,l,h){if((h=void 0!==h?h:vt)!==vt&&h!==yt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,n,r,s,o,a,h,i=void 0===(i=void 0===i&&h===vt?nt:i)&&h===yt?ut:i,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:Re,this.minFilter=void 0!==a?a:Re,this.flipY=!1,this.generateMipmaps=!1}}Fh.prototype.isDepthTexture=!0;class Hh extends _{constructor(i=1,n=8,r=0,s=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:i,segments:n,thetaStart:r,thetaLength:s},n=Math.max(3,n);var t=[],o=[],a=[],l=[],h=new De,c=new W;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let e=0,t=3;e<=n;e++,t+=3){var u=r+e/n*s;h.x=i*Math.cos(u),h.y=i*Math.sin(u),o.push(h.x,h.y,h.z),a.push(0,0,1),c.x=(o[t]/i+1)/2,c.y=(o[t+1]/i+1)/2,l.push(c.x,c.y)}for(let e=1;e<=n;e++)t.push(e,e+1,0);this.setIndex(t),this.setAttribute("position",new k(o,3)),this.setAttribute("normal",new k(a,3)),this.setAttribute("uv",new k(l,2))}static fromJSON(e){return new Hh(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Uh extends _{constructor(h=1,c=1,n=1,u=8,r=1,e=!1,d=0,p=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:h,radiusBottom:c,height:n,radialSegments:u,heightSegments:r,openEnded:e,thetaStart:d,thetaLength:p};const m=this,f=(u=Math.floor(u),r=Math.floor(r),[]),g=[],v=[],y=[];let x=0;const s=[],w=n/2;let b=0;function t(t){const i=x,n=new W,r=new De;let s=0;var o=!0===t?h:c,a=!0===t?1:-1;for(let e=1;e<=u;e++)g.push(0,w*a,0),v.push(0,a,0),y.push(.5,.5),x++;var l=x;for(let e=0;e<=u;e++){const c=e/u*p+d,t=Math.cos(c),i=Math.sin(c);r.x=o*i,r.y=w*a,r.z=o*t,g.push(r.x,r.y,r.z),v.push(0,a,0),n.x=.5*t+.5,n.y=.5*i*a+.5,y.push(n.x,n.y),x++}for(let e=0;e<u;e++){const c=i+e,u=l+e;!0===t?f.push(u,u+1,c):f.push(u+1,u,c),s+=3}m.addGroup(b,s,!0===t?1:2),b+=s}{const a=new De,l=new De;let i=0;var o=(c-h)/n;for(let e=0;e<=r;e++){const f=[],b=e/r,t=b*(c-h)+h;for(let e=0;e<=u;e++){const c=e/u,r=c*p+d,m=Math.sin(r),s=Math.cos(r);l.x=t*m,l.y=-b*n+w,l.z=t*s,g.push(l.x,l.y,l.z),a.set(m,o,s).normalize(),v.push(a.x,a.y,a.z),y.push(c,1-b),f.push(x++)}s.push(f)}for(let t=0;t<u;t++)for(let e=0;e<r;e++){const n=s[e][t],u=s[e+1][t],r=s[e+1][t+1],a=s[e][t+1];f.push(n,u,a),f.push(u,r,a),i+=6}m.addGroup(b,i,0),b+=i}!1===e&&(0<h&&t(!0),0<c)&&t(!1),this.setIndex(f),this.setAttribute("position",new k(g,3)),this.setAttribute("normal",new k(v,3)),this.setAttribute("uv",new k(y,2))}static fromJSON(e){return new Uh(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Gh extends Uh{constructor(e=1,t=1,i=8,n=1,r=!1,s=0,o=2*Math.PI){super(0,e,t,i,n,r,s,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:s,thetaLength:o}}static fromJSON(e){return new Gh(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Wh extends _{constructor(i=[],t=[],e=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:i,indices:t,radius:e,detail:n};const r=[],s=[];function o(e){r.push(e.x,e.y,e.z)}function a(e,t){e*=3;t.x=i[0+e],t.y=i[1+e],t.z=i[2+e]}function l(e,t,i,n){n<0&&1===e.x&&(s[t]=e.x-1),0===i.x&&0===i.z&&(s[t]=n/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}var c=n,u=new De,d=new De,p=new De;for(let e=0;e<t.length;e+=3){a(t[e+0],u),a(t[e+1],d),a(t[e+2],p);{m=void 0;f=void 0;g=void 0;v=void 0;y=void 0;x=void 0;var m=u;var f=d;var g=p;var v=c;var y=v+1,x=[];for(let t=0;t<=y;t++){x[t]=[];const I=m.clone().lerp(g,t/y),o=f.clone().lerp(g,t/y),O=y-t;for(let e=0;e<=O;e++)x[t][e]=0===e&&t===y?I:I.clone().lerp(o,e/O)}for(let t=0;t<y;t++)for(let e=0;e<2*(y-t)-1;e++){const g=Math.floor(e/2);e%2==0?(o(x[t][g+1]),o(x[t+1][g]),o(x[t][g])):(o(x[t][g+1]),o(x[t+1][g+1]),o(x[t+1][g]))}}}var w=e,b=new De;for(let e=0;e<r.length;e+=3)b.x=r[e+0],b.y=r[e+1],b.z=r[e+2],b.normalize().multiplyScalar(w),r[e+0]=b.x,r[e+1]=b.y,r[e+2]=b.z;var M=new De;for(let e=0;e<r.length;e+=3){M.x=r[e+0],M.y=r[e+1],M.z=r[e+2];var N=h(M)/2/Math.PI+.5,B=Math.atan2(-M.y,Math.sqrt(M.x*M.x+M.z*M.z))/Math.PI+.5;s.push(N,1-B)}var _=new De,S=new De,T=new De,E=new De,A=new W,C=new W,R=new W;for(let e=0,t=0;e<r.length;e+=9,t+=6){_.set(r[e+0],r[e+1],r[e+2]),S.set(r[e+3],r[e+4],r[e+5]),T.set(r[e+6],r[e+7],r[e+8]),A.set(s[t+0],s[t+1]),C.set(s[t+2],s[t+3]),R.set(s[t+4],s[t+5]),E.copy(_).add(S).add(T).divideScalar(3);var L=h(E);l(A,t+0,_,L),l(C,t+2,S,L),l(R,t+4,T,L)}for(let e=0;e<s.length;e+=6){var P=s[e+0],z=s[e+2],D=s[e+4],F=Math.max(P,z,D),H=Math.min(P,z,D);.9<F&&H<.1&&(P<.2&&(s[e+0]+=1),z<.2&&(s[e+2]+=1),D<.2)&&(s[e+4]+=1)}this.setAttribute("position",new k(r,3)),this.setAttribute("normal",new k(r.slice(),3)),this.setAttribute("uv",new k(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new Wh(e.vertices,e.indices,e.radius,e.details)}}class kh extends Wh{constructor(e=1,t=0){var i=(1+Math.sqrt(5))/2,n=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new kh(e.radius,e.detail)}}const Vh=new De,jh=new De,Xh=new De,qh=new p;class Yh extends _{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){var i=Math.pow(10,4),n=Math.cos(dn*t),r=e.getIndex(),s=e.getAttribute("position"),o=(r||s).count,a=[0,0,0],l=["a","b","c"],h=new Array(3),c={},u=[];for(let e=0;e<o;e+=3){r?(a[0]=r.getX(e),a[1]=r.getX(e+1),a[2]=r.getX(e+2)):(a[0]=e,a[1]=e+1,a[2]=e+2);const{a:t,b:d,c:p}=qh;if(t.fromBufferAttribute(s,a[0]),d.fromBufferAttribute(s,a[1]),p.fromBufferAttribute(s,a[2]),qh.getNormal(Xh),h[0]=`${Math.round(t.x*i)},${Math.round(t.y*i)},`+Math.round(t.z*i),h[1]=`${Math.round(d.x*i)},${Math.round(d.y*i)},`+Math.round(d.z*i),h[2]=`${Math.round(p.x*i)},${Math.round(p.y*i)},`+Math.round(p.z*i),h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let e=0;e<3;e++){const t=(e+1)%3,m=h[e],f=h[t],g=qh[l[e]],v=qh[l[t]],y=m+"_"+f,x=f+"_"+m;x in c&&c[x]?(Xh.dot(c[x].normal)<=n&&(u.push(g.x,g.y,g.z),u.push(v.x,v.y,v.z)),c[x]=null):y in c||(c[y]={index0:a[e],index1:a[t],normal:Xh.clone()})}}for(const e in c)if(c[e]){const{index0:t,index1:w}=c[e];Vh.fromBufferAttribute(s,t),jh.fromBufferAttribute(s,w),u.push(Vh.x,Vh.y,Vh.z),u.push(jh.x,jh.y,jh.z)}this.setAttribute("position",new k(u,3))}}}class Jh{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){e=this.getUtoTmapping(e);return this.getPoint(e,t)}getPoints(t=5){var i=[];for(let e=0;e<=t;e++)i.push(this.getPoint(e/t));return i}getSpacedPoints(t=5){var i=[];for(let e=0;e<=t;e++)i.push(this.getPointAt(e/t));return i}getLength(){var e=this.getLengths();return e[e.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var i=[];let n,r=this.getPoint(0),s=0;i.push(0);for(let e=1;e<=t;e++)n=this.getPoint(e/t),s+=n.distanceTo(r),i.push(s),r=n;return this.cacheArcLengths=i}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){var i=this.getLengths();let n=0;var r=i.length,s=t||e*i[r-1];let o,a=0,l=r-1;for(;a<=l;)if((o=i[n=Math.floor(a+(l-a)/2)]-s)<0)a=n+1;else{if(!(0<o)){l=n;break}l=n-1}return i[n=l]===s?n/(r-1):(t=i[n],(n+(s-t)/(i[n+1]-t))/(r-1))}getTangent(e,t){let i=e-1e-4,n=e+1e-4;i<0&&(i=0),1<n&&(n=1);var e=this.getPoint(i),r=this.getPoint(n),t=t||new(e.isVector2?W:De);return t.copy(r).sub(e).normalize(),t}getTangentAt(e,t){e=this.getUtoTmapping(e);return this.getTangent(e,t)}computeFrenetFrames(i,e){const t=new De,n=[],r=[],s=[],o=new De,a=new Ie;for(let e=0;e<=i;e++){const t=e/i;n[e]=this.getTangentAt(t,new De)}r[0]=new De,s[0]=new De;let l=Number.MAX_VALUE;var h=Math.abs(n[0].x),c=Math.abs(n[0].y),u=Math.abs(n[0].z);h<=l&&(l=h,t.set(1,0,0)),c<=l&&(l=c,t.set(0,1,0)),u<=l&&t.set(0,0,1),o.crossVectors(n[0],t).normalize(),r[0].crossVectors(n[0],o),s[0].crossVectors(n[0],r[0]);for(let e=1;e<=i;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(n[e-1],n[e]),o.length()>Number.EPSILON){o.normalize();const i=Math.acos(gn(n[e-1].dot(n[e]),-1,1));r[e].applyMatrix4(a.makeRotationAxis(o,i))}s[e].crossVectors(n[e],r[e])}if(!0===e){let t=Math.acos(gn(r[0].dot(r[i]),-1,1));t/=i,0<n[0].dot(o.crossVectors(r[0],r[i]))&&(t=-t);for(let e=1;e<=i;e++)r[e].applyMatrix4(a.makeRotationAxis(n[e],t*e)),s[e].crossVectors(n[e],r[e])}return{tangents:n,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Zh extends Jh{constructor(e=0,t=0,i=1,n=1,r=0,s=2*Math.PI,o=!1,a=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(e,t){const i=t||new W,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;for(t=Math.abs(r)<Number.EPSILON;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=t?0:n),!0!==this.aClockwise||t||(r===n?r=-n:r-=n);t=this.aStartAngle+e*r;let s=this.aX+this.xRadius*Math.cos(t),o=this.aY+this.yRadius*Math.sin(t);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),i=s-this.aX,n=o-this.aY;s=i*e-n*t+this.aX,o=i*t+n*e+this.aY}return i.set(s,o)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){var e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}Zh.prototype.isEllipseCurve=!0;class Qh extends Zh{constructor(e,t,i,n,r,s){super(e,t,i,i,n,r,s),this.type="ArcCurve"}}function Kh(){let r=0,s=0,o=0,a=0;function l(e,t,i,n){r=e,s=i,o=-3*e+3*t-2*i-n,a=2*e-2*t+i+n}return{initCatmullRom:function(e,t,i,n,r){l(t,i,r*(i-e),r*(n-t))},initNonuniformCatmullRom:function(e,t,i,n,r,s,o){e=(t-e)/r-(i-e)/(r+s)+(i-t)/s,r=(i-t)/s-(n-t)/(s+o)+(n-i)/o;l(t,i,e*=s,r*=s)},calc:function(e){var t=e*e;return r+s*e+o*t+a*(t*e)}}}Qh.prototype.isArcCurve=!0;const $h=new De,ec=new Kh,tc=new Kh,ic=new Kh;class nc extends Jh{constructor(e=[],t=!1,i="centripetal",n=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=n}getPoint(n,e=new De){var t=this.points,i=t.length,n=(i-(this.closed?0:1))*n;let r,s,o=Math.floor(n),a=n-o;this.closed?o+=0<o?0:(Math.floor(Math.abs(o)/i)+1)*i:0===a&&o===i-1&&(o=i-2,a=1),r=this.closed||0<o?t[(o-1)%i]:($h.subVectors(t[0],t[1]).add(t[0]),$h);var l=t[o%i],h=t[(o+1)%i];if(s=this.closed||o+2<i?t[(o+2)%i]:($h.subVectors(t[i-1],t[i-2]).add(t[i-1]),$h),"centripetal"===this.curveType||"chordal"===this.curveType){const n="chordal"===this.curveType?.5:.25;let e=Math.pow(r.distanceToSquared(l),n),t=Math.pow(l.distanceToSquared(h),n),i=Math.pow(h.distanceToSquared(s),n);t<1e-4&&(t=1),e<1e-4&&(e=t),i<1e-4&&(i=t),ec.initNonuniformCatmullRom(r.x,l.x,h.x,s.x,e,t,i),tc.initNonuniformCatmullRom(r.y,l.y,h.y,s.y,e,t,i),ic.initNonuniformCatmullRom(r.z,l.z,h.z,s.z,e,t,i)}else"catmullrom"===this.curveType&&(ec.initCatmullRom(r.x,l.x,h.x,s.x,this.tension),tc.initCatmullRom(r.y,l.y,h.y,s.y,this.tension),ic.initCatmullRom(r.z,l.z,h.z,s.z,this.tension));return e.set(ec.calc(a),tc.calc(a),ic.calc(a)),e}copy(i){super.copy(i),this.points=[];for(let e=0,t=i.points.length;e<t;e++){var n=i.points[e];this.points.push(n.clone())}return this.closed=i.closed,this.curveType=i.curveType,this.tension=i.tension,this}toJSON(){var i=super.toJSON();i.points=[];for(let e=0,t=this.points.length;e<t;e++){var n=this.points[e];i.points.push(n.toArray())}return i.closed=this.closed,i.curveType=this.curveType,i.tension=this.tension,i}fromJSON(i){super.fromJSON(i),this.points=[];for(let e=0,t=i.points.length;e<t;e++){var n=i.points[e];this.points.push((new De).fromArray(n))}return this.closed=i.closed,this.curveType=i.curveType,this.tension=i.tension,this}}function rc(e,t,i,n,r){var t=.5*(n-t),r=.5*(r-i),s=e*e;return e*s*(2*i-2*n+t+r)+(-3*i+3*n-2*t-r)*s+t*e+i}function sc(e,t,i,n){return(r=1-e)*r*t+2*(1-e)*e*i+e*e*n;var r}function oc(e,t,i,n,r){return(s=1-e)*s*s*t+3*(s=1-e)*s*e*i+3*(1-e)*e*e*n+e*e*e*r;var s}nc.prototype.isCatmullRomCurve3=!0;class ac extends Jh{constructor(e=new W,t=new W,i=new W,n=new W){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e,t=new W){var i=this.v0,n=this.v1,r=this.v2,s=this.v3;return t.set(oc(e,i.x,n.x,r.x,s.x),oc(e,i.y,n.y,r.y,s.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){var e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}ac.prototype.isCubicBezierCurve=!0;class lc extends Jh{constructor(e=new De,t=new De,i=new De,n=new De){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e,t=new De){var i=this.v0,n=this.v1,r=this.v2,s=this.v3;return t.set(oc(e,i.x,n.x,r.x,s.x),oc(e,i.y,n.y,r.y,s.y),oc(e,i.z,n.z,r.z,s.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){var e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}lc.prototype.isCubicBezierCurve3=!0;class hc extends Jh{constructor(e=new W,t=new W){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new W){return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){t=t||new W;return t.copy(this.v2).sub(this.v1).normalize(),t}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){var e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}hc.prototype.isLineCurve=!0;class cc extends Jh{constructor(e=new De,t=new De){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new De){return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){var e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class uc extends Jh{constructor(e=new W,t=new W,i=new W){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new W){var i=this.v0,n=this.v1,r=this.v2;return t.set(sc(e,i.x,n.x,r.x),sc(e,i.y,n.y,r.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){var e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}uc.prototype.isQuadraticBezierCurve=!0;class dc extends Jh{constructor(e=new De,t=new De,i=new De){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new De){var i=this.v0,n=this.v1,r=this.v2;return t.set(sc(e,i.x,n.x,r.x),sc(e,i.y,n.y,r.y),sc(e,i.z,n.z,r.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){var e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}dc.prototype.isQuadraticBezierCurve3=!0;class pc extends Jh{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new W){var i=this.points,e=(i.length-1)*e,n=Math.floor(e),e=e-n,r=i[0===n?n:n-1],s=i[n],o=i[n>i.length-2?i.length-1:n+1],i=i[n>i.length-3?i.length-1:n+2];return t.set(rc(e,r.x,s.x,o.x,i.x),rc(e,r.y,s.y,o.y,i.y)),t}copy(i){super.copy(i),this.points=[];for(let e=0,t=i.points.length;e<t;e++){var n=i.points[e];this.points.push(n.clone())}return this}toJSON(){var i=super.toJSON();i.points=[];for(let e=0,t=this.points.length;e<t;e++){var n=this.points[e];i.points.push(n.toArray())}return i}fromJSON(i){super.fromJSON(i),this.points=[];for(let e=0,t=i.points.length;e<t;e++){var n=i.points[e];this.points.push((new W).fromArray(n))}return this}}pc.prototype.isSplineCurve=!0;var mc=Object.freeze({__proto__:null,ArcCurve:Qh,CatmullRomCurve3:nc,CubicBezierCurve:ac,CubicBezierCurve3:lc,EllipseCurve:Zh,LineCurve:hc,LineCurve3:cc,QuadraticBezierCurve:uc,QuadraticBezierCurve3:dc,SplineCurve:pc});class fc extends Jh{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new hc(t,e))}getPoint(e,t){var i=e*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=i){const e=n[r]-i,s=this.curves[r],o=s.getLength(),a=0===o?0:1-e/o;return s.getPointAt(a,t)}r++}return null}getLength(){var e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;var i=[];let n=0;for(let e=0,t=this.curves.length;e<t;e++)n+=this.curves[e].getLength(),i.push(n);return this.cacheLengths=i}getSpacedPoints(t=40){var i=[];for(let e=0;e<=t;e++)i.push(this.getPoint(e/t));return this.autoClose&&i.push(i[0]),i}getPoints(i=12){var n=[];let r;for(let e=0,t=this.curves;e<t.length;e++){var s=t[e],o=s&&s.isEllipseCurve?2*i:s&&(s.isLineCurve||s.isLineCurve3)?1:s&&s.isSplineCurve?i*s.points.length:i,a=s.getPoints(o);for(let e=0;e<a.length;e++){var l=a[e];r&&r.equals(l)||(n.push(l),r=l)}}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(i){super.copy(i),this.curves=[];for(let e=0,t=i.curves.length;e<t;e++){var n=i.curves[e];this.curves.push(n.clone())}return this.autoClose=i.autoClose,this}toJSON(){var i=super.toJSON();i.autoClose=this.autoClose,i.curves=[];for(let e=0,t=this.curves.length;e<t;e++){var n=this.curves[e];i.curves.push(n.toJSON())}return i}fromJSON(i){super.fromJSON(i),this.autoClose=i.autoClose,this.curves=[];for(let e=0,t=i.curves.length;e<t;e++){var n=i.curves[e];this.curves.push((new mc[n.type]).fromJSON(n))}return this}}class gc extends fc{constructor(e){super(),this.type="Path",this.currentPoint=new W,e&&this.setFromPoints(e)}setFromPoints(i){this.moveTo(i[0].x,i[0].y);for(let e=1,t=i.length;e<t;e++)this.lineTo(i[e].x,i[e].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){var i=new hc(this.currentPoint.clone(),new W(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,n){e=new uc(this.currentPoint.clone(),new W(e,t),new W(i,n));return this.curves.push(e),this.currentPoint.set(i,n),this}bezierCurveTo(e,t,i,n,r,s){e=new ac(this.currentPoint.clone(),new W(e,t),new W(i,n),new W(r,s));return this.curves.push(e),this.currentPoint.set(r,s),this}splineThru(e){var t=[this.currentPoint.clone()].concat(e),t=new pc(t);return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,n,r,s){var o=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(e+o,t+a,i,n,r,s),this}absarc(e,t,i,n,r,s){return this.absellipse(e,t,i,i,n,r,s),this}ellipse(e,t,i,n,r,s,o,a){var l=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+l,t+h,i,n,r,s,o,a),this}absellipse(e,t,i,n,r,s,o,a){t=new Zh(e,t,i,n,r,s,o,a);if(0<this.curves.length){const e=t.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(t);e=t.getPoint(1);return this.currentPoint.copy(e),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){var e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class vc extends gc{constructor(e){super(e),this.uuid=fn(),this.type="Shape",this.holes=[]}getPointsHoles(i){var n=[];for(let e=0,t=this.holes.length;e<t;e++)n[e]=this.holes[e].getPoints(i);return n}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(i){super.copy(i),this.holes=[];for(let e=0,t=i.holes.length;e<t;e++){var n=i.holes[e];this.holes.push(n.clone())}return this}toJSON(){var i=super.toJSON();i.uuid=this.uuid,i.holes=[];for(let e=0,t=this.holes.length;e<t;e++){var n=this.holes[e];i.holes.push(n.toJSON())}return i}fromJSON(i){super.fromJSON(i),this.uuid=i.uuid,this.holes=[];for(let e=0,t=i.holes.length;e<t;e++){var n=i.holes[e];this.holes.push((new gc).fromJSON(n))}return this}}function yc(a,l,h=2){var c=l&&l.length,u=c?l[0]*h:a.length;let d=xc(a,0,u,h,!0);var p=[];if(d&&d.next!==d.prev){let t,i,n,r,s,o,e;if(c&&(d=function(e,t,i,n){var r,s,o=[];let a,l,h,c,u;for(a=0,l=t.length;a<l;a++)h=t[a]*n,c=a<l-1?t[a+1]*n:e.length,(u=xc(e,h,c,n,!1))===u.next&&(u.steiner=!0),o.push(function(e){let t=e,i=e;for(;(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next,t!==e;);return i}(u));for(o.sort(Mc),a=0;a<o.length;a++)r=o[a],(s=function(i,e){let n=e;var r=i.x,s=i.y;let o,a=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){const i=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(i<=r&&i>a){if((a=i)===r){if(s===n.y)return n;if(s===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}}while((n=n.next)!==e);if(!o)return null;if(r!==a){var l,h,c=o,u=o.x,d=o.y;let e,t=1/0;for(n=o;r>=n.x&&n.x>=u&&r!==n.x&&Sc(s<d?r:a,s,u,d,s<d?a:r,s,n.x,n.y)&&(e=Math.abs(s-n.y)/(r-n.x),Rc(n,i))&&(e<t||e===t&&(n.x>o.x||n.x===o.x&&(l=o,h=n,f(l.prev,l,h.prev)<0)&&f(h.next,l,l.next)<0))&&(o=n,t=e),(n=n.next)!==c;);}return o}(r,s=i))&&(r=Lc(s,r),wc(s,s.next),wc(r,r.next)),i=wc(i,i.next);return i}(a,l,d,h)),a.length>80*h){t=n=a[0],i=r=a[1];for(let e=h;e<u;e+=h)s=a[e],o=a[e+1],s<t&&(t=s),o<i&&(i=o),s>n&&(n=s),o>r&&(r=o);e=0!==(e=Math.max(n-t,r-i))?1/e:0}bc(d,p,h,t,i,e)}return p}function xc(e,o,t,i,n){let r,s;if(n===0<function(i,n,r){let s=0;for(let e=o,t=n-r;e<n;e+=r)s+=(i[t]-i[e])*(i[e+1]+i[t+1]),t=e;return s}(e,t,i))for(r=o;r<t;r+=i)s=Pc(r,e[r],e[r+1],s);else for(r=t-i;r>=o;r-=i)s=Pc(r,e[r],e[r+1],s);return s&&Tc(s,s.next)&&(zc(s),s=s.next),s}function wc(e,t){if(!e)return e;t=t||e;let i,n=e;do{if(i=!1,n.steiner||!Tc(n,n.next)&&0!==f(n.prev,n,n.next))n=n.next;else{if(zc(n),(n=t=n.prev)===n.next)break;i=!0}}while(i||n!==t);return t}function bc(n,r,s,o,a,l,h){if(n){if(!h&&l){var c=n;var u=o;var d=a;var p=l;let h=c;for(;null===h.z&&(h.z=_c(h.x,h.y,u,d,p)),h.prevZ=h.prev,h.nextZ=h.next,(h=h.next)!==c;);h.prevZ.nextZ=null,h.prevZ=null;{var m=h;let e,t,i,n,r,s,o,a,l=1;do{for(t=m,m=null,r=null,s=0;t;){for(s++,i=t,o=0,e=0;e<l&&(o++,i=i.nextZ);e++);for(a=l;0<o||0<a&&i;)0!==o&&(0===a||!i||t.z<=i.z)?(t=(n=t).nextZ,o--):(i=(n=i).nextZ,a--),r?r.nextZ=n:m=n,n.prevZ=r,r=n;t=i}}while(r.nextZ=null,l*=2,1<s)}}let e,t,i=n;for(;n.prev!==n.next;)if(e=n.prev,t=n.next,l?function(e,t,i,n){var r=e.prev,s=e,o=e.next;if(0<=f(r,s,o))return;var a=(r.x<s.x?r.x<o.x?r:o:s.x<o.x?s:o).x,l=(r.y<s.y?r.y<o.y?r:o:s.y<o.y?s:o).y,h=(r.x>s.x?r.x>o.x?r:o:s.x>o.x?s:o).x,c=(r.y>s.y?r.y>o.y?r:o:s.y>o.y?s:o).y,u=_c(a,l,t,i,n),d=_c(h,c,t,i,n);let p=e.prevZ,m=e.nextZ;for(;p&&p.z>=u&&m&&m.z<=d;){if(p!==e.prev&&p!==e.next&&Sc(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&0<=f(p.prev,p,p.next))return;if(p=p.prevZ,m!==e.prev&&m!==e.next&&Sc(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&0<=f(m.prev,m,m.next))return;m=m.nextZ}for(;p&&p.z>=u;){if(p!==e.prev&&p!==e.next&&Sc(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&0<=f(p.prev,p,p.next))return;p=p.prevZ}for(;m&&m.z<=d;){if(m!==e.prev&&m!==e.next&&Sc(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&0<=f(m.prev,m,m.next))return;m=m.nextZ}return 1}(n,o,a,l):function(e){var t=e.prev,i=e,n=e.next;if(0<=f(t,i,n))return;let r=e.next.next;for(;r!==e.prev;){if(Sc(t.x,t.y,i.x,i.y,n.x,n.y,r.x,r.y)&&0<=f(r.prev,r,r.next))return;r=r.next}return 1}(n))r.push(e.i/s),r.push(n.i/s),r.push(t.i/s),zc(n),n=t.next,i=t.next;else if((n=t)===i){h?1===h?bc(n=function(e,t,i){let n=e;do{var r=n.prev,s=n.next.next;!Tc(r,s)&&Ec(r,n,n.next,s)&&Rc(r,s)&&Rc(s,r)&&(t.push(r.i/i),t.push(n.i/i),t.push(s.i/i),zc(n),zc(n.next),n=e=s),n=n.next}while(n!==e);return wc(n)}(wc(n),r,s),r,s,o,a,l,2):2===h&&function(e,t,i,n,r,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){var a;if(o.i!==e.i&&function(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&Ec(i,i.next,e,t))return 1}while((i=i.next)!==e)}(e,t)&&(Rc(e,t)&&Rc(t,e)&&function(e,t){let i=e,n=!1;for(var r=(e.x+t.x)/2,s=(e.y+t.y)/2;i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),(i=i.next)!==e;);return n}(e,t)&&(f(e.prev,e,t.prev)||f(e,t.prev,t))||Tc(e,t)&&0<f(e.prev,e,e.next)&&0<f(t.prev,t,t.next))}(o,e))return a=Lc(o,e),o=wc(o,o.next),a=wc(a,a.next),bc(o,t,i,n,r,s),bc(a,t,i,n,r,s);e=e.next}}while(o=o.next,o!==e)}(n,r,s,o,a,l):bc(wc(n),r,s,o,a,l,1);break}}}function Mc(e,t){return e.x-t.x}function _c(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Sc(e,t,i,n,r,s,o,a){return 0<=(r-o)*(t-a)-(e-o)*(s-a)&&0<=(e-o)*(n-a)-(i-o)*(t-a)&&0<=(i-o)*(s-a)-(r-o)*(n-a)}function f(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function Tc(e,t){return e.x===t.x&&e.y===t.y}function Ec(e,t,i,n){var r=Cc(f(e,t,i)),s=Cc(f(e,t,n)),o=Cc(f(i,n,e)),a=Cc(f(i,n,t));return r!==s&&o!==a||0===r&&Ac(e,i,t)||0===s&&Ac(e,n,t)||0===o&&Ac(i,e,n)||0===a&&Ac(i,t,n)}function Ac(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function Cc(e){return 0<e?1:e<0?-1:0}function Rc(e,t){return f(e.prev,e,e.next)<0?0<=f(e,t,e.next)&&0<=f(e,e.prev,t):f(e,t,e.prev)<0||f(e,e.next,t)<0}function Lc(e,t){var i=new Dc(e.i,e.x,e.y),n=new Dc(t.i,t.x,t.y),r=e.next,s=t.prev;return(e.next=t).prev=e,(i.next=r).prev=i,(n.next=i).prev=n,(s.next=n).prev=s,n}function Pc(e,t,i,n){e=new Dc(e,t,i);return n?(e.next=n.next,(e.prev=n).next.prev=e,n.next=e):(e.prev=e).next=e,e}function zc(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 Dc(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Ic{static area(i){var n=i.length;let r=0;for(let e=n-1,t=0;t<n;e=t++)r+=i[e].x*i[t].y-i[t].x*i[e].y;return.5*r}static isClockWise(e){return Ic.area(e)<0}static triangulateShape(e,t){var i=[],n=[],r=[];Oc(e),Nc(i,e);let s=e.length;t.forEach(Oc);for(let e=0;e<t.length;e++)n.push(s),s+=t[e].length,Nc(i,t[e]);var o=yc(i,n);for(let e=0;e<o.length;e+=3)r.push(o.slice(e,e+3));return r}}function Oc(e){var t=e.length;2<t&&e[t-1].equals(e[0])&&e.pop()}function Nc(t,i){for(let e=0;e<i.length;e++)t.push(i[e].x),t.push(i[e].y)}class Bc extends _{constructor(i=new vc([new W(.5,.5),new W(-.5,.5),new W(-.5,-.5),new W(.5,-.5)]),F={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:i,options:F},i=Array.isArray(i)?i:[i];const H=this,U=[],G=[];for(let e=0,t=i.length;e<t;e++)!function(e){const n=[],N=void 0!==F.curveSegments?F.curveSegments:12,u=void 0!==F.steps?F.steps:1;let i=void 0!==F.depth?F.depth:1,r=void 0===F.bevelEnabled||F.bevelEnabled,t=void 0!==F.bevelThickness?F.bevelThickness:.2,s=void 0!==F.bevelSize?F.bevelSize:t-.1,o=void 0!==F.bevelOffset?F.bevelOffset:0,d=void 0!==F.bevelSegments?F.bevelSegments:3;const a=F.extrudePath,p=void 0!==F.UVGenerator?F.UVGenerator:Fc;void 0!==F.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),i=F.amount);let l,h,c,m,f,g=!1;a&&(l=a.getSpacedPoints(u),g=!0,r=!1,h=a.computeFrenetFrames(u,!1),c=new De,m=new De,f=new De),r||(d=0,t=0,s=0,o=0);e=e.extractPoints(N);let v=e.shape;const y=e.holes;if(!Ic.isClockWise(v)){v=v.reverse();for(let e=0,t=y.length;e<t;e++){const F=y[e];Ic.isClockWise(F)&&(y[e]=F.reverse())}}const x=Ic.triangulateShape(v,y),w=v;for(let e=0,t=y.length;e<t;e++){const F=y[e];v=v.concat(F)}function b(e,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(e)}const M=v.length,_=x.length;function S(e,t,i){let n,r,s;const o=e.x-t.x,a=e.y-t.y,l=i.x-e.x,h=i.y-e.y,c=o*o+a*a,u=o*h-a*l;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(c),d=Math.sqrt(l*l+h*h),p=t.x-a/u,m=t.y+o/u,f=((i.x-h/d-p)*h-(i.y+l/d-m)*l)/(o*h-a*l);n=p+o*f-e.x,r=m+a*f-e.y;t=n*n+r*r;if(t<=2)return new W(n,r);s=Math.sqrt(t/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(h)&&(e=!0),s=e?(n=-a,r=o,Math.sqrt(c)):(n=o,r=a,Math.sqrt(c/2))}return new W(n/s,r/s)}var T=[];for(let e=0,t=w.length,i=t-1,n=e+1;e<t;e++,i++,n++)i===t&&(i=0),n===t&&(n=0),T[e]=S(w[e],w[i],w[n]);var E=[];let A,C=T.concat();for(let e=0,t=y.length;e<t;e++){const F=y[e];A=[];for(let e=0,t=F.length,i=t-1,n=e+1;e<t;e++,i++,n++)i===t&&(i=0),n===t&&(n=0),A[e]=S(F[e],F[i],F[n]);E.push(A),C=C.concat(A)}for(let e=0;e<d;e++){const F=e/d,H=t*Math.cos(F*Math.PI/2),U=s*Math.sin(F*Math.PI/2)+o;for(let e=0,t=w.length;e<t;e++){const F=b(w[e],T[e],U);L(F.x,F.y,-H)}for(let e=0,t=y.length;e<t;e++){const F=y[e];A=E[e];for(let e=0,t=F.length;e<t;e++){const G=b(F[e],A[e],U);L(G.x,G.y,-H)}}}var R=s+o;for(let e=0;e<M;e++){const F=r?b(v[e],C[e],R):v[e];g?(m.copy(h.normals[0]).multiplyScalar(F.x),c.copy(h.binormals[0]).multiplyScalar(F.y),f.copy(l[0]).add(m).add(c),L(f.x,f.y,f.z)):L(F.x,F.y,0)}for(let t=1;t<=u;t++)for(let e=0;e<M;e++){const H=r?b(v[e],C[e],R):v[e];g?(m.copy(h.normals[t]).multiplyScalar(H.x),c.copy(h.binormals[t]).multiplyScalar(H.y),f.copy(l[t]).add(m).add(c),L(f.x,f.y,f.z)):L(H.x,H.y,i/u*t)}for(let e=d-1;0<=e;e--){const F=e/d,H=t*Math.cos(F*Math.PI/2),U=s*Math.sin(F*Math.PI/2)+o;for(let e=0,t=w.length;e<t;e++){const F=b(w[e],T[e],U);L(F.x,F.y,i+H)}for(let e=0,t=y.length;e<t;e++){const F=y[e];A=E[e];for(let e=0,t=F.length;e<t;e++){const G=b(F[e],A[e],U);g?L(G.x,G.y+l[u-1].y,l[u-1].x+H):L(G.x,G.y,i+H)}}}function B(e,n){let r=e.length;for(;0<=--r;){var s=r;let i=r-1;i<0&&(i=e.length-1);for(let e=0,t=u+2*d;e<t;e++){const r=M*e,c=M*(e+1);h=l=a=o=void 0;var o=n+s+r,a=n+i+r,l=n+i+c,h=n+s+c;z(o),z(a),z(h),z(a),z(l),z(h),o=U.length/3,D((a=p.generateSideWallUV(H,U,o-6,o-3,o-2,o-1))[0]),D(a[1]),D(a[3]),D(a[1]),D(a[2]),D(a[3])}}}function L(e,t,i){n.push(e),n.push(t),n.push(i)}function P(e,t,i){z(e),z(t),z(i);e=U.length/3,t=p.generateTopUV(H,U,e-3,e-2,e-1);D(t[0]),D(t[1]),D(t[2])}function z(e){U.push(n[3*e+0]),U.push(n[3*e+1]),U.push(n[3*e+2])}function D(e){G.push(e.x),G.push(e.y)}{e=U.length/3;if(r){let e=0,t=0*M;for(let e=0;e<_;e++){const H=x[e];P(H[2]+t,H[1]+t,H[0]+t)}e=u+2*d,t=M*e;for(let e=0;e<_;e++){const H=x[e];P(H[0]+t,H[1]+t,H[2]+t)}}else{for(let e=0;e<_;e++){var I=x[e];P(I[2],I[1],I[0])}for(let e=0;e<_;e++){var O=x[e];P(O[0]+M*u,O[1]+M*u,O[2]+M*u)}}H.addGroup(e,U.length/3-e,0)}{e=U.length/3;let i=0;B(w,i),i+=w.length;for(let e=0,t=y.length;e<t;e++){const H=y[e];B(H,i),i+=H.length}H.addGroup(e,U.length/3-e,1)}}(i[e]);this.setAttribute("position",new k(U,3)),this.setAttribute("uv",new k(G,2)),this.computeVertexNormals()}toJSON(){var e=super.toJSON(),i=this.parameters.shapes,t=this.parameters.options,n=e;if(n.shapes=[],Array.isArray(i))for(let e=0,t=i.length;e<t;e++){var r=i[e];n.shapes.push(r.uuid)}else n.shapes.push(i.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}static fromJSON(i,n){var r=[];for(let e=0,t=i.shapes.length;e<t;e++){var s=n[i.shapes[e]];r.push(s)}var e=i.options.extrudePath;return void 0!==e&&(i.options.extrudePath=(new mc[e.type]).fromJSON(e)),new Bc(r,i.options)}}const Fc={generateTopUV:function(e,t,i,n,r){var s=t[3*i],i=t[3*i+1],o=t[3*n],n=t[3*n+1],a=t[3*r],t=t[3*r+1];return[new W(s,i),new W(o,n),new W(a,t)]},generateSideWallUV:function(e,t,i,n,r,s){var o=t[3*i],a=t[3*i+1],i=t[3*i+2],l=t[3*n],h=t[3*n+1],n=t[3*n+2],c=t[3*r],u=t[3*r+1],r=t[3*r+2],d=t[3*s],p=t[3*s+1],t=t[3*s+2];return Math.abs(a-h)<Math.abs(o-l)?[new W(o,1-i),new W(l,1-n),new W(c,1-r),new W(d,1-t)]:[new W(a,1-i),new W(h,1-n),new W(u,1-r),new W(p,1-t)]}};class Hc extends Wh{constructor(e=1,t=0){var i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Hc(e.radius,e.detail)}}class Uc extends _{constructor(i=[new W(0,.5),new W(.5,0),new W(0,-.5)],n=12,r=0,s=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:i,segments:n,phiStart:r,phiLength:s},n=Math.floor(n),s=gn(s,0,2*Math.PI);const o=[],a=[],l=[],h=1/n,c=new De,u=new W;for(let t=0;t<=n;t++){var e=r+t*h*s,d=Math.sin(e),p=Math.cos(e);for(let e=0;e<=i.length-1;e++)c.x=i[e].x*d,c.y=i[e].y,c.z=i[e].x*p,a.push(c.x,c.y,c.z),u.x=t/n,u.y=e/(i.length-1),l.push(u.x,u.y)}for(let t=0;t<n;t++)for(let e=0;e<i.length-1;e++){const s=e+t*i.length,a=s,l=s+i.length,h=s+i.length+1,c=s+1;o.push(a,l,c),o.push(l,h,c)}if(this.setIndex(o),this.setAttribute("position",new k(a,3)),this.setAttribute("uv",new k(l,2)),this.computeVertexNormals(),s===2*Math.PI){const r=this.attributes.normal.array,s=new De,o=new De,a=new De,l=n*i.length*3;for(let e=0,t=0;e<i.length;e++,t+=3)s.x=r[t+0],s.y=r[t+1],s.z=r[t+2],o.x=r[l+t+0],o.y=r[l+t+1],o.z=r[l+t+2],a.addVectors(s,o).normalize(),r[t+0]=r[l+t+0]=a.x,r[t+1]=r[l+t+1]=a.y,r[t+2]=r[l+t+2]=a.z}}static fromJSON(e){return new Uc(e.points,e.segments,e.phiStart,e.phiLength)}}class Gc extends Wh{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Gc(e.radius,e.detail)}}class Wc extends _{constructor(e=.5,t=1,i=8,n=1,r=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:s},i=Math.max(3,i);const o=[],a=[],l=[],h=[];let c=e;var u=(t-e)/(n=Math.max(1,n)),d=new De,p=new W;for(let e=0;e<=n;e++){for(let e=0;e<=i;e++){const n=r+e/i*s;d.x=c*Math.cos(n),d.y=c*Math.sin(n),a.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/t+1)/2,p.y=(d.y/t+1)/2,h.push(p.x,p.y)}c+=u}for(let e=0;e<n;e++){const t=e*(i+1);for(let e=0;e<i;e++){const n=e+t,r=n,s=n+i+1,a=n+i+2,l=n+1;o.push(r,s,l),o.push(s,a,l)}}this.setIndex(o),this.setAttribute("position",new k(a,3)),this.setAttribute("normal",new k(l,3)),this.setAttribute("uv",new k(h,2))}static fromJSON(e){return new Wc(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class kc extends _{constructor(t=new vc([new W(0,.5),new W(-.5,-.5),new W(.5,-.5)]),o=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:o};const a=[],l=[],h=[],c=[];let i=0,u=0;if(!1===Array.isArray(t))n(t);else for(let e=0;e<t.length;e++)n(t[e]),this.addGroup(i,u,e),i+=u,u=0;function n(e){var i=l.length/3,e=e.extractPoints(o);let n=e.shape;var r=e.holes;!1===Ic.isClockWise(n)&&(n=n.reverse());for(let e=0,t=r.length;e<t;e++){const o=r[e];!0===Ic.isClockWise(o)&&(r[e]=o.reverse())}var s=Ic.triangulateShape(n,r);for(let e=0,t=r.length;e<t;e++){const o=r[e];n=n.concat(o)}for(let e=0,t=n.length;e<t;e++){const o=n[e];l.push(o.x,o.y,0),h.push(0,0,1),c.push(o.x,o.y)}for(let e=0,t=s.length;e<t;e++){const o=s[e],l=o[0]+i,h=o[1]+i,c=o[2]+i;a.push(l,h,c),u+=3}}this.setIndex(a),this.setAttribute("position",new k(l,3)),this.setAttribute("normal",new k(h,3)),this.setAttribute("uv",new k(c,2))}toJSON(){var e=super.toJSON(),i=this.parameters.shapes,n=e;if(n.shapes=[],Array.isArray(i))for(let e=0,t=i.length;e<t;e++){var r=i[e];n.shapes.push(r.uuid)}else n.shapes.push(i.uuid);return n}static fromJSON(i,n){var r=[];for(let e=0,t=i.shapes.length;e<t;e++){var s=n[i.shapes[e]];r.push(s)}return new kc(r,i.curveSegments)}}class Vc extends _{constructor(i=1,n=32,r=16,s=0,o=2*Math.PI,a=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:i,widthSegments:n,heightSegments:r,phiStart:s,phiLength:o,thetaStart:a,thetaLength:l},n=Math.max(3,Math.floor(n)),r=Math.max(2,Math.floor(r));const h=Math.min(a+l,Math.PI);let c=0;var u=[],d=new De,p=new De,m=[],f=[],g=[],v=[];for(let e=0;e<=r;e++){var y=[],x=e/r;let t=0;0==e&&0==a?t=.5/n:e==r&&h==Math.PI&&(t=-.5/n);for(let e=0;e<=n;e++){const h=e/n;d.x=-i*Math.cos(s+h*o)*Math.sin(a+x*l),d.y=i*Math.cos(a+x*l),d.z=i*Math.sin(s+h*o)*Math.sin(a+x*l),f.push(d.x,d.y,d.z),p.copy(d).normalize(),g.push(p.x,p.y,p.z),v.push(h+t,1-x),y.push(c++)}u.push(y)}for(let t=0;t<r;t++)for(let e=0;e<n;e++){const n=u[t][e+1],o=u[t][e],l=u[t+1][e],c=u[t+1][e+1];(0!==t||0<a)&&m.push(n,o,c),(t!==r-1||h<Math.PI)&&m.push(o,l,c)}this.setIndex(m),this.setAttribute("position",new k(f,3)),this.setAttribute("normal",new k(g,3)),this.setAttribute("uv",new k(v,2))}static fromJSON(e){return new Vc(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class jc extends Wh{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new jc(e.radius,e.detail)}}class Xc extends _{constructor(i=1,n=.4,r=8,s=6,o=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:i,tube:n,radialSegments:r,tubularSegments:s,arc:o},r=Math.floor(r),s=Math.floor(s);const a=[],l=[],h=[],c=[],u=new De,d=new De,p=new De;for(let t=0;t<=r;t++)for(let e=0;e<=s;e++){var m=e/s*o,f=t/r*Math.PI*2;d.x=(i+n*Math.cos(f))*Math.cos(m),d.y=(i+n*Math.cos(f))*Math.sin(m),d.z=n*Math.sin(f),l.push(d.x,d.y,d.z),u.x=i*Math.cos(m),u.y=i*Math.sin(m),p.subVectors(d,u).normalize(),h.push(p.x,p.y,p.z),c.push(e/s),c.push(t/r)}for(let t=1;t<=r;t++)for(let e=1;e<=s;e++){const r=(s+1)*t+e-1,o=(s+1)*(t-1)+e-1,l=(s+1)*(t-1)+e,h=(s+1)*t+e;a.push(r,o,h),a.push(o,l,h)}this.setIndex(a),this.setAttribute("position",new k(l,3)),this.setAttribute("normal",new k(h,3)),this.setAttribute("uv",new k(c,2))}static fromJSON(e){return new Xc(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class qc extends _{constructor(e=1,i=.4,n=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:i,tubularSegments:n,radialSegments:r,p:s,q:o},n=Math.floor(n),r=Math.floor(r);const a=[],l=[],h=[],c=[],u=new De,d=new De,p=new De,m=new De,f=new De,g=new De,v=new De;for(let t=0;t<=n;++t){var y=t/n*s*Math.PI*2;x(y,s,o,e,p),x(.01+y,s,o,e,m),g.subVectors(m,p),v.addVectors(m,p),f.crossVectors(g,v),v.crossVectors(f,g),f.normalize(),v.normalize();for(let e=0;e<=r;++e){const s=e/r*Math.PI*2,o=-i*Math.cos(s),m=i*Math.sin(s);u.x=p.x+(o*v.x+m*f.x),u.y=p.y+(o*v.y+m*f.y),u.z=p.z+(o*v.z+m*f.z),l.push(u.x,u.y,u.z),d.subVectors(u,p).normalize(),h.push(d.x,d.y,d.z),c.push(t/n),c.push(e/r)}}for(let t=1;t<=n;t++)for(let e=1;e<=r;e++){const n=(r+1)*(t-1)+(e-1),s=(r+1)*t+(e-1),o=(r+1)*t+e,l=(r+1)*(t-1)+e;a.push(n,s,l),a.push(s,o,l)}function x(e,t,i,n,r){var s=Math.cos(e),o=Math.sin(e),i=i/t*e,t=Math.cos(i);r.x=n*(2+t)*.5*s,r.y=n*(2+t)*o*.5,r.z=n*Math.sin(i)*.5}this.setIndex(a),this.setAttribute("position",new k(l,3)),this.setAttribute("normal",new k(h,3)),this.setAttribute("uv",new k(c,2))}static fromJSON(e){return new qc(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Yc extends _{constructor(e=new dc(new De(-1,-1,0),new De(-1,1,0),new De(1,1,0)),r=64,s=1,o=8,t=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:r,radius:s,radialSegments:o,closed:t};const a=e.computeFrenetFrames(r,t),l=(this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,new De),h=new De,i=new W;let c=new De;const u=[],d=[],n=[],p=[];function m(t){c=e.getPointAt(t/r,c);var i=a.normals[t],n=a.binormals[t];for(let e=0;e<=o;e++){const r=e/o*Math.PI*2,t=Math.sin(r),a=-Math.cos(r);h.x=a*i.x+t*n.x,h.y=a*i.y+t*n.y,h.z=a*i.z+t*n.z,h.normalize(),d.push(h.x,h.y,h.z),l.x=c.x+s*h.x,l.y=c.y+s*h.y,l.z=c.z+s*h.z,u.push(l.x,l.y,l.z)}}for(let e=0;e<r;e++)m(e);m(!1===t?r:0);for(let t=0;t<=r;t++)for(let e=0;e<=o;e++)i.x=t/r,i.y=e/o,n.push(i.x,i.y);for(let t=1;t<=r;t++)for(let e=1;e<=o;e++){var f=(o+1)*(t-1)+(e-1),g=(o+1)*t+(e-1),v=(o+1)*t+e,y=(o+1)*(t-1)+e;p.push(f,g,y),p.push(g,v,y)}this.setIndex(p),this.setAttribute("position",new k(u,3)),this.setAttribute("normal",new k(d,3)),this.setAttribute("uv",new k(n,2))}toJSON(){var e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Yc((new mc[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Jc extends _{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){var n=[],r=new Set,s=new De,o=new De;if(null!==e.index){var a=e.attributes.position,l=e.index;let i=e.groups;for(let e=0,t=(i=0===i.length?[{start:0,count:l.count,materialIndex:0}]:i).length;e<t;++e){var h=i[e],c=h.start;for(let t=c,e=c+h.count;t<e;t+=3)for(let e=0;e<3;e++){var u=l.getX(t+e),d=l.getX(t+(e+1)%3);s.fromBufferAttribute(a,u),o.fromBufferAttribute(a,d),!0===Zc(s,o,r)&&(n.push(s.x,s.y,s.z),n.push(o.x,o.y,o.z))}}}else{var i=e.attributes.position;for(let t=0,e=i.count/3;t<e;t++)for(let e=0;e<3;e++){var p=3*t+e,m=3*t+(e+1)%3;s.fromBufferAttribute(i,p),o.fromBufferAttribute(i,m),!0===Zc(s,o,r)&&(n.push(s.x,s.y,s.z),n.push(o.x,o.y,o.z))}}this.setAttribute("position",new k(n,3))}}}function Zc(e,t,i){var n=`${e.x},${e.y},${e.z}-${t.x},${t.y},`+t.z,t=`${t.x},${t.y},${t.z}-${e.x},${e.y},`+e.z;return!0!==i.has(n)&&!0!==i.has(t)&&(i.add(n,t),!0)}var Qc=Object.freeze({__proto__:null,BoxGeometry:Is,BoxBufferGeometry:Is,CircleGeometry:Hh,CircleBufferGeometry:Hh,ConeGeometry:Gh,ConeBufferGeometry:Gh,CylinderGeometry:Uh,CylinderBufferGeometry:Uh,DodecahedronGeometry:kh,DodecahedronBufferGeometry:kh,EdgesGeometry:Yh,ExtrudeGeometry:Bc,ExtrudeBufferGeometry:Bc,IcosahedronGeometry:Hc,IcosahedronBufferGeometry:Hc,LatheGeometry:Uc,LatheBufferGeometry:Uc,OctahedronGeometry:Gc,OctahedronBufferGeometry:Gc,PlaneGeometry:Ks,PlaneBufferGeometry:Ks,PolyhedronGeometry:Wh,PolyhedronBufferGeometry:Wh,RingGeometry:Wc,RingBufferGeometry:Wc,ShapeGeometry:kc,ShapeBufferGeometry:kc,SphereGeometry:Vc,SphereBufferGeometry:Vc,TetrahedronGeometry:jc,TetrahedronBufferGeometry:jc,TorusGeometry:Xc,TorusBufferGeometry:Xc,TorusKnotGeometry:qc,TorusKnotBufferGeometry:qc,TubeGeometry:Yc,TubeBufferGeometry:Yc,WireframeGeometry:Jc});class Kc extends i{constructor(e){super(),this.type="ShadowMaterial",this.color=new g(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Kc.prototype.isShadowMaterial=!0;class $c extends i{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new g(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 g(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ii,this.normalScale=new W(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.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}$c.prototype.isMeshStandardMaterial=!0;class eu extends $c{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new W(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return gn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.sheenColor=new g(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new g(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new g(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){0<this._sheen!=0<e&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){0<this._clearcoat!=0<e&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){0<this._transmission!=0<e&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}eu.prototype.isMeshPhysicalMaterial=!0;class tu extends i{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new g(16777215),this.specular=new g(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new g(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ii,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=O,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}tu.prototype.isMeshPhongMaterial=!0;class iu extends i{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new g(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new g(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ii,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}iu.prototype.isMeshToonMaterial=!0;class nu extends i{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ii,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}nu.prototype.isMeshNormalMaterial=!0;class ru extends i{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new g(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new g(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=O,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}ru.prototype.isMeshLambertMaterial=!0;class su extends i{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new g(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ii,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}}su.prototype.isMeshMatcapMaterial=!0;class ou extends y{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}ou.prototype.isLineDashedMaterial=!0;var au=Object.freeze({__proto__:null,ShadowMaterial:Kc,SpriteMaterial:Nl,RawShaderMaterial:ao,ShaderMaterial:Fs,PointsMaterial:Ch,MeshPhysicalMaterial:eu,MeshStandardMaterial:$c,MeshPhongMaterial:tu,MeshToonMaterial:iu,MeshNormalMaterial:nu,MeshLambertMaterial:ru,MeshDepthMaterial:yl,MeshDistanceMaterial:xl,MeshBasicMaterial:$r,MeshMatcapMaterial:su,LineDashedMaterial:ou,LineBasicMaterial:y,Material:i});const m={arraySlice:function(e,t,i){return m.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==i?i:e.length)):e.slice(t,i)},convertArray:function(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(i){var t=i.length,n=new Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort(function(e,t){return i[e]-i[t]}),n},sortedArray:function(i,n,r){const s=i.length,o=new i.constructor(s);for(let e=0,t=0;t!==s;++e){const s=r[e]*n;for(let e=0;e!==n;++e)o[t++]=i[s+e]}return o},flattenJSON:function(t,i,n,r){let s=1,o=t[0];for(;void 0!==o&&void 0===o[r];)o=t[s++];if(void 0!==o){let e=o[r];if(void 0!==e)if(Array.isArray(e))for(;void 0!==(e=o[r])&&(i.push(o.time),n.push.apply(n,e)),void 0!==(o=t[s++]););else if(void 0!==e.toArray)for(;void 0!==(e=o[r])&&(i.push(o.time),e.toArray(n,n.length)),void 0!==(o=t[s++]););else for(;void 0!==(e=o[r])&&(i.push(o.time),n.push(e)),void 0!==(o=t[s++]););}},subclip:function(e,i,n,r,s=30){const o=e.clone();o.name=i;var t=[];for(let e=0;e<o.tracks.length;++e){const i=o.tracks[e],a=i.getValueSize(),l=[],h=[];for(let t=0;t<i.times.length;++t){const o=i.times[t]*s;if(!(o<n||o>=r)){l.push(i.times[t]);for(let e=0;e<a;++e)h.push(i.values[t*a+e])}}0!==l.length&&(i.times=m.convertArray(l,i.times.constructor),i.values=m.convertArray(h,i.values.constructor),t.push(i))}o.tracks=t;let a=1/0;for(let e=0;e<o.tracks.length;++e)a>o.tracks[e].times[0]&&(a=o.tracks[e].times[0]);for(let e=0;e<o.tracks.length;++e)o.tracks[e].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(n,r=0,s=n,o=30){const a=s.tracks.length,l=r/(o=o<=0?30:o);for(let e=0;e<a;++e){const o=s.tracks[e],a=o.ValueTypeName;if("bool"!==a&&"string"!==a){var h=n.tracks.find(function(e){return e.name===o.name&&e.ValueTypeName===a});if(void 0!==h){let e=0;var c=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(e=c/3);let t=0;var u=h.getValueSize(),d=(h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(t=u/3),o.times.length-1);let i;if(l<=o.times[0]){const n=e,r=c-e;i=m.arraySlice(o.values,n,r)}else if(l>=o.times[d]){const n=d*c+e,r=n+c-e;i=m.arraySlice(o.values,n,r)}else{const n=o.createInterpolant(),r=e,s=c-e;n.evaluate(l),i=m.arraySlice(n.resultBuffer,r,s)}"quaternion"===a&&(new On).fromArray(i).normalize().conjugate().toArray(i);var p=h.times.length;for(let e=0;e<p;++e){const r=e*u+t;if("quaternion"===a)On.multiplyQuaternionsFlat(h.values,r,i,0,h.values,r);else{const n=u-2*t;for(let e=0;e<n;++e)h.values[r+e]-=i[e]}}}}}return n.blendMode=bi,n}};class lu{constructor(e,t,i,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){var i=this.parameterPositions;let n=this._cachedIndex,r=i[n],s=i[n-1];e:{t:{let e;i:{n:if(!(t<r)){for(var o=n+2;;){if(void 0===r){if(t<s)break n;return n=i.length,this._cachedIndex=n,this.afterEnd_(n-1,t,s)}if(n===o)break;if(s=r,t<(r=i[++n]))break t}e=i.length;break i}if(t>=s)break e;var a=i[1];t<a&&(n=2,s=a);for(var l=n-2;;){if(void 0===s)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===l)break;if(r=s,t>=(s=i[--n-1]))break t}e=n,n=0}for(;n<e;){const r=n+e>>>1;t<i[r]?e=r:n=1+r}if(r=i[n],void 0===(s=i[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return n=i.length,this._cachedIndex=n,this.afterEnd_(n-1,s,t)}this._cachedIndex=n,this.intervalChanged_(n,s,r)}return this.interpolate_(n,s,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){var t=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=e*n;for(let e=0;e!==n;++e)t[e]=i[r+e];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}lu.prototype.beforeStart_=lu.prototype.copySampleValue_,lu.prototype.afterEnd_=lu.prototype.copySampleValue_;class hu extends lu{constructor(e,t,i,n){super(e,t,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:vi,endingEnd:vi}}intervalChanged_(e,t,i){var n=this.parameterPositions;let r=e-2,s=e+1,o=n[r],a=n[s];if(void 0===o)switch(this.getSettings_().endingStart){case yi:r=e,o=2*t-i;break;case xi:r=n.length-2,o=t+n[r]-n[r+1];break;default:r=e,o=i}if(void 0===a)switch(this.getSettings_().endingEnd){case yi:s=e,a=2*i-t;break;case xi:s=1,a=i+n[1]-n[0];break;default:s=e-1,a=t}var l=.5*(i-t),h=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(a-i),this._offsetPrev=r*h,this._offsetNext=s*h}interpolate_(e,t,i,n){var r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=e*o,l=a-o,h=this._offsetPrev,c=this._offsetNext,e=this._weightPrev,u=this._weightNext,i=(i-t)/(n-t),n=i*i,t=n*i,d=-e*t+2*e*n-e*i,p=(1+e)*t+(-1.5-2*e)*n+(-.5+e)*i+1,m=(-1-u)*t+(1.5+u)*n+.5*i,f=u*t-u*n;for(let e=0;e!==o;++e)r[e]=d*s[h+e]+p*s[l+e]+m*s[a+e]+f*s[c+e];return r}}class cu extends lu{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){var r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=e*o,l=a-o,h=(i-t)/(n-t),c=1-h;for(let e=0;e!==o;++e)r[e]=s[l+e]*c+s[a+e]*h;return r}}class uu extends lu{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e){return this.copySampleValue_(e-1)}}class du{constructor(e,t,i,n){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=m.convertArray(t,this.TimeBufferType),this.values=m.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:m.convertArray(e.times,Array),values:m.convertArray(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(i.interpolation=t)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new uu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new cu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new hu(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case mi:t=this.InterpolantFactoryMethodDiscrete;break;case fi:t=this.InterpolantFactoryMethodLinear;break;case gi:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}console.warn("THREE.KeyframeTrack:",t)}else this.createInterpolant=t;return this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return mi;case this.InterpolantFactoryMethodLinear:return fi;case this.InterpolantFactoryMethodSmooth:return gi}}getValueSize(){return this.values.length/this.times.length}shift(i){if(0!==i){var n=this.times;for(let e=0,t=n.length;e!==t;++e)n[e]+=i}return this}scale(i){if(1!==i){var n=this.times;for(let e=0,t=n.length;e!==t;++e)n[e]*=i}return this}trim(e,t){var i=this.times,n=i.length;let r=0,s=n-1;for(;r!==n&&i[r]<e;)++r;for(;-1!==s&&i[s]>t;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);const e=this.getValueSize();this.times=m.arraySlice(i,r,s),this.values=m.arraySlice(this.values,r*e,s*e)}return this}validate(){let i=!0;var e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),i=!1);const n=this.times,r=this.values,t=n.length;0===t&&(console.error("THREE.KeyframeTrack: Track is empty.",this),i=!1);let s=null;for(let e=0;e!==t;e++){const r=n[e];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,r),i=!1;break}if(null!==s&&s>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,r,s),i=!1;break}s=r}if(void 0!==r&&m.isTypedArray(r))for(let e=0,t=r.length;e!==t;++e){const n=r[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),i=!1;break}}return i}optimize(){const i=m.arraySlice(this.times),n=m.arraySlice(this.values),r=this.getValueSize(),s=this.getInterpolation()===gi,o=i.length-1;let a=1;for(let e=1;e<o;++e){let t=!1;var l=i[e];if(l!==i[e+1]&&(1!==e||l!==i[0]))if(s)t=!0;else{const i=e*r,s=i-r,a=i+r;for(let e=0;e!==r;++e){const r=n[i+e];if(r!==n[s+e]||r!==n[a+e]){t=!0;break}}}if(t){if(e!==a){i[a]=i[e];const s=e*r,o=a*r;for(let e=0;e!==r;++e)n[o+e]=n[s+e]}++a}}if(0<o){i[a]=i[o];for(let e=o*r,t=a*r,i=0;i!==r;++i)n[t+i]=n[e+i];++a}return a!==i.length?(this.times=m.arraySlice(i,0,a),this.values=m.arraySlice(n,0,a*r)):(this.times=i,this.values=n),this}clone(){var e=m.arraySlice(this.times,0),t=m.arraySlice(this.values,0),e=new this.constructor(this.name,e,t);return e.createInterpolant=this.createInterpolant,e}}du.prototype.TimeBufferType=Float32Array,du.prototype.ValueBufferType=Float32Array,du.prototype.DefaultInterpolation=fi;class pu extends du{}pu.prototype.ValueTypeName="bool",pu.prototype.ValueBufferType=Array,pu.prototype.DefaultInterpolation=mi,pu.prototype.InterpolantFactoryMethodLinear=void 0,pu.prototype.InterpolantFactoryMethodSmooth=void 0;class mu extends du{}mu.prototype.ValueTypeName="color";class fu extends du{}fu.prototype.ValueTypeName="number";class gu extends lu{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){var r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(i-t)/(n-t);let l=e*o;for(var h=l+o;l!==h;l+=4)On.slerpFlat(r,0,s,l-o,s,l,a);return r}}class vu extends du{InterpolantFactoryMethodLinear(e){return new gu(this.times,this.values,this.getValueSize(),e)}}vu.prototype.ValueTypeName="quaternion",vu.prototype.DefaultInterpolation=fi,vu.prototype.InterpolantFactoryMethodSmooth=void 0;class yu extends du{}yu.prototype.ValueTypeName="string",yu.prototype.ValueBufferType=Array,yu.prototype.DefaultInterpolation=mi,yu.prototype.InterpolantFactoryMethodLinear=void 0,yu.prototype.InterpolantFactoryMethodSmooth=void 0;class xu extends du{}class wu{constructor(e,t=-1,i,n=wi){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=fn(),this.duration<0&&this.resetDuration()}static parse(e){var i=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,t=n.length;e!==t;++e)i.push(function(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return fu;case"vector":case"vector2":case"vector3":case"vector4":return xu;case"color":return mu;case"quaternion":return vu;case"bool":case"boolean":return pu;case"string":return yu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],i=[];m.flattenJSON(e.keys,t,i,"value"),e.times=t,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}(n[e]).scale(r));var t=new this(e.name,e.duration,i,e.blendMode);return t.uuid=e.uuid,t}static toJSON(e){var i=[],n=e.tracks,e={name:e.name,duration:e.duration,tracks:i,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,t=n.length;e!==t;++e)i.push(du.toJSON(n[e]));return e}static CreateFromMorphTargetSequence(e,n,r,s){var o=n.length,a=[];for(let i=0;i<o;i++){let e=[],t=[];e.push((i+o-1)%o,i,(i+1)%o),t.push(0,1,0);var l=m.getKeyframeOrder(e);e=m.sortedArray(e,1,l),t=m.sortedArray(t,1,l),s||0!==e[0]||(e.push(o),t.push(t[0])),a.push(new fu(".morphTargetInfluences["+n[i].name+"]",e,t).scale(1/r))}return new this(e,-1,a)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const t=e;i=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<i.length;e++)if(i[e].name===t)return i[e];return null}static CreateClipsFromMorphTargetSequences(i,e,n){var r={},s=/^([\w-]*?)([\d]+)$/;for(let e=0,t=i.length;e<t;e++){const n=i[e],o=n.name.match(s);if(o&&1<o.length){const i=o[1];let e=r[i];e||(r[i]=e=[]),e.push(n)}}const o=[];for(const i in r)o.push(this.CreateFromMorphTargetSequence(i,r[i],e,n));return o}static parseAnimation(i,t){if(!i)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,i,n,r){var s,o;0!==i.length&&(s=[],o=[],m.flattenJSON(i,s,o,n),0!==s.length)&&r.push(new e(t,s,o))},r=[],s=i.name||"default",o=i.fps||30,e=i.blendMode;let a=i.length||-1;var l=i.hierarchy||[];for(let e=0;e<l.length;e++){const s=l[e].keys;if(s&&0!==s.length)if(s[0].morphTargets){const i={};let t;for(t=0;t<s.length;t++)if(s[t].morphTargets)for(let e=0;e<s[t].morphTargets.length;e++)i[s[t].morphTargets[e]]=-1;for(const n in i){const i=[],o=[];for(let e=0;e!==s[t].morphTargets.length;++e){const r=s[t];i.push(r.time),o.push(r.morphTarget===n?1:0)}r.push(new fu(".morphTargetInfluence["+n+"]",i,o))}a=i.length*(o||1)}else{const o=".bones["+t[e].name+"]";n(xu,o+".position",s,"pos",r),n(vu,o+".quaternion",s,"rot",r),n(xu,o+".scale",s,"scl",r)}}return 0===r.length?null:new this(s,a,r,e)}resetDuration(){let i=0;for(let e=0,t=this.tracks.length;e!==t;++e){var n=this.tracks[e];i=Math.max(i,n.times[n.times.length-1])}return this.duration=i,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){var t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}const bu={enabled:!(xu.prototype.ValueTypeName="vector"),files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class Mu{constructor(e,t,i){const n=this;let r=!1,s=0,o=0,a=void 0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){o++,!1===r&&void 0!==n.onStart&&n.onStart(e,s,o),r=!0},this.itemEnd=function(e){s++,void 0!==n.onProgress&&n.onProgress(e,s,o),s===o&&(r=!1,void 0!==n.onLoad)&&n.onLoad()},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return a?a(e):e},this.setURLModifier=function(e){return a=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){e=l.indexOf(e);return-1!==e&&l.splice(e,2),this},this.getHandler=function(i){for(let e=0,t=l.length;e<t;e+=2){var n=l[e],r=l[e+1];if(n.global&&(n.lastIndex=0),n.test(i))return r}return null}}}const _u=new Mu;class Su{constructor(e){this.manager=void 0!==e?e:_u,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(i,n){const r=this;return new Promise(function(e,t){r.load(i,e,n,t)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Tu={};class Eu extends Su{constructor(e){super(e)}load(l,e,t,i){void 0===l&&(l=""),void 0!==this.path&&(l=this.path+l),l=this.manager.resolveURL(l);const n=bu.get(l);if(void 0!==n)return this.manager.itemStart(l),setTimeout(()=>{e&&e(n),this.manager.itemEnd(l)},0),n;void 0!==Tu[l]?Tu[l].push({onLoad:e,onProgress:t,onError:i}):(Tu[l]=[],Tu[l].push({onLoad:e,onProgress:t,onError:i}),t=new Request(l,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),fetch(t).then(e=>{if(200!==e.status&&0!==e.status)throw Error(`fetch for "${e.url}" responded with ${e.status}: `+e.statusText);{0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");const s=Tu[l],i=e.body.getReader(),t=e.headers.get("Content-Length"),o=t?parseInt(t):0,a=0!==o;let r=0;return new ReadableStream({start(t){!function n(){i.read().then(({done:i,value:e})=>{if(i)t.close();else{r+=e.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:r,total:o});for(let e=0,t=s.length;e<t;e++){const n=s[e];n.onProgress&&n.onProgress(i)}t.enqueue(e),n()}})}()}})}}).then(e=>{var t=new Response(e);switch(this.responseType){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(e=>(new DOMParser).parseFromString(e,this.mimeType));case"json":return t.json();default:return t.text()}}).then(i=>{bu.add(l,i);var n=Tu[l];delete Tu[l];for(let e=0,t=n.length;e<t;e++){var r=n[e];r.onLoad&&r.onLoad(i)}this.manager.itemEnd(l)}).catch(i=>{var n=Tu[l];delete Tu[l];for(let e=0,t=n.length;e<t;e++){var r=n[e];r.onError&&r.onError(i)}this.manager.itemError(l),this.manager.itemEnd(l)}),this.manager.itemStart(l))}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Au extends Su{constructor(e){super(e)}load(t,i,e,n){const r=this,s=new Eu(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(e){try{i(r.parse(JSON.parse(e)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},e,n)}parse(t){var i=[];for(let e=0;e<t.length;e++){var n=wu.parse(t[e]);i.push(n)}return i}}class Cu extends Su{constructor(e){super(e)}load(i,n,r,s){const o=this,a=[],l=new Nh,h=new Eu(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(o.withCredentials);let c=0;if(Array.isArray(i))for(let e=0,t=i.length;e<t;++e)!function(t){h.load(i[t],function(e){e=o.parse(e,!0);a[t]={width:e.width,height:e.height,format:e.format,mipmaps:e.mipmaps},6===(c+=1)&&(1===e.mipmapCount&&(l.minFilter=F),l.image=a,l.format=e.format,l.needsUpdate=!0,n)&&n(l)},r,s)}(e);else h.load(i,function(e){var i=o.parse(e,!0);if(i.isCubemap){const e=i.mipmaps.length/i.mipmapCount;for(let t=0;t<e;t++){a[t]={mipmaps:[]};for(let e=0;e<i.mipmapCount;e++)a[t].mipmaps.push(i.mipmaps[t*i.mipmapCount+e]),a[t].format=i.format,a[t].width=i.width,a[t].height=i.height}l.image=a}else l.image.width=i.width,l.image.height=i.height,l.mipmaps=i.mipmaps;1===i.mipmapCount&&(l.minFilter=F),l.format=i.format,l.needsUpdate=!0,n&&n(l)},r,s);return l}}class Ru extends Su{constructor(e){super(e)}load(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=bu.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout(function(){e&&e(s),r.manager.itemEnd(t)},0),s;const o=En("img");function a(){h(),bu.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){h(),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}function h(){o.removeEventListener("load",a,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}class Lu extends Su{constructor(e){super(e)}load(i,n,e,r){const s=new Gs,o=new Ru(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;for(let e=0;e<i.length;++e)!function(t){o.load(i[t],function(e){s.images[t]=e,6===++a&&(s.needsUpdate=!0,n)&&n(s)},void 0,r)}(e);return s}}class Pu extends Su{constructor(e){super(e)}load(e,t,i,n){const r=this,s=new lh,o=new Eu(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,function(e){e=r.parse(e);e&&(void 0!==e.image?s.image=e.image:void 0!==e.data&&(s.image.width=e.width,s.image.height=e.height,s.image.data=e.data),s.wrapS=void 0!==e.wrapS?e.wrapS:Ce,s.wrapT=void 0!==e.wrapT?e.wrapT:Ce,s.magFilter=void 0!==e.magFilter?e.magFilter:F,s.minFilter=void 0!==e.minFilter?e.minFilter:F,s.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.encoding&&(s.encoding=e.encoding),void 0!==e.flipY&&(s.flipY=e.flipY),void 0!==e.format&&(s.format=e.format),void 0!==e.type&&(s.type=e.type),void 0!==e.mipmaps&&(s.mipmaps=e.mipmaps,s.minFilter=Ke),1===e.mipmapCount&&(s.minFilter=F),void 0!==e.generateMipmaps&&(s.generateMipmaps=e.generateMipmaps),s.needsUpdate=!0,t)&&t(s,e)},i,n),s}}class zu extends Su{constructor(e){super(e)}load(e,t,i,n){const r=new c,s=new Ru(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(e){r.image=e,r.needsUpdate=!0,void 0!==t&&t(r)},i,n),r}}class Du extends u{constructor(e,t=1){super(),this.type="Light",this.color=new g(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){e=super.toJSON(e);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}Du.prototype.isLight=!0;class Iu extends Du{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy(u.DefaultUp),this.updateMatrix(),this.groundColor=new g(t)}copy(e){return Du.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Iu.prototype.isHemisphereLight=!0;const Ou=new Ie,Nu=new De,Bu=new De;class Fu{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new W(512,512),this.map=null,this.mapPass=null,this.matrix=new Ie,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Js,this._frameExtents=new W(1,1),this._viewportCount=1,this._viewports=[new ze(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){var t=this.camera,i=this.matrix;Nu.setFromMatrixPosition(e.matrixWorld),t.position.copy(Nu),Bu.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Bu),t.updateMatrixWorld(),Ou.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ou),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){var e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Hu extends Fu{constructor(){super(new B(50,1,.5,500)),this.focus=1}updateMatrices(e){var t=this.camera,i=2*pn*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;i===t.fov&&n===t.aspect&&r===t.far||(t.fov=i,t.aspect=n,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}Hu.prototype.isSpotLightShadow=!0;class Uu extends Du{constructor(e,t,i=0,n=Math.PI/3,r=0,s=1){super(e,t),this.type="SpotLight",this.position.copy(u.DefaultUp),this.updateMatrix(),this.target=new u,this.distance=i,this.angle=n,this.penumbra=r,this.decay=s,this.shadow=new Hu}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Uu.prototype.isSpotLight=!0;const Gu=new Ie,Wu=new De,ku=new De;class Vu extends Fu{constructor(){super(new B(90,1,.5,500)),this._frameExtents=new W(4,2),this._viewportCount=6,this._viewports=[new ze(2,1,1,1),new ze(0,1,1,1),new ze(3,1,1,1),new ze(1,1,1,1),new ze(3,0,1,1),new ze(1,0,1,1)],this._cubeDirections=[new De(1,0,0),new De(-1,0,0),new De(0,0,1),new De(0,0,-1),new De(0,1,0),new De(0,-1,0)],this._cubeUps=[new De(0,1,0),new De(0,1,0),new De(0,1,0),new De(0,1,0),new De(0,0,1),new De(0,0,-1)]}updateMatrices(e,t=0){var i=this.camera,n=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),Wu.setFromMatrixPosition(e.matrixWorld),i.position.copy(Wu),ku.copy(i.position),ku.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(ku),i.updateMatrixWorld(),n.makeTranslation(-Wu.x,-Wu.y,-Wu.z),Gu.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Gu)}}Vu.prototype.isPointLightShadow=!0;class ju extends Du{constructor(e,t,i=0,n=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new Vu}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}ju.prototype.isPointLight=!0;class Xu extends Fu{constructor(){super(new oo(-5,5,5,-5,.5,500))}}Xu.prototype.isDirectionalLightShadow=!0;class qu extends Du{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(u.DefaultUp),this.updateMatrix(),this.target=new u,this.shadow=new Xu}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}qu.prototype.isDirectionalLight=!0;class Yu extends Du{constructor(e,t){super(e,t),this.type="AmbientLight"}}Yu.prototype.isAmbientLight=!0;class Ju extends Du{constructor(e,t,i=10,n=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){e=super.toJSON(e);return e.object.width=this.width,e.object.height=this.height,e}}Ju.prototype.isRectAreaLight=!0;class Zu{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new De)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){var i=e.x,n=e.y,e=e.z,r=this.coefficients;return t.copy(r[0]).multiplyScalar(.282095),t.addScaledVector(r[1],.488603*n),t.addScaledVector(r[2],.488603*e),t.addScaledVector(r[3],.488603*i),t.addScaledVector(r[4],i*n*1.092548),t.addScaledVector(r[5],n*e*1.092548),t.addScaledVector(r[6],.315392*(3*e*e-1)),t.addScaledVector(r[7],i*e*1.092548),t.addScaledVector(r[8],.546274*(i*i-n*n)),t}getIrradianceAt(e,t){var i=e.x,n=e.y,e=e.z,r=this.coefficients;return t.copy(r[0]).multiplyScalar(.886227),t.addScaledVector(r[1],1.023328*n),t.addScaledVector(r[2],1.023328*e),t.addScaledVector(r[3],1.023328*i),t.addScaledVector(r[4],.858086*i*n),t.addScaledVector(r[5],.858086*n*e),t.addScaledVector(r[6],.743125*e*e-.247708),t.addScaledVector(r[7],.858086*i*e),t.addScaledVector(r[8],.429043*(i*i-n*n)),t}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,i){for(let e=0;e<9;e++)this.coefficients[e].addScaledVector(t.coefficients[e],i);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,i){for(let e=0;e<9;e++)this.coefficients[e].lerp(t.coefficients[e],i);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,i=0){var n=this.coefficients;for(let e=0;e<9;e++)n[e].fromArray(t,i+3*e);return this}toArray(t=[],i=0){var n=this.coefficients;for(let e=0;e<9;e++)n[e].toArray(t,i+3*e);return t}static getBasisAt(e,t){var i=e.x,n=e.y,e=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*e,t[3]=.488603*i,t[4]=1.092548*i*n,t[5]=1.092548*n*e,t[6]=.315392*(3*e*e-1),t[7]=1.092548*i*e,t[8]=.546274*(i*i-n*n)}}Zu.prototype.isSphericalHarmonics3=!0;class Qu extends Du{constructor(e=new Zu,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){e=super.toJSON(e);return e.object.sh=this.sh.toArray(),e}}Qu.prototype.isLightProbe=!0;class Ku extends Su{constructor(e){super(e),this.textures={}}load(t,i,e,n){const r=this,s=new Eu(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,function(e){try{i(r.parse(JSON.parse(e)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},e,n)}parse(t){const i=this.textures;function e(e){return void 0===i[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),i[e]}var n=new au[t.type];if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&void 0!==n.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.sheen&&(n.sheen=t.sheen),void 0!==t.sheenColor&&(n.sheenColor=(new g).setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(n.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==n.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==n.specular&&n.specular.setHex(t.specular),void 0!==t.specularIntensity&&(n.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==n.specularColor&&n.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.clearcoat&&(n.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(n.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.transmission&&(n.transmission=t.transmission),void 0!==t.thickness&&(n.thickness=t.thickness),void 0!==t.attenuationDistance&&(n.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==n.attenuationColor&&n.attenuationColor.setHex(t.attenuationColor),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.flatShading&&(n.flatShading=t.flatShading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.combine&&(n.combine=t.combine),void 0!==t.side&&(n.side=t.side),void 0!==t.shadowSide&&(n.shadowSide=t.shadowSide),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.format&&(n.format=t.format),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(n.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(n.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(n.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(n.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(n.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(n.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(n.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(n.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(n.rotation=t.rotation),1!==t.linewidth&&(n.linewidth=t.linewidth),void 0!==t.dashSize&&(n.dashSize=t.dashSize),void 0!==t.gapSize&&(n.gapSize=t.gapSize),void 0!==t.scale&&(n.scale=t.scale),void 0!==t.polygonOffset&&(n.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(n.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(n.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(n.dithering=t.dithering),void 0!==t.alphaToCoverage&&(n.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(n.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.toneMapped&&(n.toneMapped=t.toneMapped),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?n.vertexColors=0<t.vertexColors:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const i in t.uniforms){var r=t.uniforms[i];switch(n.uniforms[i]={},r.type){case"t":n.uniforms[i].value=e(r.value);break;case"c":n.uniforms[i].value=(new g).setHex(r.value);break;case"v2":n.uniforms[i].value=(new W).fromArray(r.value);break;case"v3":n.uniforms[i].value=(new De).fromArray(r.value);break;case"v4":n.uniforms[i].value=(new ze).fromArray(r.value);break;case"m3":n.uniforms[i].value=(new v).fromArray(r.value);break;case"m4":n.uniforms[i].value=(new Ie).fromArray(r.value);break;default:n.uniforms[i].value=r.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const i in t.extensions)n.extensions[i]=t.extensions[i];if(void 0!==t.shading&&(n.flatShading=1===t.shading),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=e(t.map)),void 0!==t.matcap&&(n.matcap=e(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=e(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=e(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),n.normalScale=(new W).fromArray(e)}return void 0!==t.displacementMap&&(n.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=e(t.specularMap)),void 0!==t.specularIntensityMap&&(n.specularIntensityMap=e(t.specularIntensityMap)),void 0!==t.specularColorMap&&(n.specularColorMap=e(t.specularColorMap)),void 0!==t.envMap&&(n.envMap=e(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=e(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=e(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=e(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=e(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new W).fromArray(t.clearcoatNormalScale)),void 0!==t.transmissionMap&&(n.transmissionMap=e(t.transmissionMap)),void 0!==t.thicknessMap&&(n.thicknessMap=e(t.thicknessMap)),void 0!==t.sheenColorMap&&(n.sheenColorMap=e(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(n.sheenRoughnessMap=e(t.sheenRoughnessMap)),n}setTextures(e){return this.textures=e,this}}class $u{static decodeText(i){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(i);let n="";for(let e=0,t=i.length;e<t;e++)n+=String.fromCharCode(i[e]);try{return decodeURIComponent(escape(n))}catch(i){return n}}static extractUrlBase(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class ed extends _{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){var e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}ed.prototype.isInstancedBufferGeometry=!0;class td extends Su{constructor(e){super(e)}load(t,i,e,n){const r=this,s=new Eu(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,function(e){try{i(r.parse(JSON.parse(e)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},e,n)}parse(i){const r={},s={};function n(e,t){var i,n;return void 0!==r[t]?r[t]:(i=e.interleavedBuffers[t],e=e,n=i.buffer,n=void 0!==s[n]?s[n]:(e=e.arrayBuffers[n],e=new Uint32Array(e).buffer,s[n]=e),e=Tn(i.type,n),(n=new Il(e,i.stride)).uuid=i.uuid,r[t]=n)}const o=new(i.isInstancedBufferGeometry?ed:_),a=i.data.index;if(void 0!==a){const i=Tn(a.type,a.array);o.setIndex(new T(i,1))}var t=i.data.attributes;for(const r in t){const s=t[r];let e;if(s.isInterleavedBufferAttribute){const r=n(i.data,s.data);e=new Ol(r,s.itemSize,s.offset,s.normalized)}else{const i=Tn(s.type,s.array);e=new(s.isInstancedBufferAttribute?dh:T)(i,s.itemSize,s.normalized)}void 0!==s.name&&(e.name=s.name),void 0!==s.usage&&e.setUsage(s.usage),void 0!==s.updateRange&&(e.updateRange.offset=s.updateRange.offset,e.updateRange.count=s.updateRange.count),o.setAttribute(r,e)}var e=i.data.morphAttributes;if(e)for(const r in e){const s=e[r],a=[];for(let t=0,e=s.length;t<e;t++){const o=s[t];let e;if(o.isInterleavedBufferAttribute){const r=n(i.data,o.data);e=new Ol(r,o.itemSize,o.offset,o.normalized)}else{const i=Tn(o.type,o.array);e=new T(i,o.itemSize,o.normalized)}void 0!==o.name&&(e.name=o.name),a.push(e)}o.morphAttributes[r]=a}i.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);var l=i.data.groups||i.data.drawcalls||i.data.offsets;if(void 0!==l)for(let e=0,t=l.length;e!==t;++e){const r=l[e];o.addGroup(r.start,r.count,r.materialIndex)}var h=i.data.boundingSphere;if(void 0!==h){const i=new De;void 0!==h.center&&i.fromArray(h.center),o.boundingSphere=new nr(i,h.radius)}return i.name&&(o.name=i.name),i.userData&&(o.userData=i.userData),o}}class id extends Su{constructor(e){super(e)}load(i,n,e,r){const s=this,t=""===this.path?$u.extractUrlBase(i):this.path;this.resourcePath=this.resourcePath||t;var o=new Eu(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(i,function(e){let t=null;try{t=JSON.parse(e)}catch(e){return void 0!==r&&r(e),void console.error("THREE:ObjectLoader: Can't parse "+i+".",e.message)}e=t.metadata;void 0!==e&&void 0!==e.type&&"geometry"!==e.type.toLowerCase()?s.parse(t,n):console.error("THREE.ObjectLoader: Can't load "+i)},e,r)}async loadAsync(e,t){var i=""===this.path?$u.extractUrlBase(e):this.path,i=(this.resourcePath=this.resourcePath||i,new Eu(this.manager)),i=(i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),await i.loadAsync(e,t)),t=JSON.parse(i),i=t.metadata;if(void 0===i||void 0===i.type||"geometry"===i.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return this.parseAsync(t)}parse(e,t){const i=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),s=this.parseImages(e.images,function(){void 0!==t&&t(l)}),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,r,a,o,i),h=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,h),void 0!==t){let e=!1;for(const t in s)if(s[t]instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){var t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,i),n=await this.parseImagesAsync(e.images),n=this.parseTextures(e.textures,n),r=this.parseMaterials(e.materials,n),i=this.parseObject(e.object,i,r,n,t),r=this.parseSkeletons(e.skeletons,i);return this.bindSkeletons(i,r),i}parseShapes(i){var n={};if(void 0!==i)for(let e=0,t=i.length;e<t;e++){var r=(new vc).fromJSON(i[e]);n[r.uuid]=r}return n}parseSkeletons(i,e){const n={},r={};if(e.traverse(function(e){e.isBone&&(r[e.uuid]=e)}),void 0!==i)for(let e=0,t=i.length;e<t;e++){var s=(new uh).fromJSON(i[e],r);n[s.uuid]=s}return n}parseGeometries(i,n){var r={};if(void 0!==i){var s=new td;for(let t=0,e=i.length;t<e;t++){let e;var o=i[t];switch(o.type){case"BufferGeometry":case"InstancedBufferGeometry":e=s.parse(o);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:o.type in Qc?e=Qc[o.type].fromJSON(o,n):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${o.type}"`)}e.uuid=o.uuid,void 0!==o.name&&(e.name=o.name),!0===e.isBufferGeometry&&void 0!==o.userData&&(e.userData=o.userData),r[o.uuid]=e}}return r}parseMaterials(i,e){const n={},r={};if(void 0!==i){var s=new Ku;s.setTextures(e);for(let e=0,t=i.length;e<t;e++){var o=i[e];if("MultiMaterial"===o.type){const i=[];for(let e=0;e<o.materials.length;e++){const r=o.materials[e];void 0===n[r.uuid]&&(n[r.uuid]=s.parse(r)),i.push(n[r.uuid])}r[o.uuid]=i}else void 0===n[o.uuid]&&(n[o.uuid]=s.parse(o)),r[o.uuid]=n[o.uuid]}}return r}parseAnimations(t){var i={};if(void 0!==t)for(let e=0;e<t.length;e++){var n=t[e],n=wu.parse(n);i[n.uuid]=n}return i}parseImages(i,n){const r=this,s={};let o;function a(e){var t,i;return"string"==typeof e?(i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t=e)?t:r.resourcePath+t,r.manager.itemStart(i),o.load(i,function(){r.manager.itemEnd(i)},void 0,function(){r.manager.itemError(i),r.manager.itemEnd(i)})):e.data?{data:Tn(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==i&&0<i.length){const r=new Mu(n);(o=new Ru(r)).setCrossOrigin(this.crossOrigin);for(let e=0,t=i.length;e<t;e++){const r=i[e],o=r.url;if(Array.isArray(o)){s[r.uuid]=[];for(let e=0,t=o.length;e<t;e++){const n=a(o[e]);null!==n&&(n instanceof HTMLImageElement?s[r.uuid].push(n):s[r.uuid].push(new lh(n.data,n.width,n.height)))}}else{const i=a(r.url);null!==i&&(s[r.uuid]=i)}}}return s}async parseImagesAsync(i){const n=this,r={};let s;async function o(e){var t;return"string"==typeof e?(t=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t=e)?t:n.resourcePath+t,s.loadAsync(t)):e.data?{data:Tn(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==i&&0<i.length){(s=new Ru(this.manager)).setCrossOrigin(this.crossOrigin);for(let e=0,t=i.length;e<t;e++){const s=i[e],a=s.url;if(Array.isArray(a)){r[s.uuid]=[];for(let e=0,t=a.length;e<t;e++){const n=a[e],l=await o(n);null!==l&&(l instanceof HTMLImageElement?r[s.uuid].push(l):r[s.uuid].push(new lh(l.data,l.width,l.height)))}}else{const i=await o(s.url);null!==i&&(r[s.uuid]=i)}}}return r}parseTextures(i,n){function r(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var s={};if(void 0!==i)for(let t=0,e=i.length;t<e;t++){var o=i[t];let e;void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===n[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var a=n[o.image];Array.isArray(a)?(e=new Gs(a),6===a.length&&(e.needsUpdate=!0)):(e=a&&a.data?new lh(a.data,a.width,a.height):new c(a),a&&(e.needsUpdate=!0)),e.uuid=o.uuid,void 0!==o.name&&(e.name=o.name),void 0!==o.mapping&&(e.mapping=r(o.mapping,nd)),void 0!==o.offset&&e.offset.fromArray(o.offset),void 0!==o.repeat&&e.repeat.fromArray(o.repeat),void 0!==o.center&&e.center.fromArray(o.center),void 0!==o.rotation&&(e.rotation=o.rotation),void 0!==o.wrap&&(e.wrapS=r(o.wrap[0],rd),e.wrapT=r(o.wrap[1],rd)),void 0!==o.format&&(e.format=o.format),void 0!==o.type&&(e.type=o.type),void 0!==o.encoding&&(e.encoding=o.encoding),void 0!==o.minFilter&&(e.minFilter=r(o.minFilter,sd)),void 0!==o.magFilter&&(e.magFilter=r(o.magFilter,sd)),void 0!==o.anisotropy&&(e.anisotropy=o.anisotropy),void 0!==o.flipY&&(e.flipY=o.flipY),void 0!==o.premultiplyAlpha&&(e.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(e.unpackAlignment=o.unpackAlignment),void 0!==o.userData&&(e.userData=o.userData),s[o.uuid]=e}return s}parseObject(e,t,s,i,n){let r,o,a;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function h(i){if(void 0!==i){if(Array.isArray(i)){var n=[];for(let e=0,t=i.length;e<t;e++){var r=i[e];void 0===s[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),n.push(s[r])}return n}return void 0===s[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),s[i]}}function c(e){return void 0===i[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),i[e]}switch(e.type){case"Scene":r=new Dl,void 0!==e.background&&(Number.isInteger(e.background)?r.background=new g(e.background):r.background=c(e.background)),void 0!==e.environment&&(r.environment=c(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new zl(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new Pl(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new B(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new oo(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"AmbientLight":r=new Yu(e.color,e.intensity);break;case"DirectionalLight":r=new qu(e.color,e.intensity);break;case"PointLight":r=new ju(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new Ju(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new Uu(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new Iu(e.color,e.groundColor,e.intensity);break;case"LightProbe":r=(new Qu).fromJSON(e);break;case"SkinnedMesh":o=l(e.geometry),a=h(e.material),r=new oh(o,a),void 0!==e.bindMode&&(r.bindMode=e.bindMode),void 0!==e.bindMatrix&&r.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(r.skeleton=e.skeleton);break;case"Mesh":o=l(e.geometry),a=h(e.material),r=new S(o,a);break;case"InstancedMesh":o=l(e.geometry),a=h(e.material);const t=e.count,s=e.instanceMatrix,i=e.instanceColor;(r=new vh(o,a,t)).instanceMatrix=new dh(new Float32Array(s.array),16),void 0!==i&&(r.instanceColor=new dh(new Float32Array(i.array),i.itemSize));break;case"LOD":r=new eh;break;case"Line":r=new _h(l(e.geometry),h(e.material));break;case"LineLoop":r=new Ah(l(e.geometry),h(e.material));break;case"LineSegments":r=new Eh(l(e.geometry),h(e.material));break;case"PointCloud":case"Points":r=new Dh(l(e.geometry),h(e.material));break;case"Sprite":r=new Zl(h(e.material));break;case"Group":r=new Tl;break;case"Bone":r=new ah;break;default:r=new u}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(r.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera)&&(r.shadow.camera=this.parseObject(e.shadow.camera)),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.frustumCulled&&(r.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(r.renderOrder=e.renderOrder),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.layers&&(r.layers.mask=e.layers),void 0!==e.children){const o=e.children;for(let e=0;e<o.length;e++)r.add(this.parseObject(o[e],t,s,i,n))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const s=t[e];r.animations.push(n[s])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(r.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const s=t[e],i=r.getObjectByProperty("uuid",s.object);void 0!==i&&r.addLevel(i,s.distance)}}return r}bindSkeletons(e,i){0!==Object.keys(i).length&&e.traverse(function(e){var t;!0===e.isSkinnedMesh&&void 0!==e.skeleton&&(void 0===(t=i[e.skeleton])?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(t,e.bindMatrix))})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const nd={UVMapping:Ee,CubeReflectionMapping:Fe,CubeRefractionMapping:He,EquirectangularReflectionMapping:Ue,EquirectangularRefractionMapping:Ge,CubeUVReflectionMapping:We,CubeUVRefractionMapping:ke},rd={RepeatWrapping:Ve,ClampToEdgeWrapping:Ce,MirroredRepeatWrapping:je},sd={NearestFilter:Re,NearestMipmapNearestFilter:Xe,NearestMipmapLinearFilter:Ye,LinearFilter:F,LinearMipmapNearestFilter:Ze,LinearMipmapLinearFilter:Ke};class od extends Su{constructor(e){super(e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(t,i,e,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=bu.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout(function(){i&&i(s),r.manager.itemEnd(t)},0),s;var o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader,fetch(t,o).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(e){bu.add(t,e),i&&i(e),r.manager.itemEnd(t)}).catch(function(e){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}),r.manager.itemStart(t)}}let ad;od.prototype.isImageBitmapLoader=!0;const ld={getContext:function(){return ad=void 0===ad?new(window.AudioContext||window.webkitAudioContext):ad},setContext:function(e){ad=e}};class hd extends Su{constructor(e){super(e)}load(t,i,e,n){const r=this,s=new Eu(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(e){try{const t=e.slice(0);ld.getContext().decodeAudioData(t,function(e){i(e)})}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},e,n)}}class cd extends Qu{constructor(e,t,i=1){super(void 0,i);var i=(new g).set(e),e=(new g).set(t),t=new De(i.r,i.g,i.b),i=new De(e.r,e.g,e.b),e=Math.sqrt(Math.PI),n=e*Math.sqrt(.75);this.sh.coefficients[0].copy(t).add(i).multiplyScalar(e),this.sh.coefficients[1].copy(t).sub(i).multiplyScalar(n)}}cd.prototype.isHemisphereLightProbe=!0;class ud extends Qu{constructor(e,t=1){super(void 0,t);t=(new g).set(e);this.sh.coefficients[0].set(t.r,t.g,t.b).multiplyScalar(2*Math.sqrt(Math.PI))}}ud.prototype.isAmbientLightProbe=!0;const dd=new Ie,pd=new Ie;class md{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new B,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new B,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){var t,i,n,r,s,o=this._cache;o.focus===e.focus&&o.fov===e.fov&&o.aspect===e.aspect*this.aspect&&o.near===e.near&&o.far===e.far&&o.zoom===e.zoom&&o.eyeSep===this.eyeSep||(o.focus=e.focus,o.fov=e.fov,o.aspect=e.aspect*this.aspect,o.near=e.near,o.far=e.far,o.zoom=e.zoom,o.eyeSep=this.eyeSep,t=e.projectionMatrix.clone(),i=(r=o.eyeSep/2)*o.near/o.focus,n=o.near*Math.tan(dn*o.fov*.5)/o.zoom,pd.elements[12]=-r,dd.elements[12]=r,r=-n*o.aspect+i,s=n*o.aspect+i,t.elements[0]=2*o.near/(s-r),t.elements[8]=(s+r)/(s-r),this.cameraL.projectionMatrix.copy(t),r=-n*o.aspect-i,s=n*o.aspect-i,t.elements[0]=2*o.near/(s-r),t.elements[8]=(s+r)/(s-r),this.cameraR.projectionMatrix.copy(t)),this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(pd),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(dd)}}class fd{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=gd(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;var t;return this.autoStart&&!this.running?(this.start(),0):(this.running&&(t=gd(),e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e),e)}}function gd(){return("undefined"==typeof performance?Date:performance).now()}const vd=new De,yd=new On,xd=new De,wd=new De;class bd extends u{constructor(){super(),this.type="AudioListener",this.context=ld.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new fd}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return(null!==this.filter?(this.gain.disconnect(this.filter),this.filter):this.gain).disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);var t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(vd,yd,xd),wd.set(0,0,-1).applyQuaternion(yd),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(vd.x,e),t.positionY.linearRampToValueAtTime(vd.y,e),t.positionZ.linearRampToValueAtTime(vd.z,e),t.forwardX.linearRampToValueAtTime(wd.x,e),t.forwardY.linearRampToValueAtTime(wd.y,e),t.forwardZ.linearRampToValueAtTime(wd.z,e),t.upX.linearRampToValueAtTime(i.x,e),t.upY.linearRampToValueAtTime(i.y,e),t.upZ.linearRampToValueAtTime(i.z,e)}else t.setPosition(vd.x,vd.y,vd.z),t.setOrientation(wd.x,wd.y,wd.z,i.x,i.y,i.z)}}class Md extends u{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else{if(!1!==this.hasPlaybackControl)return this._startedAt=this.context.currentTime+e,(e=this.context.createBufferSource()).buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect();console.warn("THREE.Audio: this Audio has no playback control.")}}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e=e||[],!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const _d=new De,Sd=new On,Td=new De,Ed=new De;class Ad extends Md{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(_d,Sd,Td),Ed.set(0,0,1).applyQuaternion(Sd);var t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(_d.x,e),t.positionY.linearRampToValueAtTime(_d.y,e),t.positionZ.linearRampToValueAtTime(_d.z,e),t.orientationX.linearRampToValueAtTime(Ed.x,e),t.orientationY.linearRampToValueAtTime(Ed.y,e),t.orientationZ.linearRampToValueAtTime(Ed.z,e)}else t.setPosition(_d.x,_d.y,_d.z),t.setOrientation(Ed.x,Ed.y,Ed.z)}}}class Cd{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;var i=this.getFrequencyData();for(let e=0;e<i.length;e++)t+=i[e];return t/i.length}}class Rd{constructor(e,t,i){let n,r,s;switch(this.binding=e,this.valueSize=i,t){case"quaternion":n=this._slerp,r=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){var i=this.buffer,n=this.valueSize,r=e*n+n;let s=this.cumulativeWeight;if(0===s){for(let e=0;e!==n;++e)i[r+e]=i[e];s=t}else{const e=t/(s+=t);this._mixBufferRegion(i,r,0,e,n)}this.cumulativeWeight=s}accumulateAdditive(e){var t=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,n,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){var i=this.valueSize,n=this.buffer,r=e*i+i,t=this.cumulativeWeight,e=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,t<1){const e=i*this._origIndex;this._mixBufferRegion(n,r,e,1-t,i)}0<e&&this._mixBufferRegionAdditive(n,r,this._addIndex*i,1,i);for(let e=i,t=i+i;e!==t;++e)if(n[e]!==n[e+i]){s.setValue(n,r);break}}saveOriginalState(){var e=this.binding,i=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(i,r);for(let e=n,t=r;e!==t;++e)i[e]=i[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){var t=this._addIndex*this.valueSize,i=t+this.valueSize;for(let e=t;e<i;e++)this.buffer[e]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){var t=this._origIndex*this.valueSize,i=this._addIndex*this.valueSize;for(let e=0;e<this.valueSize;e++)this.buffer[i+e]=this.buffer[t+e]}_select(t,i,n,e,r){if(.5<=e)for(let e=0;e!==r;++e)t[i+e]=t[n+e]}_slerp(e,t,i,n){On.slerpFlat(e,t,e,t,e,i,n)}_slerpAdditive(e,t,i,n,r){r=this._workIndex*r;On.multiplyQuaternionsFlat(e,r,e,t,e,i),On.slerpFlat(e,t,e,t,e,r,n)}_lerp(t,i,n,r,s){var o=1-r;for(let e=0;e!==s;++e){const s=i+e;t[s]=t[s]*o+t[n+e]*r}}_lerpAdditive(t,i,n,r,s){for(let e=0;e!==s;++e){const s=i+e;t[s]=t[s]+t[n+e]*r}}}const Ld=new RegExp("[\\[\\]\\.:\\/]","g"),Pd="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",zd=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Dd=/(WCOD+)?/.source.replace("WCOD",Pd),Id=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Od=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Nd=new RegExp("^"+zd+Dd+Id+Od+"$"),Bd=["material","materials","bones"];class x{constructor(e,t,i){this.path=t,this.parsedPath=i||x.parseTrackName(t),this.node=x.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return new(e&&e.isAnimationObjectGroup?x.Composite:x)(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Ld,"")}static parseTrackName(e){var t=Nd.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var t={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=t.nodeName&&t.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const e=t.nodeName.substring(i+1);-1!==Bd.indexOf(e)&&(t.nodeName=t.nodeName.substring(0,i),t.objectName=e)}if(null===t.propertyName||0===t.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return t}static findNode(e,n){if(!n||""===n||"."===n||-1===n||n===e.name||n===e.uuid)return e;if(e.skeleton){var t=e.skeleton.getBoneByName(n);if(void 0!==t)return t}if(e.children){const r=function(t){for(let e=0;e<t.length;e++){var i=t[e];if(i.name===n||i.uuid===n)return i;i=r(i.children);if(i)return i}return null},i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(i,n){var r=this.resolvedProperty;for(let e=0,t=r.length;e!==t;++e)i[n++]=r[e]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(i,n){var r=this.resolvedProperty;for(let e=0,t=r.length;e!==t;++e)r[e]=i[n++]}_setValue_array_setNeedsUpdate(i,n){var r=this.resolvedProperty;for(let e=0,t=r.length;e!==t;++e)r[e]=i[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(i,n){var r=this.resolvedProperty;for(let e=0,t=r.length;e!==t;++e)r[e]=i[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let i=this.node;const e=this.parsedPath,n=e.objectName,r=e.propertyName;let s=e.propertyIndex;if(i||(i=x.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=i),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,i){if(n){let t=e.objectIndex;switch(n){case"materials":if(!i.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!i.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);i=i.material.materials;break;case"bones":if(!i.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);i=i.skeleton.bones;for(let e=0;e<i.length;e++)if(i[e].name===t){t=e;break}break;default:if(void 0===i[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);i=i[n]}if(void 0!==t){if(void 0===i[t])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,i);i=i[t]}}var o=i[r];if(void 0===o){const n=e.nodeName;void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",i)}else{let e=this.Versioning.None,t=(void 0!==(this.targetObject=i).needsUpdate?e=this.Versioning.NeedsUpdate:void 0!==i.matrixWorldNeedsUpdate&&(e=this.Versioning.MatrixWorldNeedsUpdate),this.BindingType.Direct);if(void 0!==s){if("morphTargetInfluences"===r){if(!i.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!i.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!i.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==i.morphTargetDictionary[s]&&(s=i.morphTargetDictionary[s])}t=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else void 0!==o.fromArray&&void 0!==o.toArray?(t=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(t=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[t],this.setValue=this.SetterByBindingTypeAndVersioning[t][e]}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}x.Composite=class{constructor(e,t,i){i=i||x.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();var i=this._targetGroup.nCachedObjects_,i=this._bindings[i];void 0!==i&&i.getValue(e,t)}setValue(i,n){var r=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=r.length;e!==t;++e)r[e].setValue(i,n)}bind(){var i=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=i.length;e!==t;++e)i[e].bind()}unbind(){var i=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=i.length;e!==t;++e)i[e].unbind()}},x.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},x.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},x.prototype.GetterByBindingType=[x.prototype._getValue_direct,x.prototype._getValue_array,x.prototype._getValue_arrayElement,x.prototype._getValue_toArray],x.prototype.SetterByBindingTypeAndVersioning=[[x.prototype._setValue_direct,x.prototype._setValue_direct_setNeedsUpdate,x.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[x.prototype._setValue_array,x.prototype._setValue_array_setNeedsUpdate,x.prototype._setValue_array_setMatrixWorldNeedsUpdate],[x.prototype._setValue_arrayElement,x.prototype._setValue_arrayElement_setNeedsUpdate,x.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[x.prototype._setValue_fromArray,x.prototype._setValue_fromArray_setNeedsUpdate,x.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Fd{constructor(){this.uuid=fn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var i={};this._indicesByUUID=i;for(let e=0,t=arguments.length;e!==t;++e)i[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}add(){const n=this._objects,r=this._indicesByUUID,s=this._paths,o=this._parsedPaths,a=this._bindings,l=a.length;let h=void 0,c=n.length,u=this.nCachedObjects_;for(let e=0,t=arguments.length;e!==t;++e){var d=arguments[e],p=d.uuid;let i=r[p];if(void 0===i){i=c++,r[p]=i,n.push(d);for(let e=0,t=l;e!==t;++e)a[e].push(new x(d,s[e],o[e]))}else if(i<u){h=n[i];const c=--u,m=n[c];r[m.uuid]=i,n[i]=m,r[p]=c,n[c]=d;for(let t=0,e=l;t!==e;++t){const r=a[t],l=r[c];let e=r[i];r[i]=l,void 0===e&&(e=new x(d,s[t],o[t])),r[c]=e}}else n[i]!==h&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=u}remove(){const i=this._objects,n=this._indicesByUUID,r=this._bindings,s=r.length;let o=this.nCachedObjects_;for(let e=0,t=arguments.length;e!==t;++e){var a=arguments[e],l=a.uuid,h=n[l];if(void 0!==h&&h>=o){var c=o++,u=i[c];n[u.uuid]=h,i[h]=u,n[l]=c,i[c]=a;for(let e=0,t=s;e!==t;++e){const n=r[e],s=n[c],o=n[h];n[h]=s,n[c]=o}}}this.nCachedObjects_=o}uncache(){const i=this._objects,n=this._indicesByUUID,r=this._bindings,s=r.length;let o=this.nCachedObjects_,a=i.length;for(let e=0,t=arguments.length;e!==t;++e){var l=arguments[e].uuid,h=n[l];if(void 0!==h)if(delete n[l],h<o){var c=--o,l=i[c],u=--a,d=i[u];n[l.uuid]=h,i[h]=l,n[d.uuid]=c,i[c]=d,i.pop();for(let e=0,t=s;e!==t;++e){const n=r[e],s=n[c],o=n[u];n[h]=s,n[c]=o,n.pop()}}else{const o=--a,p=i[o];0<o&&(n[p.uuid]=h),i[h]=p,i.pop();for(let e=0,t=s;e!==t;++e){const n=r[e];n[h]=n[o],n.pop()}}}this.nCachedObjects_=o}subscribe_(i,n){var e=this._bindingsIndicesByPath;let r=e[i];var t=this._bindings;if(void 0!==r)return t[r];var s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,h=this.nCachedObjects_,c=new Array(l);r=t.length,e[i]=r,s.push(i),o.push(n),t.push(c);for(let e=h,t=a.length;e!==t;++e){const r=a[e];c[e]=new x(r,i,n)}return c}unsubscribe_(e){var t,i,n,r,s,o=this._bindingsIndicesByPath,a=o[e];void 0!==a&&(t=this._paths,i=this._parsedPaths,s=(n=this._bindings)[r=n.length-1],n[o[e[r]]=a]=s,n.pop(),i[a]=i[r],i.pop(),t[a]=t[r],t.pop())}}Fd.prototype.isAnimationObjectGroup=!0;class Hd{constructor(e,t,i=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=n;var r=t.tracks,s=r.length,o=new Array(s),a={endingStart:vi,endingEnd:vi};for(let e=0;e!==s;++e){const t=r[e].createInterpolant(null);(o[e]=t).settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=di,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const i=this._clip.duration,n=e._clip.duration,r=n/i,s=i/n;e.warp(1,r,t),this.warp(s,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){var n=this._mixer,r=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);var n=o.parameterPositions,a=o.sampleValues;return n[0]=r,n[1]=r+i,a[0]=e/s,a[1]=t/s,this}stopWarping(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(i,n,e,r){if(this.enabled){var t=this._startTime;if(null!==t){const r=(i-t)*e;if(r<0||0===e)return;this._startTime=null,n=e*r}n*=this._updateTimeScale(i);var s=this._updateTime(n),o=this._updateWeight(i);if(0<o){const i=this._interpolants,n=this._propertyBindings;if(this.blendMode===bi)for(let e=0,t=i.length;e!==t;++e)i[e].evaluate(s),n[e].accumulateAdditive(o);else{wi;for(let e=0,t=i.length;e!==t;++e)i[e].evaluate(s),n[e].accumulate(r,o)}}}else this._updateWeight(i)}_updateWeight(e){let t=0;var i,n;return this.enabled&&(t=this.weight,null!==(i=this._weightInterpolant))&&(n=i.evaluate(e)[0],t*=n,e>i.parameterPositions[1])&&(this.stopFading(),0===n)&&(this.enabled=!1),this._effectiveWeight=t}_updateTimeScale(e){let t=0;var i;return this.paused||(t=this.timeScale,null!==(i=this._timeScaleInterpolant)&&(t*=i.evaluate(e)[0],e>i.parameterPositions[1])&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)),this._effectiveTimeScale=t}_updateTime(e){const t=this._clip.duration,i=this.loop;let n=this.time+e,r=this._loopCount;var s=i===pi;if(0===e)return-1!==r&&s&&1==(1&r)?t-n:n;if(i===ui){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(0<=e?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=t||n<0){const i=Math.floor(n/t);n-=t*i,r+=Math.abs(i);var o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=0<e?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<e?1:-1});else{if(1==o){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&1==(1&r))return t-n}return n}_setEndings(e,t,i){var n=this._interpolantSettings;i?(n.endingStart=yi,n.endingEnd=yi):(n.endingStart=e?this.zeroSlopeAtStart?yi:vi:xi,n.endingEnd=t?this.zeroSlopeAtEnd?yi:vi:xi)}_scheduleFading(e,t,i){var n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);var n=s.parameterPositions,o=s.sampleValues;return n[0]=r,o[0]=t,n[1]=r+e,o[1]=i,this}}class Ud extends cn{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,i){const n=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,h=this._bindingsByRootAndName;let c=h[l];void 0===c&&(c={},h[l]=c);for(let t=0;t!==s;++t){const s=r[t],h=s.name;let e=c[h];if(void 0===e){if(void 0!==(e=o[t])){null===e._cacheIndex&&(++e.referenceCount,this._addInactiveBinding(e,l,h));continue}const r=i&&i._propertyBindings[t].binding.parsedPath;++(e=new Rd(x.create(n,h,r),s.ValueTypeName,s.getValueSize())).referenceCount,this._addInactiveBinding(e,l,h)}o[t]=e,a[t].resultBuffer=e.buffer}}_activateAction(e){if(!this._isActiveAction(e)){null===e._cacheIndex&&(t=(e._localRoot||this._root).uuid,i=e._clip.uuid,n=this._actionsByClip[i],this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,i,t));var t,i,n,r=e._propertyBindings;for(let e=0,t=r.length;e!==t;++e){var s=r[e];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){var i=e._propertyBindings;for(let e=0,t=i.length;e!==t;++e){var n=i[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){e=e._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(e,t,i){var n=this._actions,r=this._actionsByClip;let s=r[t];if(void 0===s)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=s;else{const t=s.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=n.length,n.push(e),s.actionByRoot[i]=e}_removeInactiveAction(e){var t=this._actions,i=t[t.length-1],n=e._cacheIndex,n=(t[i._cacheIndex=n]=i,t.pop(),e._cacheIndex=null,e._clip.uuid),i=this._actionsByClip,t=i[n],r=t.knownActions,s=r[r.length-1],o=e._byClipCacheIndex;r[s._byClipCacheIndex=o]=s,r.pop(),e._byClipCacheIndex=null,delete t.actionByRoot[(e._localRoot||this._root).uuid],0===r.length&&delete i[n],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){var i=e._propertyBindings;for(let e=0,t=i.length;e!==t;++e){var n=i[e];0==--n.referenceCount&&this._removeInactiveBinding(n)}}_lendAction(e){var t=this._actions,i=e._cacheIndex,n=this._nActiveActions++,r=t[n];t[e._cacheIndex=n]=e,t[r._cacheIndex=i]=r}_takeBackAction(e){var t=this._actions,i=e._cacheIndex,n=--this._nActiveActions,r=t[n];t[e._cacheIndex=n]=e,t[r._cacheIndex=i]=r}_addInactiveBinding(e,t,i){var n=this._bindingsByRootAndName,r=this._bindings;let s=n[t];void 0===s&&(s={},n[t]=s),(s[i]=e)._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){var t=this._bindings,i=e.binding,n=i.rootNode.uuid,i=i.path,r=this._bindingsByRootAndName,s=r[n],o=t[t.length-1],e=e._cacheIndex;t[o._cacheIndex=e]=o,t.pop(),delete s[i],0===Object.keys(s).length&&delete r[n]}_lendBinding(e){var t=this._bindings,i=e._cacheIndex,n=this._nActiveBindings++,r=t[n];t[e._cacheIndex=n]=e,t[r._cacheIndex=i]=r}_takeBackBinding(e){var t=this._bindings,i=e._cacheIndex,n=--this._nActiveBindings,r=t[n];t[e._cacheIndex=n]=e,t[r._cacheIndex=i]=r}_lendControlInterpolant(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return void 0===i&&(e[(i=new cu(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t]=i),i}_takeBackControlInterpolant(e){var t=this._controlInterpolants,i=e.__cacheIndex,n=--this._nActiveControlInterpolants,r=t[n];t[e.__cacheIndex=n]=e,t[r.__cacheIndex=i]=r}clipAction(e,t,i){var n=t||this._root,r=n.uuid;let s="string"==typeof e?wu.findByName(n,e):e;var n=null!==s?s.uuid:e,o=this._actionsByClip[n];let a=null;if(void 0===i&&(i=null!==s?s.blendMode:wi),void 0!==o){const e=o.actionByRoot[r];if(void 0!==e&&e.blendMode===i)return e;a=o.knownActions[0],null===s&&(s=a._clip)}return null===s?null:(e=new Hd(this,s,t,i),this._bindAction(e,a),this._addInactiveAction(e,n,r),e)}existingAction(e,t){var t=t||this._root,i=t.uuid,t="string"==typeof e?wu.findByName(t,e):e,t=t?t.uuid:e,e=this._actionsByClip[t];return void 0!==e&&e.actionByRoot[i]||null}stopAllAction(){var t=this._actions;for(let e=this._nActiveActions-1;0<=e;--e)t[e].stop();return this}update(t){t*=this.timeScale;var i=this._actions,n=this._nActiveActions,r=this.time+=t,s=Math.sign(t),o=this._accuIndex^=1;for(let e=0;e!==n;++e)i[e]._update(r,t,s,o);var a=this._bindings,l=this._nActiveBindings;for(let e=0;e!==l;++e)a[e].apply(o);return this}setTime(e){for(let e=this.time=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(i){const n=this._actions,e=i.uuid,r=this._actionsByClip,s=r[e];if(void 0!==s){const i=s.knownActions;for(let e=0,t=i.length;e!==t;++e){const r=i[e],s=(this._deactivateAction(r),r._cacheIndex),o=n[n.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,o._cacheIndex=s,n[s]=o,n.pop(),this._removeInactiveBindingsForAction(r)}delete r[e]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const e in i){const n=i[e].actionByRoot[t];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[t];if(void 0!==n)for(const e in n){const t=n[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){e=this.existingAction(e,t);null!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}}Ud.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class Gd{constructor(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Gd(void 0===this.value.clone?this.value:this.value.clone())}}class Wd extends Il{constructor(e,t,i=1){super(e,t),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){e=super.clone(e);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(e){e=super.toJSON(e);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}Wd.prototype.isInstancedInterleavedBuffer=!0;class kd{constructor(e,t,i,n,r){this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=n,this.count=r,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}kd.prototype.isGLBufferAttribute=!0;class Vd{constructor(e,t,i=0,n=1/0){this.ray=new ur(e,t),this.near=i,this.far=n,this.camera=null,this.layers=new Mr,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,i=[]){return Xd(e,this,i,t),i.sort(jd),i}intersectObjects(i,n=!0,r=[]){for(let e=0,t=i.length;e<t;e++)Xd(i[e],this,r,n);return r.sort(jd),r}}function jd(e,t){return e.distance-t.distance}function Xd(e,i,n,r){if(e.layers.test(i.layers)&&e.raycast(i,n),!0===r){const r=e.children;for(let e=0,t=r.length;e<t;e++)Xd(r[e],i,n,!0)}}class qd{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(gn(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class Yd{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return(new this.constructor).copy(this)}}const Jd=new W;class Zd{constructor(e=new W(1/0,1/0),t=new W(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(i){this.makeEmpty();for(let e=0,t=i.length;e<t;e++)this.expandByPoint(i[e]);return this}setFromCenterAndSize(e,t){t=Jd.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(t),this.max.copy(e).add(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Jd.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}Zd.prototype.isBox2=!0;const Qd=new De,Kd=new De;class $d{constructor(e=new De,t=new De){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Qd.subVectors(e,this.start),Kd.subVectors(this.end,this.start);e=Kd.dot(Kd);let i=Kd.dot(Qd)/e;return i=t?gn(i,0,1):i}closestPointToPoint(e,t,i){e=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(e).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const ep=new De;class tp extends u{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;var e=new _,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1;e<32;e++,t++){const n=e/32*Math.PI*2,r=t/32*Math.PI*2;i.push(Math.cos(n),Math.sin(n),1,Math.cos(r),Math.sin(r),1)}e.setAttribute("position",new k(i,3));const n=new y({fog:!1,toneMapped:!1});this.cone=new Eh(e,n),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();var e=this.light.distance||1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),ep.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(ep),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const ip=new De,np=new Ie,rp=new Ie;class sp extends Eh{constructor(e){const t=function t(i){var n=[];i&&i.isBone&&n.push(i);for(let e=0;e<i.children.length;e++)n.push.apply(n,t(i.children[e]));return n}(e),i=new _,n=[],r=[],s=new g(0,0,1),o=new g(0,1,0);for(let e=0;e<t.length;e++){const i=t[e];i.parent&&i.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(s.r,s.g,s.b),r.push(o.r,o.g,o.b))}i.setAttribute("position",new k(n,3)),i.setAttribute("color",new k(r,3)),super(i,new y({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){var i=this.bones,t=this.geometry,n=t.getAttribute("position");rp.copy(this.root.matrixWorld).invert();for(let e=0,t=0;e<i.length;e++){var r=i[e];r.parent&&r.parent.isBone&&(np.multiplyMatrices(rp,r.matrixWorld),ip.setFromMatrixPosition(np),n.setXYZ(t,ip.x,ip.y,ip.z),np.multiplyMatrices(rp,r.parent.matrixWorld),ip.setFromMatrixPosition(np),n.setXYZ(t+1,ip.x,ip.y,ip.z),t+=2)}t.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}class op extends S{constructor(e,t,i){super(new Vc(t,4,2),new $r({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const ap=new De,lp=new g,hp=new g;class cp extends u{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;e=new Gc(t),e.rotateY(.5*Math.PI),this.material=new $r({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0),i=e.getAttribute("position"),t=new Float32Array(3*i.count);e.setAttribute("color",new T(t,3)),this.add(new S(e,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var i=e.geometry.getAttribute("color");lp.copy(this.light.color),hp.copy(this.light.groundColor);for(let e=0,t=i.count;e<t;e++){var n=e<t/2?lp:hp;i.setXYZ(e,n.r,n.g,n.b)}i.needsUpdate=!0}e.lookAt(ap.setFromMatrixPosition(this.light.matrixWorld).negate())}}class up extends Eh{constructor(e=10,n=10,r=4473924,s=8947848){r=new g(r),s=new g(s);var o=n/2,a=e/n,l=e/2,h=[],c=[];for(let e=0,t=0,i=-l;e<=n;e++,i+=a){h.push(-l,0,i,l,0,i),h.push(i,0,-l,i,0,l);const n=e===o?r:s;n.toArray(c,t),t+=3,n.toArray(c,t),t+=3,n.toArray(c,t),t+=3,n.toArray(c,t),t+=3}e=new _;e.setAttribute("position",new k(h,3)),e.setAttribute("color",new k(c,3)),super(e,new y({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class dp extends Eh{constructor(t=10,i=16,n=8,r=64,s=4473924,o=8947848){s=new g(s),o=new g(o);var a=[],l=[];for(let e=0;e<=i;e++){const r=e/i*(2*Math.PI),p=Math.sin(r)*t,m=Math.cos(r)*t;a.push(0,0,0),a.push(p,0,m);var h=1&e?s:o;l.push(h.r,h.g,h.b),l.push(h.r,h.g,h.b)}for(let e=0;e<=n;e++){const p=1&e?s:o,f=t-t/n*e;for(let e=0;e<r;e++){var c=e/r*(2*Math.PI),u=Math.sin(c)*f,d=Math.cos(c)*f;a.push(u,0,d),l.push(p.r,p.g,p.b),c=(e+1)/r*(2*Math.PI),u=Math.sin(c)*f,d=Math.cos(c)*f,a.push(u,0,d),l.push(p.r,p.g,p.b)}}const p=new _;p.setAttribute("position",new k(a,3)),p.setAttribute("color",new k(l,3)),super(p,new y({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const pp=new De,mp=new De,fp=new De;class gp extends u{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===t&&(t=1);let n=new _;n.setAttribute("position",new k([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));e=new y({fog:!1,toneMapped:!1});this.lightPlane=new _h(n,e),this.add(this.lightPlane),(n=new _).setAttribute("position",new k([0,0,0,0,0,1],3)),this.targetLine=new _h(n,e),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){pp.setFromMatrixPosition(this.light.matrixWorld),mp.setFromMatrixPosition(this.light.target.matrixWorld),fp.subVectors(mp,pp),this.lightPlane.lookAt(mp),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(mp),this.targetLine.scale.z=fp.length()}}const vp=new De,a=new Hs;class yp extends Eh{constructor(e){const t=new _,i=new y({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],s={},o=new g(16755200),a=new g(16711680),l=new g(43775),h=new g(16777215),c=new g(3355443);function u(e,t,i){d(e,i),d(t,i)}function d(e,t){n.push(0,0,0),r.push(t.r,t.g,t.b),void 0===s[e]&&(s[e]=[]),s[e].push(n.length/3-1)}u("n1","n2",o),u("n2","n4",o),u("n4","n3",o),u("n3","n1",o),u("f1","f2",o),u("f2","f4",o),u("f4","f3",o),u("f3","f1",o),u("n1","f1",o),u("n2","f2",o),u("n3","f3",o),u("n4","f4",o),u("p","n1",a),u("p","n2",a),u("p","n3",a),u("p","n4",a),u("u1","u2",l),u("u2","u3",l),u("u3","u1",l),u("c","t",h),u("p","c",c),u("cn1","cn2",c),u("cn3","cn4",c),u("cf1","cf2",c),u("cf3","cf4",c),t.setAttribute("position",new k(n,3)),t.setAttribute("color",new k(r,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}update(){var e=this.geometry,t=this.pointMap;a.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),l("c",t,e,a,0,0,-1),l("t",t,e,a,0,0,1),l("n1",t,e,a,-1,-1,-1),l("n2",t,e,a,1,-1,-1),l("n3",t,e,a,-1,1,-1),l("n4",t,e,a,1,1,-1),l("f1",t,e,a,-1,-1,1),l("f2",t,e,a,1,-1,1),l("f3",t,e,a,-1,1,1),l("f4",t,e,a,1,1,1),l("u1",t,e,a,.7,1.1,-1),l("u2",t,e,a,-.7,1.1,-1),l("u3",t,e,a,0,2,-1),l("cf1",t,e,a,-1,0,1),l("cf2",t,e,a,1,0,1),l("cf3",t,e,a,0,-1,1),l("cf4",t,e,a,0,1,1),l("cn1",t,e,a,-1,0,-1),l("cn2",t,e,a,1,0,-1),l("cn3",t,e,a,0,-1,-1),l("cn4",t,e,a,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function l(i,e,t,n,r,s,o){vp.set(r,s,o).unproject(n);var a=e[i];if(void 0!==a){const i=t.getAttribute("position");for(let e=0,t=a.length;e<t;e++)i.setXYZ(a[e],vp.x,vp.y,vp.z)}}const xp=new Fn;class wp extends Eh{constructor(e,t=16776960){var i=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]),n=new Float32Array(24),r=new _;r.setIndex(new T(i,1)),r.setAttribute("position",new T(n,3)),super(r,new y({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){var t,i,n;void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&xp.setFromObject(this.object),xp.isEmpty()||(e=xp.min,t=xp.max,(n=(i=this.geometry.attributes.position).array)[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=e.x,n[4]=t.y,n[5]=t.z,n[6]=e.x,n[7]=e.y,n[8]=t.z,n[9]=t.x,n[10]=e.y,n[11]=t.z,n[12]=t.x,n[13]=t.y,n[14]=e.z,n[15]=e.x,n[16]=t.y,n[17]=e.z,n[18]=e.x,n[19]=e.y,n[20]=e.z,n[21]=t.x,n[22]=e.y,n[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere())}setFromObject(e){return this.object=e,this.update(),this}copy(e){return Eh.prototype.copy.call(this,e),this.object=e.object,this}}class bp extends Eh{constructor(e,t=16776960){var i=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]),n=new _;n.setIndex(new T(i,1)),n.setAttribute("position",new k([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new y({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class Mp extends _h{constructor(e,t=1,i=16776960){var n=new _,n=(n.setAttribute("position",new k([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),n.computeBoundingSphere(),super(n,new y({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t,new _);n.setAttribute("position",new k([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),n.computeBoundingSphere(),this.add(new S(n,new $r({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?Ae:Oe,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const _p=new De;let Sp,Tp;class Ep extends u{constructor(e=new De(0,0,1),t=new De(0,0,0),i=1,n=16776960,r=.2*i,s=.2*r){super(),this.type="ArrowHelper",void 0===Sp&&((Sp=new _).setAttribute("position",new k([0,0,0,0,1,0],3)),(Tp=new Uh(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new _h(Sp,new y({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new S(Tp,new $r({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,r,s)}setDirection(e){.99999<e.y?this.quaternion.set(0,0,0,1):e.y<-.99999?this.quaternion.set(1,0,0,0):(_p.set(e.z,0,-e.x).normalize(),e=Math.acos(e.y),this.quaternion.setFromAxisAngle(_p,e))}setLength(e,t=.2*e,i=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class Ap extends Eh{constructor(e=1){var e=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],t=new _;t.setAttribute("position",new k(e,3)),t.setAttribute("color",new k([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(t,new y({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,i){var n=new g,r=this.geometry.attributes.color.array;return n.set(e),n.toArray(r,0),n.toArray(r,3),n.set(t),n.toArray(r,6),n.toArray(r,9),n.set(i),n.toArray(r,12),n.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Cp{constructor(){this.type="ShapePath",this.color=new g,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new gc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,n){return this.currentPath.quadraticCurveTo(e,t,i,n),this}bezierCurveTo(e,t,i,n,r,s){return this.currentPath.bezierCurveTo(e,t,i,n,r,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(o,a){function e(i){var n=[];for(let e=0,t=i.length;e<t;e++){var r=i[e],s=new vc;s.curves=r.curves,n.push(s)}return n}const l=Ic.isClockWise,h=this.subPaths;if(0===h.length)return[];if(!0===a)return e(h);let c,u,d;var t=[];if(1===h.length)u=h[0],(d=new vc).curves=u.curves,t.push(d);else{var p=!l(h[0].getPoints()),p=o?!p:p,m=[],f=[];let i,n,s=[],r=0;f[r]=void 0,s[r]=[];for(let e=0,t=h.length;e<t;e++)i=(u=h[e]).getPoints(),c=l(i),(c=o?!c:c)?(!p&&f[r]&&r++,f[r]={s:new vc,p:i},f[r].s.curves=u.curves,p&&r++,s[r]=[]):s[r].push({h:u,p:i[0]});if(!f[0])return e(h);if(1<f.length){let r=!1;const a=[];for(let e=0,t=f.length;e<t;e++)m[e]=[];for(let n=0,e=f.length;n<e;n++){const l=s[n];for(let i=0;i<l.length;i++){const c=l[i];let t=!0;for(let e=0;e<f.length;e++)!function(o,a){var e=a.length;let l=!1;for(let r=e-1,s=0;s<e;r=s++){let e=a[r],t=a[s],i=t.x-e.x,n=t.y-e.y;if(Math.abs(n)>Number.EPSILON){if(n<0&&(e=a[s],i=-i,t=a[r],n=-n),!(o.y<e.y||o.y>t.y))if(o.y===e.y){if(o.x===e.x)return 1}else{const a=n*(o.x-e.x)-i*(o.y-e.y);if(0==a)return 1;a<0||(l=!l)}}else if(o.y===e.y&&(t.x<=o.x&&o.x<=e.x||e.x<=o.x&&o.x<=t.x))return 1}return l}(c.p,f[e].p)||(n!==e&&a.push({froms:n,tos:e,hole:i}),t?(t=!1,m[e].push(c)):r=!0);t&&m[n].push(c)}}0<a.length&&(r||(s=m))}for(let i=0,e=f.length;i<e;i++){d=f[i].s,t.push(d);for(let e=0,t=(n=s[i]).length;e<t;e++)d.holes.push(n[e].h)}}return t}}const Rp=new Float32Array(1),Lp=new Int32Array(Rp.buffer);class Pp{static toHalfFloat(e){65504<e&&(console.warn("THREE.DataUtils.toHalfFloat(): value exceeds 65504."),e=65504),Rp[0]=e;e=Lp[0];let t=e>>16&32768,i=e>>12&2047;var n=e>>23&255;return n<103||(142<n?t=t|31744|((255==n?0:1)&&8388607&e):n<113?(i|=2048,t|=(i>>114-n)+(i>>113-n&1)):t=(t|=n-112<<10|i>>1)+(1&i)),t}}const zp=0,Dp=1,Ip=0,Op=1,Np=2;function Bp(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function Fp(e=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,(e.materials=e).clone=function(){return e.slice()},e}function Hp(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Dh(e,t)}function Up(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Zl(e)}function Gp(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Dh(e,t)}function Wp(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Ch(e)}function kp(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Ch(e)}function Vp(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Ch(e)}function jp(e,t,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new De(e,t,i)}function Xp(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new T(e,t).setUsage($i)}function qp(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new ts(e,t)}function Yp(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new is(e,t)}function Jp(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new ns(e,t)}function Zp(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new rs(e,t)}function Qp(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new ss(e,t)}function Kp(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new os(e,t)}function $p(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new as(e,t)}function em(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new k(e,t)}function tm(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new hs(e,t)}function im(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Ap(e)}function nm(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new wp(e,t)}function rm(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Eh(new Yh(e.geometry),new y({color:void 0!==t?t:16777215}))}function sm(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Eh(new Jc(e.geometry),new y({color:void 0!==t?t:16777215}))}function om(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Eu(e)}function am(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Pu(e)}function lm(e,t,i){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Ws(e,i)}function hm(){console.error("THREE.CanvasRenderer has been removed")}function cm(){console.error("THREE.JSONLoader has been removed.")}Jh.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Jh.prototype),(e.prototype.constructor=e).prototype.getPoint=t,e},gc.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},up.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},sp.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Su.prototype.extractUrlBase=function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),$u.extractUrlBase(e)},Su.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.")}},Zd.prototype.center=function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},Zd.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Zd.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},Zd.prototype.size=function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)},Fn.prototype.center=function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Fn.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Fn.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},Fn.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},Fn.prototype.size=function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)},nr.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Js.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},$d.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},v.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},v.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},v.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},v.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},v.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},v.prototype.getInverse=function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Ie.prototype.extractPosition=function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},Ie.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},Ie.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new De).setFromMatrixColumn(this,3)},Ie.prototype.setRotationFromQuaternion=function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},Ie.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Ie.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Ie.prototype.multiplyVector4=function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Ie.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Ie.prototype.rotateAxis=function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},Ie.prototype.crossVector=function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Ie.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Ie.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Ie.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Ie.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Ie.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Ie.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Ie.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Ie.prototype.makeFrustum=function(e,t,i,n,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,n,i,r,s)},Ie.prototype.getInverse=function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Xs.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},On.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},On.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},ur.prototype.isIntersectionBox=function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},ur.prototype.isIntersectionPlane=function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},ur.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},p.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},p.prototype.barycoordFromPoint=function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},p.prototype.midpoint=function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},p.prototypenormal=function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},p.prototype.plane=function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)},p.barycoordFromPoint=function(e,t,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),p.getBarycoord(e,t,i,n,r)},p.normal=function(e,t,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),p.getNormal(e,t,i,n)},vc.prototype.extractAllPoints=function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},vc.prototype.extrude=function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Bc(this,e)},vc.prototype.makeGeometry=function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new kc(this,e)},W.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},W.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},W.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},De.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},De.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},De.prototype.getPositionFromMatrix=function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},De.prototype.getScaleFromMatrix=function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},De.prototype.getColumnFromMatrix=function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},De.prototype.applyProjection=function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},De.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},De.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},De.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},ze.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},ze.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},u.prototype.getChildByName=function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},u.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},u.prototype.translate=function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},u.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},u.prototype.applyMatrix=function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(u.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.")}}}),S.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(S.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),Mi},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.")}}}),oh.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},B.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Du.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(T.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===$i},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage($i)}}}),T.prototype.setDynamic=function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?$i:Ki),this},T.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},T.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},_.prototype.addIndex=function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},_.prototype.addAttribute=function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new T(t,arguments[2])))},_.prototype.addDrawCall=function(e,t,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},_.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},_.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},_.prototype.removeAttribute=function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},_.prototype.applyMatrix=function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(_.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}}}),Il.prototype.setDynamic=function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?$i:Ki),this},Il.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Bc.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Bc.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Bc.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},Dl.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Gd.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(i.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 g}},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===D}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}}),Object.defineProperties(Fs.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}}}),s.prototype.clearTarget=function(e,t,i,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,i,n)},s.prototype.animate=function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},s.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},s.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},s.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},s.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},s.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},s.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},s.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},s.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},s.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},s.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},s.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},s.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},s.prototype.enableScissorTest=function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},s.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},s.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},s.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},s.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},s.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},s.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},s.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},s.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},s.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},s.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(s.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?Ti:Pe}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(wl.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(zn.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}}}),Md.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return(new hd).load(e,function(e){t.setBuffer(e)}),this},Cd.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Us.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},Us.prototype.clear=function(e,t,i,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,i,n)},Rn.crossOrigin=void 0,Rn.loadTexture=function(e,t,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new zu,r=(r.setCrossOrigin(this.crossOrigin),r.load(e,i,void 0,n));return t&&(r.mapping=t),r},Rn.loadTextureCube=function(e,t,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new Lu,r=(r.setCrossOrigin(this.crossOrigin),r.load(e,i,void 0,n));return t&&(r.mapping=t),r},Rn.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Rn.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const um={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function dm(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}function pm(){return console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),new _}function mm(){return console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),new _}function fm(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function gm(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function vm(){console.error("THREE.ImmediateRenderObject has been removed.")}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:w}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=w)},861:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};function t(){return"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)}n.r(e),n.d(e,{default:()=>c}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),t()&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var a=o.VantaBase;let l="object"==typeof window&&window.THREE,{Camera:d,ClampToEdgeWrapping:p,DataTexture:m,FloatType:f,Mesh:g,NearestFilter:v,PlaneBufferGeometry:y,RGBAFormat:x,Scene:w,ShaderMaterial:b,WebGLRenderTarget:M}=l||{};function _(l,h,c,e){e&&({Camera:d,ClampToEdgeWrapping:p,DataTexture:m,FloatType:f,Mesh:g,NearestFilter:v,PlaneBufferGeometry:y,RGBAFormat:x,Scene:w,ShaderMaterial:b,WebGLRenderTarget:M}=e),this.variables=[],this.currentTextureIndex=0;var o=f,n=new w,r=new d,i=(r.position.z=1,{passThruTexture:{value:null}}),s=t("uniform sampler2D passThruTexture;\n\nvoid main() {\n\n\tvec2 uv = gl_FragCoord.xy / resolution.xy;\n\n\tgl_FragColor = texture2D( passThruTexture, uv );\n\n}\n",i),a=new g(new y(2,2),s);function u(e){e.defines.resolution="vec2( "+l.toFixed(1)+", "+h.toFixed(1)+" )"}function t(e,t){t=new b({uniforms:t=t||{},vertexShader:"void main()\t{\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n",fragmentShader:e});return u(t),t}n.add(a),this.setDataType=function(e){return o=e,this},this.addVariable=function(e,t,i){e={name:e,initialValueTexture:i,material:this.createShaderMaterial(t),dependencies:null,renderTargets:[],wrapS:null,wrapT:null,minFilter:v,magFilter:v};return this.variables.push(e),e},this.setVariableDependencies=function(e,t){e.dependencies=t},this.init=function(){if(!c.capabilities.isWebGL2&&!c.extensions.get("OES_texture_float"))return"No OES_texture_float support for float textures.";if(0===c.capabilities.maxVertexTextures)return"No support for vertex shader textures.";for(var e=0;e<this.variables.length;e++){var t=this.variables[e],i=(t.renderTargets[0]=this.createRenderTarget(l,h,t.wrapS,t.wrapT,t.minFilter,t.magFilter),t.renderTargets[1]=this.createRenderTarget(l,h,t.wrapS,t.wrapT,t.minFilter,t.magFilter),this.renderTexture(t.initialValueTexture,t.renderTargets[0]),this.renderTexture(t.initialValueTexture,t.renderTargets[1]),t.material),n=i.uniforms;if(null!==t.dependencies)for(var r=0;r<t.dependencies.length;r++){var s=t.dependencies[r];if(s.name!==t.name){for(var o=!1,a=0;a<this.variables.length;a++)if(s.name===this.variables[a].name){o=!0;break}if(!o)return"Variable dependency not found. Variable="+t.name+", dependency="+s.name}n[s.name]={value:null},i.fragmentShader="\nuniform sampler2D "+s.name+";\n"+i.fragmentShader}}return this.currentTextureIndex=0,null},this.compute=function(){for(var e=this.currentTextureIndex,t=0===this.currentTextureIndex?1:0,i=0,n=this.variables.length;i<n;i++){var r=this.variables[i];if(null!==r.dependencies)for(var s=r.material.uniforms,o=0,a=r.dependencies.length;o<a;o++){var l=r.dependencies[o];s[l.name].value=l.renderTargets[e].texture}this.doRenderTarget(r.material,r.renderTargets[t])}this.currentTextureIndex=t},this.getCurrentRenderTarget=function(e){return e.renderTargets[this.currentTextureIndex]},this.getAlternateRenderTarget=function(e){return e.renderTargets[0===this.currentTextureIndex?1:0]},this.addResolutionDefine=u,this.createShaderMaterial=t,this.createRenderTarget=function(e,t,i,n,r,s){return new M(e=e||l,t=t||h,{wrapS:i=i||p,wrapT:n=n||p,minFilter:r=r||v,magFilter:s=s||v,format:x,type:o,stencilBuffer:!1,depthBuffer:!1})},this.createTexture=function(){var e=new Float32Array(l*h*4);return new m(e,l,h,x,f)},this.renderTexture=function(e,t){i.passThruTexture.value=e,this.doRenderTarget(s,t),i.passThruTexture.value=null},this.doRenderTarget=function(e,t){var i=c.getRenderTarget();a.material=e,c.setRenderTarget(t),c.render(n,r),a.material=s,c.setRenderTarget(i)}}let S="object"==typeof window&&window.THREE;const u=!t();let T=32,E=T*T;class A{constructor(e){var n,t,i=new S.Vector3,r=500,s=500,o=200,c=e;this.position=new S.Vector3,this.velocity=new S.Vector3,n=new S.Vector3,this.setGoal=function(e){t=e},this.setWorldSize=function(e,t,i){r=e,s=t,o=i},this.run=function(e){i.set(-r,this.position.y,this.position.z),(i=this.avoid(i)).multiplyScalar(5),n.add(i),i.set(r,this.position.y,this.position.z),(i=this.avoid(i)).multiplyScalar(5),n.add(i),i.set(this.position.x,-s,this.position.z),(i=this.avoid(i)).multiplyScalar(5),n.add(i),i.set(this.position.x,s,this.position.z),(i=this.avoid(i)).multiplyScalar(5),n.add(i),i.set(this.position.x,this.position.y,-o),(i=this.avoid(i)).multiplyScalar(5),n.add(i),i.set(this.position.x,this.position.y,o),(i=this.avoid(i)).multiplyScalar(5),n.add(i),.5<Math.random()&&this.flock(e),this.move()},this.flock=function(e){t&&n.add(this.reach(t,.005)),n.add(this.alignment(e)),n.add(this.cohesion(e)),n.add(this.separation(e))},this.move=function(){this.velocity.add(n);var e=this.velocity.length();2.5<e&&this.velocity.divideScalar(e/2.5),this.position.add(this.velocity),n.set(0,0,0)},this.checkBounds=function(){this.position.x>r&&(this.position.x=-r),this.position.x<-r&&(this.position.x=r),this.position.y>s&&(this.position.y=-s),this.position.y<-s&&(this.position.y=s),this.position.z>o&&(this.position.z=-o),this.position.z<-o&&(this.position.z=o)},this.avoid=function(e){var t=new S.Vector3;return t.copy(this.position),t.sub(e),t.multiplyScalar(1/this.position.distanceToSquared(e)),t},this.repulse=function(e){var t,i=this.position.distanceTo(e);i<150&&((t=new S.Vector3).subVectors(this.position,e),t.multiplyScalar(.5/i),n.add(t))},this.reach=function(e,t){var i=new S.Vector3;return i.subVectors(e,this.position),i.multiplyScalar(t),i},this.alignment=function(e){for(var t,i,n,r=new S.Vector3,s=0,o=100*c.alignment/20,a=0,l=e.length;a<l;a++).6<Math.random()||0<(i=(t=e[a]).position.distanceTo(this.position))&&i<=o&&(r.add(t.velocity),s++);return 0<s&&(r.divideScalar(s),.1<(n=r.length()))&&r.divideScalar(n/.1),r},this.cohesion=function(e){for(var t,i,n=new S.Vector3,r=new S.Vector3,s=0,o=100*c.cohesion/20,a=0,l=e.length;a<l;a++).6<Math.random()||0<(i=(t=e[a]).position.distanceTo(this.position))&&i<=o&&(n.add(t.position),s++);0<s&&n.divideScalar(s),r.subVectors(n,this.position);var h=r.length();return.1<h&&r.divideScalar(h/.1),r},this.separation=function(e){for(var t,i,n=new S.Vector3,r=new S.Vector3,s=100*c.separation/20,o=0,a=e.length;o<a;o++).6<Math.random()||0<(i=(t=e[o]).position.distanceTo(this.position))&&i<=s&&(r.subVectors(this.position,t.position),r.normalize(),r.divideScalar(i),n.add(r));return n}}}class h extends a{static initClass(){this.prototype.defaultOptions={backgroundColor:465199,color1:16711680,color2:53759,colorMode:"varianceGradient",birdSize:1,wingSpan:30,speedLimit:5,separation:20,alignment:20,cohesion:20,quantity:5}}constructor(e){S=e.THREE||S,super(e)}initComputeRenderer(){this.gpuCompute=new _(T,T,this.renderer,S);var t=this.gpuCompute.createTexture(),i=this.gpuCompute.createTexture();{const s=t.image.data;let e=0;const o=s.length;for(var n=[];e<o;){const o=800*Math.random()-400,a=800*Math.random()-400,l=800*Math.random()-400;s[e+0]=o,s[e+1]=a,s[e+2]=l,s[e+3]=1,n.push(e+=4)}}{const h=i.image.data;let e=0;const c=h.length;for(var r=[];e<c;){const c=Math.random()-.5,u=Math.random()-.5,d=Math.random()-.5;h[e+0]=10*c,h[e+1]=10*u,h[e+2]=10*d,h[e+3]=1,r.push(e+=4)}}this.velocityVariable=this.gpuCompute.addVariable("textureVelocity","uniform float time;\nuniform float testing;\nuniform float delta; // about 0.016\nuniform float separationDistance; // 20\nuniform float alignmentDistance; // 40\nuniform float cohesionDistance;\nuniform float speedLimit;\nuniform float freedomFactor;\nuniform vec3 predator;\n\nconst float width = resolution.x;\nconst float height = resolution.y;\n\nconst float PI = 3.141592653589793;\nconst float PI_2 = PI * 2.0;\n// const float VISION = PI * 0.55;\n\nfloat zoneRadius = 40.0;\nfloat zoneRadiusSquared = 1600.0;\n\nfloat separationThresh = 0.45;\nfloat alignmentThresh = 0.65;\n\nconst float UPPER_BOUNDS = BOUNDS;\nconst float LOWER_BOUNDS = -UPPER_BOUNDS;\n\nfloat rand(vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvoid main() {\n\n zoneRadius = separationDistance + alignmentDistance + cohesionDistance;\n separationThresh = separationDistance / zoneRadius;\n alignmentThresh = ( separationDistance + alignmentDistance ) / zoneRadius;\n zoneRadiusSquared = zoneRadius * zoneRadius;\n\n\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec3 birdPosition, birdVelocity;\n\n vec3 selfPosition = texture2D( texturePosition, uv ).xyz;\n vec3 selfVelocity = texture2D( textureVelocity, uv ).xyz;\n\n float dist;\n vec3 dir; // direction\n float distSquared;\n\n float separationSquared = separationDistance * separationDistance;\n float cohesionSquared = cohesionDistance * cohesionDistance;\n\n float f;\n float percent;\n\n vec3 velocity = selfVelocity;\n\n float limit = speedLimit;\n\n dir = predator * UPPER_BOUNDS - selfPosition;\n dir.z = 0.;\n // dir.z *= 0.6;\n dist = length( dir );\n distSquared = dist * dist;\n\n float preyRadius = 150.0;\n float preyRadiusSq = preyRadius * preyRadius;\n\n // move birds away from predator\n if (dist < preyRadius) {\n\n f = ( distSquared / preyRadiusSq - 1.0 ) * delta * 100.;\n velocity += normalize( dir ) * f;\n limit += 5.0;\n }\n\n // if (testing == 0.0) {}\n // if ( rand( uv + time ) < freedomFactor ) {}\n\n // Attract flocks to the center\n vec3 central = vec3( 0., 0., 0. );\n dir = selfPosition - central;\n dist = length( dir );\n\n dir.y *= 2.5;\n velocity -= normalize( dir ) * delta * 5.;\n\n for (float y=0.0;y<height;y++) {\n for (float x=0.0;x<width;x++) {\n\n vec2 ref = vec2( x + 0.5, y + 0.5 ) / resolution.xy;\n birdPosition = texture2D( texturePosition, ref ).xyz;\n\n dir = birdPosition - selfPosition;\n dist = length(dir);\n\n if (dist < 0.0001) continue;\n\n distSquared = dist * dist;\n\n if (distSquared > zoneRadiusSquared ) continue;\n\n percent = distSquared / zoneRadiusSquared;\n\n if ( percent < separationThresh ) { // low\n\n // Separation - Move apart for comfort\n f = (separationThresh / percent - 1.0) * delta;\n velocity -= normalize(dir) * f;\n\n } else if ( percent < alignmentThresh ) { // high\n\n // Alignment - fly the same direction\n float threshDelta = alignmentThresh - separationThresh;\n float adjustedPercent = ( percent - separationThresh ) / threshDelta;\n\n birdVelocity = texture2D( textureVelocity, ref ).xyz;\n\n f = ( 0.5 - cos( adjustedPercent * PI_2 ) * 0.5 + 0.5 ) * delta;\n velocity += normalize(birdVelocity) * f;\n\n } else {\n\n // Attraction / Cohesion - move closer\n float threshDelta = 1.0 - alignmentThresh;\n float adjustedPercent = ( percent - alignmentThresh ) / threshDelta;\n\n f = ( 0.5 - ( cos( adjustedPercent * PI_2 ) * -0.5 + 0.5 ) ) * delta;\n\n velocity += normalize(dir) * f;\n\n }\n }\n }\n\n // this make tends to fly around than down or up\n // if (velocity.y > 0.) velocity.y *= (1. - 0.2 * delta);\n\n // Speed Limits\n if ( length( velocity ) > limit ) {\n velocity = normalize( velocity ) * limit;\n }\n\n gl_FragColor = vec4( velocity, 1.0 );\n\n}",i),this.positionVariable=this.gpuCompute.addVariable("texturePosition","uniform float time;\nuniform float delta;\n\nvoid main() {\n\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec4 tmpPos = texture2D( texturePosition, uv );\n vec3 position = tmpPos.xyz;\n vec3 velocity = texture2D( textureVelocity, uv ).xyz;\n\n float phase = tmpPos.w;\n\n phase = mod( ( phase + delta +\n length( velocity.xz ) * delta * 3. +\n max( velocity.y, 0.0 ) * delta * 6. ), 62.83 );\n\n gl_FragColor = vec4( position + velocity * delta * 15. , phase );\n\n}",t),this.gpuCompute.setVariableDependencies(this.velocityVariable,[this.positionVariable,this.velocityVariable]),this.gpuCompute.setVariableDependencies(this.positionVariable,[this.positionVariable,this.velocityVariable]),this.positionUniforms=this.positionVariable.material.uniforms,this.velocityUniforms=this.velocityVariable.material.uniforms,this.positionUniforms.time={value:0},this.positionUniforms.delta={value:0},this.velocityUniforms.time={value:1},this.velocityUniforms.delta={value:0},this.velocityUniforms.testing={value:1},this.velocityUniforms.separationDistance={value:1},this.velocityUniforms.alignmentDistance={value:1},this.velocityUniforms.cohesionDistance={value:1},this.velocityUniforms.speedLimit={value:1},this.velocityUniforms.freedomFactor={value:1},this.velocityUniforms.predator={value:new S.Vector3},this.velocityVariable.material.defines.BOUNDS=800..toFixed(2),this.velocityVariable.wrapS=S.RepeatWrapping,this.velocityVariable.wrapT=S.RepeatWrapping,this.positionVariable.wrapS=S.RepeatWrapping,this.positionVariable.wrapT=S.RepeatWrapping;i=this.gpuCompute.init();null!==i&&console.error(i)}initGpgpuBirds(){var e=(e=>{const t=new S.BufferGeometry,i=(e.quantity&&(T=Math.pow(2,e.quantity),E=T*T),3*E),n=3*i,r=new S.BufferAttribute(new Float32Array(3*n),3),s=new S.BufferAttribute(new Float32Array(3*n),3),o=new S.BufferAttribute(new Float32Array(2*n),2),a=new S.BufferAttribute(new Float32Array(n),1);t.setAttribute||(t.setAttribute=t.addAttribute),t.setAttribute("position",r),t.setAttribute("birdColor",s),t.setAttribute("reference",o),t.setAttribute("birdVertex",a);let l=0;const h=function(){for(let e=0;e<arguments.length;e++)r.array[l++]=arguments[e]},c=e.wingSpan||20,u=e.birdSize||1;for(let e=0;e<E;e++)h(0,-0,-20*u,0,4*u,-20*u,0,0,30*u),h(0,0,-15*u,-c*u,0,0,0,0,15*u),h(0,0,15*u,c*u,0,0,0,0,-15*u);var d={};for(l=0;l<3*i;l++){const t=~~(l/3),i=t%T/T,n=~~(t/T)/T,r=~~(l/9)/E,h=r.toString(),c=-1!=e.colorMode.indexOf("Gradient");var p=!c&&d[h]?d[h]:e.effect.getNewCol(r);c||d[h]||(d[h]=p),s.array[3*l+0]=p.r,s.array[3*l+1]=p.g,s.array[3*l+2]=p.b,o.array[2*l]=i,o.array[2*l+1]=n,a.array[l]=l%9}return t.scale(.2,.2,.2)})(Object.assign({},this.options,{effect:this})),t=(this.birdUniforms={color:{value:new S.Color(16720384)},texturePosition:{value:null},textureVelocity:{value:null},time:{value:1},delta:{value:0},birdSize:{value:this.options.birdSize}},new S.ShaderMaterial({uniforms:this.birdUniforms,vertexShader:"attribute vec2 reference;\nattribute float birdVertex;\n\nattribute vec3 birdColor;\n\nuniform sampler2D texturePosition;\nuniform sampler2D textureVelocity;\n\nvarying vec4 vColor;\nvarying float z;\n\nuniform float time;\nuniform float birdSize;\n\nvoid main() {\n\n vec4 tmpPos = texture2D( texturePosition, reference );\n vec3 pos = tmpPos.xyz;\n vec3 velocity = normalize(texture2D( textureVelocity, reference ).xyz);\n\n vec3 newPosition = position;\n\n if ( birdVertex == 4.0 || birdVertex == 7.0 ) {\n // flap wings\n newPosition.y = sin( tmpPos.w ) * 5. * birdSize;\n }\n\n newPosition = mat3( modelMatrix ) * newPosition;\n\n velocity.z *= -1.;\n float xz = length( velocity.xz );\n float xyz = 1.;\n float x = sqrt( 1. - velocity.y * velocity.y );\n\n float cosry = velocity.x / xz;\n float sinry = velocity.z / xz;\n\n float cosrz = x / xyz;\n float sinrz = velocity.y / xyz;\n\n mat3 maty = mat3(\n cosry, 0, -sinry,\n 0 , 1, 0 ,\n sinry, 0, cosry\n );\n\n mat3 matz = mat3(\n cosrz , sinrz, 0,\n -sinrz, cosrz, 0,\n 0 , 0 , 1\n );\n newPosition = maty * matz * newPosition;\n newPosition += pos;\n z = newPosition.z;\n\n vColor = vec4( birdColor, 1.0 );\n gl_Position = projectionMatrix * viewMatrix * vec4( newPosition, 1.0 );\n}",fragmentShader:"varying vec4 vColor;\nvarying float z;\nuniform vec3 color;\nvoid main() {\n // Fake colors for now\n float rr = 0.2 + ( 1000. - z ) / 1000. * vColor.x;\n float gg = 0.2 + ( 1000. - z ) / 1000. * vColor.y;\n float bb = 0.2 + ( 1000. - z ) / 1000. * vColor.z;\n gl_FragColor = vec4( rr, gg, bb, 1. );\n}",side:S.DoubleSide})),e=new S.Mesh(e,t);return e.rotation.y=Math.PI/2,e.matrixAutoUpdate=!1,e.updateMatrix(),this.scene.add(e)}getNewCol(e){const t=this.options,i=null!=t.color1?t.color1:4456448,n=null!=t.color2?t.color2:6684672,r=new S.Color(i),s=new S.Color(n);let o,a;if(a=-1!=t.colorMode.indexOf("Gradient")?Math.random():e,0==t.colorMode.indexOf("variance")){const e=(r.r+Math.random()*s.r).clamp(0,1),t=(r.g+Math.random()*s.g).clamp(0,1),i=(r.b+Math.random()*s.b).clamp(0,1);o=new S.Color(e,t,i)}else o=0==t.colorMode.indexOf("mix")?new S.Color(i+a*n):r.lerp(s,a);return o}onInit(){this.camera=new S.PerspectiveCamera(75,this.width/this.height,1,3e3),this.camera.position.z=350,this.fog=new S.Fog(16777215,100,1e3),this.mouseX=this.mouseY=0;const e=this.birds=[],t=this.boids=[],i=this.options;if(u)try{this.initComputeRenderer(),this.valuesChanger=this.valuesChanger.bind(this),this.valuesChanger(),this.initGpgpuBirds()}catch(e){console.error("[vanta.js] birds init error: ",e)}else for(var n=6*Math.pow(2,i.quantity),r=0;r<n;r++){(s=t[r]=new A(i)).position.x=400*Math.random()-200,s.position.y=400*Math.random()-200,s.position.z=400*Math.random()-200,s.velocity.x=2*Math.random()-1,s.velocity.y=2*Math.random()-1,s.velocity.z=2*Math.random()-1,s.setWorldSize(500,500,300);var s=-1!=i.colorMode.indexOf("Gradient"),o=((r={})=>{const e=new S.BufferGeometry,s=[];function t(e,t,i){var n=1.5*(r.birdSize||1);s.push(new S.Vector3(e*n,t*n,i*n))}t(5,0,0),t(-5,-1,1),t(-5,0,0),t(-5,-2,-1),t(0,2,-6),t(0,2,6),t(2,0,0),t(-3,0,0),e.setFromPoints(s);var i=[];return i.push(0,2,1),i.push(4,7,6),i.push(5,6,7),e.setIndex(i),e})(i),a=o.attributes.position.length,l=new S.BufferAttribute(new Float32Array(a),3);if(s)for(var h=0;h<o.index.array.length;h+=3)for(var c=0;c<=2;c++){const e=o.index.array[h+c],t=this.getNewCol();l.array[3*e]=t.r,l.array[3*e+1]=t.g,l.array[3*e+2]=t.b}else{const e=this.getNewCol(r/n);for(h=0;h<l.array.length;h+=3)l.array[h]=e.r,l.array[h+1]=e.g,l.array[h+2]=e.b}o.setAttribute("color",l),(a=e[r]=new S.Mesh(o,new S.MeshBasicMaterial({color:16777215,side:S.DoubleSide,vertexColors:S.VertexColors}))).phase=Math.floor(62.83*Math.random()),a.position.x=t[r].position.x,a.position.y=t[r].position.y,a.position.z=t[r].position.z,this.scene.add(a)}}valuesChanger(){this.velocityUniforms&&(this.velocityUniforms.separationDistance.value=this.options.separation,this.velocityUniforms.alignmentDistance.value=this.options.alignment,this.velocityUniforms.speedLimit.value=this.options.speedLimit,this.velocityUniforms.cohesionDistance.value=this.options.cohesion)}onUpdate(){this.now=performance.now(),this.last||(this.last=this.now);let e=(this.now-this.last)/1e3;if(1<e&&(e=1),this.last=this.now,u)this.positionUniforms.time.value=this.now,this.positionUniforms.delta.value=e,this.velocityUniforms.time.value=this.now,this.velocityUniforms.delta.value=e,this.birdUniforms.time.value=this.now,this.birdUniforms.delta.value=e,this.velocityUniforms.predator.value.set(this.mouseX,-this.mouseY,0),this.mouseX=1e4,this.mouseY=1e4,this.gpuCompute.compute(),this.birdUniforms.texturePosition.value=this.gpuCompute.getCurrentRenderTarget(this.positionVariable).texture,this.birdUniforms.textureVelocity.value=this.gpuCompute.getCurrentRenderTarget(this.velocityVariable).texture;else{const e=this.birds,s=this.boids;for(var t,i,n=0,r=e.length;n<r;n++){(t=s[n]).run(s),(i=e[n]).rotation.y=Math.atan2(-t.velocity.z,t.velocity.x),i.rotation.z=Math.asin(t.velocity.y/t.velocity.length()),i.phase=(i.phase+(Math.max(0,i.rotation.z)+.1))%62.83;const r=16;i.geometry.attributes.position.array[16]=i.geometry.attributes.position.array[13]=5*Math.sin(i.phase)*this.options.birdSize,i.geometry.attributes.position.needsUpdate=!0,i.geometry.computeVertexNormals(),i.position.x=s[n].position.x,i.position.y=s[n].position.y,i.position.z=s[n].position.z}}}onMouseMove(e,t){if(this.mouseX=e-.5,this.mouseY=t-.5,!u){const e=this.boids;for(var i,n=new S.Vector3(this.mouseX*this.width,-this.mouseY*this.height,0),r=0,s=e.length;r<s;r++)i=e[r],n.z=i.position.z,i.repulse(n)}}onDestroy(){}onResize(){}}h.initClass();const c=o.register("BIRDS",h);return e})())()},862:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>c}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let a="object"==typeof window&&window.THREE;class l extends t{constructor(e){(a=e.THREE||a).Color.prototype.toVector=function(){return new a.Vector3(this.r,this.g,this.b)},super(e),this.updateUniforms=this.updateUniforms.bind(this)}init(){this.mode="shader",this.uniforms={iTime:{type:"f",value:1},iResolution:{type:"v2",value:new a.Vector2(1,1)},iDpr:{type:"f",value:window.devicePixelRatio||1},iMouse:{type:"v2",value:new a.Vector2(this.mouseX||0,this.mouseY||0)}},super.init(),this.fragmentShader&&this.initBasicShader()}setOptions(e){super.setOptions(e),this.updateUniforms()}initBasicShader(e=this.fragmentShader,t=this.vertexShader){t=t||"uniform float uTime;\nuniform vec2 uResolution;\nvoid main() {\n gl_Position = vec4( position, 1.0 );\n}",this.updateUniforms(),"function"==typeof this.valuesChanger&&this.valuesChanger();t=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t,fragmentShader:e}),e=this.options.texturePath,e&&(this.uniforms.iTex={type:"t",value:(new a.TextureLoader).load(e)}),e=new a.Mesh(new a.PlaneGeometry(2,2),t);this.scene.add(e),this.camera=new a.Camera,this.camera.position.z=1}updateUniforms(){var e={};let t,i;for(t in this.options)i=this.options[t],-1!==t.toLowerCase().indexOf("color")?e[t]={type:"v3",value:new a.Color(i).toVector()}:"number"==typeof i&&(e[t]={type:"f",value:i});return Object.assign(this.uniforms,e)}resize(){super.resize(),this.uniforms.iResolution.value.x=this.width/this.scale,this.uniforms.iResolution.value.y=this.height/this.scale}}class h extends l{}const c=o.register("FOG",h);return h.prototype.defaultOptions={highlightColor:16761600,midtoneColor:16719616,lowlightColor:2949375,baseColor:16772075,blurFactor:.6,speed:1,zoom:1,scale:2,scaleMobile:4},h.prototype.fragmentShader="uniform vec2 iResolution;\nuniform vec2 iMouse;\nuniform float iTime;\n\nuniform float blurFactor;\nuniform vec3 baseColor;\nuniform vec3 lowlightColor;\nuniform vec3 midtoneColor;\nuniform vec3 highlightColor;\nuniform float zoom;\n\nfloat random (in vec2 _st) {\n return fract(sin(dot(_st.xy,\n vec2(0.129898,0.78233)))*\n 437.585453123);\n}\n\n// Based on Morgan McGuire @morgan3d\n// https://www.shadertoy.com/view/4dS3Wd\nfloat noise (in vec2 _st) {\n vec2 i = floor(_st);\n vec2 f = fract(_st);\n\n // Four corners in 2D of a tile\n float a = random(i);\n float b = random(i + vec2(1.0, 0.0));\n float c = random(i + vec2(0.0, 1.0));\n float d = random(i + vec2(1.0, 1.0));\n\n vec2 u = f * f * (3.0 - 2.0 * f);\n\n return mix(a, b, u.x) +\n (c - a)* u.y * (1.0 - u.x) +\n (d - b) * u.x * u.y;\n}\n\n#define NUM_OCTAVES 6\n\nfloat fbm ( in vec2 _st) {\n float v = 0.0;\n float a = blurFactor;\n vec2 shift = vec2(100.0);\n // Rotate to reduce axial bias\n mat2 rot = mat2(cos(0.5), sin(0.5),\n -sin(0.5), cos(0.50));\n for (int i = 0; i < NUM_OCTAVES; ++i) {\n v += a * noise(_st);\n _st = rot * _st * 2.0 + shift;\n a *= (1. - blurFactor);\n }\n return v;\n}\n\nvoid main() {\n vec2 st = gl_FragCoord.xy / iResolution.xy*3.;\n st.x *= 0.7 * iResolution.x / iResolution.y ; // Still keep it more landscape than square\n st *= zoom;\n\n // st += st * abs(sin(iTime*0.1)*3.0);\n vec3 color = vec3(0.0);\n\n vec2 q = vec2(0.);\n q.x = fbm( st + 0.00*iTime);\n q.y = fbm( st + vec2(1.0));\n\n vec2 dir = vec2(0.15,0.126);\n vec2 r = vec2(0.);\n r.x = fbm( st + 1.0*q + vec2(1.7,9.2)+ dir.x*iTime );\n r.y = fbm( st + 1.0*q + vec2(8.3,2.8)+ dir.y*iTime);\n\n float f = fbm(st+r);\n\n color = mix(baseColor,\n lowlightColor,\n clamp((f*f)*4.0,0.0,1.0));\n\n color = mix(color,\n midtoneColor,\n clamp(length(q),0.0,1.0));\n\n color = mix(color,\n highlightColor,\n clamp(length(r.x),0.0,1.0));\n\n vec3 finalColor = mix(baseColor, color, f*f*f+.6*f*f+.5*f);\n gl_FragColor = vec4(finalColor,1.0);\n}\n",e})())()},863:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>l}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let d="object"==typeof window&&window.THREE;class a extends t{static initClass(){this.prototype.ww=100,this.prototype.hh=80,this.prototype.waveNoise=4}constructor(e){d=e.THREE||d,super(e)}getMaterial(){var e={color:this.options.color,shininess:this.options.shininess,flatShading:!0,side:d.DoubleSide};return new d.MeshPhongMaterial(e)}onInit(){let i,n;const e=this.getMaterial(),t=new d.BufferGeometry,r=(this.gg=[],[]);for(i=0;i<=this.ww;i++)for(this.gg[i]=[],n=0;n<=this.hh;n++){const u=r.length,e=new d.Vector3(18*(i-.5*this.ww),(null==(o=this.waveNoise)&&(o=1),(s=0)+Math.random()*(o-s)-10),18*(.5*this.hh-n));r.push(e),this.gg[i][n]=u}t.setFromPoints(r);var s,o,a,l,h=[];for(i=1;i<=this.ww;i++)for(n=1;n<=this.hh;n++){let e,t;const r=this.gg[i][n],s=this.gg[i][n-1],o=this.gg[i-1][n],d=this.gg[i-1][n-1];null==(a=0)&&(a=0),null==(l=1)&&(l=1),t=Math.floor(a+Math.random()*(l-a+1))?(e=[d,s,o],[s,o,r]):(e=[d,s,r],[d,o,r]),h.push(...e,...t)}t.setIndex(h),this.plane=new d.Mesh(t,e),this.scene.add(this.plane);var c=new d.AmbientLight(16777215,.9),c=(this.scene.add(c),new d.PointLight(16777215,.9));c.position.set(-100,250,-100),this.scene.add(c),this.camera=new d.PerspectiveCamera(35,this.width/this.height,50,1e4),this.cameraPosition=new d.Vector3(240,200,390),this.cameraTarget=new d.Vector3(140,-30,190),this.camera.position.copy(this.cameraPosition),this.scene.add(this.camera)}onUpdate(){let e;this.plane.material.color.set(this.options.color),this.plane.material.shininess=this.options.shininess,this.camera.ox=this.cameraPosition.x/this.options.zoom,this.camera.oy=this.cameraPosition.y/this.options.zoom,this.camera.oz=this.cameraPosition.z/this.options.zoom,null!=this.controls&&this.controls.update();const t=this.camera;.01<Math.abs(t.tx-t.position.x)&&(e=t.tx-t.position.x,t.position.x+=.02*e),.01<Math.abs(t.ty-t.position.y)&&(e=t.ty-t.position.y,t.position.y+=.02*e),.01<Math.abs(t.tz-t.position.z)&&(e=t.tz-t.position.z,t.position.z+=.02*e),t.lookAt(this.cameraTarget),this.oy=this.oy||{};for(let e=0;e<this.plane.geometry.attributes.position.array.length;e+=3){const t={x:this.plane.geometry.attributes.position.array[e],y:this.plane.geometry.attributes.position.array[e+1],z:this.plane.geometry.attributes.position.array[e+2],oy:this.oy[e]};var i,n;t.oy?(i=this.options.waveSpeed,n=Math.sqrt(i)*Math.cos(-t.x-.7*t.z),i=Math.sin(i*this.t*.02-i*t.x*.025+i*t.z*.015+n),n=Math.pow(i+1,2)/4,t.y=t.oy+n*this.options.waveHeight,this.plane.geometry.attributes.position.array[e+1]=t.y):this.oy[e]=t.y}this.plane.geometry.attributes.position.setUsage(d.DynamicDrawUsage),this.plane.geometry.computeVertexNormals(),this.plane.geometry.attributes.position.needsUpdate=!0,this.wireframe&&(this.wireframe.geometry.fromGeometry(this.plane.geometry),this.wireframe.geometry.computeFaceNormals())}onMouseMove(e,t){var i=this.camera;return i.oy||(i.oy=i.position.y,i.ox=i.position.x,i.oz=i.position.z),i.tx=i.ox+100*(e-.5)/this.options.zoom,i.ty=i.oy+-100*(t-.5)/this.options.zoom,i.tz=i.oz+-50*(e-.5)/this.options.zoom}}a.prototype.defaultOptions={color:21896,shininess:30,waveHeight:15,waveSpeed:1,zoom:1},a.initClass();const l=o.register("WAVES",a);return e})())()},864:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>c}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let a="object"==typeof window&&window.THREE;class l extends t{constructor(e){(a=e.THREE||a).Color.prototype.toVector=function(){return new a.Vector3(this.r,this.g,this.b)},super(e),this.updateUniforms=this.updateUniforms.bind(this)}init(){this.mode="shader",this.uniforms={iTime:{type:"f",value:1},iResolution:{type:"v2",value:new a.Vector2(1,1)},iDpr:{type:"f",value:window.devicePixelRatio||1},iMouse:{type:"v2",value:new a.Vector2(this.mouseX||0,this.mouseY||0)}},super.init(),this.fragmentShader&&this.initBasicShader()}setOptions(e){super.setOptions(e),this.updateUniforms()}initBasicShader(e=this.fragmentShader,t=this.vertexShader){t=t||"uniform float uTime;\nuniform vec2 uResolution;\nvoid main() {\n gl_Position = vec4( position, 1.0 );\n}",this.updateUniforms(),"function"==typeof this.valuesChanger&&this.valuesChanger();t=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t,fragmentShader:e}),e=this.options.texturePath,e&&(this.uniforms.iTex={type:"t",value:(new a.TextureLoader).load(e)}),e=new a.Mesh(new a.PlaneGeometry(2,2),t);this.scene.add(e),this.camera=new a.Camera,this.camera.position.z=1}updateUniforms(){var e={};let t,i;for(t in this.options)i=this.options[t],-1!==t.toLowerCase().indexOf("color")?e[t]={type:"v3",value:new a.Color(i).toVector()}:"number"==typeof i&&(e[t]={type:"f",value:i});return Object.assign(this.uniforms,e)}resize(){super.resize(),this.uniforms.iResolution.value.x=this.width/this.scale,this.uniforms.iResolution.value.y=this.height/this.scale}}class h extends l{}const c=o.register("CLOUDS",h);return h.prototype.defaultOptions={backgroundColor:16777215,skyColor:6863063,cloudColor:11387358,cloudShadowColor:1586512,sunColor:16750873,sunGlareColor:16737843,sunlightColor:16750899,scale:3,scaleMobile:12,speed:1,mouseEase:!0},h.prototype.fragmentShader="uniform vec2 iResolution;\nuniform vec2 iMouse;\nuniform float iTime;\nuniform sampler2D iTex;\n\nuniform float speed;\nuniform vec3 skyColor;\nuniform vec3 cloudColor;\nuniform vec3 cloudShadowColor;\nuniform vec3 sunColor;\nuniform vec3 sunlightColor;\nuniform vec3 sunGlareColor;\nuniform vec3 backgroundColor;\n\n// uniform vec4 iMouse; // mouse pixel coords. xy: current (if MLB down), zw: click\n// uniform samplerXX iChannel0..3; // input channel. XX = 2D/Cube\n\n\n// Volumetric clouds. It performs level of detail (LOD) for faster rendering\nfloat hash(float p) {\n p = fract(p * 0.011);\n p *= (p + 7.5);\n p *= (p + p);\n return fract(p);\n}\n\nfloat noise( vec3 x ){\n // The noise function returns a value in the range -1.0f -> 1.0f\n vec3 p = floor(x);\n vec3 f = fract(x);\n f = f*f*(3.0-2.0*f);\n float n = p.x + p.y*57.0 + 113.0*p.z;\n return mix(mix(mix( hash(n+0.0 ), hash(n+1.0 ),f.x),\n mix( hash(n+57.0 ), hash(n+58.0 ),f.x),f.y),\n mix(mix( hash(n+113.0), hash(n+114.0),f.x),\n mix( hash(n+170.0), hash(n+171.0),f.x),f.y),f.z);\n}\n\nconst float constantTime = 1000.;\nfloat map5( in vec3 p ){\n vec3 speed1 = vec3(0.5,0.01,1.0) * 0.5 * speed;\n vec3 q = p - speed1*(iTime + constantTime);\n float f;\n f = 0.50000*noise( q ); q = q*2.02;\n f += 0.25000*noise( q ); q = q*2.03;\n f += 0.12500*noise( q ); q = q*2.01;\n f += 0.06250*noise( q ); q = q*2.02;\n f += 0.03125*noise( q );\n return clamp( 1.5 - p.y - 2.0 + 1.75*f, 0.0, 1.0 );\n}\nfloat map4( in vec3 p ){\n vec3 speed1 = vec3(0.5,0.01,1.0) * 0.5 * speed;\n vec3 q = p - speed1*(iTime + constantTime);\n float f;\n f = 0.50000*noise( q ); q = q*2.02;\n f += 0.25000*noise( q ); q = q*2.03;\n f += 0.12500*noise( q ); q = q*2.01;\n f += 0.06250*noise( q );\n return clamp( 1.5 - p.y - 2.0 + 1.75*f, 0.0, 1.0 );\n}\nfloat map3( in vec3 p ){\n vec3 speed1 = vec3(0.5,0.01,1.0) * 0.5 * speed;\n vec3 q = p - speed1*(iTime + constantTime);\n float f;\n f = 0.50000*noise( q ); q = q*2.02;\n f += 0.25000*noise( q ); q = q*2.03;\n f += 0.12500*noise( q );\n return clamp( 1.5 - p.y - 2.0 + 1.75*f, 0.0, 1.0 );\n}\nfloat map2( in vec3 p ){\n vec3 speed1 = vec3(0.5,0.01,1.0) * 0.5 * speed;\n vec3 q = p - speed1*(iTime + constantTime);\n float f;\n f = 0.50000*noise( q ); q = q*2.02;\n f += 0.25000*noise( q );\n return clamp( 1.5 - p.y - 2.0 + 1.75*f, 0.0, 1.0 );\n}\n\nvec3 sundir = normalize( vec3(-1.0,0.0,-1.0) );\n\nvec4 integrate( in vec4 sum, in float dif, in float den, in vec3 bgcol, in float t ){\n // lighting\n vec3 lin = cloudColor*1.4 + sunlightColor*dif;\n vec4 col = vec4( mix( vec3(1.0,0.95,0.8), cloudShadowColor, den ), den );\n col.xyz *= lin;\n col.xyz = mix( col.xyz, bgcol, 1.0-exp(-0.003*t*t) );\n // front to back blending\n col.a *= 0.4;\n col.rgb *= col.a;\n return sum + col*(1.0-sum.a);\n}\n\n#define MARCH(STEPS,MAPLOD) for(int i=0; i<STEPS; i++) { vec3 pos = ro + t*rd; if( pos.y<-3.0 || pos.y>2.0 || sum.a > 0.99 ) break; float den = MAPLOD( pos ); if( den>0.01 ) { float dif = clamp((den - MAPLOD(pos+0.3*sundir))/0.6, 0.0, 1.0 ); sum = integrate( sum, dif, den, bgcol, t ); } t += max(0.075,0.02*t); }\n\nvec4 raymarch( in vec3 ro, in vec3 rd, in vec3 bgcol, in ivec2 px ){\n vec4 sum = vec4(0.0);\n\n float t = 0.0;\n\n MARCH(20,map5);\n MARCH(25,map4);\n MARCH(30,map3);\n MARCH(40,map2);\n\n return clamp( sum, 0.0, 1.0 );\n}\n\nmat3 setCamera( in vec3 ro, in vec3 ta, float cr ){\n vec3 cw = normalize(ta-ro);\n vec3 cp = vec3(sin(cr), cos(cr),0.0);\n vec3 cu = normalize( cross(cw,cp) );\n vec3 cv = normalize( cross(cu,cw) );\n return mat3( cu, cv, cw );\n}\n\nvec4 render( in vec3 ro, in vec3 rd, in ivec2 px ){\n // background sky\n float sun = clamp( dot(sundir,rd), 0.0, 1.0 );\n vec3 col = skyColor - rd.y*0.2*vec3(1.0,0.5,1.0) + 0.15*0.5;\n col += 0.2*sunColor*pow( sun, 8.0 );\n\n // clouds\n vec4 res = raymarch( ro, rd, col, px );\n col = col*(1.0-res.w) + res.xyz;\n\n // sun glare\n col += 0.2*sunGlareColor*pow( sun, 3.0 );\n\n return vec4( col, 1.0 );\n}\n\nvoid main(){\n vec2 p = (-iResolution.xy + 2.0*gl_FragCoord.xy)/ iResolution.y;\n\n vec2 m = iMouse.xy/iResolution.xy;\n m.y = (1.0 - m.y) * 0.33 + 0.28; // camera height\n\n m.x *= 0.25;\n m.x += sin(iTime * 0.1 + 3.1415) * 0.25 + 0.25;\n\n // camera\n vec3 ro = 4.0*normalize(vec3(sin(3.0*m.x), 0.4*m.y, cos(3.0*m.x))); // origin\n vec3 ta = vec3(0.0, -1.0, 0.0);\n mat3 ca = setCamera( ro, ta, 0.0 );\n // ray\n vec3 rd = ca * normalize( vec3(p.xy,1.5));\n\n gl_FragColor = render( ro, rd, ivec2(gl_FragCoord-0.5) );\n}\n",e})())()},865:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>c}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let a="object"==typeof window&&window.THREE;class l extends t{constructor(e){(a=e.THREE||a).Color.prototype.toVector=function(){return new a.Vector3(this.r,this.g,this.b)},super(e),this.updateUniforms=this.updateUniforms.bind(this)}init(){this.mode="shader",this.uniforms={iTime:{type:"f",value:1},iResolution:{type:"v2",value:new a.Vector2(1,1)},iDpr:{type:"f",value:window.devicePixelRatio||1},iMouse:{type:"v2",value:new a.Vector2(this.mouseX||0,this.mouseY||0)}},super.init(),this.fragmentShader&&this.initBasicShader()}setOptions(e){super.setOptions(e),this.updateUniforms()}initBasicShader(e=this.fragmentShader,t=this.vertexShader){t=t||"uniform float uTime;\nuniform vec2 uResolution;\nvoid main() {\n gl_Position = vec4( position, 1.0 );\n}",this.updateUniforms(),"function"==typeof this.valuesChanger&&this.valuesChanger();t=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t,fragmentShader:e}),e=this.options.texturePath,e&&(this.uniforms.iTex={type:"t",value:(new a.TextureLoader).load(e)}),e=new a.Mesh(new a.PlaneGeometry(2,2),t);this.scene.add(e),this.camera=new a.Camera,this.camera.position.z=1}updateUniforms(){var e={};let t,i;for(t in this.options)i=this.options[t],-1!==t.toLowerCase().indexOf("color")?e[t]={type:"v3",value:new a.Color(i).toVector()}:"number"==typeof i&&(e[t]={type:"f",value:i});return Object.assign(this.uniforms,e)}resize(){super.resize(),this.uniforms.iResolution.value.x=this.width/this.scale,this.uniforms.iResolution.value.y=this.height/this.scale}}class h extends l{}const c=o.register("CLOUDS2",h);return h.prototype.defaultOptions={backgroundColor:0,skyColor:6072010,cloudColor:3362176,lightColor:16777215,speed:1,texturePath:"./gallery/noise.png",scaleMobile:4},h.prototype.fragmentShader="uniform vec2 iResolution;\nuniform vec2 iMouse;\nuniform float iTime;\nuniform sampler2D iTex;\nuniform float speed;\nuniform vec3 skyColor;\nuniform vec3 cloudColor;\nuniform vec3 lightColor;\n\n# define T texture2D(iTex, fract((s*p.zw + ceil(s*p.x)) / 200.0)).y / (s += s) * 4.0\n\nvoid main(){\n vec2 coord = gl_FragCoord.xy;\n vec4 p, d = vec4(0.8, 0, coord / iResolution.y - 0.65);\n vec3 out1 = skyColor - d.w; // sky gradient\n float s, f, t = 200.0 + sin(dot(coord,coord));\n const float MAX_ITER = 100.0;\n for (float i = 1.0; i <= MAX_ITER; i += 1.0) {\n t -= 2.0; if (t < 0.0) { break; } // march step\n p = 0.05 * t * d;\n p.xz += iTime * 0.50000 * speed; // movement through space\n p.x += sin(iTime * 0.25 * speed) * 0.25;\n s = 2.0;\n f = p.w + 1.0-T-T-T-T;\n // f = p.w + 1.0 - 0.25*noise(p.xyz * 2.0) - 0.25*noise(p.zxy * 2.01) - 0.25*noise(p.yzx * 2.03);\n if (f < 0.0) {\n vec3 cloudColorShading = mix(lightColor, cloudColor, -f);\n out1 = mix(out1, cloudColorShading, -f * 0.4);\n }\n }\n gl_FragColor = vec4(out1, 1.0);\n}",e})())()},866:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};function g(e,t){return null==t&&(t=1),(e=null==e?0:e)+Math.random()*(t-e)}n.r(e),n.d(e,{default:()=>l}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const v=e=>.299*e.r+.587*e.g+.114*e.b,i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{},t=(o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24",o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}},o.VantaBase),m="object"==typeof window;let y=m&&window.THREE;class a extends t{static initClass(){this.prototype.defaultOptions={color:16727937,color2:16777215,size:1,backgroundColor:2299196,points:10,maxDistance:20,spacing:15,showDots:!0}}constructor(e){y=e.THREE||y,super(e)}genPoint(e,t,i){let n;if(this.points||(this.points=[]),this.options.showDots){const e=new y.SphereGeometry(.25,12,12),t=new y.MeshLambertMaterial({color:this.options.color});n=new y.Mesh(e,t)}else n=new y.Object3D;return this.cont.add(n),n.ox=e,n.oy=t,n.oz=i,n.position.set(e,t,i),n.r=0,this.points.push(n)}onInit(){this.cont=new y.Group,this.cont.position.set(-50,-20,0),this.scene.add(this.cont);let i=this.options.points,n=this.options["spacing"];const r=i*i*2,s=(this.linePositions=new Float32Array(r*r*3),this.lineColors=new Float32Array(r*r*3),v(new y.Color(this.options.color))),t=v(new y.Color(this.options.backgroundColor)),o=(this.blending=s>t?"additive":"subtractive",new y.BufferGeometry);o.setAttribute("position",new y.BufferAttribute(this.linePositions,3).setUsage(y.DynamicDrawUsage)),o.setAttribute("color",new y.BufferAttribute(this.lineColors,3).setUsage(y.DynamicDrawUsage)),o.computeBoundingSphere(),o.setDrawRange(0,0);var e=new y.LineBasicMaterial({vertexColors:y.VertexColors,blending:"additive"===this.blending?y.AdditiveBlending:null,transparent:!0});this.linesMesh=new y.LineSegments(o,e),this.cont.add(this.linesMesh);for(let t=0;t<=i;t++)for(let e=0;e<=i;e++){const r=0,s=(t-i/2)*n;var a=(e-i/2)*n;this.genPoint(s,0,a)}this.camera=new y.PerspectiveCamera(20,this.width/this.height,.01,1e4),this.camera.position.set(50,100,150),this.scene.add(this.camera);var e=new y.AmbientLight(16777215,.75),e=(this.scene.add(e),this.spot=new y.SpotLight(16777215,1),this.spot.position.set(0,200,0),this.spot.distance=400,this.spot.target=this.cont,this.scene.add(this.spot),this.cont2=new y.Group,this.cont2.position.set(0,15,0),this.scene.add(this.cont2),new y.LineBasicMaterial({color:this.options.color2})),l=[];for(let e=0;e<80;e++){const i=g(18,24),n=i+g(1,6),v=g(-1,1),r=Math.sqrt(1-v*v),s=g(0,2*Math.PI),t=Math.sin(s)*r,o=Math.cos(s)*r;l.push(new y.Vector3(o*i,t*i,v*i)),l.push(new y.Vector3(o*n,t*n,v*n))}var h=(new y.BufferGeometry).setFromPoints(l),h=(this.linesMesh2=new y.LineSegments(h,e),this.linesMesh2.position.set(0,0,0),this.cont2.add(this.linesMesh2),new y.LineBasicMaterial({color:this.options.color2,linewidth:2})),c=[];c.push(new y.Vector3(0,30,0)),c.push(new y.Vector3(0,-30,0));for(let e=0;e<4;e++){var u=.15*Math.cos(e/4*Math.PI*2),d=.15*Math.sin(e/4*Math.PI*2),p=[17.9,12,8,5,3,2,1.5,1.1,.8,.6,.45,.3,.2,.1,.05,.03,.02,.01];for(let e=0;e<p.length;e++){var m=p[e],f=6*(e+1);c.push(new y.Vector3(u*f,m,d*f)),c.push(new y.Vector3(u*f,-m,d*f))}}e=(new y.BufferGeometry).setFromPoints(c),this.linesMesh3=new y.LineSegments(e,h),this.linesMesh3.position.set(0,0,0),this.cont2.add(this.linesMesh3),e=new y.LineBasicMaterial({color:this.options.color}),h=new y.SphereGeometry(18*this.options.size,18,14),h=new y.EdgesGeometry(h);this.sphere=new y.LineSegments(h,e),this.sphere.position.set(0,0,0),this.cont2.add(this.sphere),this.cont2.rotation.x=-.25}onUpdate(){let i;null!=this.helper&&this.helper.update(),null!=this.controls&&this.controls.update();var e=this.camera;.01<Math.abs(e.tx-e.position.x)&&(i=e.tx-e.position.x,e.position.x+=.02*i),.01<Math.abs(e.ty-e.position.y)&&(i=e.ty-e.position.y,e.position.y+=.02*i),m&&window.innerWidth<480?e.lookAt(new y.Vector3(-10,0,0)):m&&window.innerWidth<720?e.lookAt(new y.Vector3(-20,0,0)):e.lookAt(new y.Vector3(-40,0,0));let n=0,r=0,s=0;var o,a=new y.Color(this.options.backgroundColor),l=new y.Color(this.options.color),e=new y.Color(this.options.color2),h=l.clone().sub(a);this.rayCaster&&this.rayCaster.setFromCamera(new y.Vector2(this.rcMouseX,this.rcMouseY),this.camera),this.linesMesh2&&(this.linesMesh2.rotation.z+=.002,this.linesMesh2.rotation.x+=8e-4,this.linesMesh2.rotation.y+=5e-4),this.sphere&&(this.sphere.rotation.y+=.002,this.linesMesh3.rotation.y-=.004);for(let t=0;t<this.points.length;t++){const m=this.points[t];var c=(this.rayCaster?this.rayCaster.ray.distanceToPoint(m.position):1e3).clamp(5,15);m.scale.z=(.25*(15-c)).clamp(1,100),m.scale.x=m.scale.y=m.scale.z,m.position.y=2*Math.sin(m.position.x/10+.01*this.t+m.position.z/10*.5);for(let e=t;e<this.points.length;e++){const i=this.points[e],u=m.position.x-i.position.x,d=m.position.y-i.position.y,p=m.position.z-i.position.z;if((o=Math.sqrt(u*u+d*d+p*p))<this.options.maxDistance){let e,t=2*(1-o/this.options.maxDistance);t=t.clamp(0,1),e="additive"===this.blending?new y.Color(0).lerp(h,t):a.clone().lerp(l,t),this.linePositions[n++]=m.position.x,this.linePositions[n++]=m.position.y,this.linePositions[n++]=m.position.z,this.linePositions[n++]=i.position.x,this.linePositions[n++]=i.position.y,this.linePositions[n++]=i.position.z,this.lineColors[r++]=e.r,this.lineColors[r++]=e.g,this.lineColors[r++]=e.b,this.lineColors[r++]=e.r,this.lineColors[r++]=e.g,this.lineColors[r++]=e.b,s++}}}return this.linesMesh.geometry.setDrawRange(0,2*s),this.linesMesh.geometry.attributes.position.needsUpdate=!0,this.linesMesh.geometry.attributes.color.needsUpdate=!0,this.sphere.material.color.set(l),this.linesMesh2.material.color.set(e),this.linesMesh3.material.color.set(e),.001*this.t}onMouseMove(e,t){var i=this.camera,n=(i.oy||(i.oy=i.position.y,i.ox=i.position.x,i.oz=i.position.z),Math.atan2(i.oz,i.ox)),r=Math.sqrt(i.oz*i.oz+i.ox*i.ox),n=n+1.5*(e-.5)*(this.options.mouseCoeffX||1);i.tz=r*Math.sin(n),i.tx=r*Math.cos(n),i.ty=i.oy+80*(t-.5)*(this.options.mouseCoeffY||1),this.rayCaster,this.rcMouseX=2*e-1,this.rcMouseY=2*-e+1}onRestart(){this.scene.remove(this.linesMesh),this.points=[]}}a.initClass();const l=o.register("GLOBE",a);return e})())()},867:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};function a(){return"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)}function l(e,t){return null==e&&(e=0),null==t&&(t=1),Math.floor(e+Math.random()*(t-e+1))}n.r(e),n.d(e,{default:()=>u}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const h=e=>.299*e.r+.587*e.g+.114*e.b,i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),a()&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let g="object"==typeof window&&window.THREE;class c extends t{static initClass(){this.prototype.defaultOptions={color:16727937,backgroundColor:2299196,points:10,maxDistance:20,spacing:15,showDots:!0}}constructor(e){g=e.THREE||g,super(e)}genPoint(e,t,i){let n;if(this.points||(this.points=[]),this.options.showDots){const e=new g.SphereGeometry(.25,12,12),t=new g.MeshLambertMaterial({color:this.options.color});n=new g.Mesh(e,t)}else n=new g.Object3D;return this.cont.add(n),n.ox=e,n.oy=t,n.oz=i,n.position.set(e,t,i),n.r=(t=-(e=2))+Math.random()*(e-t),this.points.push(n)}onInit(){this.cont=new g.Group,this.cont.position.set(0,0,0),this.scene.add(this.cont);let n=this.options.points,r=this.options["spacing"];a()&&(n=~~(.75*n),r=~~(.65*r));const s=n*n*2,o=(this.linePositions=new Float32Array(s*s*3),this.lineColors=new Float32Array(s*s*3),h(new g.Color(this.options.color))),e=h(new g.Color(this.options.backgroundColor));this.blending=o>e?"additive":"subtractive";var t=new g.BufferGeometry,i=(t.setAttribute("position",new g.BufferAttribute(this.linePositions,3).setUsage(g.DynamicDrawUsage)),t.setAttribute("color",new g.BufferAttribute(this.lineColors,3).setUsage(g.DynamicDrawUsage)),t.computeBoundingSphere(),t.setDrawRange(0,0),new g.LineBasicMaterial({vertexColors:g.VertexColors,blending:"additive"===this.blending?g.AdditiveBlending:null,transparent:!0}));this.linesMesh=new g.LineSegments(t,i),this.cont.add(this.linesMesh);for(let i=0;i<=n;i++)for(let t=0;t<=n;t++){const s=l(-3,3),o=(i-n/2)*r+l(-5,5);let e=(t-n/2)*r+l(-5,5);i%2&&(e+=.5*r),this.genPoint(o,s-l(5,15),e),this.genPoint(o+l(-5,5),s+l(5,15),e+l(-5,5))}this.camera=new g.PerspectiveCamera(25,this.width/this.height,.01,1e4),this.camera.position.set(50,100,150),this.scene.add(this.camera);t=new g.AmbientLight(16777215,.75);return this.scene.add(t),this.spot=new g.SpotLight(16777215,1),this.spot.position.set(0,200,0),this.spot.distance=400,this.spot.target=this.cont,this.scene.add(this.spot)}onDestroy(){this.scene&&this.scene.remove(this.linesMesh),this.spot=this.points=this.linesMesh=this.lineColors=this.linePositions=null}setOptions(t){super.setOptions(t),t.color&&this.points.forEach(e=>{e.material.color=new g.Color(t.color)})}onUpdate(){let n;var e=this.camera;.01<Math.abs(e.tx-e.position.x)&&(n=e.tx-e.position.x,e.position.x+=.02*n),.01<Math.abs(e.ty-e.position.y)&&(n=e.ty-e.position.y,e.position.y+=.02*n),e.lookAt(new g.Vector3(0,0,0));let r=0,s=0,o=0;var a=new g.Color(this.options.backgroundColor),l=new g.Color(this.options.color),h=l.clone().sub(a);this.rayCaster&&this.rayCaster.setFromCamera(new g.Vector2(this.rcMouseX,this.rcMouseY),this.camera);for(let i=0;i<this.points.length;i++){let t;var c,u=this.points[i],d=(this.rayCaster?this.rayCaster.ray.distanceToPoint(u.position):1e3).clamp(5,15);u.scale.x=u.scale.y=u.scale.z=(.25*(15-d)).clamp(1,100),0!==u.r&&(d=Math.atan2(u.position.z,u.position.x),t=Math.sqrt(u.position.z*u.position.z+u.position.x*u.position.x),d+=25e-5*u.r,u.position.x=t*Math.cos(d),u.position.z=t*Math.sin(d));for(let e=i;e<this.points.length;e++){const n=this.points[e],p=u.position.x-n.position.x,m=u.position.y-n.position.y,f=u.position.z-n.position.z;(t=Math.sqrt(p*p+m*m+f*f))<this.options.maxDistance&&(c=(2*(1-t/this.options.maxDistance)).clamp(0,1),c="additive"===this.blending?new g.Color(0).lerp(h,c):a.clone().lerp(l,c),this.linePositions[r++]=u.position.x,this.linePositions[r++]=u.position.y,this.linePositions[r++]=u.position.z,this.linePositions[r++]=n.position.x,this.linePositions[r++]=n.position.y,this.linePositions[r++]=n.position.z,this.lineColors[s++]=c.r,this.lineColors[s++]=c.g,this.lineColors[s++]=c.b,this.lineColors[s++]=c.r,this.lineColors[s++]=c.g,this.lineColors[s++]=c.b,o++)}}return this.linesMesh.geometry.setDrawRange(0,2*o),this.linesMesh.geometry.attributes.position.needsUpdate=!0,this.linesMesh.geometry.attributes.color.needsUpdate=!0,.001*this.t}onMouseMove(e,t){var i=this.camera,n=(i.oy||(i.oy=i.position.y,i.ox=i.position.x,i.oz=i.position.z),Math.atan2(i.oz,i.ox)),r=Math.sqrt(i.oz*i.oz+i.ox*i.ox),n=n+2*(e-.5)*(this.options.mouseCoeffX||1);i.tz=r*Math.sin(n),i.tx=r*Math.cos(n),i.ty=i.oy+50*(t-.5)*(this.options.mouseCoeffY||1),this.rayCaster,this.rcMouseX=2*e-1,this.rcMouseY=2*-e+1}onRestart(){this.scene&&this.scene.remove(this.linesMesh),this.points=[]}}c.initClass();const u=o.register("NET",c);return e})())()},868:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>c}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let a="object"==typeof window&&window.THREE;class l extends t{constructor(e){(a=e.THREE||a).Color.prototype.toVector=function(){return new a.Vector3(this.r,this.g,this.b)},super(e),this.updateUniforms=this.updateUniforms.bind(this)}init(){this.mode="shader",this.uniforms={iTime:{type:"f",value:1},iResolution:{type:"v2",value:new a.Vector2(1,1)},iDpr:{type:"f",value:window.devicePixelRatio||1},iMouse:{type:"v2",value:new a.Vector2(this.mouseX||0,this.mouseY||0)}},super.init(),this.fragmentShader&&this.initBasicShader()}setOptions(e){super.setOptions(e),this.updateUniforms()}initBasicShader(e=this.fragmentShader,t=this.vertexShader){t=t||"uniform float uTime;\nuniform vec2 uResolution;\nvoid main() {\n gl_Position = vec4( position, 1.0 );\n}",this.updateUniforms(),"function"==typeof this.valuesChanger&&this.valuesChanger();t=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t,fragmentShader:e}),e=this.options.texturePath,e&&(this.uniforms.iTex={type:"t",value:(new a.TextureLoader).load(e)}),e=new a.Mesh(new a.PlaneGeometry(2,2),t);this.scene.add(e),this.camera=new a.Camera,this.camera.position.z=1}updateUniforms(){var e={};let t,i;for(t in this.options)i=this.options[t],-1!==t.toLowerCase().indexOf("color")?e[t]={type:"v3",value:new a.Color(i).toVector()}:"number"==typeof i&&(e[t]={type:"f",value:i});return Object.assign(this.uniforms,e)}resize(){super.resize(),this.uniforms.iResolution.value.x=this.width/this.scale,this.uniforms.iResolution.value.y=this.height/this.scale}}class h extends l{}const c=o.register("CELLS",h);return h.prototype.defaultOptions={color1:35980,color2:15918901,backgroundColor:14155663,amplitudeFactor:1,ringFactor:1,rotationFactor:1,size:1.5,speed:1,scaleMobile:3},h.prototype.fragmentShader="uniform vec2 iResolution;\nuniform vec2 iMouse;\nuniform float iTime;\n\nuniform float blurFactor;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 backgroundColor;\nuniform float size;\nuniform float amplitudeFactor;\nuniform float ringFactor;\nuniform float rotationFactor;\n\nfloat length2(vec2 p) { return dot(p, p); }\n\nfloat noise(vec2 p){\n return fract(sin(fract(sin(p.x) * (43.13311)) + p.y) * 31.0011);\n}\n\nfloat worley(vec2 p) {\n float d = 1e30;\n for (int xo = -1; xo <= 1; ++xo) {\n for (int yo = -1; yo <= 1; ++yo) {\n vec2 tp = floor(p) + vec2(xo, yo);\n d = min(d, length2(p - tp - vec2(noise(tp))));\n }\n }\n vec2 uv = gl_FragCoord.xy / iResolution.xy;\n float timeOffset = 0.15 * sin(iTime * 2.0 + 10.0*(uv.x - uv.y));\n return 3.0*exp(-4.0*abs(2.0*d - 1.0 + timeOffset));\n}\n\nfloat fworley(vec2 p) {\n return sqrt(sqrt(sqrt(\n 1.1 * // light\n worley(p*5. + .3 + iTime*.0525) *\n sqrt(worley(p * 50. / size + 0.3 + iTime * -0.15)) *\n sqrt(sqrt(worley(p * -10. + 9.3))))));\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / iResolution.xy;\n float t = fworley(uv * iResolution.xy / 1500.0);\n t *= exp(-length2(abs(0.7*uv - 1.0)));\n\n float tExp = pow(t, 0.5 - t);\n vec3 c1 = color1 * (1.0 - t);\n vec3 c2 = color2 * tExp;\n\n gl_FragColor = vec4(pow(t, 1.0 - t) * (c1 + c2), 1.0);\n}\n",e})())()},869:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};function r(){return"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)}n.r(e),n.d(e,{default:()=>p}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const h=e=>e[Math.floor(Math.random()*e.length)];function c(e,t){return null==t&&(t=1),(e=null==e?0:e)+Math.random()*(t-e)}function u(e,t){return null==e&&(e=0),null==t&&(t=1),Math.floor(e+Math.random()*(t-e+1))}const i="object"==typeof window;let s=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function o(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const a=i&&window.VANTA||{};a.register=(e,t)=>a[e]=e=>new t(e),a.version="0.5.24";a.VantaBase=class{constructor(e={}){if(!i)return!1;(a.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(s=this.options.THREE),this.el=this.options.el,null==this.el)o('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void o("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return o("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){s.WebGLRenderer?(this.renderer=new s.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new s.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),r()&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),a.current===this&&(a.current=null)}};var t=a.VantaBase;let d="object"==typeof window&&window.THREE;class l extends t{static initClass(){this.prototype.defaultOptions={backgroundColor:2106408,color:8978176},this.prototype.colors=[16720469,16716185,16737996,8978176,7851025,16776960,16742195,1179647,1149149,16768290,2250188,7975100,5468283]}constructor(e){d=e.THREE||d,super(e)}material(e){return new d.MeshLambertMaterial({color:e})}genRing(e,t,i,n,r,s,o){null==n&&(n=0),null==r&&(r=1.4*Math.PI),null==s&&(s=0),null==o&&(o=1),this.rings||(this.rings=[]),t<1&&(t=1);var a={depth:.4,bevelEnabled:!1,steps:1,curveSegments:~~(64*r/6.14)},l=new d.Shape,l=(l.absarc(0,0,t+i,0,r,!1),l.lineTo(t*Math.cos(r),t*Math.sin(r)),l.absarc(0,0,t,r,0,!0),new d.ExtrudeGeometry(l,a)),a=this.material(e),l=((0===u(0,1)||60<t)&&(a.transparent=!0,a.opacity=Math.max(50/t+c(-.3,.3),.1)),new d.Mesh(l,a));if(l.rotation.x=Math.PI/2,l.rotation.z=n,l.position.y=s,l.speed=.001*o,l.receiveShadow=!0,l.castShadow=!0,this.rings.push(l),this.cont.add(l),t<20&&r<1.3*Math.PI&&u(0,2))try{this.genRing(h(this.colors),t+c(-1,3),i+c(-2,0),n+r,r+c(-.5,.5),s+c(-3,1),o)}catch(e){}return l}onInit(){let t;var{}=this;this.cont=new d.Group,this.cont.position.set(30,0,0),this.cont.rotation.x=.06667,this.cont.rotation.z=.16667,this.scene.add(this.cont);let i=r()?30:60;for(let e=0;e<i;e++){let e;t=u(0,3)?(e=c(2,4)+c(1,30)*c(1,2)*c(1,2)*c(1,2),r()&&(e*=.5),c(0,3.5)+c(0,3.5)-u(0,e/4)-e/50):(e=c(1,3)*c(2,4),c(1,2)*c(1,2)*c(1.1,1.5));const i=.05*Math.pow(2,u(0,4));t<i&&(t=i),this.genRing(h(this.colors),e,t,c(0,1e3),c(1,6),c(0,50/(e+1)+5)+5/t/(e+.5),.25*Math.max(-c(.5,2),c(1,50-e/2)-e/2))}this.camera=new d.PerspectiveCamera(25,this.width/this.height,10,1e4),this.camera.position.set(0,150,200),this.scene.add(this.camera);var e=new d.AmbientLight(16777215,.5);return this.scene.add(e),this.pointLight=new d.PointLight(16777215,.5),this.pointLight.position.set(0,150,200),this.scene.add(this.pointLight),this.spot=new d.SpotLight(16777215,1),this.spot.position.set(-15,50,100),this.spot.penumbra=1,this.spot.angle=.5,this.spot.decay=1,this.spot.distance=300,this.spot.target=this.cont,this.scene.add(this.spot)}onUpdate(){let e;null!=this.helper&&this.helper.update(),null!=this.controls&&this.controls.update();var t,i=this.camera;.01<Math.abs(i.tx-i.position.x)&&(e=i.tx-i.position.x,i.position.x+=.02*e),.01<Math.abs(i.ty-i.position.y)&&(e=i.ty-i.position.y,i.position.y+=.02*e),i.lookAt(new d.Vector3(0,25,7)),i.near=Math.max(.5*i.position.z-20,1),i.updateProjectionMatrix();for(t of Array.from(null!=this.rings?this.rings:[]))t.rotation.z+=t.speed;i=.001*this.t;return this.cont.rotation.x+=1e-4*Math.sin(i),this.cont.rotation.z+=7e-5*Math.cos(i)}onMouseMove(e,t){var i=this.camera;return i.oy||(i.oy=i.position.y,i.ox=i.position.x),i.tx=i.ox+50*(e-.5),i.ty=i.oy-50*t}}l.initClass();const p=a.register("RINGS",l);return e})())()},870:function(e,t,i){e.exports=(()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{default:()=>u}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this,e),t)};const i="object"==typeof window;let r=i&&window.THREE||{};i&&!window.VANTA&&(window.VANTA={});function s(){return Array.prototype.unshift.call(arguments,"[VANTA]"),console.error.apply(this,arguments)}const o=i&&window.VANTA||{};o.register=(e,t)=>o[e]=e=>new t(e),o.version="0.5.24";o.VantaBase=class{constructor(e={}){if(!i)return!1;(o.current=this).windowMouseMoveWrapper=this.windowMouseMoveWrapper.bind(this),this.windowTouchWrapper=this.windowTouchWrapper.bind(this),this.windowGyroWrapper=this.windowGyroWrapper.bind(this),this.resize=this.resize.bind(this),this.animationLoop=this.animationLoop.bind(this),this.restart=this.restart.bind(this);var t="function"==typeof this.getDefaultOptions?this.getDefaultOptions():this.defaultOptions;if(this.options=Object.assign({mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,scale:1,scaleMobile:1},t),(e instanceof HTMLElement||"string"==typeof e)&&(e={el:e}),Object.assign(this.options,e),this.options.THREE&&(r=this.options.THREE),this.el=this.options.el,null==this.el)s('Instance needs "el" param!');else if(!(this.options.el instanceof HTMLElement)){const e=this.el;if(this.el=(t=e,document.querySelector(t)),!this.el)return void s("Cannot find element",e)}this.prepareEl(),this.initThree(),this.setSize();try{this.init()}catch(e){return s("Init error",e),this.renderer&&this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),void(this.options.backgroundColor&&(console.log("[VANTA] Falling back to backgroundColor"),this.el.style.background="number"==typeof(t=this.options.backgroundColor)?"#"+("00000"+t.toString(16)).slice(-6):t))}this.initMouse(),this.resize(),this.animationLoop();t=window.addEventListener;t("resize",this.resize),window.requestAnimationFrame(this.resize),this.options.mouseControls&&(t("scroll",this.windowMouseMoveWrapper),t("mousemove",this.windowMouseMoveWrapper)),this.options.touchControls&&(t("touchstart",this.windowTouchWrapper),t("touchmove",this.windowTouchWrapper)),this.options.gyroControls&&t("deviceorientation",this.windowGyroWrapper)}setOptions(e={}){Object.assign(this.options,e),this.triggerMouseMove()}prepareEl(){let e,t;if("undefined"!=typeof Node&&Node.TEXT_NODE)for(e=0;e<this.el.childNodes.length;e++){const t=this.el.childNodes[e];if(t.nodeType===Node.TEXT_NODE){const e=document.createElement("span");e.textContent=t.textContent,t.parentElement.insertBefore(e,t),t.remove()}}for(e=0;e<this.el.children.length;e++)t=this.el.children[e],"static"===getComputedStyle(t).position&&(t.style.position="relative"),"auto"===getComputedStyle(t).zIndex&&(t.style.zIndex=1);"static"===getComputedStyle(this.el).position&&(this.el.style.position="relative")}applyCanvasStyles(e,t={}){Object.assign(e.style,{position:"absolute",zIndex:0,top:0,left:0,background:""}),Object.assign(e.style,t),e.classList.add("vanta-canvas")}initThree(){r.WebGLRenderer?(this.renderer=new r.WebGLRenderer({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.applyCanvasStyles(this.renderer.domElement),isNaN(this.options.backgroundAlpha)&&(this.options.backgroundAlpha=1),this.scene=new r.Scene):console.warn("[VANTA] No THREE defined on window")}getCanvasElement(){return this.renderer?this.renderer.domElement:this.p5renderer?this.p5renderer.canvas:void 0}getCanvasRect(){var e=this.getCanvasElement();return!!e&&e.getBoundingClientRect()}windowMouseMoveWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=e.clientX-t.left,e=e.clientY-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}windowTouchWrapper(e){var t,i=this.getCanvasRect();if(!i)return!1;1===e.touches.length&&(t=e.touches[0].clientX-i.left,e=e.touches[0].clientY-i.top,0<=t)&&0<=e&&t<=i.width&&e<=i.height&&(this.mouseX=t,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(t,e))}windowGyroWrapper(e){var t=this.getCanvasRect();if(!t)return!1;var i=Math.round(2*e.alpha)-t.left,e=Math.round(2*e.beta)-t.top;0<=i&&0<=e&&i<=t.width&&e<=t.height&&(this.mouseX=i,this.mouseY=e,this.options.mouseEase||this.triggerMouseMove(i,e))}triggerMouseMove(e,t){void 0===e&&void 0===t&&(t=this.options.mouseEase?(e=this.mouseEaseX,this.mouseEaseY):(e=this.mouseX,this.mouseY)),this.uniforms&&(this.uniforms.iMouse.value.x=e/this.scale,this.uniforms.iMouse.value.y=t/this.scale);e/=this.width,t/=this.height;"function"==typeof this.onMouseMove&&this.onMouseMove(e,t)}setSize(){this.scale||(this.scale=1),"undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<600)&&this.options.scaleMobile?this.scale=this.options.scaleMobile:this.options.scale&&(this.scale=this.options.scale),this.width=Math.max(this.el.offsetWidth,this.options.minWidth),this.height=Math.max(this.el.offsetHeight,this.options.minHeight)}initMouse(){(!this.mouseX&&!this.mouseY||this.mouseX===this.options.minWidth/2&&this.mouseY===this.options.minHeight/2)&&(this.mouseX=this.width/2,this.mouseY=this.height/2,this.triggerMouseMove(this.mouseX,this.mouseY))}resize(){this.setSize(),this.camera&&(this.camera.aspect=this.width/this.height,"function"==typeof this.camera.updateProjectionMatrix)&&this.camera.updateProjectionMatrix(),this.renderer&&(this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio/this.scale)),"function"==typeof this.onResize&&this.onResize()}isOnScreen(){var e=this.el.offsetHeight,t=this.el.getBoundingClientRect(),i=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop,t=t.top+i;return t-window.innerHeight<=i&&i<=t+e}animationLoop(){this.t||(this.t=0),this.t2||(this.t2=0);var e,t=performance.now();return this.prevNow&&(e=(t-this.prevNow)/(1e3/60),e=Math.max(.2,Math.min(e,5)),this.t+=e,this.t2+=(this.options.speed||1)*e,this.uniforms)&&(this.uniforms.iTime.value=.016667*this.t2),this.prevNow=t,this.options.mouseEase&&(this.mouseEaseX=this.mouseEaseX||this.mouseX||0,this.mouseEaseY=this.mouseEaseY||this.mouseY||0,.1<Math.abs(this.mouseEaseX-this.mouseX)+Math.abs(this.mouseEaseY-this.mouseY))&&(this.mouseEaseX+=.05*(this.mouseX-this.mouseEaseX),this.mouseEaseY+=.05*(this.mouseY-this.mouseEaseY),this.triggerMouseMove(this.mouseEaseX,this.mouseEaseY)),(this.isOnScreen()||this.options.forceAnimate)&&("function"==typeof this.onUpdate&&this.onUpdate(),this.scene&&this.camera&&(this.renderer.render(this.scene,this.camera),this.renderer.setClearColor(this.options.backgroundColor,this.options.backgroundAlpha)),this.fps&&this.fps.update&&this.fps.update(),"function"==typeof this.afterRender)&&this.afterRender(),this.req=window.requestAnimationFrame(this.animationLoop)}restart(){if(this.scene)for(;this.scene.children.length;)this.scene.remove(this.scene.children[0]);"function"==typeof this.onRestart&&this.onRestart(),this.init()}init(){"function"==typeof this.onInit&&this.onInit()}destroy(){"function"==typeof this.onDestroy&&this.onDestroy();var e=window.removeEventListener,e=(e("touchstart",this.windowTouchWrapper),e("touchmove",this.windowTouchWrapper),e("scroll",this.windowMouseMoveWrapper),e("mousemove",this.windowMouseMoveWrapper),e("deviceorientation",this.windowGyroWrapper),e("resize",this.resize),window.cancelAnimationFrame(this.req),this.scene);e&&e.children&&function e(t){for(;t.children&&0<t.children.length;)e(t.children[0]),t.remove(t.children[0]);t.geometry&&t.geometry.dispose(),t.material&&(Object.keys(t.material).forEach(e=>{t.material[e]&&null!==t.material[e]&&"function"==typeof t.material[e].dispose&&t.material[e].dispose()}),t.material.dispose())}(e),this.renderer&&(this.renderer.domElement&&this.el.removeChild(this.renderer.domElement),this.renderer=null,this.scene=null),o.current===this&&(o.current=null)}};var t=o.VantaBase;let a="object"==typeof window&&window.THREE;class l extends t{constructor(e){(a=e.THREE||a).Color.prototype.toVector=function(){return new a.Vector3(this.r,this.g,this.b)},super(e),this.updateUniforms=this.updateUniforms.bind(this)}init(){this.mode="shader",this.uniforms={iTime:{type:"f",value:1},iResolution:{type:"v2",value:new a.Vector2(1,1)},iDpr:{type:"f",value:window.devicePixelRatio||1},iMouse:{type:"v2",value:new a.Vector2(this.mouseX||0,this.mouseY||0)}},super.init(),this.fragmentShader&&this.initBasicShader()}setOptions(e){super.setOptions(e),this.updateUniforms()}initBasicShader(e=this.fragmentShader,t=this.vertexShader){t=t||"uniform float uTime;\nuniform vec2 uResolution;\nvoid main() {\n gl_Position = vec4( position, 1.0 );\n}",this.updateUniforms(),"function"==typeof this.valuesChanger&&this.valuesChanger();t=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t,fragmentShader:e}),e=this.options.texturePath,e&&(this.uniforms.iTex={type:"t",value:(new a.TextureLoader).load(e)}),e=new a.Mesh(new a.PlaneGeometry(2,2),t);this.scene.add(e),this.camera=new a.Camera,this.camera.position.z=1}updateUniforms(){var e={};let t,i;for(t in this.options)i=this.options[t],-1!==t.toLowerCase().indexOf("color")?e[t]={type:"v3",value:new a.Color(i).toVector()}:"number"==typeof i&&(e[t]={type:"f",value:i});return Object.assign(this.uniforms,e)}resize(){super.resize(),this.uniforms.iResolution.value.x=this.width/this.scale,this.uniforms.iResolution.value.y=this.height/this.scale}}let h="object"==typeof window&&window.THREE;class c extends l{constructor(e){h=e.THREE||h,super(e)}getDefaultOptions(){return{baseColor:6745,color2:15918901,backgroundColor:1251907,amplitudeFactor:1,ringFactor:1,rotationFactor:1,xOffset:0,yOffset:0,size:1,speed:1,mouseEase:!0,scaleMobile:1,scale:1}}onInit(){var e={minFilter:h.LinearFilter,magFilter:h.LinearFilter,format:h.RGBFormat},t=this.width*window.devicePixelRatio/this.scale,i=this.height*window.devicePixelRatio/this.scale;this.bufferTarget=new h.WebGLRenderTarget(t,i,e),this.bufferFeedback=new h.WebGLRenderTarget(t,i,e)}initBasicShader(e,t){super.initBasicShader(e,t),this.uniforms.iBuffer={type:"t",value:this.bufferTarget.texture}}onUpdate(){this.uniforms.iBuffer.value=this.bufferFeedback.texture;var e=this.renderer,e=(e.setRenderTarget(this.bufferTarget),e.render(this.scene,this.camera),e.setRenderTarget(null),e.clear(),this.bufferTarget);this.bufferTarget=this.bufferFeedback,this.bufferFeedback=e}onResize(){var e,t;this.bufferTarget&&(e=this.width*window.devicePixelRatio/this.scale,t=this.height*window.devicePixelRatio/this.scale,this.bufferTarget.setSize(e,t),this.bufferFeedback.setSize(e,t))}onDestroy(){this.bufferTarget=null,this.bufferFeedback=null}}const u=o.register("HALO",c);return c.prototype.fragmentShader="uniform vec2 iResolution;\nuniform float iDpr;\nuniform vec2 iMouse;\nuniform float iTime;\n\nuniform float xOffset;\nuniform float yOffset;\nuniform vec3 baseColor;\nuniform vec3 color2;\nuniform vec3 backgroundColor;\nuniform float size;\nuniform float shape;\nuniform float ringFactor;\nuniform float rotationFactor;\nuniform float amplitudeFactor;\n\nuniform sampler2D iBuffer;\nuniform sampler2D iTex;\nconst float PI = 3.14159265359;\n\n// float length2(vec2 p) { return dot(p, p); }\n\n// float noise(vec2 p){\n// return fract(sin(fract(sin(p.x) * (43.13311)) + p.y) * 31.0011);\n// }\n\n// float worley(vec2 p) {\n// float d = 1e30;\n// for (int xo = -1; xo <= 1; ++xo) {\n// for (int yo = -1; yo <= 1; ++yo) {\n// vec2 tp = floor(p) + vec2(xo, yo);\n// d = min(d, length2(p - tp - vec2(noise(tp))));\n// }\n// }\n// vec2 uv = gl_FragCoord.xy / iResolution.xy;\n// float timeOffset = 0.15 * sin(iTime * 2.0 + 10.0*(uv.x - uv.y));\n// return 3.0*exp(-4.0*abs(2.0*d - 1.0 + timeOffset));\n// }\n\n// float fworley(vec2 p) {\n// return sqrt(\n// 1.1 * // light\n// worley(p*10. + .3 + iTime*.0525) *\n// sqrt(worley(p * 50. / size + 0.1 + iTime * -0.75)) *\n// 4.1 *\n// sqrt(sqrt(worley(p * -1. + 9.3))));\n// }\n\nvec4 j2hue(float c) {\n return .5+.5*cos(6.28*c+vec4(0,-2.1,2.1,0));\n}\n\nvec3 permute(vec3 x) { return mod(((x*34.0)+1.0)*x, 289.0); }\n\nfloat snoise(vec2 v){\n const vec4 C = vec4(0.211324865405187, 0.366025403784439,\n -0.577350269189626, 0.024390243902439);\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n i = mod(i, 289.0);\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy),\n dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\nvec2 sincos( float x ){return vec2(sin(x), cos(x));}\nvec2 rotate2d(vec2 uv, float phi){vec2 t = sincos(phi); return vec2(uv.x*t.y-uv.y*t.x, uv.x*t.x+uv.y*t.y);}\nvec3 rotate3d(vec3 p, vec3 v, float phi){ v = normalize(v); vec2 t = sincos(-phi); float s = t.x, c = t.y, x =-v.x, y =-v.y, z =-v.z; mat4 M = mat4(x*x*(1.-c)+c,x*y*(1.-c)-z*s,x*z*(1.-c)+y*s,0.,y*x*(1.-c)+z*s,y*y*(1.-c)+c,y*z*(1.-c)-x*s,0.,z*x*(1.-c)-y*s,z*y*(1.-c)+x*s,z*z*(1.-c)+c,0.,0.,0.,0.,1.);return (vec4(p,1.)*M).xyz;}\n\n// Classic Perlin 3D Noise\n// by Stefan Gustavson\nvec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}\nvec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}\nvec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}\nfloat p3d(vec3 P){\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod(Pi0, 289.0);\n Pi1 = mod(Pi1, 289.0);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 / 7.0;\n vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 / 7.0;\n vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\n\nvoid main() {\n vec2 res2 = iResolution.xy * iDpr;\n vec2 pixel = vec2(gl_FragCoord.xy - 0.5 * res2) / res2.y; // center-origin pixel coord\n pixel.x -= xOffset * res2.x / res2.y;\n pixel.y -= yOffset;\n\n vec2 uv = gl_FragCoord.xy / res2; // 0 to 1\n\n // float nn1 = snoise(uv * 0.25 + iTime * 0.005 + mixedColor.b * 0.01) * 0.1;\n // float nn2 = snoise(uv * 0.25 + iTime * 0.005 + mixedColor.b * 0.01 + 1000.) * 0.1;\n // uv += vec2(nn1, nn2);\n\n // PERLIN DISTORTION\n // float noiseScale = 10.;\n // float timeScale = 0.5;\n // uv += vec2( p3d(vec3(uv * noiseScale, iTime * timeScale)), p3d(vec3(1000. + uv * noiseScale , iTime * timeScale)) ) * 0.001;\n\n // uv = rotate2d(uv, 0.001);\n // pixel = rotate2d(pixel, 0.001);\n\n vec2 mouse2 = (iMouse * iDpr / res2 - 0.5) * vec2(1.,-1.);\n vec2 uvBig = (uv - 0.5) * 0.996 + 0.5;\n\n vec4 oldImage = texture2D(iBuffer, uv);\n vec3 mixedColor = oldImage.rgb - backgroundColor;\n\n // float spinDist = 0.002 + 0.002 * sin(iTime * 0.4);\n float cropDist = 0.01;\n float cropXOffset = 0.2;\n float cropYOffset = 0.2;\n // float cropXOffset = 0.4 + 0.1 * sin(iTime * 0.4);\n // float cropYOffset = 0.4 + 0.1 * cos(iTime * 0.6);\n\n vec2 offset = uv + vec2((mixedColor.g - cropXOffset) * cropDist, (mixedColor.r - cropYOffset) * cropDist);\n\n // float nn = snoise(uv * 10.) * 0.001;\n // offset += nn;\n\n float spinDist = 0.001;\n float spinSpeed = 0.2 + 0.15 * cos(iTime * 0.5);\n float timeFrac = mod(iTime, 6.5);\n vec2 offset2 = uvBig + vec2(cos(timeFrac * spinSpeed) * spinDist, sin(timeFrac * spinSpeed) * spinDist);\n\n mixedColor = texture2D(iBuffer, offset).rgb * 0.4\n + texture2D(iBuffer, offset2).rgb * 0.6\n - backgroundColor;\n\n\n // mixedColor *= .875;\n float fadeAmt = 0.0015; // fade this amount each frame // 0.002\n mixedColor = (mixedColor - fadeAmt) * .995;\n\n // float nn = snoise(uvBig * 10.) * 20.;\n // mixedColor *= clamp(nn, 0.98, 1.0);\n\n vec4 spectrum = abs( abs( .95*atan(uv.x, uv.y) -vec4(0,2,4,0) ) -3. )-1.;\n float angle = atan(pixel.x, pixel.y);\n float dist = length(pixel - mouse2*0.15) * 8. + sin(iTime) * .01;\n\n // mixedColor *= pow(1.-dist*0.002, 2.);\n\n\n // Flowery shapes\n // float edge = abs(dist * 0.5);\n float flowerPeaks = .05 * amplitudeFactor * size;\n float flowerPetals = 7.;\n float edge = abs((dist + sin(angle * flowerPetals + iTime * 0.5) * sin(iTime * 1.5) * flowerPeaks) * 0.65 / size);\n // float edge = abs((dist + sin(angle * 4. + iTime * 2.) * sin(iTime * 3.) * 0.75) * 1.);\n\n // vec4 rainbow = abs( abs( .95*mod(iTime * 1., 2. * PI) - vec4(0,2,4,0) ) -3. )-1.;\n // vec4 rainbow = vec4(0,2,4,0);\n\n float colorChangeSpeed = 0.75 + 0.05 * sin(iTime) * 1.5;\n float rainbowInput = timeFrac * colorChangeSpeed;\n // NOISE!\n // float nn = snoise(uv * 0.25 + iTime * 0.005 + mixedColor.b * 0.01) * 20.;\n // rainbowInput += nn;\n\n float brightness = 0.7;\n vec4 rainbow = sqrt(j2hue(cos(rainbowInput))) + vec4(baseColor,0) - 1.0 + brightness;\n float factor = smoothstep(1., .9, edge) * pow(edge, 2.);\n vec3 color = rainbow.rgb * smoothstep(1., .9, edge) * pow(edge, 20.);\n vec4 ring = vec4(\n backgroundColor + clamp( mixedColor + color, 0., 1.)\n , 1.0);\n\n // float t = fworley(uv * u_resolution.xy / 1500.0);\n // t *= exp(-length2(abs(0.7*uv - 1.0)));\n // float tExp = pow(t, 2. - t);\n // vec3 c1 = color1 * (1.0 - t);\n // vec3 c2 = color2 * tExp;\n // vec4 cells = vec4(mixedColor * 0.25, 1.) + vec4(pow(t, 1.0 - t) * (c1 + c2), 1.0);\n // gl_FragColor = clamp(ring + cells * 0.5, 0.0, 1.0);\n\n // float nn = snoise(uv * 10.) * 0.01; // creepy!\n gl_FragColor = ring;\n}\n",e})())()}}]);