From 619f9a948efd847f93ef7c87ca44b3d32d2b534b Mon Sep 17 00:00:00 2001 From: syui Date: Fri, 21 Nov 2025 07:01:31 +0900 Subject: [PATCH] fix --- .../{index-BbOfbEG1.js => index-Cc80FqGU.js} | 516 +++++++++--------- static/pkg/atmosphere/fly_c.vrma | Bin 0 -> 71736 bytes static/pkg/atmosphere/fly_idle.vrma | Bin 0 -> 71736 bytes static/pkg/atmosphere/fly_stop.vrma | Bin 0 -> 59252 bytes static/pkg/atmosphere/index.html | 2 +- 5 files changed, 259 insertions(+), 259 deletions(-) rename static/pkg/atmosphere/assets/{index-BbOfbEG1.js => index-Cc80FqGU.js} (68%) create mode 100644 static/pkg/atmosphere/fly_c.vrma create mode 100644 static/pkg/atmosphere/fly_idle.vrma create mode 100644 static/pkg/atmosphere/fly_stop.vrma diff --git a/static/pkg/atmosphere/assets/index-BbOfbEG1.js b/static/pkg/atmosphere/assets/index-Cc80FqGU.js similarity index 68% rename from static/pkg/atmosphere/assets/index-BbOfbEG1.js rename to static/pkg/atmosphere/assets/index-Cc80FqGU.js index 75463696..be0980e5 100644 --- a/static/pkg/atmosphere/assets/index-BbOfbEG1.js +++ b/static/pkg/atmosphere/assets/index-Cc80FqGU.js @@ -1,4 +1,4 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const r of a)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function t(a){const r={};return a.integrity&&(r.integrity=a.integrity),a.referrerPolicy&&(r.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?r.credentials="include":a.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(a){if(a.ep)return;a.ep=!0;const r=t(a);fetch(a.href,r)}})();function r1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var GO={exports:{}},s1={};/** +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const r of a)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function t(a){const r={};return a.integrity&&(r.integrity=a.integrity),a.referrerPolicy&&(r.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?r.credentials="include":a.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(a){if(a.ep)return;a.ep=!0;const r=t(a);fetch(a.href,r)}})();function l1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var WO={exports:{}},c1={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var uz=Symbol.for("react.transitional.element"),hz=Symbol.for("react.fragment");function VO(n,e,t){var i=null;if(t!==void 0&&(i=""+t),e.key!==void 0&&(i=""+e.key),"key"in e){t={};for(var a in e)a!=="key"&&(t[a]=e[a])}else t=e;return e=t.ref,{$$typeof:uz,type:n,key:i,ref:e!==void 0?e:null,props:t}}s1.Fragment=hz;s1.jsx=VO;s1.jsxs=VO;GO.exports=s1;var Nt=GO.exports,kO={exports:{}},Wt={};/** + */var hz=Symbol.for("react.transitional.element"),fz=Symbol.for("react.fragment");function XO(n,e,t){var i=null;if(t!==void 0&&(i=""+t),e.key!==void 0&&(i=""+e.key),"key"in e){t={};for(var a in e)a!=="key"&&(t[a]=e[a])}else t=e;return e=t.ref,{$$typeof:hz,type:n,key:i,ref:e!==void 0?e:null,props:t}}c1.Fragment=fz;c1.jsx=XO;c1.jsxs=XO;WO.exports=c1;var Rt=WO.exports,YO={exports:{}},Xt={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var sM=Symbol.for("react.transitional.element"),fz=Symbol.for("react.portal"),dz=Symbol.for("react.fragment"),pz=Symbol.for("react.strict_mode"),mz=Symbol.for("react.profiler"),gz=Symbol.for("react.consumer"),vz=Symbol.for("react.context"),_z=Symbol.for("react.forward_ref"),xz=Symbol.for("react.suspense"),yz=Symbol.for("react.memo"),WO=Symbol.for("react.lazy"),Sz=Symbol.for("react.activity"),Ow=Symbol.iterator;function Tz(n){return n===null||typeof n!="object"?null:(n=Ow&&n[Ow]||n["@@iterator"],typeof n=="function"?n:null)}var XO={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},YO=Object.assign,qO={};function Ud(n,e,t){this.props=n,this.context=e,this.refs=qO,this.updater=t||XO}Ud.prototype.isReactComponent={};Ud.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};Ud.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function jO(){}jO.prototype=Ud.prototype;function oM(n,e,t){this.props=n,this.context=e,this.refs=qO,this.updater=t||XO}var lM=oM.prototype=new jO;lM.constructor=oM;YO(lM,Ud.prototype);lM.isPureReactComponent=!0;var Lw=Array.isArray;function n3(){}var ei={H:null,A:null,T:null,S:null},ZO=Object.prototype.hasOwnProperty;function cM(n,e,t){var i=t.ref;return{$$typeof:sM,type:n,key:e,ref:i!==void 0?i:null,props:t}}function Ez(n,e){return cM(n.type,e,n.props)}function uM(n){return typeof n=="object"&&n!==null&&n.$$typeof===sM}function Mz(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var Iw=/\/+/g;function GS(n,e){return typeof n=="object"&&n!==null&&n.key!=null?Mz(""+n.key):e.toString(36)}function bz(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(n3,n3):(n.status="pending",n.then(function(e){n.status==="pending"&&(n.status="fulfilled",n.value=e)},function(e){n.status==="pending"&&(n.status="rejected",n.reason=e)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Mf(n,e,t,i,a){var r=typeof n;(r==="undefined"||r==="boolean")&&(n=null);var s=!1;if(n===null)s=!0;else switch(r){case"bigint":case"string":case"number":s=!0;break;case"object":switch(n.$$typeof){case sM:case fz:s=!0;break;case WO:return s=n._init,Mf(s(n._payload),e,t,i,a)}}if(s)return a=a(n),s=i===""?"."+GS(n,0):i,Lw(a)?(t="",s!=null&&(t=s.replace(Iw,"$&/")+"/"),Mf(a,e,t,"",function(h){return h})):a!=null&&(uM(a)&&(a=Ez(a,t+(a.key==null||n&&n.key===a.key?"":(""+a.key).replace(Iw,"$&/")+"/")+s)),e.push(a)),1;s=0;var o=i===""?".":i+":";if(Lw(n))for(var c=0;c>>1,ie=W[oe];if(0>>1;oea(nt,K))tta(gt,nt)?(W[oe]=gt,W[tt]=K,oe=tt):(W[oe]=nt,W[Xe]=K,oe=Xe);else if(tta(gt,K))W[oe]=gt,W[tt]=K,oe=tt;else break e}}return te}function a(W,te){var K=W.sortIndex-te.sortIndex;return K!==0?K:W.id-te.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;n.unstable_now=function(){return r.now()}}else{var s=Date,o=s.now();n.unstable_now=function(){return s.now()-o}}var c=[],h=[],f=1,d=null,m=3,g=!1,x=!1,T=!1,S=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function b(W){for(var te=t(h);te!==null;){if(te.callback===null)i(h);else if(te.startTime<=W)i(h),te.sortIndex=te.expirationTime,e(c,te);else break;te=t(h)}}function D(W){if(T=!1,b(W),!x)if(t(c)!==null)x=!0,C||(C=!0,j());else{var te=t(h);te!==null&&re(D,te.startTime-W)}}var C=!1,I=-1,P=5,O=-1;function R(){return S?!0:!(n.unstable_now()-OW&&R());){var oe=d.callback;if(typeof oe=="function"){d.callback=null,m=d.priorityLevel;var ie=oe(d.expirationTime<=W);if(W=n.unstable_now(),typeof ie=="function"){d.callback=ie,b(W),te=!0;break t}d===t(c)&&i(c),b(W)}else i(c);d=t(c)}if(d!==null)te=!0;else{var Ce=t(h);Ce!==null&&re(D,Ce.startTime-W),te=!1}}break e}finally{d=null,m=K,g=!1}te=void 0}}finally{te?j():C=!1}}}var j;if(typeof E=="function")j=function(){E(B)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,se=ee.port2;ee.port1.onmessage=B,j=function(){se.postMessage(null)}}else j=function(){v(B,0)};function re(W,te){I=v(function(){W(n.unstable_now())},te)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(W){W.callback=null},n.unstable_forceFrameRate=function(W){0>W||125oe?(W.sortIndex=K,e(h,W),t(c)===null&&W===t(h)&&(T?(y(I),I=-1):T=!0,re(D,K-oe))):(W.sortIndex=ie,e(c,W),x||g||(x=!0,C||(C=!0,j()))),W},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(W){var te=m;return function(){var K=m;m=te;try{return W.apply(this,arguments)}finally{m=K}}}})(JO);QO.exports=JO;var wz=QO.exports,$O={exports:{}},Ua={};/** + */(function(n){function e(W,te){var K=W.length;W.push(te);e:for(;0>>1,ie=W[oe];if(0>>1;oea(nt,K))tta(gt,nt)?(W[oe]=gt,W[tt]=K,oe=tt):(W[oe]=nt,W[Xe]=K,oe=Xe);else if(tta(gt,K))W[oe]=gt,W[tt]=K,oe=tt;else break e}}return te}function a(W,te){var K=W.sortIndex-te.sortIndex;return K!==0?K:W.id-te.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;n.unstable_now=function(){return r.now()}}else{var s=Date,o=s.now();n.unstable_now=function(){return s.now()-o}}var c=[],h=[],f=1,d=null,m=3,g=!1,x=!1,T=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function b(W){for(var te=t(h);te!==null;){if(te.callback===null)i(h);else if(te.startTime<=W)i(h),te.sortIndex=te.expirationTime,e(c,te);else break;te=t(h)}}function D(W){if(T=!1,b(W),!x)if(t(c)!==null)x=!0,C||(C=!0,j());else{var te=t(h);te!==null&&re(D,te.startTime-W)}}var C=!1,I=-1,P=5,O=-1;function w(){return y?!0:!(n.unstable_now()-OW&&w());){var oe=d.callback;if(typeof oe=="function"){d.callback=null,m=d.priorityLevel;var ie=oe(d.expirationTime<=W);if(W=n.unstable_now(),typeof ie=="function"){d.callback=ie,b(W),te=!0;break t}d===t(c)&&i(c),b(W)}else i(c);d=t(c)}if(d!==null)te=!0;else{var Ce=t(h);Ce!==null&&re(D,Ce.startTime-W),te=!1}}break e}finally{d=null,m=K,g=!1}te=void 0}}finally{te?j():C=!1}}}var j;if(typeof E=="function")j=function(){E(B)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,se=ee.port2;ee.port1.onmessage=B,j=function(){se.postMessage(null)}}else j=function(){v(B,0)};function re(W,te){I=v(function(){W(n.unstable_now())},te)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(W){W.callback=null},n.unstable_forceFrameRate=function(W){0>W||125oe?(W.sortIndex=K,e(h,W),t(c)===null&&W===t(h)&&(T?(S(I),I=-1):T=!0,re(D,K-oe))):(W.sortIndex=ie,e(c,W),x||g||(x=!0,C||(C=!0,j()))),W},n.unstable_shouldYield=w,n.unstable_wrapCallback=function(W){var te=m;return function(){var K=m;m=te;try{return W.apply(this,arguments)}finally{m=K}}}})(tL);eL.exports=tL;var Cz=eL.exports,nL={exports:{}},Pa={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Cz=be;function eL(n){var e="https://react.dev/errors/"+n;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tL)}catch(n){console.error(n)}}tL(),$O.exports=Ua;var Oz=$O.exports;/** + */var Nz=Me;function iL(n){var e="https://react.dev/errors/"+n;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aL)}catch(n){console.error(n)}}aL(),nL.exports=Pa;var Lz=nL.exports;/** * @license React * react-dom-client.production.js * @@ -38,15 +38,15 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Hi=wz,nL=be,Lz=Oz;function Ue(n){var e="https://react.dev/errors/"+n;if(1Nf||(n.current=l3[Nf],l3[Nf]=null,Nf--)}function Yn(n,e){Nf++,l3[Nf]=n.current,n.current=e}var no=oo(null),km=oo(null),Jl=oo(null),T_=oo(null);function E_(n,e){switch(Yn(Jl,e),Yn(km,n),Yn(no,null),e.nodeType){case 9:case 11:n=(n=e.documentElement)&&(n=n.namespaceURI)?kC(n):0;break;default:if(n=e.tagName,e=e.namespaceURI)e=kC(e),n=wI(e,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}$i(no),Yn(no,n)}function sd(){$i(no),$i(km),$i(Jl)}function c3(n){n.memoizedState!==null&&Yn(T_,n);var e=no.current,t=wI(e,n.type);e!==t&&(Yn(km,n),Yn(no,t))}function M_(n){km.current===n&&($i(no),$i(km)),T_.current===n&&($i(T_),e0._currentValue=Ru)}var VS,Bw;function hu(n){if(VS===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);VS=e&&e[1]||"",Bw=-1Of||(n.current=h3[Of],h3[Of]=null,Of--)}function Yn(n,e){Of++,h3[Of]=n.current,n.current=e}var io=lo(null),Xm=lo(null),tc=lo(null),b_=lo(null);function A_(n,e){switch(Yn(tc,e),Yn(Xm,n),Yn(io,null),e.nodeType){case 9:case 11:n=(n=e.documentElement)&&(n=n.namespaceURI)?YC(n):0;break;default:if(n=e.tagName,e=e.namespaceURI)e=YC(e),n=DI(e,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}ea(io),Yn(io,n)}function ld(){ea(io),ea(Xm),ea(tc)}function f3(n){n.memoizedState!==null&&Yn(b_,n);var e=io.current,t=DI(e,n.type);e!==t&&(Yn(Xm,n),Yn(io,t))}function w_(n){Xm.current===n&&(ea(io),ea(Xm)),b_.current===n&&(ea(b_),n0._currentValue=Cu)}var XS,GR;function du(n){if(XS===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);XS=e&&e[1]||"",GR=-1)":-1a||c[i]!==h[a]){var f=` -`+c[i].replace(" at new "," at ");return n.displayName&&f.includes("")&&(f=f.replace("",n.displayName)),f}while(1<=i&&0<=a);break}}}finally{kS=!1,Error.prepareStackTrace=t}return(t=n?n.displayName||n.name:"")?hu(t):""}function Bz(n,e){switch(n.tag){case 26:case 27:case 5:return hu(n.type);case 16:return hu("Lazy");case 13:return n.child!==e&&e!==null?hu("Suspense Fallback"):hu("Suspense");case 19:return hu("SuspenseList");case 0:case 15:return WS(n.type,!1);case 11:return WS(n.type.render,!1);case 1:return WS(n.type,!0);case 31:return hu("Activity");default:return""}}function Hw(n){try{var e="",t=null;do e+=Bz(n,t),t=n,n=n.return;while(n);return e}catch(i){return` +`+c[i].replace(" at new "," at ");return n.displayName&&f.includes("")&&(f=f.replace("",n.displayName)),f}while(1<=i&&0<=a);break}}}finally{YS=!1,Error.prepareStackTrace=t}return(t=n?n.displayName||n.name:"")?du(t):""}function Hz(n,e){switch(n.tag){case 26:case 27:case 5:return du(n.type);case 16:return du("Lazy");case 13:return n.child!==e&&e!==null?du("Suspense Fallback"):du("Suspense");case 19:return du("SuspenseList");case 0:case 15:return qS(n.type,!1);case 11:return qS(n.type.render,!1);case 1:return qS(n.type,!0);case 31:return du("Activity");default:return""}}function VR(n){try{var e="",t=null;do e+=Hz(n,t),t=n,n=n.return;while(n);return e}catch(i){return` Error generating stack: `+i.message+` -`+i.stack}}var u3=Object.prototype.hasOwnProperty,pM=Hi.unstable_scheduleCallback,XS=Hi.unstable_cancelCallback,Hz=Hi.unstable_shouldYield,Fz=Hi.unstable_requestPaint,br=Hi.unstable_now,Gz=Hi.unstable_getCurrentPriorityLevel,cL=Hi.unstable_ImmediatePriority,uL=Hi.unstable_UserBlockingPriority,b_=Hi.unstable_NormalPriority,Vz=Hi.unstable_LowPriority,hL=Hi.unstable_IdlePriority,kz=Hi.log,Wz=Hi.unstable_setDisableYieldValue,x0=null,Ar=null;function Wl(n){if(typeof kz=="function"&&Wz(n),Ar&&typeof Ar.setStrictMode=="function")try{Ar.setStrictMode(x0,n)}catch{}}var Rr=Math.clz32?Math.clz32:qz,Xz=Math.log,Yz=Math.LN2;function qz(n){return n>>>=0,n===0?32:31-(Xz(n)/Yz|0)|0}var Ng=256,Dg=262144,Og=4194304;function fu(n){var e=n&42;if(e!==0)return e;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function c1(n,e,t){var i=n.pendingLanes;if(i===0)return 0;var a=0,r=n.suspendedLanes,s=n.pingedLanes;n=n.warmLanes;var o=i&134217727;return o!==0?(i=o&~r,i!==0?a=fu(i):(s&=o,s!==0?a=fu(s):t||(t=o&~n,t!==0&&(a=fu(t))))):(o=i&~r,o!==0?a=fu(o):s!==0?a=fu(s):t||(t=i&~n,t!==0&&(a=fu(t)))),a===0?0:e!==0&&e!==a&&!(e&r)&&(r=a&-a,t=e&-e,r>=t||r===32&&(t&4194048)!==0)?e:a}function y0(n,e){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&e)===0}function jz(n,e){switch(n){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fL(){var n=Og;return Og<<=1,!(Og&62914560)&&(Og=4194304),n}function YS(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function S0(n,e){n.pendingLanes|=e,e!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Zz(n,e,t,i,a,r){var s=n.pendingLanes;n.pendingLanes=t,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=t,n.entangledLanes&=t,n.errorRecoveryDisabledLanes&=t,n.shellSuspendCounter=0;var o=n.entanglements,c=n.expirationTimes,h=n.hiddenUpdates;for(t=s&~t;0"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var tB=/[\n"\\]/g;function Kr(n){return n.replace(tB,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function d3(n,e,t,i,a,r,s,o){n.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?n.type=s:n.removeAttribute("type"),e!=null?s==="number"?(e===0&&n.value===""||n.value!=e)&&(n.value=""+qr(e)):n.value!==""+qr(e)&&(n.value=""+qr(e)):s!=="submit"&&s!=="reset"||n.removeAttribute("value"),e!=null?p3(n,s,qr(e)):t!=null?p3(n,s,qr(t)):i!=null&&n.removeAttribute("value"),a==null&&r!=null&&(n.defaultChecked=!!r),a!=null&&(n.checked=a&&typeof a!="function"&&typeof a!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?n.name=""+qr(o):n.removeAttribute("name")}function SL(n,e,t,i,a,r,s,o){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(n.type=r),e!=null||t!=null){if(!(r!=="submit"&&r!=="reset"||e!=null)){f3(n);return}t=t!=null?""+qr(t):"",e=e!=null?""+qr(e):t,o||e===n.value||(n.value=e),n.defaultValue=e}i=i??a,i=typeof i!="function"&&typeof i!="symbol"&&!!i,n.checked=o?n.checked:!!i,n.defaultChecked=!!i,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(n.name=s),f3(n)}function p3(n,e,t){e==="number"&&A_(n.ownerDocument)===n||n.defaultValue===""+t||(n.defaultValue=""+t)}function Zf(n,e,t,i){if(n=n.options,e){e={};for(var a=0;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g3=!1;if($o)try{var bp={};Object.defineProperty(bp,"passive",{get:function(){g3=!0}}),window.addEventListener("test",bp,bp),window.removeEventListener("test",bp,bp)}catch{g3=!1}var Xl=null,yM=null,$v=null;function AL(){if($v)return $v;var n,e=yM,t=e.length,i,a="value"in Xl?Xl.value:Xl.textContent,r=a.length;for(n=0;n=gm),Kw=" ",Qw=!1;function wL(n,e){switch(n){case"keyup":return CB.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function CL(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Lf=!1;function DB(n,e){switch(n){case"compositionend":return CL(e);case"keypress":return e.which!==32?null:(Qw=!0,Kw);case"textInput":return n=e.data,n===Kw&&Qw?null:n;default:return null}}function OB(n,e){if(Lf)return n==="compositionend"||!TM&&wL(n,e)?(n=AL(),$v=yM=Xl=null,Lf=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=nC(t)}}function LL(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?LL(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function IL(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var e=A_(n.document);e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=A_(n.document)}return e}function EM(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}var FB=$o&&"documentMode"in document&&11>=document.documentMode,If=null,v3=null,_m=null,_3=!1;function aC(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;_3||If==null||If!==A_(i)||(i=If,"selectionStart"in i&&EM(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),_m&&Ym(_m,i)||(_m=i,i=W_(v3,"onSelect"),0>=s,a-=s,Js=1<<32-Rr(e)+a|t<P?(O=I,I=null):O=I.sibling;var R=m(v,I,E[P],b);if(R===null){I===null&&(I=O);break}n&&I&&R.alternate===null&&e(v,I),y=r(R,y,P),C===null?D=R:C.sibling=R,C=R,I=O}if(P===E.length)return t(v,I),un&&Ho(v,P),D;if(I===null){for(;PP?(O=I,I=null):O=I.sibling;var B=m(v,I,R.value,b);if(B===null){I===null&&(I=O);break}n&&I&&B.alternate===null&&e(v,I),y=r(B,y,P),C===null?D=B:C.sibling=B,C=B,I=O}if(R.done)return t(v,I),un&&Ho(v,P),D;if(I===null){for(;!R.done;P++,R=E.next())R=d(v,R.value,b),R!==null&&(y=r(R,y,P),C===null?D=R:C.sibling=R,C=R);return un&&Ho(v,P),D}for(I=i(I);!R.done;P++,R=E.next())R=g(I,v,P,R.value,b),R!==null&&(n&&R.alternate!==null&&I.delete(R.key===null?P:R.key),y=r(R,y,P),C===null?D=R:C.sibling=R,C=R);return n&&I.forEach(function(j){return e(v,j)}),un&&Ho(v,P),D}function S(v,y,E,b){if(typeof E=="object"&&E!==null&&E.type===Cf&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Cg:e:{for(var D=E.key;y!==null;){if(y.key===D){if(D=E.type,D===Cf){if(y.tag===7){t(v,y.sibling),b=a(y,E.props.children),b.return=v,v=b;break e}}else if(y.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===zl&&du(D)===y.type){t(v,y.sibling),b=a(y,E.props),Rp(b,E),b.return=v,v=b;break e}t(v,y);break}else e(v,y);y=y.sibling}E.type===Cf?(b=wu(E.props.children,v.mode,b,E.key),b.return=v,v=b):(b=t_(E.type,E.key,E.props,null,v.mode,b),Rp(b,E),b.return=v,v=b)}return s(v);case nm:e:{for(D=E.key;y!==null;){if(y.key===D)if(y.tag===4&&y.stateNode.containerInfo===E.containerInfo&&y.stateNode.implementation===E.implementation){t(v,y.sibling),b=a(y,E.children||[]),b.return=v,v=b;break e}else{t(v,y);break}else e(v,y);y=y.sibling}b=tT(E,v.mode,b),b.return=v,v=b}return s(v);case zl:return E=du(E),S(v,y,E,b)}if(im(E))return x(v,y,E,b);if(Mp(E)){if(D=Mp(E),typeof D!="function")throw Error(Ue(150));return E=D.call(E),T(v,y,E,b)}if(typeof E.then=="function")return S(v,y,Pg(E),b);if(E.$$typeof===Xo)return S(v,y,Ug(v,E),b);zg(v,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,y!==null&&y.tag===6?(t(v,y.sibling),b=a(y,E),b.return=v,v=b):(t(v,y),b=eT(E,v.mode,b),b.return=v,v=b),s(v)):t(v,y)}return function(v,y,E,b){try{Zm=0;var D=S(v,y,E,b);return Jf=null,D}catch(I){if(I===Hd||I===m1)throw I;var C=Sr(29,I,null,v.mode);return C.lanes=b,C.return=v,C}finally{}}}var Fu=ZL(!0),KL=ZL(!1),Bl=!1;function OM(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function b3(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ec(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function tc(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,xn&2){var a=i.pending;return a===null?e.next=e:(e.next=a.next,a.next=e),i.pending=e,e=w_(n),GL(n,null,t),e}return p1(n,i,e,t),w_(n)}function ym(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194048)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,pL(n,t)}}function iT(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var a=null,r=null;if(t=t.firstBaseUpdate,t!==null){do{var s={lane:t.lane,tag:t.tag,payload:t.payload,callback:null,next:null};r===null?a=r=s:r=r.next=s,t=t.next}while(t!==null);r===null?a=r=e:r=r.next=e}else a=r=e;t={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:r,shared:i.shared,callbacks:i.callbacks},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}var A3=!1;function Sm(){if(A3){var n=Qf;if(n!==null)throw n}}function Tm(n,e,t,i){A3=!1;var a=n.updateQueue;Bl=!1;var r=a.firstBaseUpdate,s=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,h=c.next;c.next=null,s===null?r=h:s.next=h,s=c;var f=n.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==s&&(o===null?f.firstBaseUpdate=h:o.next=h,f.lastBaseUpdate=c))}if(r!==null){var d=a.baseState;s=0,f=h=c=null,o=r;do{var m=o.lane&-536870913,g=m!==o.lane;if(g?(cn&m)===m:(i&m)===m){m!==0&&m===cd&&(A3=!0),f!==null&&(f=f.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var x=n,T=o;m=e;var S=t;switch(T.tag){case 1:if(x=T.payload,typeof x=="function"){d=x.call(S,d,m);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=T.payload,m=typeof x=="function"?x.call(S,d,m):x,m==null)break e;d=ti({},d,m);break e;case 2:Bl=!0}}m=o.callback,m!==null&&(n.flags|=64,g&&(n.flags|=8192),g=a.callbacks,g===null?a.callbacks=[m]:g.push(m))}else g={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(h=f=g,c=d):f=f.next=g,s|=m;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;g=o,o=g.next,g.next=null,a.lastBaseUpdate=g,a.shared.pending=null}}while(!0);f===null&&(c=d),a.baseState=c,a.firstBaseUpdate=h,a.lastBaseUpdate=f,r===null&&(a.shared.lanes=0),fc|=s,n.lanes=s,n.memoizedState=d}}function QL(n,e){if(typeof n!="function")throw Error(Ue(191,n));n.call(e)}function JL(n,e){var t=n.callbacks;if(t!==null)for(n.callbacks=null,n=0;nr?r:8;var s=Ut.T,o={};Ut.T=o,XM(n,!1,e,t);try{var c=a(),h=Ut.S;if(h!==null&&h(o,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=ZB(c,i);Em(n,e,f,wr(n))}else Em(n,e,i,wr(n))}catch(d){Em(n,e,{then:function(){},status:"rejected",reason:d},wr())}finally{yn.p=r,s!==null&&o.types!==null&&(s.types=o.types),Ut.T=s}}function tH(){}function D3(n,e,t,i){if(n.tag!==5)throw Error(Ue(476));var a=E5(n).queue;T5(n,a,e,Ru,t===null?tH:function(){return M5(n),t(i)})}function E5(n){var e=n.memoizedState;if(e!==null)return e;e={memoizedState:Ru,baseState:Ru,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tl,lastRenderedState:Ru},next:null};var t={};return e.next={memoizedState:t,baseState:t,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tl,lastRenderedState:t},next:null},n.memoizedState=e,n=n.alternate,n!==null&&(n.memoizedState=e),e}function M5(n){var e=E5(n);e.next===null&&(e=n.alternate.memoizedState),Em(n,e.next.queue,{},wr())}function WM(){return ca(e0)}function b5(){return Si().memoizedState}function A5(){return Si().memoizedState}function nH(n){for(var e=n.return;e!==null;){switch(e.tag){case 24:case 3:var t=wr();n=ec(t);var i=tc(e,n,t);i!==null&&(Qa(i,e,t),ym(i,e,t)),e={cache:CM()},n.payload=e;return}e=e.return}}function iH(n,e,t){var i=wr();t={lane:i,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null},x1(n)?w5(e,t):(t=bM(n,e,t,i),t!==null&&(Qa(t,n,i),C5(t,e,i)))}function R5(n,e,t){var i=wr();Em(n,e,t,i)}function Em(n,e,t,i){var a={lane:i,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null};if(x1(n))w5(e,a);else{var r=n.alternate;if(n.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var s=e.lastRenderedState,o=r(s,t);if(a.hasEagerState=!0,a.eagerState=o,Nr(o,s))return p1(n,e,a,0),Hn===null&&d1(),!1}catch{}finally{}if(t=bM(n,e,a,i),t!==null)return Qa(t,n,i),C5(t,e,i),!0}return!1}function XM(n,e,t,i){if(i={lane:2,revertLane:eb(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},x1(n)){if(e)throw Error(Ue(479))}else e=bM(n,t,i,2),e!==null&&Qa(e,n,2)}function x1(n){var e=n.alternate;return n===jt||e!==null&&e===jt}function w5(n,e){$f=I_=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function C5(n,e,t){if(t&4194048){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,pL(n,t)}}var Qm={readContext:ca,use:v1,useCallback:gi,useContext:gi,useEffect:gi,useImperativeHandle:gi,useLayoutEffect:gi,useInsertionEffect:gi,useMemo:gi,useReducer:gi,useRef:gi,useState:gi,useDebugValue:gi,useDeferredValue:gi,useTransition:gi,useSyncExternalStore:gi,useId:gi,useHostTransitionStatus:gi,useFormState:gi,useActionState:gi,useOptimistic:gi,useMemoCache:gi,useCacheRefresh:gi};Qm.useEffectEvent=gi;var N5={readContext:ca,use:v1,useCallback:function(n,e){return Ra().memoizedState=[n,e===void 0?null:e],n},useContext:ca,useEffect:xC,useImperativeHandle:function(n,e,t){t=t!=null?t.concat([n]):null,a_(4194308,4,v5.bind(null,e,n),t)},useLayoutEffect:function(n,e){return a_(4194308,4,n,e)},useInsertionEffect:function(n,e){a_(4,2,n,e)},useMemo:function(n,e){var t=Ra();e=e===void 0?null:e;var i=n();if(Gu){Wl(!0);try{n()}finally{Wl(!1)}}return t.memoizedState=[i,e],i},useReducer:function(n,e,t){var i=Ra();if(t!==void 0){var a=t(e);if(Gu){Wl(!0);try{t(e)}finally{Wl(!1)}}}else a=e;return i.memoizedState=i.baseState=a,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:a},i.queue=n,n=n.dispatch=iH.bind(null,jt,n),[i.memoizedState,n]},useRef:function(n){var e=Ra();return n={current:n},e.memoizedState=n},useState:function(n){n=C3(n);var e=n.queue,t=R5.bind(null,jt,e);return e.dispatch=t,[n.memoizedState,t]},useDebugValue:VM,useDeferredValue:function(n,e){var t=Ra();return kM(t,n,e)},useTransition:function(){var n=C3(!1);return n=T5.bind(null,jt,n.queue,!0,!1),Ra().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,e,t){var i=jt,a=Ra();if(un){if(t===void 0)throw Error(Ue(407));t=t()}else{if(t=e(),Hn===null)throw Error(Ue(349));cn&127||i5(i,e,t)}a.memoizedState=t;var r={value:t,getSnapshot:e};return a.queue=r,xC(r5.bind(null,i,r,n),[n]),i.flags|=2048,hd(9,{destroy:void 0},a5.bind(null,i,r,t,e),null),t},useId:function(){var n=Ra(),e=Hn.identifierPrefix;if(un){var t=$s,i=Js;t=(i&~(1<<32-Rr(i)-1)).toString(32)+t,e="_"+e+"R_"+t,t=U_++,0<\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof i.is=="string"?s.createElement("select",{is:i.is}):s.createElement("select"),i.multiple?r.multiple=!0:i.size&&(r.size=i.size);break;default:r=typeof i.is=="string"?s.createElement(a,{is:i.is}):s.createElement(a)}}r[sa]=e,r[$a]=i;e:for(s=e.child;s!==null;){if(s.tag===5||s.tag===6)r.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break e;for(;s.sibling===null;){if(s.return===null||s.return===e)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}e.stateNode=r;e:switch(ua(r,a,i),a){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Mo(e)}}return Kn(e),hT(e,e.type,n===null?null:n.memoizedProps,e.pendingProps,t),null;case 6:if(n&&e.stateNode!=null)n.memoizedProps!==i&&Mo(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(Ue(166));if(n=Jl.current,Gh(e)){if(n=e.stateNode,t=e.memoizedProps,i=null,a=oa,a!==null)switch(a.tag){case 27:case 5:i=a.memoizedProps}n[sa]=e,n=!!(n.nodeValue===t||i!==null&&i.suppressHydrationWarning===!0||RI(n.nodeValue,t)),n||uc(e,!0)}else n=X_(n).createTextNode(i),n[sa]=e,e.stateNode=n}return Kn(e),null;case 31:if(t=e.memoizedState,n===null||n.memoizedState!==null){if(i=Gh(e),t!==null){if(n===null){if(!i)throw Error(Ue(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Ue(557));n[sa]=e}else Bu(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Kn(e),n=!1}else t=nT(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=t),n=!0;if(!n)return e.flags&256?(yr(e),e):(yr(e),null);if(e.flags&128)throw Error(Ue(558))}return Kn(e),null;case 13:if(i=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(a=Gh(e),i!==null&&i.dehydrated!==null){if(n===null){if(!a)throw Error(Ue(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Ue(317));a[sa]=e}else Bu(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Kn(e),a=!1}else a=nT(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=a),a=!0;if(!a)return e.flags&256?(yr(e),e):(yr(e),null)}return yr(e),e.flags&128?(e.lanes=t,e):(t=i!==null,n=n!==null&&n.memoizedState!==null,t&&(i=e.child,a=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(a=i.alternate.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==a&&(i.flags|=2048)),t!==n&&t&&(e.child.flags|=8192),Bg(e,e.updateQueue),Kn(e),null);case 4:return sd(),n===null&&tb(e.stateNode.containerInfo),Kn(e),null;case 10:return Zo(e.type),Kn(e),null;case 19:if($i(yi),i=e.memoizedState,i===null)return Kn(e),null;if(a=(e.flags&128)!==0,r=i.rendering,r===null)if(a)wp(i,!1);else{if(vi!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(r=L_(n),r!==null){for(e.flags|=128,wp(i,!1),n=r.updateQueue,e.updateQueue=n,Bg(e,n),e.subtreeFlags=0,n=t,t=e.child;t!==null;)VL(t,n),t=t.sibling;return Yn(yi,yi.current&1|2),un&&Ho(e,i.treeForkCount),e.child}n=n.sibling}i.tail!==null&&br()>H_&&(e.flags|=128,a=!0,wp(i,!1),e.lanes=4194304)}else{if(!a)if(n=L_(r),n!==null){if(e.flags|=128,a=!0,n=n.updateQueue,e.updateQueue=n,Bg(e,n),wp(i,!0),i.tail===null&&i.tailMode==="hidden"&&!r.alternate&&!un)return Kn(e),null}else 2*br()-i.renderingStartTime>H_&&t!==536870912&&(e.flags|=128,a=!0,wp(i,!1),e.lanes=4194304);i.isBackwards?(r.sibling=e.child,e.child=r):(n=i.last,n!==null?n.sibling=r:e.child=r,i.last=r)}return i.tail!==null?(n=i.tail,i.rendering=n,i.tail=n.sibling,i.renderingStartTime=br(),n.sibling=null,t=yi.current,Yn(yi,a?t&1|2:t&1),un&&Ho(e,i.treeForkCount),n):(Kn(e),null);case 22:case 23:return yr(e),LM(),i=e.memoizedState!==null,n!==null?n.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?t&536870912&&!(e.flags&128)&&(Kn(e),e.subtreeFlags&6&&(e.flags|=8192)):Kn(e),t=e.updateQueue,t!==null&&Bg(e,t.retryQueue),t=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==t&&(e.flags|=2048),n!==null&&$i(Cu),null;case 24:return t=null,n!==null&&(t=n.memoizedState.cache),e.memoizedState.cache!==t&&(e.flags|=2048),Zo(Ni),Kn(e),null;case 25:return null;case 30:return null}throw Error(Ue(156,e.tag))}function lH(n,e){switch(wM(e),e.tag){case 1:return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Zo(Ni),sd(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 26:case 27:case 5:return M_(e),null;case 31:if(e.memoizedState!==null){if(yr(e),e.alternate===null)throw Error(Ue(340));Bu()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 13:if(yr(e),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ue(340));Bu()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return $i(yi),null;case 4:return sd(),null;case 10:return Zo(e.type),null;case 22:case 23:return yr(e),LM(),n!==null&&$i(Cu),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 24:return Zo(Ni),null;case 25:return null;default:return null}}function V5(n,e){switch(wM(e),e.tag){case 3:Zo(Ni),sd();break;case 26:case 27:case 5:M_(e);break;case 4:sd();break;case 31:e.memoizedState!==null&&yr(e);break;case 13:yr(e);break;case 19:$i(yi);break;case 10:Zo(e.type);break;case 22:case 23:yr(e),LM(),n!==null&&$i(Cu);break;case 24:Zo(Ni)}}function A0(n,e){try{var t=e.updateQueue,i=t!==null?t.lastEffect:null;if(i!==null){var a=i.next;t=a;do{if((t.tag&n)===n){i=void 0;var r=t.create,s=t.inst;i=r(),s.destroy=i}t=t.next}while(t!==a)}}catch(o){Cn(e,e.return,o)}}function hc(n,e,t){try{var i=e.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var r=a.next;i=r;do{if((i.tag&n)===n){var s=i.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,a=e;var c=t,h=o;try{h()}catch(f){Cn(a,c,f)}}}i=i.next}while(i!==r)}}catch(f){Cn(e,e.return,f)}}function k5(n){var e=n.updateQueue;if(e!==null){var t=n.stateNode;try{JL(e,t)}catch(i){Cn(n,n.return,i)}}}function W5(n,e,t){t.props=Vu(n.type,n.memoizedProps),t.state=n.memoizedState;try{t.componentWillUnmount()}catch(i){Cn(n,e,i)}}function Mm(n,e){try{var t=n.ref;if(t!==null){switch(n.tag){case 26:case 27:case 5:var i=n.stateNode;break;case 30:i=n.stateNode;break;default:i=n.stateNode}typeof t=="function"?n.refCleanup=t(i):t.current=i}}catch(a){Cn(n,e,a)}}function eo(n,e){var t=n.ref,i=n.refCleanup;if(t!==null)if(typeof i=="function")try{i()}catch(a){Cn(n,e,a)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof t=="function")try{t(null)}catch(a){Cn(n,e,a)}else t.current=null}function X5(n){var e=n.type,t=n.memoizedProps,i=n.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":t.autoFocus&&i.focus();break e;case"img":t.src?i.src=t.src:t.srcSet&&(i.srcset=t.srcSet)}}catch(a){Cn(n,n.return,a)}}function fT(n,e,t){try{var i=n.stateNode;NH(i,n.type,t,e),i[$a]=e}catch(a){Cn(n,n.return,a)}}function Y5(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&xc(n.type)||n.tag===4}function dT(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Y5(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&xc(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function P3(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t).insertBefore(n,e):(e=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,e.appendChild(n),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Yo));else if(i!==4&&(i===27&&xc(n.type)&&(t=n.stateNode,e=null),n=n.child,n!==null))for(P3(n,e,t),n=n.sibling;n!==null;)P3(n,e,t),n=n.sibling}function B_(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(i===27&&xc(n.type)&&(t=n.stateNode),n=n.child,n!==null))for(B_(n,e,t),n=n.sibling;n!==null;)B_(n,e,t),n=n.sibling}function q5(n){var e=n.stateNode,t=n.memoizedProps;try{for(var i=n.type,a=e.attributes;a.length;)e.removeAttributeNode(a[0]);ua(e,i,t),e[sa]=n,e[$a]=t}catch(r){Cn(n,n.return,r)}}var Go=!1,Ci=!1,pT=!1,OC=typeof WeakSet=="function"?WeakSet:Set,Ki=null;function cH(n,e){if(n=n.containerInfo,k3=Z_,n=IL(n),EM(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var a=i.anchorOffset,r=i.focusNode;i=i.focusOffset;try{t.nodeType,r.nodeType}catch{t=null;break e}var s=0,o=-1,c=-1,h=0,f=0,d=n,m=null;t:for(;;){for(var g;d!==t||a!==0&&d.nodeType!==3||(o=s+a),d!==r||i!==0&&d.nodeType!==3||(c=s+i),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)m=d,d=g;for(;;){if(d===n)break t;if(m===t&&++h===a&&(o=s),m===r&&++f===i&&(c=s),(g=d.nextSibling)!==null)break;d=m,m=d.parentNode}d=g}t=o===-1||c===-1?null:{start:o,end:c}}else t=null}t=t||{start:0,end:0}}else t=null;for(W3={focusedElem:n,selectionRange:t},Z_=!1,Ki=e;Ki!==null;)if(e=Ki,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Ki=n;else for(;Ki!==null;){switch(e=Ki,r=e.alternate,n=e.flags,e.tag){case 0:if(n&4&&(n=e.updateQueue,n=n!==null?n.events:null,n!==null))for(t=0;t title"))),ua(r,i,t),r[sa]=n,Ji(r),i=r;break e;case"link":var s=JC("link","href",a).get(i+(t.href||""));if(s){for(var o=0;oS&&(s=S,S=T,T=s);var v=iC(o,T),y=iC(o,S);if(v&&y&&(g.rangeCount!==1||g.anchorNode!==v.node||g.anchorOffset!==v.offset||g.focusNode!==y.node||g.focusOffset!==y.offset)){var E=d.createRange();E.setStart(v.node,v.offset),g.removeAllRanges(),T>S?(g.addRange(E),g.extend(y.node,y.offset)):(E.setEnd(y.node,y.offset),g.addRange(E))}}}}for(d=[],g=o;g=g.parentNode;)g.nodeType===1&&d.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;ot?32:t,Ut.T=null,t=H3,H3=null;var r=ic,s=Ko;if(Bi=0,dd=ic=null,Ko=0,xn&6)throw Error(Ue(331));var o=xn;if(xn|=4,aI(r.current),tI(r,r.current,s,t),xn=o,R0(0,!1),Ar&&typeof Ar.onPostCommitFiberRoot=="function")try{Ar.onPostCommitFiberRoot(x0,r)}catch{}return!0}finally{yn.p=a,Ut.T=i,xI(n,e)}}function PC(n,e,t){e=Qr(t,e),e=L3(n.stateNode,e,2),n=tc(n,e,2),n!==null&&(S0(n,2),lo(n))}function Cn(n,e,t){if(n.tag===3)PC(n,n,t);else for(;e!==null;){if(e.tag===3){PC(e,n,t);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(nc===null||!nc.has(i))){n=Qr(t,n),t=U5(2),i=tc(e,t,2),i!==null&&(P5(t,i,e,n),S0(i,2),lo(i));break}}e=e.return}}function gT(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new fH;var a=new Set;i.set(e,a)}else a=i.get(e),a===void 0&&(a=new Set,i.set(e,a));a.has(t)||(QM=!0,a.add(t),n=vH.bind(null,n,e,t),e.then(n,n))}function vH(n,e,t){var i=n.pingCache;i!==null&&i.delete(e),n.pingedLanes|=n.suspendedLanes&t,n.warmLanes&=~t,Hn===n&&(cn&t)===t&&(vi===4||vi===3&&(cn&62914560)===cn&&300>br()-y1?!(xn&2)&&pd(n,0):JM|=t,fd===cn&&(fd=0)),lo(n)}function SI(n,e){e===0&&(e=fL()),n=ah(n,e),n!==null&&(S0(n,e),lo(n))}function _H(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),SI(n,t)}function xH(n,e){var t=0;switch(n.tag){case 31:case 13:var i=n.stateNode,a=n.memoizedState;a!==null&&(t=a.retryLane);break;case 19:i=n.stateNode;break;case 22:i=n.stateNode._retryCache;break;default:throw Error(Ue(314))}i!==null&&i.delete(e),SI(n,t)}function yH(n,e){return pM(n,e)}var V_=null,Af=null,G3=!1,k_=!1,vT=!1,jl=0;function lo(n){n!==Af&&n.next===null&&(Af===null?V_=Af=n:Af=Af.next=n),k_=!0,G3||(G3=!0,TH())}function R0(n,e){if(!vT&&k_){vT=!0;do for(var t=!1,i=V_;i!==null;){if(n!==0){var a=i.pendingLanes;if(a===0)var r=0;else{var s=i.suspendedLanes,o=i.pingedLanes;r=(1<<31-Rr(42|n)+1)-1,r&=a&~(s&~o),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(t=!0,zC(i,r))}else r=cn,r=c1(i,i===Hn?r:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(r&3)||y0(i,r)||(t=!0,zC(i,r));i=i.next}while(t);vT=!1}}function SH(){TI()}function TI(){k_=G3=!1;var n=0;jl!==0&&OH()&&(n=jl);for(var e=br(),t=null,i=V_;i!==null;){var a=i.next,r=EI(i,e);r===0?(i.next=null,t===null?V_=a:t.next=a,a===null&&(Af=t)):(t=i,(n!==0||r&3)&&(k_=!0)),i=a}Bi!==0&&Bi!==5||R0(n),jl!==0&&(jl=0)}function EI(n,e){for(var t=n.suspendedLanes,i=n.pingedLanes,a=n.expirationTimes,r=n.pendingLanes&-62914561;0o)break;var f=c.transferSize,d=c.initiatorType;f&&VC(d)&&(c=c.responseEnd,s+=f*(c"u"?null:document;function OI(n,e,t){var i=Gd;if(i&&typeof e=="string"&&e){var a=Kr(e);a='link[rel="'+n+'"][href="'+a+'"]',typeof t=="string"&&(a+='[crossorigin="'+t+'"]'),ZC.has(a)||(ZC.add(a),n={rel:n,crossOrigin:t,href:e},i.querySelector(a)===null&&(e=i.createElement("link"),ua(e,"link",n),Ji(e),i.head.appendChild(e)))}}function GH(n){sl.D(n),OI("dns-prefetch",n,null)}function VH(n,e){sl.C(n,e),OI("preconnect",n,e)}function kH(n,e,t){sl.L(n,e,t);var i=Gd;if(i&&n&&e){var a='link[rel="preload"][as="'+Kr(e)+'"]';e==="image"&&t&&t.imageSrcSet?(a+='[imagesrcset="'+Kr(t.imageSrcSet)+'"]',typeof t.imageSizes=="string"&&(a+='[imagesizes="'+Kr(t.imageSizes)+'"]')):a+='[href="'+Kr(n)+'"]';var r=a;switch(e){case"style":r=md(n);break;case"script":r=Vd(n)}rs.has(r)||(n=ti({rel:"preload",href:e==="image"&&t&&t.imageSrcSet?void 0:n,as:e},t),rs.set(r,n),i.querySelector(a)!==null||e==="style"&&i.querySelector(w0(r))||e==="script"&&i.querySelector(C0(r))||(e=i.createElement("link"),ua(e,"link",n),Ji(e),i.head.appendChild(e)))}}function WH(n,e){sl.m(n,e);var t=Gd;if(t&&n){var i=e&&typeof e.as=="string"?e.as:"script",a='link[rel="modulepreload"][as="'+Kr(i)+'"][href="'+Kr(n)+'"]',r=a;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=Vd(n)}if(!rs.has(r)&&(n=ti({rel:"modulepreload",href:n},e),rs.set(r,n),t.querySelector(a)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(t.querySelector(C0(r)))return}i=t.createElement("link"),ua(i,"link",n),Ji(i),t.head.appendChild(i)}}}function XH(n,e,t){sl.S(n,e,t);var i=Gd;if(i&&n){var a=jf(i).hoistableStyles,r=md(n);e=e||"default";var s=a.get(r);if(!s){var o={loading:0,preload:null};if(s=i.querySelector(w0(r)))o.loading=5;else{n=ti({rel:"stylesheet",href:n,"data-precedence":e},t),(t=rs.get(r))&&nb(n,t);var c=s=i.createElement("link");Ji(c),ua(c,"link",n),c._p=new Promise(function(h,f){c.onload=h,c.onerror=f}),c.addEventListener("load",function(){o.loading|=1}),c.addEventListener("error",function(){o.loading|=2}),o.loading|=4,l_(s,e,i)}s={type:"stylesheet",instance:s,count:1,state:o},a.set(r,s)}}}function YH(n,e){sl.X(n,e);var t=Gd;if(t&&n){var i=jf(t).hoistableScripts,a=Vd(n),r=i.get(a);r||(r=t.querySelector(C0(a)),r||(n=ti({src:n,async:!0},e),(e=rs.get(a))&&ib(n,e),r=t.createElement("script"),Ji(r),ua(r,"link",n),t.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},i.set(a,r))}}function qH(n,e){sl.M(n,e);var t=Gd;if(t&&n){var i=jf(t).hoistableScripts,a=Vd(n),r=i.get(a);r||(r=t.querySelector(C0(a)),r||(n=ti({src:n,async:!0,type:"module"},e),(e=rs.get(a))&&ib(n,e),r=t.createElement("script"),Ji(r),ua(r,"link",n),t.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},i.set(a,r))}}function KC(n,e,t,i){var a=(a=Jl.current)?Y_(a):null;if(!a)throw Error(Ue(446));switch(n){case"meta":case"title":return null;case"style":return typeof t.precedence=="string"&&typeof t.href=="string"?(e=md(t.href),t=jf(a).hoistableStyles,i=t.get(e),i||(i={type:"style",instance:null,count:0,state:null},t.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(t.rel==="stylesheet"&&typeof t.href=="string"&&typeof t.precedence=="string"){n=md(t.href);var r=jf(a).hoistableStyles,s=r.get(n);if(s||(a=a.ownerDocument||a,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(n,s),(r=a.querySelector(w0(n)))&&!r._p&&(s.instance=r,s.state.loading=5),rs.has(n)||(t={rel:"preload",as:"style",href:t.href,crossOrigin:t.crossOrigin,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy},rs.set(n,t),r||jH(a,n,t,s.state))),e&&i===null)throw Error(Ue(528,""));return s}if(e&&i!==null)throw Error(Ue(529,""));return null;case"script":return e=t.async,t=t.src,typeof t=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Vd(t),t=jf(a).hoistableScripts,i=t.get(e),i||(i={type:"script",instance:null,count:0,state:null},t.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(Ue(444,n))}}function md(n){return'href="'+Kr(n)+'"'}function w0(n){return'link[rel="stylesheet"]['+n+"]"}function LI(n){return ti({},n,{"data-precedence":n.precedence,precedence:null})}function jH(n,e,t,i){n.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=n.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),ua(e,"link",t),Ji(e),n.head.appendChild(e))}function Vd(n){return'[src="'+Kr(n)+'"]'}function C0(n){return"script[async]"+n}function QC(n,e,t){if(e.count++,e.instance===null)switch(e.type){case"style":var i=n.querySelector('style[data-href~="'+Kr(t.href)+'"]');if(i)return e.instance=i,Ji(i),i;var a=ti({},t,{"data-href":t.href,"data-precedence":t.precedence,href:null,precedence:null});return i=(n.ownerDocument||n).createElement("style"),Ji(i),ua(i,"style",a),l_(i,t.precedence,n),e.instance=i;case"stylesheet":a=md(t.href);var r=n.querySelector(w0(a));if(r)return e.state.loading|=4,e.instance=r,Ji(r),r;i=LI(t),(a=rs.get(a))&&nb(i,a),r=(n.ownerDocument||n).createElement("link"),Ji(r);var s=r;return s._p=new Promise(function(o,c){s.onload=o,s.onerror=c}),ua(r,"link",i),e.state.loading|=4,l_(r,t.precedence,n),e.instance=r;case"script":return r=Vd(t.src),(a=n.querySelector(C0(r)))?(e.instance=a,Ji(a),a):(i=t,(a=rs.get(r))&&(i=ti({},t),ib(i,a)),n=n.ownerDocument||n,a=n.createElement("script"),Ji(a),ua(a,"link",i),n.head.appendChild(a),e.instance=a);case"void":return null;default:throw Error(Ue(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(i=e.instance,e.state.loading|=4,l_(i,t.precedence,n));return e.instance}function l_(n,e,t){for(var i=t.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=i.length?i[i.length-1]:null,r=a,s=0;s title"):null)}function ZH(n,e,t){if(t===1||e.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return n=e.disabled,typeof e.precedence=="string"&&n==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function II(n){return!(n.type==="stylesheet"&&!(n.state.loading&3))}function KH(n,e,t,i){if(t.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var a=md(i.href),r=e.querySelector(w0(a));if(r){e=r._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(n.count++,n=q_.bind(n),e.then(n,n)),t.state.loading|=4,t.instance=r,Ji(r);return}r=e.ownerDocument||e,i=LI(i),(a=rs.get(a))&&nb(i,a),r=r.createElement("link"),Ji(r);var s=r;s._p=new Promise(function(o,c){s.onload=o,s.onerror=c}),ua(r,"link",i),t.instance=r}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(n.count++,t=q_.bind(n),e.addEventListener("load",t),e.addEventListener("error",t))}}var ET=0;function QH(n,e){return n.stylesheets&&n.count===0&&u_(n,n.stylesheets),0ET?50:800)+e);return n.unsuspend=t,function(){n.unsuspend=null,clearTimeout(i),clearTimeout(a)}}:null}function q_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)u_(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var j_=null;function u_(n,e){n.stylesheets=null,n.unsuspend!==null&&(n.count++,j_=new Map,e.forEach(JH,n),j_=null,q_.call(n))}function JH(n,e){if(!(e.state.loading&4)){var t=j_.get(n);if(t)var i=t.get(null);else{t=new Map,j_.set(n,t);for(var a=n.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(VI)}catch(n){console.error(n)}}VI(),KO.exports=o1;var sF=KO.exports;const oF=r1(sF);var kI={exports:{}},yc={};/** +`+i.stack}}var d3=Object.prototype.hasOwnProperty,gM=Gi.unstable_scheduleCallback,jS=Gi.unstable_cancelCallback,Fz=Gi.unstable_shouldYield,Gz=Gi.unstable_requestPaint,Ar=Gi.unstable_now,Vz=Gi.unstable_getCurrentPriorityLevel,fL=Gi.unstable_ImmediatePriority,dL=Gi.unstable_UserBlockingPriority,R_=Gi.unstable_NormalPriority,kz=Gi.unstable_LowPriority,pL=Gi.unstable_IdlePriority,Wz=Gi.log,Xz=Gi.unstable_setDisableYieldValue,S0=null,wr=null;function ql(n){if(typeof Wz=="function"&&Xz(n),wr&&typeof wr.setStrictMode=="function")try{wr.setStrictMode(S0,n)}catch{}}var Rr=Math.clz32?Math.clz32:jz,Yz=Math.log,qz=Math.LN2;function jz(n){return n>>>=0,n===0?32:31-(Yz(n)/qz|0)|0}var Og=256,Lg=262144,Ig=4194304;function pu(n){var e=n&42;if(e!==0)return e;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function f1(n,e,t){var i=n.pendingLanes;if(i===0)return 0;var a=0,r=n.suspendedLanes,s=n.pingedLanes;n=n.warmLanes;var o=i&134217727;return o!==0?(i=o&~r,i!==0?a=pu(i):(s&=o,s!==0?a=pu(s):t||(t=o&~n,t!==0&&(a=pu(t))))):(o=i&~r,o!==0?a=pu(o):s!==0?a=pu(s):t||(t=i&~n,t!==0&&(a=pu(t)))),a===0?0:e!==0&&e!==a&&!(e&r)&&(r=a&-a,t=e&-e,r>=t||r===32&&(t&4194048)!==0)?e:a}function T0(n,e){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&e)===0}function Zz(n,e){switch(n){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mL(){var n=Ig;return Ig<<=1,!(Ig&62914560)&&(Ig=4194304),n}function ZS(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function E0(n,e){n.pendingLanes|=e,e!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Kz(n,e,t,i,a,r){var s=n.pendingLanes;n.pendingLanes=t,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=t,n.entangledLanes&=t,n.errorRecoveryDisabledLanes&=t,n.shellSuspendCounter=0;var o=n.entanglements,c=n.expirationTimes,h=n.hiddenUpdates;for(t=s&~t;0"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var nB=/[\n"\\]/g;function Qr(n){return n.replace(nB,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function g3(n,e,t,i,a,r,s,o){n.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?n.type=s:n.removeAttribute("type"),e!=null?s==="number"?(e===0&&n.value===""||n.value!=e)&&(n.value=""+jr(e)):n.value!==""+jr(e)&&(n.value=""+jr(e)):s!=="submit"&&s!=="reset"||n.removeAttribute("value"),e!=null?v3(n,s,jr(e)):t!=null?v3(n,s,jr(t)):i!=null&&n.removeAttribute("value"),a==null&&r!=null&&(n.defaultChecked=!!r),a!=null&&(n.checked=a&&typeof a!="function"&&typeof a!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?n.name=""+jr(o):n.removeAttribute("name")}function ML(n,e,t,i,a,r,s,o){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(n.type=r),e!=null||t!=null){if(!(r!=="submit"&&r!=="reset"||e!=null)){m3(n);return}t=t!=null?""+jr(t):"",e=e!=null?""+jr(e):t,o||e===n.value||(n.value=e),n.defaultValue=e}i=i??a,i=typeof i!="function"&&typeof i!="symbol"&&!!i,n.checked=o?n.checked:!!i,n.defaultChecked=!!i,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(n.name=s),m3(n)}function v3(n,e,t){e==="number"&&C_(n.ownerDocument)===n||n.defaultValue===""+t||(n.defaultValue=""+t)}function Qf(n,e,t,i){if(n=n.options,e){e={};for(var a=0;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x3=!1;if(el)try{var wp={};Object.defineProperty(wp,"passive",{get:function(){x3=!0}}),window.addEventListener("test",wp,wp),window.removeEventListener("test",wp,wp)}catch{x3=!1}var jl=null,TM=null,t_=null;function CL(){if(t_)return t_;var n,e=TM,t=e.length,i,a="value"in jl?jl.value:jl.textContent,r=a.length;for(n=0;n=_m),$R=" ",eC=!1;function DL(n,e){switch(n){case"keyup":return NB.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function OL(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Uf=!1;function OB(n,e){switch(n){case"compositionend":return OL(e);case"keypress":return e.which!==32?null:(eC=!0,$R);case"textInput":return n=e.data,n===$R&&eC?null:n;default:return null}}function LB(n,e){if(Uf)return n==="compositionend"||!MM&&DL(n,e)?(n=CL(),t_=TM=jl=null,Uf=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=rC(t)}}function PL(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?PL(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function zL(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var e=C_(n.document);e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=C_(n.document)}return e}function bM(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}var GB=el&&"documentMode"in document&&11>=document.documentMode,Pf=null,y3=null,ym=null,S3=!1;function oC(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;S3||Pf==null||Pf!==C_(i)||(i=Pf,"selectionStart"in i&&bM(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ym&&jm(ym,i)||(ym=i,i=q_(y3,"onSelect"),0>=s,a-=s,$s=1<<32-Rr(e)+a|t<P?(O=I,I=null):O=I.sibling;var w=m(v,I,E[P],b);if(w===null){I===null&&(I=O);break}n&&I&&w.alternate===null&&e(v,I),S=r(w,S,P),C===null?D=w:C.sibling=w,C=w,I=O}if(P===E.length)return t(v,I),un&&Fo(v,P),D;if(I===null){for(;PP?(O=I,I=null):O=I.sibling;var B=m(v,I,w.value,b);if(B===null){I===null&&(I=O);break}n&&I&&B.alternate===null&&e(v,I),S=r(B,S,P),C===null?D=B:C.sibling=B,C=B,I=O}if(w.done)return t(v,I),un&&Fo(v,P),D;if(I===null){for(;!w.done;P++,w=E.next())w=d(v,w.value,b),w!==null&&(S=r(w,S,P),C===null?D=w:C.sibling=w,C=w);return un&&Fo(v,P),D}for(I=i(I);!w.done;P++,w=E.next())w=g(I,v,P,w.value,b),w!==null&&(n&&w.alternate!==null&&I.delete(w.key===null?P:w.key),S=r(w,S,P),C===null?D=w:C.sibling=w,C=w);return n&&I.forEach(function(j){return e(v,j)}),un&&Fo(v,P),D}function y(v,S,E,b){if(typeof E=="object"&&E!==null&&E.type===Df&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Dg:e:{for(var D=E.key;S!==null;){if(S.key===D){if(D=E.type,D===Df){if(S.tag===7){t(v,S.sibling),b=a(S,E.props.children),b.return=v,v=b;break e}}else if(S.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===Hl&&mu(D)===S.type){t(v,S.sibling),b=a(S,E.props),Cp(b,E),b.return=v,v=b;break e}t(v,S);break}else e(v,S);S=S.sibling}E.type===Df?(b=Nu(E.props.children,v.mode,b,E.key),b.return=v,v=b):(b=i_(E.type,E.key,E.props,null,v.mode,b),Cp(b,E),b.return=v,v=b)}return s(v);case am:e:{for(D=E.key;S!==null;){if(S.key===D)if(S.tag===4&&S.stateNode.containerInfo===E.containerInfo&&S.stateNode.implementation===E.implementation){t(v,S.sibling),b=a(S,E.children||[]),b.return=v,v=b;break e}else{t(v,S);break}else e(v,S);S=S.sibling}b=aT(E,v.mode,b),b.return=v,v=b}return s(v);case Hl:return E=mu(E),y(v,S,E,b)}if(rm(E))return x(v,S,E,b);if(Ap(E)){if(D=Ap(E),typeof D!="function")throw Error(Ue(150));return E=D.call(E),T(v,S,E,b)}if(typeof E.then=="function")return y(v,S,Bg(E),b);if(E.$$typeof===Yo)return y(v,S,zg(v,E),b);Hg(v,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,S!==null&&S.tag===6?(t(v,S.sibling),b=a(S,E),b.return=v,v=b):(t(v,S),b=iT(E,v.mode,b),b.return=v,v=b),s(v)):t(v,S)}return function(v,S,E,b){try{Qm=0;var D=y(v,S,E,b);return ed=null,D}catch(I){if(I===Gd||I===_1)throw I;var C=Tr(29,I,null,v.mode);return C.lanes=b,C.return=v,C}finally{}}}var Vu=JL(!0),$L=JL(!1),Fl=!1;function IM(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function R3(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ic(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function ac(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,xn&2){var a=i.pending;return a===null?e.next=e:(e.next=a.next,a.next=e),i.pending=e,e=D_(n),WL(n,null,t),e}return v1(n,i,e,t),D_(n)}function Tm(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194048)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,vL(n,t)}}function sT(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var a=null,r=null;if(t=t.firstBaseUpdate,t!==null){do{var s={lane:t.lane,tag:t.tag,payload:t.payload,callback:null,next:null};r===null?a=r=s:r=r.next=s,t=t.next}while(t!==null);r===null?a=r=e:r=r.next=e}else a=r=e;t={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:r,shared:i.shared,callbacks:i.callbacks},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}var C3=!1;function Em(){if(C3){var n=$f;if(n!==null)throw n}}function Mm(n,e,t,i){C3=!1;var a=n.updateQueue;Fl=!1;var r=a.firstBaseUpdate,s=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,h=c.next;c.next=null,s===null?r=h:s.next=h,s=c;var f=n.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==s&&(o===null?f.firstBaseUpdate=h:o.next=h,f.lastBaseUpdate=c))}if(r!==null){var d=a.baseState;s=0,f=h=c=null,o=r;do{var m=o.lane&-536870913,g=m!==o.lane;if(g?(cn&m)===m:(i&m)===m){m!==0&&m===hd&&(C3=!0),f!==null&&(f=f.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var x=n,T=o;m=e;var y=t;switch(T.tag){case 1:if(x=T.payload,typeof x=="function"){d=x.call(y,d,m);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=T.payload,m=typeof x=="function"?x.call(y,d,m):x,m==null)break e;d=ni({},d,m);break e;case 2:Fl=!0}}m=o.callback,m!==null&&(n.flags|=64,g&&(n.flags|=8192),g=a.callbacks,g===null?a.callbacks=[m]:g.push(m))}else g={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(h=f=g,c=d):f=f.next=g,s|=m;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;g=o,o=g.next,g.next=null,a.lastBaseUpdate=g,a.shared.pending=null}}while(!0);f===null&&(c=d),a.baseState=c,a.firstBaseUpdate=h,a.lastBaseUpdate=f,r===null&&(a.shared.lanes=0),mc|=s,n.lanes=s,n.memoizedState=d}}function e5(n,e){if(typeof n!="function")throw Error(Ue(191,n));n.call(e)}function t5(n,e){var t=n.callbacks;if(t!==null)for(n.callbacks=null,n=0;nr?r:8;var s=Ut.T,o={};Ut.T=o,qM(n,!1,e,t);try{var c=a(),h=Ut.S;if(h!==null&&h(o,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=KB(c,i);bm(n,e,f,Cr(n))}else bm(n,e,i,Cr(n))}catch(d){bm(n,e,{then:function(){},status:"rejected",reason:d},Cr())}finally{yn.p=r,s!==null&&o.types!==null&&(s.types=o.types),Ut.T=s}}function nH(){}function I3(n,e,t,i){if(n.tag!==5)throw Error(Ue(476));var a=A5(n).queue;b5(n,a,e,Cu,t===null?nH:function(){return w5(n),t(i)})}function A5(n){var e=n.memoizedState;if(e!==null)return e;e={memoizedState:Cu,baseState:Cu,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nl,lastRenderedState:Cu},next:null};var t={};return e.next={memoizedState:t,baseState:t,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nl,lastRenderedState:t},next:null},n.memoizedState=e,n=n.alternate,n!==null&&(n.memoizedState=e),e}function w5(n){var e=A5(n);e.next===null&&(e=n.alternate.memoizedState),bm(n,e.next.queue,{},Cr())}function YM(){return ua(n0)}function R5(){return Ti().memoizedState}function C5(){return Ti().memoizedState}function iH(n){for(var e=n.return;e!==null;){switch(e.tag){case 24:case 3:var t=Cr();n=ic(t);var i=ac(e,n,t);i!==null&&(Ja(i,e,t),Tm(i,e,t)),e={cache:DM()},n.payload=e;return}e=e.return}}function aH(n,e,t){var i=Cr();t={lane:i,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null},T1(n)?D5(e,t):(t=wM(n,e,t,i),t!==null&&(Ja(t,n,i),O5(t,e,i)))}function N5(n,e,t){var i=Cr();bm(n,e,t,i)}function bm(n,e,t,i){var a={lane:i,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null};if(T1(n))D5(e,a);else{var r=n.alternate;if(n.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var s=e.lastRenderedState,o=r(s,t);if(a.hasEagerState=!0,a.eagerState=o,Dr(o,s))return v1(n,e,a,0),Hn===null&&g1(),!1}catch{}finally{}if(t=wM(n,e,a,i),t!==null)return Ja(t,n,i),O5(t,e,i),!0}return!1}function qM(n,e,t,i){if(i={lane:2,revertLane:nb(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},T1(n)){if(e)throw Error(Ue(479))}else e=wM(n,t,i,2),e!==null&&Ja(e,n,2)}function T1(n){var e=n.alternate;return n===Zt||e!==null&&e===Zt}function D5(n,e){td=z_=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function O5(n,e,t){if(t&4194048){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,vL(n,t)}}var $m={readContext:ua,use:y1,useCallback:vi,useContext:vi,useEffect:vi,useImperativeHandle:vi,useLayoutEffect:vi,useInsertionEffect:vi,useMemo:vi,useReducer:vi,useRef:vi,useState:vi,useDebugValue:vi,useDeferredValue:vi,useTransition:vi,useSyncExternalStore:vi,useId:vi,useHostTransitionStatus:vi,useFormState:vi,useActionState:vi,useOptimistic:vi,useMemoCache:vi,useCacheRefresh:vi};$m.useEffectEvent=vi;var L5={readContext:ua,use:y1,useCallback:function(n,e){return Ra().memoizedState=[n,e===void 0?null:e],n},useContext:ua,useEffect:TC,useImperativeHandle:function(n,e,t){t=t!=null?t.concat([n]):null,s_(4194308,4,y5.bind(null,e,n),t)},useLayoutEffect:function(n,e){return s_(4194308,4,n,e)},useInsertionEffect:function(n,e){s_(4,2,n,e)},useMemo:function(n,e){var t=Ra();e=e===void 0?null:e;var i=n();if(ku){ql(!0);try{n()}finally{ql(!1)}}return t.memoizedState=[i,e],i},useReducer:function(n,e,t){var i=Ra();if(t!==void 0){var a=t(e);if(ku){ql(!0);try{t(e)}finally{ql(!1)}}}else a=e;return i.memoizedState=i.baseState=a,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:a},i.queue=n,n=n.dispatch=aH.bind(null,Zt,n),[i.memoizedState,n]},useRef:function(n){var e=Ra();return n={current:n},e.memoizedState=n},useState:function(n){n=O3(n);var e=n.queue,t=N5.bind(null,Zt,e);return e.dispatch=t,[n.memoizedState,t]},useDebugValue:WM,useDeferredValue:function(n,e){var t=Ra();return XM(t,n,e)},useTransition:function(){var n=O3(!1);return n=b5.bind(null,Zt,n.queue,!0,!1),Ra().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,e,t){var i=Zt,a=Ra();if(un){if(t===void 0)throw Error(Ue(407));t=t()}else{if(t=e(),Hn===null)throw Error(Ue(349));cn&127||s5(i,e,t)}a.memoizedState=t;var r={value:t,getSnapshot:e};return a.queue=r,TC(l5.bind(null,i,r,n),[n]),i.flags|=2048,dd(9,{destroy:void 0},o5.bind(null,i,r,t,e),null),t},useId:function(){var n=Ra(),e=Hn.identifierPrefix;if(un){var t=eo,i=$s;t=(i&~(1<<32-Rr(i)-1)).toString(32)+t,e="_"+e+"R_"+t,t=B_++,0<\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof i.is=="string"?s.createElement("select",{is:i.is}):s.createElement("select"),i.multiple?r.multiple=!0:i.size&&(r.size=i.size);break;default:r=typeof i.is=="string"?s.createElement(a,{is:i.is}):s.createElement(a)}}r[oa]=e,r[er]=i;e:for(s=e.child;s!==null;){if(s.tag===5||s.tag===6)r.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break e;for(;s.sibling===null;){if(s.return===null||s.return===e)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}e.stateNode=r;e:switch(ha(r,a,i),a){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&bo(e)}}return Kn(e),pT(e,e.type,n===null?null:n.memoizedProps,e.pendingProps,t),null;case 6:if(n&&e.stateNode!=null)n.memoizedProps!==i&&bo(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(Ue(166));if(n=tc.current,kh(e)){if(n=e.stateNode,t=e.memoizedProps,i=null,a=la,a!==null)switch(a.tag){case 27:case 5:i=a.memoizedProps}n[oa]=e,n=!!(n.nodeValue===t||i!==null&&i.suppressHydrationWarning===!0||NI(n.nodeValue,t)),n||dc(e,!0)}else n=j_(n).createTextNode(i),n[oa]=e,e.stateNode=n}return Kn(e),null;case 31:if(t=e.memoizedState,n===null||n.memoizedState!==null){if(i=kh(e),t!==null){if(n===null){if(!i)throw Error(Ue(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Ue(557));n[oa]=e}else Fu(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Kn(e),n=!1}else t=rT(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=t),n=!0;if(!n)return e.flags&256?(Sr(e),e):(Sr(e),null);if(e.flags&128)throw Error(Ue(558))}return Kn(e),null;case 13:if(i=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(a=kh(e),i!==null&&i.dehydrated!==null){if(n===null){if(!a)throw Error(Ue(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Ue(317));a[oa]=e}else Fu(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Kn(e),a=!1}else a=rT(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=a),a=!0;if(!a)return e.flags&256?(Sr(e),e):(Sr(e),null)}return Sr(e),e.flags&128?(e.lanes=t,e):(t=i!==null,n=n!==null&&n.memoizedState!==null,t&&(i=e.child,a=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(a=i.alternate.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==a&&(i.flags|=2048)),t!==n&&t&&(e.child.flags|=8192),Fg(e,e.updateQueue),Kn(e),null);case 4:return ld(),n===null&&ib(e.stateNode.containerInfo),Kn(e),null;case 10:return Ko(e.type),Kn(e),null;case 19:if(ea(Si),i=e.memoizedState,i===null)return Kn(e),null;if(a=(e.flags&128)!==0,r=i.rendering,r===null)if(a)Np(i,!1);else{if(_i!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(r=P_(n),r!==null){for(e.flags|=128,Np(i,!1),n=r.updateQueue,e.updateQueue=n,Fg(e,n),e.subtreeFlags=0,n=t,t=e.child;t!==null;)XL(t,n),t=t.sibling;return Yn(Si,Si.current&1|2),un&&Fo(e,i.treeForkCount),e.child}n=n.sibling}i.tail!==null&&Ar()>V_&&(e.flags|=128,a=!0,Np(i,!1),e.lanes=4194304)}else{if(!a)if(n=P_(r),n!==null){if(e.flags|=128,a=!0,n=n.updateQueue,e.updateQueue=n,Fg(e,n),Np(i,!0),i.tail===null&&i.tailMode==="hidden"&&!r.alternate&&!un)return Kn(e),null}else 2*Ar()-i.renderingStartTime>V_&&t!==536870912&&(e.flags|=128,a=!0,Np(i,!1),e.lanes=4194304);i.isBackwards?(r.sibling=e.child,e.child=r):(n=i.last,n!==null?n.sibling=r:e.child=r,i.last=r)}return i.tail!==null?(n=i.tail,i.rendering=n,i.tail=n.sibling,i.renderingStartTime=Ar(),n.sibling=null,t=Si.current,Yn(Si,a?t&1|2:t&1),un&&Fo(e,i.treeForkCount),n):(Kn(e),null);case 22:case 23:return Sr(e),UM(),i=e.memoizedState!==null,n!==null?n.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?t&536870912&&!(e.flags&128)&&(Kn(e),e.subtreeFlags&6&&(e.flags|=8192)):Kn(e),t=e.updateQueue,t!==null&&Fg(e,t.retryQueue),t=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==t&&(e.flags|=2048),n!==null&&ea(Du),null;case 24:return t=null,n!==null&&(t=n.memoizedState.cache),e.memoizedState.cache!==t&&(e.flags|=2048),Ko(Li),Kn(e),null;case 25:return null;case 30:return null}throw Error(Ue(156,e.tag))}function cH(n,e){switch(NM(e),e.tag){case 1:return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Ko(Li),ld(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 26:case 27:case 5:return w_(e),null;case 31:if(e.memoizedState!==null){if(Sr(e),e.alternate===null)throw Error(Ue(340));Fu()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 13:if(Sr(e),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ue(340));Fu()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return ea(Si),null;case 4:return ld(),null;case 10:return Ko(e.type),null;case 22:case 23:return Sr(e),UM(),n!==null&&ea(Du),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 24:return Ko(Li),null;case 25:return null;default:return null}}function X5(n,e){switch(NM(e),e.tag){case 3:Ko(Li),ld();break;case 26:case 27:case 5:w_(e);break;case 4:ld();break;case 31:e.memoizedState!==null&&Sr(e);break;case 13:Sr(e);break;case 19:ea(Si);break;case 10:Ko(e.type);break;case 22:case 23:Sr(e),UM(),n!==null&&ea(Du);break;case 24:Ko(Li)}}function R0(n,e){try{var t=e.updateQueue,i=t!==null?t.lastEffect:null;if(i!==null){var a=i.next;t=a;do{if((t.tag&n)===n){i=void 0;var r=t.create,s=t.inst;i=r(),s.destroy=i}t=t.next}while(t!==a)}}catch(o){Cn(e,e.return,o)}}function pc(n,e,t){try{var i=e.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var r=a.next;i=r;do{if((i.tag&n)===n){var s=i.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,a=e;var c=t,h=o;try{h()}catch(f){Cn(a,c,f)}}}i=i.next}while(i!==r)}}catch(f){Cn(e,e.return,f)}}function Y5(n){var e=n.updateQueue;if(e!==null){var t=n.stateNode;try{t5(e,t)}catch(i){Cn(n,n.return,i)}}}function q5(n,e,t){t.props=Wu(n.type,n.memoizedProps),t.state=n.memoizedState;try{t.componentWillUnmount()}catch(i){Cn(n,e,i)}}function Am(n,e){try{var t=n.ref;if(t!==null){switch(n.tag){case 26:case 27:case 5:var i=n.stateNode;break;case 30:i=n.stateNode;break;default:i=n.stateNode}typeof t=="function"?n.refCleanup=t(i):t.current=i}}catch(a){Cn(n,e,a)}}function to(n,e){var t=n.ref,i=n.refCleanup;if(t!==null)if(typeof i=="function")try{i()}catch(a){Cn(n,e,a)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof t=="function")try{t(null)}catch(a){Cn(n,e,a)}else t.current=null}function j5(n){var e=n.type,t=n.memoizedProps,i=n.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":t.autoFocus&&i.focus();break e;case"img":t.src?i.src=t.src:t.srcSet&&(i.srcset=t.srcSet)}}catch(a){Cn(n,n.return,a)}}function mT(n,e,t){try{var i=n.stateNode;DH(i,n.type,t,e),i[er]=e}catch(a){Cn(n,n.return,a)}}function Z5(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Tc(n.type)||n.tag===4}function gT(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Z5(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Tc(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function H3(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t).insertBefore(n,e):(e=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,e.appendChild(n),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=qo));else if(i!==4&&(i===27&&Tc(n.type)&&(t=n.stateNode,e=null),n=n.child,n!==null))for(H3(n,e,t),n=n.sibling;n!==null;)H3(n,e,t),n=n.sibling}function G_(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(i===27&&Tc(n.type)&&(t=n.stateNode),n=n.child,n!==null))for(G_(n,e,t),n=n.sibling;n!==null;)G_(n,e,t),n=n.sibling}function K5(n){var e=n.stateNode,t=n.memoizedProps;try{for(var i=n.type,a=e.attributes;a.length;)e.removeAttributeNode(a[0]);ha(e,i,t),e[oa]=n,e[er]=t}catch(r){Cn(n,n.return,r)}}var Vo=!1,Di=!1,vT=!1,UC=typeof WeakSet=="function"?WeakSet:Set,Ji=null;function uH(n,e){if(n=n.containerInfo,Y3=J_,n=zL(n),bM(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var a=i.anchorOffset,r=i.focusNode;i=i.focusOffset;try{t.nodeType,r.nodeType}catch{t=null;break e}var s=0,o=-1,c=-1,h=0,f=0,d=n,m=null;t:for(;;){for(var g;d!==t||a!==0&&d.nodeType!==3||(o=s+a),d!==r||i!==0&&d.nodeType!==3||(c=s+i),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)m=d,d=g;for(;;){if(d===n)break t;if(m===t&&++h===a&&(o=s),m===r&&++f===i&&(c=s),(g=d.nextSibling)!==null)break;d=m,m=d.parentNode}d=g}t=o===-1||c===-1?null:{start:o,end:c}}else t=null}t=t||{start:0,end:0}}else t=null;for(q3={focusedElem:n,selectionRange:t},J_=!1,Ji=e;Ji!==null;)if(e=Ji,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Ji=n;else for(;Ji!==null;){switch(e=Ji,r=e.alternate,n=e.flags,e.tag){case 0:if(n&4&&(n=e.updateQueue,n=n!==null?n.events:null,n!==null))for(t=0;t title"))),ha(r,i,t),r[oa]=n,$i(r),i=r;break e;case"link":var s=t4("link","href",a).get(i+(t.href||""));if(s){for(var o=0;oy&&(s=y,y=T,T=s);var v=sC(o,T),S=sC(o,y);if(v&&S&&(g.rangeCount!==1||g.anchorNode!==v.node||g.anchorOffset!==v.offset||g.focusNode!==S.node||g.focusOffset!==S.offset)){var E=d.createRange();E.setStart(v.node,v.offset),g.removeAllRanges(),T>y?(g.addRange(E),g.extend(S.node,S.offset)):(E.setEnd(S.node,S.offset),g.addRange(E))}}}}for(d=[],g=o;g=g.parentNode;)g.nodeType===1&&d.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;ot?32:t,Ut.T=null,t=V3,V3=null;var r=sc,s=Qo;if(Fi=0,md=sc=null,Qo=0,xn&6)throw Error(Ue(331));var o=xn;if(xn|=4,oI(r.current),aI(r,r.current,s,t),xn=o,C0(0,!1),wr&&typeof wr.onPostCommitFiberRoot=="function")try{wr.onPostCommitFiberRoot(S0,r)}catch{}return!0}finally{yn.p=a,Ut.T=i,TI(n,e)}}function HC(n,e,t){e=Jr(t,e),e=P3(n.stateNode,e,2),n=ac(n,e,2),n!==null&&(E0(n,2),co(n))}function Cn(n,e,t){if(n.tag===3)HC(n,n,t);else for(;e!==null;){if(e.tag===3){HC(e,n,t);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(rc===null||!rc.has(i))){n=Jr(t,n),t=B5(2),i=ac(e,t,2),i!==null&&(H5(t,i,e,n),E0(i,2),co(i));break}}e=e.return}}function xT(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new dH;var a=new Set;i.set(e,a)}else a=i.get(e),a===void 0&&(a=new Set,i.set(e,a));a.has(t)||($M=!0,a.add(t),n=_H.bind(null,n,e,t),e.then(n,n))}function _H(n,e,t){var i=n.pingCache;i!==null&&i.delete(e),n.pingedLanes|=n.suspendedLanes&t,n.warmLanes&=~t,Hn===n&&(cn&t)===t&&(_i===4||_i===3&&(cn&62914560)===cn&&300>Ar()-E1?!(xn&2)&&gd(n,0):eb|=t,pd===cn&&(pd=0)),co(n)}function MI(n,e){e===0&&(e=mL()),n=sh(n,e),n!==null&&(E0(n,e),co(n))}function xH(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),MI(n,t)}function yH(n,e){var t=0;switch(n.tag){case 31:case 13:var i=n.stateNode,a=n.memoizedState;a!==null&&(t=a.retryLane);break;case 19:i=n.stateNode;break;case 22:i=n.stateNode._retryCache;break;default:throw Error(Ue(314))}i!==null&&i.delete(e),MI(n,t)}function SH(n,e){return gM(n,e)}var X_=null,Rf=null,W3=!1,Y_=!1,yT=!1,Ql=0;function co(n){n!==Rf&&n.next===null&&(Rf===null?X_=Rf=n:Rf=Rf.next=n),Y_=!0,W3||(W3=!0,EH())}function C0(n,e){if(!yT&&Y_){yT=!0;do for(var t=!1,i=X_;i!==null;){if(n!==0){var a=i.pendingLanes;if(a===0)var r=0;else{var s=i.suspendedLanes,o=i.pingedLanes;r=(1<<31-Rr(42|n)+1)-1,r&=a&~(s&~o),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(t=!0,FC(i,r))}else r=cn,r=f1(i,i===Hn?r:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(r&3)||T0(i,r)||(t=!0,FC(i,r));i=i.next}while(t);yT=!1}}function TH(){bI()}function bI(){Y_=W3=!1;var n=0;Ql!==0&&LH()&&(n=Ql);for(var e=Ar(),t=null,i=X_;i!==null;){var a=i.next,r=AI(i,e);r===0?(i.next=null,t===null?X_=a:t.next=a,a===null&&(Rf=t)):(t=i,(n!==0||r&3)&&(Y_=!0)),i=a}Fi!==0&&Fi!==5||C0(n),Ql!==0&&(Ql=0)}function AI(n,e){for(var t=n.suspendedLanes,i=n.pingedLanes,a=n.expirationTimes,r=n.pendingLanes&-62914561;0o)break;var f=c.transferSize,d=c.initiatorType;f&&XC(d)&&(c=c.responseEnd,s+=f*(c"u"?null:document;function UI(n,e,t){var i=kd;if(i&&typeof e=="string"&&e){var a=Qr(e);a='link[rel="'+n+'"][href="'+a+'"]',typeof t=="string"&&(a+='[crossorigin="'+t+'"]'),JC.has(a)||(JC.add(a),n={rel:n,crossOrigin:t,href:e},i.querySelector(a)===null&&(e=i.createElement("link"),ha(e,"link",n),$i(e),i.head.appendChild(e)))}}function VH(n){ol.D(n),UI("dns-prefetch",n,null)}function kH(n,e){ol.C(n,e),UI("preconnect",n,e)}function WH(n,e,t){ol.L(n,e,t);var i=kd;if(i&&n&&e){var a='link[rel="preload"][as="'+Qr(e)+'"]';e==="image"&&t&&t.imageSrcSet?(a+='[imagesrcset="'+Qr(t.imageSrcSet)+'"]',typeof t.imageSizes=="string"&&(a+='[imagesizes="'+Qr(t.imageSizes)+'"]')):a+='[href="'+Qr(n)+'"]';var r=a;switch(e){case"style":r=vd(n);break;case"script":r=Wd(n)}ss.has(r)||(n=ni({rel:"preload",href:e==="image"&&t&&t.imageSrcSet?void 0:n,as:e},t),ss.set(r,n),i.querySelector(a)!==null||e==="style"&&i.querySelector(N0(r))||e==="script"&&i.querySelector(D0(r))||(e=i.createElement("link"),ha(e,"link",n),$i(e),i.head.appendChild(e)))}}function XH(n,e){ol.m(n,e);var t=kd;if(t&&n){var i=e&&typeof e.as=="string"?e.as:"script",a='link[rel="modulepreload"][as="'+Qr(i)+'"][href="'+Qr(n)+'"]',r=a;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=Wd(n)}if(!ss.has(r)&&(n=ni({rel:"modulepreload",href:n},e),ss.set(r,n),t.querySelector(a)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(t.querySelector(D0(r)))return}i=t.createElement("link"),ha(i,"link",n),$i(i),t.head.appendChild(i)}}}function YH(n,e,t){ol.S(n,e,t);var i=kd;if(i&&n){var a=Kf(i).hoistableStyles,r=vd(n);e=e||"default";var s=a.get(r);if(!s){var o={loading:0,preload:null};if(s=i.querySelector(N0(r)))o.loading=5;else{n=ni({rel:"stylesheet",href:n,"data-precedence":e},t),(t=ss.get(r))&&ab(n,t);var c=s=i.createElement("link");$i(c),ha(c,"link",n),c._p=new Promise(function(h,f){c.onload=h,c.onerror=f}),c.addEventListener("load",function(){o.loading|=1}),c.addEventListener("error",function(){o.loading|=2}),o.loading|=4,u_(s,e,i)}s={type:"stylesheet",instance:s,count:1,state:o},a.set(r,s)}}}function qH(n,e){ol.X(n,e);var t=kd;if(t&&n){var i=Kf(t).hoistableScripts,a=Wd(n),r=i.get(a);r||(r=t.querySelector(D0(a)),r||(n=ni({src:n,async:!0},e),(e=ss.get(a))&&rb(n,e),r=t.createElement("script"),$i(r),ha(r,"link",n),t.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},i.set(a,r))}}function jH(n,e){ol.M(n,e);var t=kd;if(t&&n){var i=Kf(t).hoistableScripts,a=Wd(n),r=i.get(a);r||(r=t.querySelector(D0(a)),r||(n=ni({src:n,async:!0,type:"module"},e),(e=ss.get(a))&&rb(n,e),r=t.createElement("script"),$i(r),ha(r,"link",n),t.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},i.set(a,r))}}function $C(n,e,t,i){var a=(a=tc.current)?Z_(a):null;if(!a)throw Error(Ue(446));switch(n){case"meta":case"title":return null;case"style":return typeof t.precedence=="string"&&typeof t.href=="string"?(e=vd(t.href),t=Kf(a).hoistableStyles,i=t.get(e),i||(i={type:"style",instance:null,count:0,state:null},t.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(t.rel==="stylesheet"&&typeof t.href=="string"&&typeof t.precedence=="string"){n=vd(t.href);var r=Kf(a).hoistableStyles,s=r.get(n);if(s||(a=a.ownerDocument||a,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(n,s),(r=a.querySelector(N0(n)))&&!r._p&&(s.instance=r,s.state.loading=5),ss.has(n)||(t={rel:"preload",as:"style",href:t.href,crossOrigin:t.crossOrigin,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy},ss.set(n,t),r||ZH(a,n,t,s.state))),e&&i===null)throw Error(Ue(528,""));return s}if(e&&i!==null)throw Error(Ue(529,""));return null;case"script":return e=t.async,t=t.src,typeof t=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Wd(t),t=Kf(a).hoistableScripts,i=t.get(e),i||(i={type:"script",instance:null,count:0,state:null},t.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(Ue(444,n))}}function vd(n){return'href="'+Qr(n)+'"'}function N0(n){return'link[rel="stylesheet"]['+n+"]"}function PI(n){return ni({},n,{"data-precedence":n.precedence,precedence:null})}function ZH(n,e,t,i){n.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=n.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),ha(e,"link",t),$i(e),n.head.appendChild(e))}function Wd(n){return'[src="'+Qr(n)+'"]'}function D0(n){return"script[async]"+n}function e4(n,e,t){if(e.count++,e.instance===null)switch(e.type){case"style":var i=n.querySelector('style[data-href~="'+Qr(t.href)+'"]');if(i)return e.instance=i,$i(i),i;var a=ni({},t,{"data-href":t.href,"data-precedence":t.precedence,href:null,precedence:null});return i=(n.ownerDocument||n).createElement("style"),$i(i),ha(i,"style",a),u_(i,t.precedence,n),e.instance=i;case"stylesheet":a=vd(t.href);var r=n.querySelector(N0(a));if(r)return e.state.loading|=4,e.instance=r,$i(r),r;i=PI(t),(a=ss.get(a))&&ab(i,a),r=(n.ownerDocument||n).createElement("link"),$i(r);var s=r;return s._p=new Promise(function(o,c){s.onload=o,s.onerror=c}),ha(r,"link",i),e.state.loading|=4,u_(r,t.precedence,n),e.instance=r;case"script":return r=Wd(t.src),(a=n.querySelector(D0(r)))?(e.instance=a,$i(a),a):(i=t,(a=ss.get(r))&&(i=ni({},t),rb(i,a)),n=n.ownerDocument||n,a=n.createElement("script"),$i(a),ha(a,"link",i),n.head.appendChild(a),e.instance=a);case"void":return null;default:throw Error(Ue(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(i=e.instance,e.state.loading|=4,u_(i,t.precedence,n));return e.instance}function u_(n,e,t){for(var i=t.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=i.length?i[i.length-1]:null,r=a,s=0;s title"):null)}function KH(n,e,t){if(t===1||e.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return n=e.disabled,typeof e.precedence=="string"&&n==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function zI(n){return!(n.type==="stylesheet"&&!(n.state.loading&3))}function QH(n,e,t,i){if(t.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var a=vd(i.href),r=e.querySelector(N0(a));if(r){e=r._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(n.count++,n=K_.bind(n),e.then(n,n)),t.state.loading|=4,t.instance=r,$i(r);return}r=e.ownerDocument||e,i=PI(i),(a=ss.get(a))&&ab(i,a),r=r.createElement("link"),$i(r);var s=r;s._p=new Promise(function(o,c){s.onload=o,s.onerror=c}),ha(r,"link",i),t.instance=r}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(n.count++,t=K_.bind(n),e.addEventListener("load",t),e.addEventListener("error",t))}}var AT=0;function JH(n,e){return n.stylesheets&&n.count===0&&f_(n,n.stylesheets),0AT?50:800)+e);return n.unsuspend=t,function(){n.unsuspend=null,clearTimeout(i),clearTimeout(a)}}:null}function K_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)f_(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Q_=null;function f_(n,e){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Q_=new Map,e.forEach($H,n),Q_=null,K_.call(n))}function $H(n,e){if(!(e.state.loading&4)){var t=Q_.get(n);if(t)var i=t.get(null);else{t=new Map,Q_.set(n,t);for(var a=n.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(XI)}catch(n){console.error(n)}}XI(),$O.exports=u1;var oF=$O.exports;const lF=l1(oF);var YI={exports:{}},Ec={};/** * @license React * react-reconciler-constants.production.js * @@ -54,15 +54,15 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */yc.ConcurrentRoot=1;yc.ContinuousEventPriority=8;yc.DefaultEventPriority=32;yc.DiscreteEventPriority=2;yc.IdleEventPriority=268435456;yc.LegacyRoot=0;yc.NoEventPriority=0;kI.exports=yc;var f_=kI.exports;/** + */Ec.ConcurrentRoot=1;Ec.ContinuousEventPriority=8;Ec.DefaultEventPriority=32;Ec.DiscreteEventPriority=2;Ec.IdleEventPriority=268435456;Ec.LegacyRoot=0;Ec.NoEventPriority=0;YI.exports=Ec;var p_=YI.exports;/** * @license * Copyright 2010-2025 Three.js Authors * SPDX-License-Identifier: MIT - */const ws="181",mu={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},gu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},WI=0,J3=1,XI=2,lF=3,YI=0,b1=1,Cm=2,ys=3,Cs=0,Oi=1,la=2,Sa=0,Ou=1,$3=2,eE=3,tE=4,lb=5,Qs=100,qI=101,jI=102,ZI=103,KI=104,QI=200,Gf=201,JI=202,$I=203,Q_=204,J_=205,eU=206,tU=207,nU=208,iU=209,aU=210,rU=211,sU=212,oU=213,lU=214,$_=0,i0=1,ex=2,ku=3,tx=4,nx=5,ix=6,ax=7,N0=0,cU=1,uU=2,ns=0,hU=1,fU=2,dU=3,cb=4,pU=5,mU=6,gU=7,nE="attached",vU="detached",A1=300,al=301,dc=302,a0=303,r0=304,kd=306,Ta=1e3,Li=1001,vd=1002,Fn=1003,R1=1004,cF=1004,yu=1005,uF=1005,Ht=1006,td=1007,hF=1007,Er=1008,_U=1008,Ii=1009,w1=1010,C1=1011,Wu=1012,D0=1013,Ns=1014,ri=1015,Xn=1016,N1=1017,D1=1018,Xu=1020,ub=35902,hb=35899,fb=1021,db=1022,Jn=1023,_d=1026,Yu=1027,bs=1028,O0=1029,Vo=1030,O1=1031,fF=1032,L1=1033,Nm=33776,Dm=33777,Om=33778,Lm=33779,rx=35840,sx=35841,ox=35842,lx=35843,cx=36196,ux=37492,hx=37496,fx=37808,dx=37809,px=37810,mx=37811,gx=37812,vx=37813,_x=37814,xx=37815,yx=37816,Sx=37817,Tx=37818,Ex=37819,Mx=37820,bx=37821,Ax=36492,Rx=36494,wx=36495,Cx=36283,Nx=36284,Dx=36285,Ox=36286,xU=2200,yU=2201,SU=2202,xd=2300,yd=2301,d_=2302,Su=2400,Tu=2401,s0=2402,I1=2500,pb=2501,TU=0,mb=1,Lx=2,Sc=3200,EU=3201,dF=3202,pF=3203,ol=0,MU=1,Na="",En="srgb",Wn="srgb-linear",o0="linear",Rn="srgb",mF=0,vu=7680,gF=7681,vF=7682,_F=7683,xF=34055,yF=34056,SF=5386,TF=512,EF=513,MF=514,bF=515,AF=516,RF=517,wF=518,iE=519,bU=512,AU=513,RU=514,gb=515,wU=516,CU=517,NU=518,DU=519,l0=35044,OU=35048,CF=35040,NF=35045,DF=35049,OF=35041,LF=35046,IF=35050,UF=35042,PF="100",ao="300 es",Mr=2e3,Sd=2001,zF={COMPUTE:"compute",RENDER:"render"},BF={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},HF={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function LU(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const FF={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Vf(n,e){return new FF[n](e)}function c0(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function IU(){const n=c0("canvas");return n.style.display="block",n}const s4={};let pc=null;function GF(n){pc=n}function VF(){return pc}function u0(...n){const e="THREE."+n.shift();pc?pc("log",e,...n):console.log(e,...n)}function ut(...n){const e="THREE."+n.shift();pc?pc("warn",e,...n):console.warn(e,...n)}function Bt(...n){const e="THREE."+n.shift();pc?pc("error",e,...n):console.error(e,...n)}function Td(...n){const e=n.join(" ");e in s4||(s4[e]=!0,ut(...n))}function kF(n,e,t){return new Promise(function(i,a){function r(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:a();break;case n.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:i()}}setTimeout(r,t)})}let tr=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const a=i[e];if(a!==void 0){const r=a.indexOf(t);r!==-1&&a.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const a=i.slice(0);for(let r=0,s=a.length;r>8&255]+va[n>>16&255]+va[n>>24&255]+"-"+va[e&255]+va[e>>8&255]+"-"+va[e>>16&15|64]+va[e>>24&255]+"-"+va[t&63|128]+va[t>>8&255]+"-"+va[t>>16&255]+va[t>>24&255]+va[i&255]+va[i>>8&255]+va[i>>16&255]+va[i>>24&255]).toLowerCase()}function Lt(n,e,t){return Math.max(e,Math.min(t,n))}function vb(n,e){return(n%e+e)%e}function WF(n,e,t,i,a){return i+(n-e)*(a-i)/(t-e)}function XF(n,e,t){return n!==e?(t-n)/(e-n):0}function Im(n,e,t){return(1-t)*n+t*e}function YF(n,e,t,i){return Im(n,e,1-Math.exp(-t*i))}function qF(n,e=1){return e-Math.abs(vb(n,e*2)-e)}function jF(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function ZF(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function KF(n,e){return n+Math.floor(Math.random()*(e-n+1))}function QF(n,e){return n+Math.random()*(e-n)}function JF(n){return n*(.5-Math.random())}function $F(n){n!==void 0&&(o4=n);let e=o4+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function eG(n){return n*Lu}function tG(n){return n*Ed}function nG(n){return(n&n-1)===0&&n!==0}function iG(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function aG(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function rG(n,e,t,i,a){const r=Math.cos,s=Math.sin,o=r(t/2),c=s(t/2),h=r((e+i)/2),f=s((e+i)/2),d=r((e-i)/2),m=s((e-i)/2),g=r((i-e)/2),x=s((i-e)/2);switch(a){case"XYX":n.set(o*f,c*d,c*m,o*h);break;case"YZY":n.set(c*m,o*f,c*d,o*h);break;case"ZXZ":n.set(c*d,c*m,o*f,o*h);break;case"XZX":n.set(o*f,c*x,c*g,o*h);break;case"YXY":n.set(c*g,o*f,c*x,o*h);break;case"ZYZ":n.set(c*x,c*g,o*f,o*h);break;default:ut("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}}function Da(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function qt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const $t={DEG2RAD:Lu,RAD2DEG:Ed,generateUUID:Cr,clamp:Lt,euclideanModulo:vb,mapLinear:WF,inverseLerp:XF,lerp:Im,damp:YF,pingpong:qF,smoothstep:jF,smootherstep:ZF,randInt:KF,randFloat:QF,randFloatSpread:JF,seededRandom:$F,degToRad:eG,radToDeg:tG,isPowerOfTwo:nG,ceilPowerOfTwo:iG,floorPowerOfTwo:aG,setQuaternionFromProperEuler:rG,normalize:qt,denormalize:Da};class de{constructor(e=0,t=0){de.prototype.isVector2=!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){return 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){return 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){const t=this.x,i=this.y,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6],this.y=a[1]*t+a[4]*i+a[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=Lt(this.x,e.x,t.x),this.y=Lt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Lt(this.x,e,t),this.y=Lt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Lt(i,e,t))}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=Math.trunc(this.x),this.y=Math.trunc(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}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Lt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}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){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),a=Math.sin(t),r=this.x-e.x,s=this.y-e.y;return this.x=r*i-s*a+e.x,this.y=r*a+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Tt{constructor(e=0,t=0,i=0,a=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=a}static slerpFlat(e,t,i,a,r,s,o){let c=i[a+0],h=i[a+1],f=i[a+2],d=i[a+3],m=r[s+0],g=r[s+1],x=r[s+2],T=r[s+3];if(o<=0){e[t+0]=c,e[t+1]=h,e[t+2]=f,e[t+3]=d;return}if(o>=1){e[t+0]=m,e[t+1]=g,e[t+2]=x,e[t+3]=T;return}if(d!==T||c!==m||h!==g||f!==x){let S=c*m+h*g+f*x+d*T;S<0&&(m=-m,g=-g,x=-x,T=-T,S=-S);let v=1-o;if(S<.9995){const y=Math.acos(S),E=Math.sin(y);v=Math.sin(v*y)/E,o=Math.sin(o*y)/E,c=c*v+m*o,h=h*v+g*o,f=f*v+x*o,d=d*v+T*o}else{c=c*v+m*o,h=h*v+g*o,f=f*v+x*o,d=d*v+T*o;const y=1/Math.sqrt(c*c+h*h+f*f+d*d);c*=y,h*=y,f*=y,d*=y}}e[t]=c,e[t+1]=h,e[t+2]=f,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,a,r,s){const o=i[a],c=i[a+1],h=i[a+2],f=i[a+3],d=r[s],m=r[s+1],g=r[s+2],x=r[s+3];return e[t]=o*x+f*d+c*g-h*m,e[t+1]=c*x+f*m+h*d-o*g,e[t+2]=h*x+f*g+o*m-c*d,e[t+3]=f*x-o*d-c*m-h*g,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,a){return this._x=e,this._y=t,this._z=i,this._w=a,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=!0){const i=e._x,a=e._y,r=e._z,s=e._order,o=Math.cos,c=Math.sin,h=o(i/2),f=o(a/2),d=o(r/2),m=c(i/2),g=c(a/2),x=c(r/2);switch(s){case"XYZ":this._x=m*f*d+h*g*x,this._y=h*g*d-m*f*x,this._z=h*f*x+m*g*d,this._w=h*f*d-m*g*x;break;case"YXZ":this._x=m*f*d+h*g*x,this._y=h*g*d-m*f*x,this._z=h*f*x-m*g*d,this._w=h*f*d+m*g*x;break;case"ZXY":this._x=m*f*d-h*g*x,this._y=h*g*d+m*f*x,this._z=h*f*x+m*g*d,this._w=h*f*d-m*g*x;break;case"ZYX":this._x=m*f*d-h*g*x,this._y=h*g*d+m*f*x,this._z=h*f*x-m*g*d,this._w=h*f*d+m*g*x;break;case"YZX":this._x=m*f*d+h*g*x,this._y=h*g*d+m*f*x,this._z=h*f*x-m*g*d,this._w=h*f*d-m*g*x;break;case"XZY":this._x=m*f*d-h*g*x,this._y=h*g*d-m*f*x,this._z=h*f*x+m*g*d,this._w=h*f*d+m*g*x;break;default:ut("Quaternion: .setFromEuler() encountered an unknown order: "+s)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,a=Math.sin(i);return this._x=e.x*a,this._y=e.y*a,this._z=e.z*a,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],a=t[4],r=t[8],s=t[1],o=t[5],c=t[9],h=t[2],f=t[6],d=t[10],m=i+o+d;if(m>0){const g=.5/Math.sqrt(m+1);this._w=.25/g,this._x=(f-c)*g,this._y=(r-h)*g,this._z=(s-a)*g}else if(i>o&&i>d){const g=2*Math.sqrt(1+i-o-d);this._w=(f-c)/g,this._x=.25*g,this._y=(a+s)/g,this._z=(r+h)/g}else if(o>d){const g=2*Math.sqrt(1+o-i-d);this._w=(r-h)/g,this._x=(a+s)/g,this._y=.25*g,this._z=(c+f)/g}else{const g=2*Math.sqrt(1+d-i-o);this._w=(s-a)/g,this._x=(r+h)/g,this._y=(c+f)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(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(Lt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const a=Math.min(1,t/i);return this.slerp(e,a),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(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,a=e._y,r=e._z,s=e._w,o=t._x,c=t._y,h=t._z,f=t._w;return this._x=i*f+s*o+a*h-r*c,this._y=a*f+s*c+r*o-i*h,this._z=r*f+s*h+i*c-a*o,this._w=s*f-i*o-a*c-r*h,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let i=e._x,a=e._y,r=e._z,s=e._w,o=this.dot(e);o<0&&(i=-i,a=-a,r=-r,s=-s,o=-o);let c=1-t;if(o<.9995){const h=Math.acos(o),f=Math.sin(h);c=Math.sin(c*h)/f,t=Math.sin(t*h)/f,this._x=this._x*c+i*t,this._y=this._y*c+a*t,this._z=this._z*c+r*t,this._w=this._w*c+s*t,this._onChangeCallback()}else this._x=this._x*c+i*t,this._y=this._y*c+a*t,this._z=this._z*c+r*t,this._w=this._w*c+s*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),a=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(a*Math.sin(e),a*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}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._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class L{constructor(e=0,t=0,i=0){L.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(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){return 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){return 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){return 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 this.applyQuaternion(l4.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(l4.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,a=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*a,this.y=r[1]*t+r[4]*i+r[7]*a,this.z=r[2]*t+r[5]*i+r[8]*a,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,a=this.z,r=e.elements,s=1/(r[3]*t+r[7]*i+r[11]*a+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*a+r[12])*s,this.y=(r[1]*t+r[5]*i+r[9]*a+r[13])*s,this.z=(r[2]*t+r[6]*i+r[10]*a+r[14])*s,this}applyQuaternion(e){const t=this.x,i=this.y,a=this.z,r=e.x,s=e.y,o=e.z,c=e.w,h=2*(s*a-o*i),f=2*(o*t-r*a),d=2*(r*i-s*t);return this.x=t+c*h+s*d-o*f,this.y=i+c*f+o*h-r*d,this.z=a+c*d+r*f-s*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,a=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*a,this.y=r[1]*t+r[5]*i+r[9]*a,this.z=r[2]*t+r[6]*i+r[10]*a,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=Lt(this.x,e.x,t.x),this.y=Lt(this.y,e.y,t.y),this.z=Lt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Lt(this.x,e,t),this.y=Lt(this.y,e,t),this.z=Lt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Lt(i,e,t))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(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){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,a=e.y,r=e.z,s=t.x,o=t.y,c=t.z;return this.x=a*c-r*o,this.y=r*s-i*c,this.z=i*o-a*s,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return MT.copy(this).projectOnVector(e),this.sub(MT)}reflect(e){return this.sub(MT.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Lt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,a=this.z-e.z;return t*t+i*i+a*a}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){const a=Math.sin(t)*e;return this.x=a*Math.sin(i),this.y=Math.cos(t)*e,this.z=a*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){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),a=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=a,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}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){return 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(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const MT=new L,l4=new Tt;class Et{constructor(e,t,i,a,r,s,o,c,h){Et.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,a,r,s,o,c,h)}set(e,t,i,a,r,s,o,c,h){const f=this.elements;return f[0]=e,f[1]=a,f[2]=o,f[3]=t,f[4]=r,f[5]=c,f[6]=i,f[7]=s,f[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,a=t.elements,r=this.elements,s=i[0],o=i[3],c=i[6],h=i[1],f=i[4],d=i[7],m=i[2],g=i[5],x=i[8],T=a[0],S=a[3],v=a[6],y=a[1],E=a[4],b=a[7],D=a[2],C=a[5],I=a[8];return r[0]=s*T+o*y+c*D,r[3]=s*S+o*E+c*C,r[6]=s*v+o*b+c*I,r[1]=h*T+f*y+d*D,r[4]=h*S+f*E+d*C,r[7]=h*v+f*b+d*I,r[2]=m*T+g*y+x*D,r[5]=m*S+g*E+x*C,r[8]=m*v+g*b+x*I,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],h=e[7],f=e[8];return t*s*f-t*o*h-i*r*f+i*o*c+a*r*h-a*s*c}invert(){const e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],h=e[7],f=e[8],d=f*s-o*h,m=o*c-f*r,g=h*r-s*c,x=t*d+i*m+a*g;if(x===0)return this.set(0,0,0,0,0,0,0,0,0);const T=1/x;return e[0]=d*T,e[1]=(a*h-f*i)*T,e[2]=(o*i-a*s)*T,e[3]=m*T,e[4]=(f*t-a*c)*T,e[5]=(a*r-o*t)*T,e[6]=g*T,e[7]=(i*c-h*t)*T,e[8]=(s*t-i*r)*T,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const 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,a,r,s,o){const c=Math.cos(r),h=Math.sin(r);return this.set(i*c,i*h,-i*(c*s+h*o)+s+e,-a*h,a*c,-a*(-h*s+c*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(bT.makeScale(e,t)),this}rotate(e){return this.premultiply(bT.makeRotation(-e)),this}translate(e,t){return this.premultiply(bT.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let a=0;a<9;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const 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)}}const bT=new Et,c4=new Et().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),u4=new Et().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function sG(){const n={enabled:!0,workingColorSpace:Wn,spaces:{},convert:function(a,r,s){return this.enabled===!1||r===s||!r||!s||(this.spaces[r].transfer===Rn&&(a.r=Qo(a.r),a.g=Qo(a.g),a.b=Qo(a.b)),this.spaces[r].primaries!==this.spaces[s].primaries&&(a.applyMatrix3(this.spaces[r].toXYZ),a.applyMatrix3(this.spaces[s].fromXYZ)),this.spaces[s].transfer===Rn&&(a.r=nd(a.r),a.g=nd(a.g),a.b=nd(a.b))),a},workingToColorSpace:function(a,r){return this.convert(a,this.workingColorSpace,r)},colorSpaceToWorking:function(a,r){return this.convert(a,r,this.workingColorSpace)},getPrimaries:function(a){return this.spaces[a].primaries},getTransfer:function(a){return a===Na?o0:this.spaces[a].transfer},getToneMappingMode:function(a){return this.spaces[a].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(a,r=this.workingColorSpace){return a.fromArray(this.spaces[r].luminanceCoefficients)},define:function(a){Object.assign(this.spaces,a)},_getMatrix:function(a,r,s){return a.copy(this.spaces[r].toXYZ).multiply(this.spaces[s].fromXYZ)},_getDrawingBufferColorSpace:function(a){return this.spaces[a].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(a=this.workingColorSpace){return this.spaces[a].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(a,r){return Td("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(a,r)},toWorkingColorSpace:function(a,r){return Td("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(a,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[Wn]:{primaries:e,whitePoint:i,transfer:o0,toXYZ:c4,fromXYZ:u4,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:En},outputColorSpaceConfig:{drawingBufferColorSpace:En}},[En]:{primaries:e,whitePoint:i,transfer:Rn,toXYZ:c4,fromXYZ:u4,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:En}}}),n}const rn=sG();function Qo(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function nd(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let kh;class UU{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{kh===void 0&&(kh=c0("canvas")),kh.width=e.width,kh.height=e.height;const a=kh.getContext("2d");e instanceof ImageData?a.putImageData(e,0,0):a.drawImage(e,0,0,e.width,e.height),i=kh}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=c0("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const a=i.getImageData(0,0,e.width,e.height),r=a.data;for(let s=0;s1),this.pmremVersion=0}get width(){return this.source.getSize(RT).x}get height(){return this.source.getSize(RT).y}get depth(){return this.source.getSize(RT).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,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.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){ut(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const a=this[t];if(a===void 0){ut(`Texture.setValues(): property '${t}' does not exist.`);continue}a&&i&&a.isVector2&&i.isVector2||a&&i&&a.isVector3&&i.isVector3||a&&i&&a.isMatrix3&&i.isMatrix3?a.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,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,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==A1)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ta:e.x=e.x-Math.floor(e.x);break;case Li:e.x=e.x<0?0:1;break;case vd:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Ta:e.y=e.y-Math.floor(e.y);break;case Li:e.y=e.y<0?0:1;break;case vd:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Nn.DEFAULT_IMAGE=null;Nn.DEFAULT_MAPPING=A1;Nn.DEFAULT_ANISOTROPY=1;class zt{constructor(e=0,t=0,i=0,a=1){zt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=a}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,a){return this.x=e,this.y=t,this.z=i,this.w=a,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=e.w!==void 0?e.w:1,this}add(e){return 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){return 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){const t=this.x,i=this.y,a=this.z,r=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*a+s[12]*r,this.y=s[1]*t+s[5]*i+s[9]*a+s[13]*r,this.z=s[2]*t+s[6]*i+s[10]*a+s[14]*r,this.w=s[3]*t+s[7]*i+s[11]*a+s[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const 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,a,r;const c=e.elements,h=c[0],f=c[4],d=c[8],m=c[1],g=c[5],x=c[9],T=c[2],S=c[6],v=c[10];if(Math.abs(f-m)<.01&&Math.abs(d-T)<.01&&Math.abs(x-S)<.01){if(Math.abs(f+m)<.1&&Math.abs(d+T)<.1&&Math.abs(x+S)<.1&&Math.abs(h+g+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const E=(h+1)/2,b=(g+1)/2,D=(v+1)/2,C=(f+m)/4,I=(d+T)/4,P=(x+S)/4;return E>b&&E>D?E<.01?(i=0,a=.707106781,r=.707106781):(i=Math.sqrt(E),a=C/i,r=I/i):b>D?b<.01?(i=.707106781,a=0,r=.707106781):(a=Math.sqrt(b),i=C/a,r=P/a):D<.01?(i=.707106781,a=.707106781,r=0):(r=Math.sqrt(D),i=I/r,a=P/r),this.set(i,a,r,t),this}let y=Math.sqrt((S-x)*(S-x)+(d-T)*(d-T)+(m-f)*(m-f));return Math.abs(y)<.001&&(y=1),this.x=(S-x)/y,this.y=(d-T)/y,this.z=(m-f)/y,this.w=Math.acos((h+g+v-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],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=Lt(this.x,e.x,t.x),this.y=Lt(this.y,e.y,t.y),this.z=Lt(this.z,e.z,t.z),this.w=Lt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Lt(this.x,e,t),this.y=Lt(this.y,e,t),this.z=Lt(this.z,e,t),this.w=Lt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Lt(i,e,t))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(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){return 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}}class _b extends tr{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ht,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new zt(0,0,e,t),this.scissorTest=!1,this.viewport=new zt(0,0,e,t);const a={width:e,height:t,depth:i.depth},r=new Nn(a);this.textures=[];const s=i.count;for(let o=0;o1);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){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t=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,ps),ps.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(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),e.normal.z>0?(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){if(this.isEmpty())return!1;this.getCenter(Dp),Xg.subVectors(this.max,Dp),Wh.subVectors(e.a,Dp),Xh.subVectors(e.b,Dp),Yh.subVectors(e.c,Dp),bl.subVectors(Xh,Wh),Al.subVectors(Yh,Xh),Yc.subVectors(Wh,Yh);let t=[0,-bl.z,bl.y,0,-Al.z,Al.y,0,-Yc.z,Yc.y,bl.z,0,-bl.x,Al.z,0,-Al.x,Yc.z,0,-Yc.x,-bl.y,bl.x,0,-Al.y,Al.x,0,-Yc.y,Yc.x,0];return!wT(t,Wh,Xh,Yh,Xg)||(t=[1,0,0,0,1,0,0,0,1],!wT(t,Wh,Xh,Yh,Xg))?!1:(Yg.crossVectors(bl,Al),t=[Yg.x,Yg.y,Yg.z],wT(t,Wh,Xh,Yh,Xg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ps).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ps).length()*.5),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()?this:(Ro[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ro[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ro[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ro[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ro[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ro[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ro[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ro[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ro),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Ro=[new L,new L,new L,new L,new L,new L,new L,new L],ps=new L,Wg=new ea,Wh=new L,Xh=new L,Yh=new L,bl=new L,Al=new L,Yc=new L,Dp=new L,Xg=new L,Yg=new L,qc=new L;function wT(n,e,t,i,a){for(let r=0,s=n.length-3;r<=s;r+=3){qc.fromArray(n,r);const o=a.x*Math.abs(qc.x)+a.y*Math.abs(qc.y)+a.z*Math.abs(qc.z),c=e.dot(qc),h=t.dot(qc),f=i.dot(qc);if(Math.max(-Math.max(c,h,f),Math.min(c,h,f))>o)return!1}return!0}const cG=new ea,Op=new L,CT=new L;class ta{constructor(e=new L,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):cG.setFromPoints(e).getCenter(i);let a=0;for(let r=0,s=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(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){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Op.subVectors(e,this.center);const t=Op.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),a=(i-this.radius)*.5;this.center.addScaledVector(Op,a/i),this.radius+=a}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(CT.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Op.copy(e.center).add(CT)),this.expandByPoint(Op.copy(e.center).sub(CT))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const wo=new L,NT=new L,qg=new L,Rl=new L,DT=new L,jg=new L,OT=new L;class sh{constructor(e=new L,t=new L(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.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,wo)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=wo.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(wo.copy(this.origin).addScaledVector(this.direction,t),wo.distanceToSquared(e))}distanceSqToSegment(e,t,i,a){NT.copy(e).add(t).multiplyScalar(.5),qg.copy(t).sub(e).normalize(),Rl.copy(this.origin).sub(NT);const r=e.distanceTo(t)*.5,s=-this.direction.dot(qg),o=Rl.dot(this.direction),c=-Rl.dot(qg),h=Rl.lengthSq(),f=Math.abs(1-s*s);let d,m,g,x;if(f>0)if(d=s*c-o,m=s*o-c,x=r*f,d>=0)if(m>=-x)if(m<=x){const T=1/f;d*=T,m*=T,g=d*(d+s*m+2*o)+m*(s*d+m+2*c)+h}else m=r,d=Math.max(0,-(s*m+o)),g=-d*d+m*(m+2*c)+h;else m=-r,d=Math.max(0,-(s*m+o)),g=-d*d+m*(m+2*c)+h;else m<=-x?(d=Math.max(0,-(-s*r+o)),m=d>0?-r:Math.min(Math.max(-r,-c),r),g=-d*d+m*(m+2*c)+h):m<=x?(d=0,m=Math.min(Math.max(-r,-c),r),g=m*(m+2*c)+h):(d=Math.max(0,-(s*r+o)),m=d>0?r:Math.min(Math.max(-r,-c),r),g=-d*d+m*(m+2*c)+h);else m=s>0?-r:r,d=Math.max(0,-(s*m+o)),g=-d*d+m*(m+2*c)+h;return i&&i.copy(this.origin).addScaledVector(this.direction,d),a&&a.copy(NT).addScaledVector(qg,m),g}intersectSphere(e,t){wo.subVectors(e.center,this.origin);const i=wo.dot(this.direction),a=wo.dot(wo)-i*i,r=e.radius*e.radius;if(a>r)return null;const s=Math.sqrt(r-a),o=i-s,c=i+s;return c<0?null:o<0?this.at(c,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,a,r,s,o,c;const h=1/this.direction.x,f=1/this.direction.y,d=1/this.direction.z,m=this.origin;return h>=0?(i=(e.min.x-m.x)*h,a=(e.max.x-m.x)*h):(i=(e.max.x-m.x)*h,a=(e.min.x-m.x)*h),f>=0?(r=(e.min.y-m.y)*f,s=(e.max.y-m.y)*f):(r=(e.max.y-m.y)*f,s=(e.min.y-m.y)*f),i>s||r>a||((r>i||isNaN(i))&&(i=r),(s=0?(o=(e.min.z-m.z)*d,c=(e.max.z-m.z)*d):(o=(e.max.z-m.z)*d,c=(e.min.z-m.z)*d),i>c||o>a)||((o>i||i!==i)&&(i=o),(c=0?i:a,t)}intersectsBox(e){return this.intersectBox(e,wo)!==null}intersectTriangle(e,t,i,a,r){DT.subVectors(t,e),jg.subVectors(i,e),OT.crossVectors(DT,jg);let s=this.direction.dot(OT),o;if(s>0){if(a)return null;o=1}else if(s<0)o=-1,s=-s;else return null;Rl.subVectors(this.origin,e);const c=o*this.direction.dot(jg.crossVectors(Rl,jg));if(c<0)return null;const h=o*this.direction.dot(DT.cross(Rl));if(h<0||c+h>s)return null;const f=-o*Rl.dot(OT);return f<0?null:this.at(f/s,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 ke{constructor(e,t,i,a,r,s,o,c,h,f,d,m,g,x,T,S){ke.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,a,r,s,o,c,h,f,d,m,g,x,T,S)}set(e,t,i,a,r,s,o,c,h,f,d,m,g,x,T,S){const v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=a,v[1]=r,v[5]=s,v[9]=o,v[13]=c,v[2]=h,v[6]=f,v[10]=d,v[14]=m,v[3]=g,v[7]=x,v[11]=T,v[15]=S,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 ke().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}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){const t=this.elements,i=e.elements,a=1/qh.setFromMatrixColumn(e,0).length(),r=1/qh.setFromMatrixColumn(e,1).length(),s=1/qh.setFromMatrixColumn(e,2).length();return t[0]=i[0]*a,t[1]=i[1]*a,t[2]=i[2]*a,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]*s,t[9]=i[9]*s,t[10]=i[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,a=e.y,r=e.z,s=Math.cos(i),o=Math.sin(i),c=Math.cos(a),h=Math.sin(a),f=Math.cos(r),d=Math.sin(r);if(e.order==="XYZ"){const m=s*f,g=s*d,x=o*f,T=o*d;t[0]=c*f,t[4]=-c*d,t[8]=h,t[1]=g+x*h,t[5]=m-T*h,t[9]=-o*c,t[2]=T-m*h,t[6]=x+g*h,t[10]=s*c}else if(e.order==="YXZ"){const m=c*f,g=c*d,x=h*f,T=h*d;t[0]=m+T*o,t[4]=x*o-g,t[8]=s*h,t[1]=s*d,t[5]=s*f,t[9]=-o,t[2]=g*o-x,t[6]=T+m*o,t[10]=s*c}else if(e.order==="ZXY"){const m=c*f,g=c*d,x=h*f,T=h*d;t[0]=m-T*o,t[4]=-s*d,t[8]=x+g*o,t[1]=g+x*o,t[5]=s*f,t[9]=T-m*o,t[2]=-s*h,t[6]=o,t[10]=s*c}else if(e.order==="ZYX"){const m=s*f,g=s*d,x=o*f,T=o*d;t[0]=c*f,t[4]=x*h-g,t[8]=m*h+T,t[1]=c*d,t[5]=T*h+m,t[9]=g*h-x,t[2]=-h,t[6]=o*c,t[10]=s*c}else if(e.order==="YZX"){const m=s*c,g=s*h,x=o*c,T=o*h;t[0]=c*f,t[4]=T-m*d,t[8]=x*d+g,t[1]=d,t[5]=s*f,t[9]=-o*f,t[2]=-h*f,t[6]=g*d+x,t[10]=m-T*d}else if(e.order==="XZY"){const m=s*c,g=s*h,x=o*c,T=o*h;t[0]=c*f,t[4]=-d,t[8]=h*f,t[1]=m*d+T,t[5]=s*f,t[9]=g*d-x,t[2]=x*d-g,t[6]=o*f,t[10]=T*d+m}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(uG,e,hG)}lookAt(e,t,i){const a=this.elements;return gr.subVectors(e,t),gr.lengthSq()===0&&(gr.z=1),gr.normalize(),wl.crossVectors(i,gr),wl.lengthSq()===0&&(Math.abs(i.z)===1?gr.x+=1e-4:gr.z+=1e-4,gr.normalize(),wl.crossVectors(i,gr)),wl.normalize(),Zg.crossVectors(gr,wl),a[0]=wl.x,a[4]=Zg.x,a[8]=gr.x,a[1]=wl.y,a[5]=Zg.y,a[9]=gr.y,a[2]=wl.z,a[6]=Zg.z,a[10]=gr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,a=t.elements,r=this.elements,s=i[0],o=i[4],c=i[8],h=i[12],f=i[1],d=i[5],m=i[9],g=i[13],x=i[2],T=i[6],S=i[10],v=i[14],y=i[3],E=i[7],b=i[11],D=i[15],C=a[0],I=a[4],P=a[8],O=a[12],R=a[1],B=a[5],j=a[9],ee=a[13],se=a[2],re=a[6],W=a[10],te=a[14],K=a[3],oe=a[7],ie=a[11],Ce=a[15];return r[0]=s*C+o*R+c*se+h*K,r[4]=s*I+o*B+c*re+h*oe,r[8]=s*P+o*j+c*W+h*ie,r[12]=s*O+o*ee+c*te+h*Ce,r[1]=f*C+d*R+m*se+g*K,r[5]=f*I+d*B+m*re+g*oe,r[9]=f*P+d*j+m*W+g*ie,r[13]=f*O+d*ee+m*te+g*Ce,r[2]=x*C+T*R+S*se+v*K,r[6]=x*I+T*B+S*re+v*oe,r[10]=x*P+T*j+S*W+v*ie,r[14]=x*O+T*ee+S*te+v*Ce,r[3]=y*C+E*R+b*se+D*K,r[7]=y*I+E*B+b*re+D*oe,r[11]=y*P+E*j+b*W+D*ie,r[15]=y*O+E*ee+b*te+D*Ce,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],i=e[4],a=e[8],r=e[12],s=e[1],o=e[5],c=e[9],h=e[13],f=e[2],d=e[6],m=e[10],g=e[14],x=e[3],T=e[7],S=e[11],v=e[15];return x*(+r*c*d-a*h*d-r*o*m+i*h*m+a*o*g-i*c*g)+T*(+t*c*g-t*h*m+r*s*m-a*s*g+a*h*f-r*c*f)+S*(+t*h*d-t*o*g-r*s*d+i*s*g+r*o*f-i*h*f)+v*(-a*o*f-t*c*d+t*o*m+a*s*d-i*s*m+i*c*f)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const a=this.elements;return e.isVector3?(a[12]=e.x,a[13]=e.y,a[14]=e.z):(a[12]=e,a[13]=t,a[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],h=e[7],f=e[8],d=e[9],m=e[10],g=e[11],x=e[12],T=e[13],S=e[14],v=e[15],y=d*S*h-T*m*h+T*c*g-o*S*g-d*c*v+o*m*v,E=x*m*h-f*S*h-x*c*g+s*S*g+f*c*v-s*m*v,b=f*T*h-x*d*h+x*o*g-s*T*g-f*o*v+s*d*v,D=x*d*c-f*T*c-x*o*m+s*T*m+f*o*S-s*d*S,C=t*y+i*E+a*b+r*D;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/C;return e[0]=y*I,e[1]=(T*m*r-d*S*r-T*a*g+i*S*g+d*a*v-i*m*v)*I,e[2]=(o*S*r-T*c*r+T*a*h-i*S*h-o*a*v+i*c*v)*I,e[3]=(d*c*r-o*m*r-d*a*h+i*m*h+o*a*g-i*c*g)*I,e[4]=E*I,e[5]=(f*S*r-x*m*r+x*a*g-t*S*g-f*a*v+t*m*v)*I,e[6]=(x*c*r-s*S*r-x*a*h+t*S*h+s*a*v-t*c*v)*I,e[7]=(s*m*r-f*c*r+f*a*h-t*m*h-s*a*g+t*c*g)*I,e[8]=b*I,e[9]=(x*d*r-f*T*r-x*i*g+t*T*g+f*i*v-t*d*v)*I,e[10]=(s*T*r-x*o*r+x*i*h-t*T*h-s*i*v+t*o*v)*I,e[11]=(f*o*r-s*d*r-f*i*h+t*d*h+s*i*g-t*o*g)*I,e[12]=D*I,e[13]=(f*T*a-x*d*a+x*i*m-t*T*m-f*i*S+t*d*S)*I,e[14]=(x*o*a-s*T*a-x*i*c+t*T*c+s*i*S-t*o*S)*I,e[15]=(s*d*a-f*o*a+f*i*c-t*d*c-s*i*m+t*o*m)*I,this}scale(e){const t=this.elements,i=e.x,a=e.y,r=e.z;return t[0]*=i,t[4]*=a,t[8]*=r,t[1]*=i,t[5]*=a,t[9]*=r,t[2]*=i,t[6]*=a,t[10]*=r,t[3]*=i,t[7]*=a,t[11]*=r,this}getMaxScaleOnAxis(){const 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],a=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,a))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),a=Math.sin(t),r=1-i,s=e.x,o=e.y,c=e.z,h=r*s,f=r*o;return this.set(h*s+i,h*o-a*c,h*c+a*o,0,h*o+a*c,f*o+i,f*c-a*s,0,h*c-a*o,f*c+a*s,r*c*c+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,a,r,s){return this.set(1,i,r,0,e,1,s,0,t,a,1,0,0,0,0,1),this}compose(e,t,i){const a=this.elements,r=t._x,s=t._y,o=t._z,c=t._w,h=r+r,f=s+s,d=o+o,m=r*h,g=r*f,x=r*d,T=s*f,S=s*d,v=o*d,y=c*h,E=c*f,b=c*d,D=i.x,C=i.y,I=i.z;return a[0]=(1-(T+v))*D,a[1]=(g+b)*D,a[2]=(x-E)*D,a[3]=0,a[4]=(g-b)*C,a[5]=(1-(m+v))*C,a[6]=(S+y)*C,a[7]=0,a[8]=(x+E)*I,a[9]=(S-y)*I,a[10]=(1-(m+T))*I,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,this}decompose(e,t,i){const a=this.elements;let r=qh.set(a[0],a[1],a[2]).length();const s=qh.set(a[4],a[5],a[6]).length(),o=qh.set(a[8],a[9],a[10]).length();this.determinant()<0&&(r=-r),e.x=a[12],e.y=a[13],e.z=a[14],ms.copy(this);const h=1/r,f=1/s,d=1/o;return ms.elements[0]*=h,ms.elements[1]*=h,ms.elements[2]*=h,ms.elements[4]*=f,ms.elements[5]*=f,ms.elements[6]*=f,ms.elements[8]*=d,ms.elements[9]*=d,ms.elements[10]*=d,t.setFromRotationMatrix(ms),i.x=r,i.y=s,i.z=o,this}makePerspective(e,t,i,a,r,s,o=Mr,c=!1){const h=this.elements,f=2*r/(t-e),d=2*r/(i-a),m=(t+e)/(t-e),g=(i+a)/(i-a);let x,T;if(c)x=r/(s-r),T=s*r/(s-r);else if(o===Mr)x=-(s+r)/(s-r),T=-2*s*r/(s-r);else if(o===Sd)x=-s/(s-r),T=-s*r/(s-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return h[0]=f,h[4]=0,h[8]=m,h[12]=0,h[1]=0,h[5]=d,h[9]=g,h[13]=0,h[2]=0,h[6]=0,h[10]=x,h[14]=T,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,i,a,r,s,o=Mr,c=!1){const h=this.elements,f=2/(t-e),d=2/(i-a),m=-(t+e)/(t-e),g=-(i+a)/(i-a);let x,T;if(c)x=1/(s-r),T=s/(s-r);else if(o===Mr)x=-2/(s-r),T=-(s+r)/(s-r);else if(o===Sd)x=-1/(s-r),T=-r/(s-r);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return h[0]=f,h[4]=0,h[8]=0,h[12]=m,h[1]=0,h[5]=d,h[9]=0,h[13]=g,h[2]=0,h[6]=0,h[10]=x,h[14]=T,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let a=0;a<16;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const 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}}const qh=new L,ms=new ke,uG=new L(0,0,0),hG=new L(1,1,1),wl=new L,Zg=new L,gr=new L,h4=new ke,f4=new Tt;class Ui{constructor(e=0,t=0,i=0,a=Ui.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=a}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,a=this._order){return this._x=e,this._y=t,this._z=i,this._order=a,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){const a=e.elements,r=a[0],s=a[4],o=a[8],c=a[1],h=a[5],f=a[9],d=a[2],m=a[6],g=a[10];switch(t){case"XYZ":this._y=Math.asin(Lt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-f,g),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(m,h),this._z=0);break;case"YXZ":this._x=Math.asin(-Lt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(o,g),this._z=Math.atan2(c,h)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(Lt(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-d,g),this._z=Math.atan2(-s,h)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-Lt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(m,g),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-s,h));break;case"YZX":this._z=Math.asin(Lt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-f,h),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,g));break;case"XZY":this._z=Math.asin(-Lt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(m,h),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-f,g),this._y=0);break;default:ut("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return h4.makeRotationFromQuaternion(e),this.setFromRotationMatrix(h4,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return f4.setFromEuler(this),this.setFromQuaternion(f4,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],e[3]!==void 0&&(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}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ui.DEFAULT_ORDER="XYZ";class Md{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(a.type="BatchedMesh",a.perObjectFrustumCulled=this.perObjectFrustumCulled,a.sortObjects=this.sortObjects,a.drawRanges=this._drawRanges,a.reservedRanges=this._reservedRanges,a.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),a.instanceInfo=this._instanceInfo.map(o=>({...o})),a.availableInstanceIds=this._availableInstanceIds.slice(),a.availableGeometryIds=this._availableGeometryIds.slice(),a.nextIndexStart=this._nextIndexStart,a.nextVertexStart=this._nextVertexStart,a.geometryCount=this._geometryCount,a.maxInstanceCount=this._maxInstanceCount,a.maxVertexCount=this._maxVertexCount,a.maxIndexCount=this._maxIndexCount,a.geometryInitialized=this._geometryInitialized,a.matricesTexture=this._matricesTexture.toJSON(e),a.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(a.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(a.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(a.boundingBox=this.boundingBox.toJSON()));function r(o,c){return o[c.uuid]===void 0&&(o[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=r(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const c=o.shapes;if(Array.isArray(c))for(let h=0,f=c.length;h0){a.children=[];for(let o=0;o0){a.animations=[];for(let o=0;o0&&(i.geometries=o),c.length>0&&(i.materials=c),h.length>0&&(i.textures=h),f.length>0&&(i.images=f),d.length>0&&(i.shapes=d),m.length>0&&(i.skeletons=m),g.length>0&&(i.animations=g),x.length>0&&(i.nodes=x)}return i.object=a,i;function s(o){const c=[];for(const h in o){const f=o[h];delete f.metadata,c.push(f)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?a.multiplyScalar(1/Math.sqrt(r)):a.set(0,0,0)}static getBarycoord(e,t,i,a,r){gs.subVectors(a,t),No.subVectors(i,t),IT.subVectors(e,t);const s=gs.dot(gs),o=gs.dot(No),c=gs.dot(IT),h=No.dot(No),f=No.dot(IT),d=s*h-o*o;if(d===0)return r.set(0,0,0),null;const m=1/d,g=(h*c-o*f)*m,x=(s*f-o*c)*m;return r.set(1-g-x,x,g)}static containsPoint(e,t,i,a){return this.getBarycoord(e,t,i,a,Do)===null?!1:Do.x>=0&&Do.y>=0&&Do.x+Do.y<=1}static getInterpolation(e,t,i,a,r,s,o,c){return this.getBarycoord(e,t,i,a,Do)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,Do.x),c.addScaledVector(s,Do.y),c.addScaledVector(o,Do.z),c)}static getInterpolatedAttribute(e,t,i,a,r,s){return BT.setScalar(0),HT.setScalar(0),FT.setScalar(0),BT.fromBufferAttribute(e,t),HT.fromBufferAttribute(e,i),FT.fromBufferAttribute(e,a),s.setScalar(0),s.addScaledVector(BT,r.x),s.addScaledVector(HT,r.y),s.addScaledVector(FT,r.z),s}static isFrontFacing(e,t,i,a){return gs.subVectors(i,t),No.subVectors(e,t),gs.cross(No).dot(a)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,a){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[a]),this}setFromAttributeAndIndices(e,t,i,a){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,a),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 gs.subVectors(this.c,this.b),No.subVectors(this.a,this.b),gs.cross(No).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ka.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ka.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,a,r){return Ka.getInterpolation(e,this.a,this.b,this.c,t,i,a,r)}containsPoint(e){return Ka.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ka.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,a=this.b,r=this.c;let s,o;Kh.subVectors(a,i),Qh.subVectors(r,i),UT.subVectors(e,i);const c=Kh.dot(UT),h=Qh.dot(UT);if(c<=0&&h<=0)return t.copy(i);PT.subVectors(e,a);const f=Kh.dot(PT),d=Qh.dot(PT);if(f>=0&&d<=f)return t.copy(a);const m=c*d-f*h;if(m<=0&&c>=0&&f<=0)return s=c/(c-f),t.copy(i).addScaledVector(Kh,s);zT.subVectors(e,r);const g=Kh.dot(zT),x=Qh.dot(zT);if(x>=0&&g<=x)return t.copy(r);const T=g*h-c*x;if(T<=0&&h>=0&&x<=0)return o=h/(h-x),t.copy(i).addScaledVector(Qh,o);const S=f*x-g*d;if(S<=0&&d-f>=0&&g-x>=0)return _4.subVectors(r,a),o=(d-f)/(d-f+(g-x)),t.copy(a).addScaledVector(_4,o);const v=1/(S+T+m);return s=T*v,o=m*v,t.copy(i).addScaledVector(Kh,s).addScaledVector(Qh,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const BU={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},Cl={h:0,s:0,l:0},Qg={h:0,s:0,l:0};function GT(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class je{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const a=e;a&&a.isColor?this.copy(a):typeof a=="number"?this.setHex(a):typeof a=="string"&&this.setStyle(a)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=En){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,rn.colorSpaceToWorking(this,t),this}setRGB(e,t,i,a=rn.workingColorSpace){return this.r=e,this.g=t,this.b=i,rn.colorSpaceToWorking(this,a),this}setHSL(e,t,i,a=rn.workingColorSpace){if(e=vb(e,1),t=Lt(t,0,1),i=Lt(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,s=2*i-r;this.r=GT(s,r,e+1/3),this.g=GT(s,r,e),this.b=GT(s,r,e-1/3)}return rn.colorSpaceToWorking(this,a),this}setStyle(e,t=En){function i(r){r!==void 0&&parseFloat(r)<1&&ut("Color: Alpha component of "+e+" will be ignored.")}let a;if(a=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const s=a[1],o=a[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:ut("Color: Unknown color model "+e)}}else if(a=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=a[1],s=r.length;if(s===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(s===6)return this.setHex(parseInt(r,16),t);ut("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=En){const i=BU[e.toLowerCase()];return i!==void 0?this.setHex(i,t):ut("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}copySRGBToLinear(e){return this.r=Qo(e.r),this.g=Qo(e.g),this.b=Qo(e.b),this}copyLinearToSRGB(e){return this.r=nd(e.r),this.g=nd(e.g),this.b=nd(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=En){return rn.workingToColorSpace(_a.copy(this),e),Math.round(Lt(_a.r*255,0,255))*65536+Math.round(Lt(_a.g*255,0,255))*256+Math.round(Lt(_a.b*255,0,255))}getHexString(e=En){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=rn.workingColorSpace){rn.workingToColorSpace(_a.copy(this),t);const i=_a.r,a=_a.g,r=_a.b,s=Math.max(i,a,r),o=Math.min(i,a,r);let c,h;const f=(o+s)/2;if(o===s)c=0,h=0;else{const d=s-o;switch(h=f<=.5?d/(s+o):d/(2-s-o),s){case i:c=(a-r)/d+(a0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){ut(`Material: parameter '${t}' has value of undefined.`);continue}const a=this[t];if(a===void 0){ut(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}a&&a.isColor?a.set(i):a&&a.isVector3&&i&&i.isVector3?a.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(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.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),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,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ou&&(i.blending=this.blending),this.side!==Cs&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Q_&&(i.blendSrc=this.blendSrc),this.blendDst!==J_&&(i.blendDst=this.blendDst),this.blendEquation!==Qs&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==ku&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==iE&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==vu&&(i.stencilFail=this.stencilFail),this.stencilZFail!==vu&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==vu&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function a(r){const s=[];for(const o in r){const c=r[o];delete c.metadata,s.push(c)}return s}if(t){const r=a(e.textures),s=a(e.images);r.length>0&&(i.textures=r),s.length>0&&(i.images=s)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const a=t.length;i=new Array(a);for(let r=0;r!==a;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class La extends qn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new je(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.envMapRotation=new Ui,this.combine=N0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,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.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}}const ko=vG();function vG(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),a=new Uint32Array(512);for(let c=0;c<256;++c){const h=c-127;h<-27?(i[c]=0,i[c|256]=32768,a[c]=24,a[c|256]=24):h<-14?(i[c]=1024>>-h-14,i[c|256]=1024>>-h-14|32768,a[c]=-h-1,a[c|256]=-h-1):h<=15?(i[c]=h+15<<10,i[c|256]=h+15<<10|32768,a[c]=13,a[c|256]=13):h<128?(i[c]=31744,i[c|256]=64512,a[c]=24,a[c|256]=24):(i[c]=31744,i[c|256]=64512,a[c]=13,a[c|256]=13)}const r=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let c=1;c<1024;++c){let h=c<<13,f=0;for(;!(h&8388608);)h<<=1,f-=8388608;h&=-8388609,f+=947912704,r[c]=h|f}for(let c=1024;c<2048;++c)r[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)s[c]=c<<23;s[31]=1199570944,s[32]=2147483648;for(let c=33;c<63;++c)s[c]=2147483648+(c-32<<23);s[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(o[c]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:a,mantissaTable:r,exponentTable:s,offsetTable:o}}function Xa(n){Math.abs(n)>65504&&ut("DataUtils.toHalfFloat(): Value out of range."),n=Lt(n,-65504,65504),ko.floatView[0]=n;const e=ko.uint32View[0],t=e>>23&511;return ko.baseTable[t]+((e&8388607)>>ko.shiftTable[t])}function om(n){const e=n>>10;return ko.uint32View[0]=ko.mantissaTable[ko.offsetTable[e]+(n&1023)]+ko.exponentTable[e],ko.floatView[0]}class aE{static toHalfFloat(e){return Xa(e)}static fromHalfFloat(e){return om(e)}}const Ri=new L,Jg=new de;let _G=0;class Ot{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:_G++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=l0,this.updateRanges=[],this.gpuType=ri,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}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.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let a=0,r=this.itemSize;at.count&&ut("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ea);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Bt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new L(-1/0,-1/0,-1/0),new L(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,a=t.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const h in c)c[h]!==void 0&&(e[h]=c[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const c in i){const h=i[c];e.data.attributes[c]=h.toJSON(e.data)}const a={};let r=!1;for(const c in this.morphAttributes){const h=this.morphAttributes[c],f=[];for(let d=0,m=h.length;d0&&(a[c]=f,r=!0)}r&&(e.data.morphAttributes=a,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}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 t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const a=e.attributes;for(const h in a){const f=a[h];this.setAttribute(h,f.clone(t))}const r=e.morphAttributes;for(const h in r){const f=[],d=r[h];for(let m=0,g=d.length;m0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,s=a.length;r(e.far-e.near)**2))&&(x4.copy(r).invert(),jc.copy(e.ray).applyMatrix4(x4),!(i.boundingBox!==null&&jc.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,jc)))}_computeIntersections(e,t,i){let a;const r=this.geometry,s=this.material,o=r.index,c=r.attributes.position,h=r.attributes.uv,f=r.attributes.uv1,d=r.attributes.normal,m=r.groups,g=r.drawRange;if(o!==null)if(Array.isArray(s))for(let x=0,T=m.length;xt.far?null:{distance:h,point:av.clone(),object:n}}function rv(n,e,t,i,a,r,s,o,c,h){n.getVertexPosition(o,ev),n.getVertexPosition(c,tv),n.getVertexPosition(h,nv);const f=AG(n,e,t,i,ev,tv,nv,S4);if(f){const d=new L;Ka.getBarycoord(S4,ev,tv,nv,d),a&&(f.uv=Ka.getInterpolatedAttribute(a,o,c,h,d,new de)),r&&(f.uv1=Ka.getInterpolatedAttribute(r,o,c,h,d,new de)),s&&(f.normal=Ka.getInterpolatedAttribute(s,o,c,h,d,new L),f.normal.dot(i.direction)>0&&f.normal.multiplyScalar(-1));const m={a:o,b:c,c:h,normal:new L,materialIndex:0};Ka.getNormal(ev,tv,nv,m.normal),f.face=m,f.barycoord=d}return f}class oh extends wt{constructor(e=1,t=1,i=1,a=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:a,heightSegments:r,depthSegments:s};const o=this;a=Math.floor(a),r=Math.floor(r),s=Math.floor(s);const c=[],h=[],f=[],d=[];let m=0,g=0;x("z","y","x",-1,-1,i,t,e,s,r,0),x("z","y","x",1,-1,i,t,-e,s,r,1),x("x","z","y",1,1,e,i,t,a,s,2),x("x","z","y",1,-1,e,i,-t,a,s,3),x("x","y","z",1,-1,e,t,i,a,r,4),x("x","y","z",-1,-1,e,t,-i,a,r,5),this.setIndex(c),this.setAttribute("position",new xt(h,3)),this.setAttribute("normal",new xt(f,3)),this.setAttribute("uv",new xt(d,2));function x(T,S,v,y,E,b,D,C,I,P,O){const R=b/I,B=D/P,j=b/2,ee=D/2,se=C/2,re=I+1,W=P+1;let te=0,K=0;const oe=new L;for(let ie=0;ie0?1:-1,f.push(oe.x,oe.y,oe.z),d.push(Xe/I),d.push(1-ie/P),te+=1}}for(let ie=0;ie=0;--e)if(n[e]>=65535)return!0;return!1}const GF={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Wf(n,e){return new GF[n](e)}function h0(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function PU(){const n=h0("canvas");return n.style.display="block",n}const c4={};let vc=null;function VF(n){vc=n}function kF(){return vc}function f0(...n){const e="THREE."+n.shift();vc?vc("log",e,...n):console.log(e,...n)}function ut(...n){const e="THREE."+n.shift();vc?vc("warn",e,...n):console.warn(e,...n)}function Bt(...n){const e="THREE."+n.shift();vc?vc("error",e,...n):console.error(e,...n)}function Md(...n){const e=n.join(" ");e in c4||(c4[e]=!0,ut(...n))}function WF(n,e,t){return new Promise(function(i,a){function r(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:a();break;case n.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:i()}}setTimeout(r,t)})}let nr=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const a=i[e];if(a!==void 0){const r=a.indexOf(t);r!==-1&&a.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const a=i.slice(0);for(let r=0,s=a.length;r>8&255]+_a[n>>16&255]+_a[n>>24&255]+"-"+_a[e&255]+_a[e>>8&255]+"-"+_a[e>>16&15|64]+_a[e>>24&255]+"-"+_a[t&63|128]+_a[t>>8&255]+"-"+_a[t>>16&255]+_a[t>>24&255]+_a[i&255]+_a[i>>8&255]+_a[i>>16&255]+_a[i>>24&255]).toLowerCase()}function Lt(n,e,t){return Math.max(e,Math.min(t,n))}function yb(n,e){return(n%e+e)%e}function XF(n,e,t,i,a){return i+(n-e)*(a-i)/(t-e)}function YF(n,e,t){return n!==e?(t-n)/(e-n):0}function Pm(n,e,t){return(1-t)*n+t*e}function qF(n,e,t,i){return Pm(n,e,1-Math.exp(-t*i))}function jF(n,e=1){return e-Math.abs(yb(n,e*2)-e)}function ZF(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function KF(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function QF(n,e){return n+Math.floor(Math.random()*(e-n+1))}function JF(n,e){return n+Math.random()*(e-n)}function $F(n){return n*(.5-Math.random())}function eG(n){n!==void 0&&(u4=n);let e=u4+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function tG(n){return n*Uu}function nG(n){return n*bd}function iG(n){return(n&n-1)===0&&n!==0}function aG(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function rG(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function sG(n,e,t,i,a){const r=Math.cos,s=Math.sin,o=r(t/2),c=s(t/2),h=r((e+i)/2),f=s((e+i)/2),d=r((e-i)/2),m=s((e-i)/2),g=r((i-e)/2),x=s((i-e)/2);switch(a){case"XYX":n.set(o*f,c*d,c*m,o*h);break;case"YZY":n.set(c*m,o*f,c*d,o*h);break;case"ZXZ":n.set(c*d,c*m,o*f,o*h);break;case"XZX":n.set(o*f,c*x,c*g,o*h);break;case"YXY":n.set(c*g,o*f,c*x,o*h);break;case"ZYZ":n.set(c*x,c*g,o*f,o*h);break;default:ut("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}}function Oa(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function jt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const $t={DEG2RAD:Uu,RAD2DEG:bd,generateUUID:Nr,clamp:Lt,euclideanModulo:yb,mapLinear:XF,inverseLerp:YF,lerp:Pm,damp:qF,pingpong:jF,smoothstep:ZF,smootherstep:KF,randInt:QF,randFloat:JF,randFloatSpread:$F,seededRandom:eG,degToRad:tG,radToDeg:nG,isPowerOfTwo:iG,ceilPowerOfTwo:aG,floorPowerOfTwo:rG,setQuaternionFromProperEuler:sG,normalize:jt,denormalize:Oa};class de{constructor(e=0,t=0){de.prototype.isVector2=!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){return 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){return 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){const t=this.x,i=this.y,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6],this.y=a[1]*t+a[4]*i+a[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=Lt(this.x,e.x,t.x),this.y=Lt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Lt(this.x,e,t),this.y=Lt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Lt(i,e,t))}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=Math.trunc(this.x),this.y=Math.trunc(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}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Lt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}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){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),a=Math.sin(t),r=this.x-e.x,s=this.y-e.y;return this.x=r*i-s*a+e.x,this.y=r*a+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class St{constructor(e=0,t=0,i=0,a=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=a}static slerpFlat(e,t,i,a,r,s,o){let c=i[a+0],h=i[a+1],f=i[a+2],d=i[a+3],m=r[s+0],g=r[s+1],x=r[s+2],T=r[s+3];if(o<=0){e[t+0]=c,e[t+1]=h,e[t+2]=f,e[t+3]=d;return}if(o>=1){e[t+0]=m,e[t+1]=g,e[t+2]=x,e[t+3]=T;return}if(d!==T||c!==m||h!==g||f!==x){let y=c*m+h*g+f*x+d*T;y<0&&(m=-m,g=-g,x=-x,T=-T,y=-y);let v=1-o;if(y<.9995){const S=Math.acos(y),E=Math.sin(S);v=Math.sin(v*S)/E,o=Math.sin(o*S)/E,c=c*v+m*o,h=h*v+g*o,f=f*v+x*o,d=d*v+T*o}else{c=c*v+m*o,h=h*v+g*o,f=f*v+x*o,d=d*v+T*o;const S=1/Math.sqrt(c*c+h*h+f*f+d*d);c*=S,h*=S,f*=S,d*=S}}e[t]=c,e[t+1]=h,e[t+2]=f,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,a,r,s){const o=i[a],c=i[a+1],h=i[a+2],f=i[a+3],d=r[s],m=r[s+1],g=r[s+2],x=r[s+3];return e[t]=o*x+f*d+c*g-h*m,e[t+1]=c*x+f*m+h*d-o*g,e[t+2]=h*x+f*g+o*m-c*d,e[t+3]=f*x-o*d-c*m-h*g,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,a){return this._x=e,this._y=t,this._z=i,this._w=a,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=!0){const i=e._x,a=e._y,r=e._z,s=e._order,o=Math.cos,c=Math.sin,h=o(i/2),f=o(a/2),d=o(r/2),m=c(i/2),g=c(a/2),x=c(r/2);switch(s){case"XYZ":this._x=m*f*d+h*g*x,this._y=h*g*d-m*f*x,this._z=h*f*x+m*g*d,this._w=h*f*d-m*g*x;break;case"YXZ":this._x=m*f*d+h*g*x,this._y=h*g*d-m*f*x,this._z=h*f*x-m*g*d,this._w=h*f*d+m*g*x;break;case"ZXY":this._x=m*f*d-h*g*x,this._y=h*g*d+m*f*x,this._z=h*f*x+m*g*d,this._w=h*f*d-m*g*x;break;case"ZYX":this._x=m*f*d-h*g*x,this._y=h*g*d+m*f*x,this._z=h*f*x-m*g*d,this._w=h*f*d+m*g*x;break;case"YZX":this._x=m*f*d+h*g*x,this._y=h*g*d+m*f*x,this._z=h*f*x-m*g*d,this._w=h*f*d-m*g*x;break;case"XZY":this._x=m*f*d-h*g*x,this._y=h*g*d-m*f*x,this._z=h*f*x+m*g*d,this._w=h*f*d+m*g*x;break;default:ut("Quaternion: .setFromEuler() encountered an unknown order: "+s)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,a=Math.sin(i);return this._x=e.x*a,this._y=e.y*a,this._z=e.z*a,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],a=t[4],r=t[8],s=t[1],o=t[5],c=t[9],h=t[2],f=t[6],d=t[10],m=i+o+d;if(m>0){const g=.5/Math.sqrt(m+1);this._w=.25/g,this._x=(f-c)*g,this._y=(r-h)*g,this._z=(s-a)*g}else if(i>o&&i>d){const g=2*Math.sqrt(1+i-o-d);this._w=(f-c)/g,this._x=.25*g,this._y=(a+s)/g,this._z=(r+h)/g}else if(o>d){const g=2*Math.sqrt(1+o-i-d);this._w=(r-h)/g,this._x=(a+s)/g,this._y=.25*g,this._z=(c+f)/g}else{const g=2*Math.sqrt(1+d-i-o);this._w=(s-a)/g,this._x=(r+h)/g,this._y=(c+f)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(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(Lt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const a=Math.min(1,t/i);return this.slerp(e,a),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(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,a=e._y,r=e._z,s=e._w,o=t._x,c=t._y,h=t._z,f=t._w;return this._x=i*f+s*o+a*h-r*c,this._y=a*f+s*c+r*o-i*h,this._z=r*f+s*h+i*c-a*o,this._w=s*f-i*o-a*c-r*h,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let i=e._x,a=e._y,r=e._z,s=e._w,o=this.dot(e);o<0&&(i=-i,a=-a,r=-r,s=-s,o=-o);let c=1-t;if(o<.9995){const h=Math.acos(o),f=Math.sin(h);c=Math.sin(c*h)/f,t=Math.sin(t*h)/f,this._x=this._x*c+i*t,this._y=this._y*c+a*t,this._z=this._z*c+r*t,this._w=this._w*c+s*t,this._onChangeCallback()}else this._x=this._x*c+i*t,this._y=this._y*c+a*t,this._z=this._z*c+r*t,this._w=this._w*c+s*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),a=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(a*Math.sin(e),a*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}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._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class L{constructor(e=0,t=0,i=0){L.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(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){return 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){return 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){return 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 this.applyQuaternion(h4.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(h4.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,a=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*a,this.y=r[1]*t+r[4]*i+r[7]*a,this.z=r[2]*t+r[5]*i+r[8]*a,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,a=this.z,r=e.elements,s=1/(r[3]*t+r[7]*i+r[11]*a+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*a+r[12])*s,this.y=(r[1]*t+r[5]*i+r[9]*a+r[13])*s,this.z=(r[2]*t+r[6]*i+r[10]*a+r[14])*s,this}applyQuaternion(e){const t=this.x,i=this.y,a=this.z,r=e.x,s=e.y,o=e.z,c=e.w,h=2*(s*a-o*i),f=2*(o*t-r*a),d=2*(r*i-s*t);return this.x=t+c*h+s*d-o*f,this.y=i+c*f+o*h-r*d,this.z=a+c*d+r*f-s*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,a=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*a,this.y=r[1]*t+r[5]*i+r[9]*a,this.z=r[2]*t+r[6]*i+r[10]*a,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=Lt(this.x,e.x,t.x),this.y=Lt(this.y,e.y,t.y),this.z=Lt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Lt(this.x,e,t),this.y=Lt(this.y,e,t),this.z=Lt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Lt(i,e,t))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(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){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,a=e.y,r=e.z,s=t.x,o=t.y,c=t.z;return this.x=a*c-r*o,this.y=r*s-i*c,this.z=i*o-a*s,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return wT.copy(this).projectOnVector(e),this.sub(wT)}reflect(e){return this.sub(wT.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Lt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,a=this.z-e.z;return t*t+i*i+a*a}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){const a=Math.sin(t)*e;return this.x=a*Math.sin(i),this.y=Math.cos(t)*e,this.z=a*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){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),a=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=a,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}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){return 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(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const wT=new L,h4=new St;class Et{constructor(e,t,i,a,r,s,o,c,h){Et.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,a,r,s,o,c,h)}set(e,t,i,a,r,s,o,c,h){const f=this.elements;return f[0]=e,f[1]=a,f[2]=o,f[3]=t,f[4]=r,f[5]=c,f[6]=i,f[7]=s,f[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,a=t.elements,r=this.elements,s=i[0],o=i[3],c=i[6],h=i[1],f=i[4],d=i[7],m=i[2],g=i[5],x=i[8],T=a[0],y=a[3],v=a[6],S=a[1],E=a[4],b=a[7],D=a[2],C=a[5],I=a[8];return r[0]=s*T+o*S+c*D,r[3]=s*y+o*E+c*C,r[6]=s*v+o*b+c*I,r[1]=h*T+f*S+d*D,r[4]=h*y+f*E+d*C,r[7]=h*v+f*b+d*I,r[2]=m*T+g*S+x*D,r[5]=m*y+g*E+x*C,r[8]=m*v+g*b+x*I,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],h=e[7],f=e[8];return t*s*f-t*o*h-i*r*f+i*o*c+a*r*h-a*s*c}invert(){const e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],h=e[7],f=e[8],d=f*s-o*h,m=o*c-f*r,g=h*r-s*c,x=t*d+i*m+a*g;if(x===0)return this.set(0,0,0,0,0,0,0,0,0);const T=1/x;return e[0]=d*T,e[1]=(a*h-f*i)*T,e[2]=(o*i-a*s)*T,e[3]=m*T,e[4]=(f*t-a*c)*T,e[5]=(a*r-o*t)*T,e[6]=g*T,e[7]=(i*c-h*t)*T,e[8]=(s*t-i*r)*T,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const 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,a,r,s,o){const c=Math.cos(r),h=Math.sin(r);return this.set(i*c,i*h,-i*(c*s+h*o)+s+e,-a*h,a*c,-a*(-h*s+c*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(RT.makeScale(e,t)),this}rotate(e){return this.premultiply(RT.makeRotation(-e)),this}translate(e,t){return this.premultiply(RT.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let a=0;a<9;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const 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)}}const RT=new Et,f4=new Et().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),d4=new Et().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function oG(){const n={enabled:!0,workingColorSpace:Wn,spaces:{},convert:function(a,r,s){return this.enabled===!1||r===s||!r||!s||(this.spaces[r].transfer===wn&&(a.r=Jo(a.r),a.g=Jo(a.g),a.b=Jo(a.b)),this.spaces[r].primaries!==this.spaces[s].primaries&&(a.applyMatrix3(this.spaces[r].toXYZ),a.applyMatrix3(this.spaces[s].fromXYZ)),this.spaces[s].transfer===wn&&(a.r=ad(a.r),a.g=ad(a.g),a.b=ad(a.b))),a},workingToColorSpace:function(a,r){return this.convert(a,this.workingColorSpace,r)},colorSpaceToWorking:function(a,r){return this.convert(a,r,this.workingColorSpace)},getPrimaries:function(a){return this.spaces[a].primaries},getTransfer:function(a){return a===Da?c0:this.spaces[a].transfer},getToneMappingMode:function(a){return this.spaces[a].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(a,r=this.workingColorSpace){return a.fromArray(this.spaces[r].luminanceCoefficients)},define:function(a){Object.assign(this.spaces,a)},_getMatrix:function(a,r,s){return a.copy(this.spaces[r].toXYZ).multiply(this.spaces[s].fromXYZ)},_getDrawingBufferColorSpace:function(a){return this.spaces[a].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(a=this.workingColorSpace){return this.spaces[a].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(a,r){return Md("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(a,r)},toWorkingColorSpace:function(a,r){return Md("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(a,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[Wn]:{primaries:e,whitePoint:i,transfer:c0,toXYZ:f4,fromXYZ:d4,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:En},outputColorSpaceConfig:{drawingBufferColorSpace:En}},[En]:{primaries:e,whitePoint:i,transfer:wn,toXYZ:f4,fromXYZ:d4,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:En}}}),n}const rn=oG();function Jo(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ad(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Xh;class zU{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Xh===void 0&&(Xh=h0("canvas")),Xh.width=e.width,Xh.height=e.height;const a=Xh.getContext("2d");e instanceof ImageData?a.putImageData(e,0,0):a.drawImage(e,0,0,e.width,e.height),i=Xh}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=h0("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const a=i.getImageData(0,0,e.width,e.height),r=a.data;for(let s=0;s1),this.pmremVersion=0}get width(){return this.source.getSize(NT).x}get height(){return this.source.getSize(NT).y}get depth(){return this.source.getSize(NT).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,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.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){ut(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const a=this[t];if(a===void 0){ut(`Texture.setValues(): property '${t}' does not exist.`);continue}a&&i&&a.isVector2&&i.isVector2||a&&i&&a.isVector3&&i.isVector3||a&&i&&a.isMatrix3&&i.isMatrix3?a.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,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,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==C1)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ea:e.x=e.x-Math.floor(e.x);break;case Pi:e.x=e.x<0?0:1;break;case xd:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Ea:e.y=e.y-Math.floor(e.y);break;case Pi:e.y=e.y<0?0:1;break;case xd:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Nn.DEFAULT_IMAGE=null;Nn.DEFAULT_MAPPING=C1;Nn.DEFAULT_ANISOTROPY=1;class zt{constructor(e=0,t=0,i=0,a=1){zt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=a}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,a){return this.x=e,this.y=t,this.z=i,this.w=a,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=e.w!==void 0?e.w:1,this}add(e){return 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){return 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){const t=this.x,i=this.y,a=this.z,r=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*a+s[12]*r,this.y=s[1]*t+s[5]*i+s[9]*a+s[13]*r,this.z=s[2]*t+s[6]*i+s[10]*a+s[14]*r,this.w=s[3]*t+s[7]*i+s[11]*a+s[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const 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,a,r;const c=e.elements,h=c[0],f=c[4],d=c[8],m=c[1],g=c[5],x=c[9],T=c[2],y=c[6],v=c[10];if(Math.abs(f-m)<.01&&Math.abs(d-T)<.01&&Math.abs(x-y)<.01){if(Math.abs(f+m)<.1&&Math.abs(d+T)<.1&&Math.abs(x+y)<.1&&Math.abs(h+g+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const E=(h+1)/2,b=(g+1)/2,D=(v+1)/2,C=(f+m)/4,I=(d+T)/4,P=(x+y)/4;return E>b&&E>D?E<.01?(i=0,a=.707106781,r=.707106781):(i=Math.sqrt(E),a=C/i,r=I/i):b>D?b<.01?(i=.707106781,a=0,r=.707106781):(a=Math.sqrt(b),i=C/a,r=P/a):D<.01?(i=.707106781,a=.707106781,r=0):(r=Math.sqrt(D),i=I/r,a=P/r),this.set(i,a,r,t),this}let S=Math.sqrt((y-x)*(y-x)+(d-T)*(d-T)+(m-f)*(m-f));return Math.abs(S)<.001&&(S=1),this.x=(y-x)/S,this.y=(d-T)/S,this.z=(m-f)/S,this.w=Math.acos((h+g+v-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],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=Lt(this.x,e.x,t.x),this.y=Lt(this.y,e.y,t.y),this.z=Lt(this.z,e.z,t.z),this.w=Lt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Lt(this.x,e,t),this.y=Lt(this.y,e,t),this.z=Lt(this.z,e,t),this.w=Lt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Lt(i,e,t))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(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){return 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}}class Sb extends nr{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ht,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new zt(0,0,e,t),this.scissorTest=!1,this.viewport=new zt(0,0,e,t);const a={width:e,height:t,depth:i.depth},r=new Nn(a);this.textures=[];const s=i.count;for(let o=0;o1);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){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t=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,ms),ms.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(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),e.normal.z>0?(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){if(this.isEmpty())return!1;this.getCenter(Lp),qg.subVectors(this.max,Lp),Yh.subVectors(e.a,Lp),qh.subVectors(e.b,Lp),jh.subVectors(e.c,Lp),wl.subVectors(qh,Yh),Rl.subVectors(jh,qh),jc.subVectors(Yh,jh);let t=[0,-wl.z,wl.y,0,-Rl.z,Rl.y,0,-jc.z,jc.y,wl.z,0,-wl.x,Rl.z,0,-Rl.x,jc.z,0,-jc.x,-wl.y,wl.x,0,-Rl.y,Rl.x,0,-jc.y,jc.x,0];return!DT(t,Yh,qh,jh,qg)||(t=[1,0,0,0,1,0,0,0,1],!DT(t,Yh,qh,jh,qg))?!1:(jg.crossVectors(wl,Rl),t=[jg.x,jg.y,jg.z],DT(t,Yh,qh,jh,qg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ms).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ms).length()*.5),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()?this:(Ro[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ro[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ro[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ro[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ro[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ro[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ro[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ro[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ro),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Ro=[new L,new L,new L,new L,new L,new L,new L,new L],ms=new L,Yg=new ta,Yh=new L,qh=new L,jh=new L,wl=new L,Rl=new L,jc=new L,Lp=new L,qg=new L,jg=new L,Zc=new L;function DT(n,e,t,i,a){for(let r=0,s=n.length-3;r<=s;r+=3){Zc.fromArray(n,r);const o=a.x*Math.abs(Zc.x)+a.y*Math.abs(Zc.y)+a.z*Math.abs(Zc.z),c=e.dot(Zc),h=t.dot(Zc),f=i.dot(Zc);if(Math.max(-Math.max(c,h,f),Math.min(c,h,f))>o)return!1}return!0}const uG=new ta,Ip=new L,OT=new L;class na{constructor(e=new L,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):uG.setFromPoints(e).getCenter(i);let a=0;for(let r=0,s=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(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){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ip.subVectors(e,this.center);const t=Ip.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),a=(i-this.radius)*.5;this.center.addScaledVector(Ip,a/i),this.radius+=a}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(OT.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ip.copy(e.center).add(OT)),this.expandByPoint(Ip.copy(e.center).sub(OT))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Co=new L,LT=new L,Zg=new L,Cl=new L,IT=new L,Kg=new L,UT=new L;class lh{constructor(e=new L,t=new L(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.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Co)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Co.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Co.copy(this.origin).addScaledVector(this.direction,t),Co.distanceToSquared(e))}distanceSqToSegment(e,t,i,a){LT.copy(e).add(t).multiplyScalar(.5),Zg.copy(t).sub(e).normalize(),Cl.copy(this.origin).sub(LT);const r=e.distanceTo(t)*.5,s=-this.direction.dot(Zg),o=Cl.dot(this.direction),c=-Cl.dot(Zg),h=Cl.lengthSq(),f=Math.abs(1-s*s);let d,m,g,x;if(f>0)if(d=s*c-o,m=s*o-c,x=r*f,d>=0)if(m>=-x)if(m<=x){const T=1/f;d*=T,m*=T,g=d*(d+s*m+2*o)+m*(s*d+m+2*c)+h}else m=r,d=Math.max(0,-(s*m+o)),g=-d*d+m*(m+2*c)+h;else m=-r,d=Math.max(0,-(s*m+o)),g=-d*d+m*(m+2*c)+h;else m<=-x?(d=Math.max(0,-(-s*r+o)),m=d>0?-r:Math.min(Math.max(-r,-c),r),g=-d*d+m*(m+2*c)+h):m<=x?(d=0,m=Math.min(Math.max(-r,-c),r),g=m*(m+2*c)+h):(d=Math.max(0,-(s*r+o)),m=d>0?r:Math.min(Math.max(-r,-c),r),g=-d*d+m*(m+2*c)+h);else m=s>0?-r:r,d=Math.max(0,-(s*m+o)),g=-d*d+m*(m+2*c)+h;return i&&i.copy(this.origin).addScaledVector(this.direction,d),a&&a.copy(LT).addScaledVector(Zg,m),g}intersectSphere(e,t){Co.subVectors(e.center,this.origin);const i=Co.dot(this.direction),a=Co.dot(Co)-i*i,r=e.radius*e.radius;if(a>r)return null;const s=Math.sqrt(r-a),o=i-s,c=i+s;return c<0?null:o<0?this.at(c,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,a,r,s,o,c;const h=1/this.direction.x,f=1/this.direction.y,d=1/this.direction.z,m=this.origin;return h>=0?(i=(e.min.x-m.x)*h,a=(e.max.x-m.x)*h):(i=(e.max.x-m.x)*h,a=(e.min.x-m.x)*h),f>=0?(r=(e.min.y-m.y)*f,s=(e.max.y-m.y)*f):(r=(e.max.y-m.y)*f,s=(e.min.y-m.y)*f),i>s||r>a||((r>i||isNaN(i))&&(i=r),(s=0?(o=(e.min.z-m.z)*d,c=(e.max.z-m.z)*d):(o=(e.max.z-m.z)*d,c=(e.min.z-m.z)*d),i>c||o>a)||((o>i||i!==i)&&(i=o),(c=0?i:a,t)}intersectsBox(e){return this.intersectBox(e,Co)!==null}intersectTriangle(e,t,i,a,r){IT.subVectors(t,e),Kg.subVectors(i,e),UT.crossVectors(IT,Kg);let s=this.direction.dot(UT),o;if(s>0){if(a)return null;o=1}else if(s<0)o=-1,s=-s;else return null;Cl.subVectors(this.origin,e);const c=o*this.direction.dot(Kg.crossVectors(Cl,Kg));if(c<0)return null;const h=o*this.direction.dot(IT.cross(Cl));if(h<0||c+h>s)return null;const f=-o*Cl.dot(UT);return f<0?null:this.at(f/s,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 ke{constructor(e,t,i,a,r,s,o,c,h,f,d,m,g,x,T,y){ke.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,a,r,s,o,c,h,f,d,m,g,x,T,y)}set(e,t,i,a,r,s,o,c,h,f,d,m,g,x,T,y){const v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=a,v[1]=r,v[5]=s,v[9]=o,v[13]=c,v[2]=h,v[6]=f,v[10]=d,v[14]=m,v[3]=g,v[7]=x,v[11]=T,v[15]=y,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 ke().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}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){const t=this.elements,i=e.elements,a=1/Zh.setFromMatrixColumn(e,0).length(),r=1/Zh.setFromMatrixColumn(e,1).length(),s=1/Zh.setFromMatrixColumn(e,2).length();return t[0]=i[0]*a,t[1]=i[1]*a,t[2]=i[2]*a,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]*s,t[9]=i[9]*s,t[10]=i[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,a=e.y,r=e.z,s=Math.cos(i),o=Math.sin(i),c=Math.cos(a),h=Math.sin(a),f=Math.cos(r),d=Math.sin(r);if(e.order==="XYZ"){const m=s*f,g=s*d,x=o*f,T=o*d;t[0]=c*f,t[4]=-c*d,t[8]=h,t[1]=g+x*h,t[5]=m-T*h,t[9]=-o*c,t[2]=T-m*h,t[6]=x+g*h,t[10]=s*c}else if(e.order==="YXZ"){const m=c*f,g=c*d,x=h*f,T=h*d;t[0]=m+T*o,t[4]=x*o-g,t[8]=s*h,t[1]=s*d,t[5]=s*f,t[9]=-o,t[2]=g*o-x,t[6]=T+m*o,t[10]=s*c}else if(e.order==="ZXY"){const m=c*f,g=c*d,x=h*f,T=h*d;t[0]=m-T*o,t[4]=-s*d,t[8]=x+g*o,t[1]=g+x*o,t[5]=s*f,t[9]=T-m*o,t[2]=-s*h,t[6]=o,t[10]=s*c}else if(e.order==="ZYX"){const m=s*f,g=s*d,x=o*f,T=o*d;t[0]=c*f,t[4]=x*h-g,t[8]=m*h+T,t[1]=c*d,t[5]=T*h+m,t[9]=g*h-x,t[2]=-h,t[6]=o*c,t[10]=s*c}else if(e.order==="YZX"){const m=s*c,g=s*h,x=o*c,T=o*h;t[0]=c*f,t[4]=T-m*d,t[8]=x*d+g,t[1]=d,t[5]=s*f,t[9]=-o*f,t[2]=-h*f,t[6]=g*d+x,t[10]=m-T*d}else if(e.order==="XZY"){const m=s*c,g=s*h,x=o*c,T=o*h;t[0]=c*f,t[4]=-d,t[8]=h*f,t[1]=m*d+T,t[5]=s*f,t[9]=g*d-x,t[2]=x*d-g,t[6]=o*f,t[10]=T*d+m}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(hG,e,fG)}lookAt(e,t,i){const a=this.elements;return vr.subVectors(e,t),vr.lengthSq()===0&&(vr.z=1),vr.normalize(),Nl.crossVectors(i,vr),Nl.lengthSq()===0&&(Math.abs(i.z)===1?vr.x+=1e-4:vr.z+=1e-4,vr.normalize(),Nl.crossVectors(i,vr)),Nl.normalize(),Qg.crossVectors(vr,Nl),a[0]=Nl.x,a[4]=Qg.x,a[8]=vr.x,a[1]=Nl.y,a[5]=Qg.y,a[9]=vr.y,a[2]=Nl.z,a[6]=Qg.z,a[10]=vr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,a=t.elements,r=this.elements,s=i[0],o=i[4],c=i[8],h=i[12],f=i[1],d=i[5],m=i[9],g=i[13],x=i[2],T=i[6],y=i[10],v=i[14],S=i[3],E=i[7],b=i[11],D=i[15],C=a[0],I=a[4],P=a[8],O=a[12],w=a[1],B=a[5],j=a[9],ee=a[13],se=a[2],re=a[6],W=a[10],te=a[14],K=a[3],oe=a[7],ie=a[11],Ce=a[15];return r[0]=s*C+o*w+c*se+h*K,r[4]=s*I+o*B+c*re+h*oe,r[8]=s*P+o*j+c*W+h*ie,r[12]=s*O+o*ee+c*te+h*Ce,r[1]=f*C+d*w+m*se+g*K,r[5]=f*I+d*B+m*re+g*oe,r[9]=f*P+d*j+m*W+g*ie,r[13]=f*O+d*ee+m*te+g*Ce,r[2]=x*C+T*w+y*se+v*K,r[6]=x*I+T*B+y*re+v*oe,r[10]=x*P+T*j+y*W+v*ie,r[14]=x*O+T*ee+y*te+v*Ce,r[3]=S*C+E*w+b*se+D*K,r[7]=S*I+E*B+b*re+D*oe,r[11]=S*P+E*j+b*W+D*ie,r[15]=S*O+E*ee+b*te+D*Ce,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],i=e[4],a=e[8],r=e[12],s=e[1],o=e[5],c=e[9],h=e[13],f=e[2],d=e[6],m=e[10],g=e[14],x=e[3],T=e[7],y=e[11],v=e[15];return x*(+r*c*d-a*h*d-r*o*m+i*h*m+a*o*g-i*c*g)+T*(+t*c*g-t*h*m+r*s*m-a*s*g+a*h*f-r*c*f)+y*(+t*h*d-t*o*g-r*s*d+i*s*g+r*o*f-i*h*f)+v*(-a*o*f-t*c*d+t*o*m+a*s*d-i*s*m+i*c*f)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const a=this.elements;return e.isVector3?(a[12]=e.x,a[13]=e.y,a[14]=e.z):(a[12]=e,a[13]=t,a[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],h=e[7],f=e[8],d=e[9],m=e[10],g=e[11],x=e[12],T=e[13],y=e[14],v=e[15],S=d*y*h-T*m*h+T*c*g-o*y*g-d*c*v+o*m*v,E=x*m*h-f*y*h-x*c*g+s*y*g+f*c*v-s*m*v,b=f*T*h-x*d*h+x*o*g-s*T*g-f*o*v+s*d*v,D=x*d*c-f*T*c-x*o*m+s*T*m+f*o*y-s*d*y,C=t*S+i*E+a*b+r*D;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/C;return e[0]=S*I,e[1]=(T*m*r-d*y*r-T*a*g+i*y*g+d*a*v-i*m*v)*I,e[2]=(o*y*r-T*c*r+T*a*h-i*y*h-o*a*v+i*c*v)*I,e[3]=(d*c*r-o*m*r-d*a*h+i*m*h+o*a*g-i*c*g)*I,e[4]=E*I,e[5]=(f*y*r-x*m*r+x*a*g-t*y*g-f*a*v+t*m*v)*I,e[6]=(x*c*r-s*y*r-x*a*h+t*y*h+s*a*v-t*c*v)*I,e[7]=(s*m*r-f*c*r+f*a*h-t*m*h-s*a*g+t*c*g)*I,e[8]=b*I,e[9]=(x*d*r-f*T*r-x*i*g+t*T*g+f*i*v-t*d*v)*I,e[10]=(s*T*r-x*o*r+x*i*h-t*T*h-s*i*v+t*o*v)*I,e[11]=(f*o*r-s*d*r-f*i*h+t*d*h+s*i*g-t*o*g)*I,e[12]=D*I,e[13]=(f*T*a-x*d*a+x*i*m-t*T*m-f*i*y+t*d*y)*I,e[14]=(x*o*a-s*T*a-x*i*c+t*T*c+s*i*y-t*o*y)*I,e[15]=(s*d*a-f*o*a+f*i*c-t*d*c-s*i*m+t*o*m)*I,this}scale(e){const t=this.elements,i=e.x,a=e.y,r=e.z;return t[0]*=i,t[4]*=a,t[8]*=r,t[1]*=i,t[5]*=a,t[9]*=r,t[2]*=i,t[6]*=a,t[10]*=r,t[3]*=i,t[7]*=a,t[11]*=r,this}getMaxScaleOnAxis(){const 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],a=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,a))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),a=Math.sin(t),r=1-i,s=e.x,o=e.y,c=e.z,h=r*s,f=r*o;return this.set(h*s+i,h*o-a*c,h*c+a*o,0,h*o+a*c,f*o+i,f*c-a*s,0,h*c-a*o,f*c+a*s,r*c*c+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,a,r,s){return this.set(1,i,r,0,e,1,s,0,t,a,1,0,0,0,0,1),this}compose(e,t,i){const a=this.elements,r=t._x,s=t._y,o=t._z,c=t._w,h=r+r,f=s+s,d=o+o,m=r*h,g=r*f,x=r*d,T=s*f,y=s*d,v=o*d,S=c*h,E=c*f,b=c*d,D=i.x,C=i.y,I=i.z;return a[0]=(1-(T+v))*D,a[1]=(g+b)*D,a[2]=(x-E)*D,a[3]=0,a[4]=(g-b)*C,a[5]=(1-(m+v))*C,a[6]=(y+S)*C,a[7]=0,a[8]=(x+E)*I,a[9]=(y-S)*I,a[10]=(1-(m+T))*I,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,this}decompose(e,t,i){const a=this.elements;let r=Zh.set(a[0],a[1],a[2]).length();const s=Zh.set(a[4],a[5],a[6]).length(),o=Zh.set(a[8],a[9],a[10]).length();this.determinant()<0&&(r=-r),e.x=a[12],e.y=a[13],e.z=a[14],gs.copy(this);const h=1/r,f=1/s,d=1/o;return gs.elements[0]*=h,gs.elements[1]*=h,gs.elements[2]*=h,gs.elements[4]*=f,gs.elements[5]*=f,gs.elements[6]*=f,gs.elements[8]*=d,gs.elements[9]*=d,gs.elements[10]*=d,t.setFromRotationMatrix(gs),i.x=r,i.y=s,i.z=o,this}makePerspective(e,t,i,a,r,s,o=br,c=!1){const h=this.elements,f=2*r/(t-e),d=2*r/(i-a),m=(t+e)/(t-e),g=(i+a)/(i-a);let x,T;if(c)x=r/(s-r),T=s*r/(s-r);else if(o===br)x=-(s+r)/(s-r),T=-2*s*r/(s-r);else if(o===Ed)x=-s/(s-r),T=-s*r/(s-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return h[0]=f,h[4]=0,h[8]=m,h[12]=0,h[1]=0,h[5]=d,h[9]=g,h[13]=0,h[2]=0,h[6]=0,h[10]=x,h[14]=T,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,i,a,r,s,o=br,c=!1){const h=this.elements,f=2/(t-e),d=2/(i-a),m=-(t+e)/(t-e),g=-(i+a)/(i-a);let x,T;if(c)x=1/(s-r),T=s/(s-r);else if(o===br)x=-2/(s-r),T=-(s+r)/(s-r);else if(o===Ed)x=-1/(s-r),T=-r/(s-r);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return h[0]=f,h[4]=0,h[8]=0,h[12]=m,h[1]=0,h[5]=d,h[9]=0,h[13]=g,h[2]=0,h[6]=0,h[10]=x,h[14]=T,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let a=0;a<16;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const 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}}const Zh=new L,gs=new ke,hG=new L(0,0,0),fG=new L(1,1,1),Nl=new L,Qg=new L,vr=new L,p4=new ke,m4=new St;class Ei{constructor(e=0,t=0,i=0,a=Ei.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=a}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,a=this._order){return this._x=e,this._y=t,this._z=i,this._order=a,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){const a=e.elements,r=a[0],s=a[4],o=a[8],c=a[1],h=a[5],f=a[9],d=a[2],m=a[6],g=a[10];switch(t){case"XYZ":this._y=Math.asin(Lt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-f,g),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(m,h),this._z=0);break;case"YXZ":this._x=Math.asin(-Lt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(o,g),this._z=Math.atan2(c,h)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(Lt(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-d,g),this._z=Math.atan2(-s,h)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-Lt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(m,g),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-s,h));break;case"YZX":this._z=Math.asin(Lt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-f,h),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,g));break;case"XZY":this._z=Math.asin(-Lt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(m,h),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-f,g),this._y=0);break;default:ut("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return p4.makeRotationFromQuaternion(e),this.setFromRotationMatrix(p4,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return m4.setFromEuler(this),this.setFromQuaternion(m4,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],e[3]!==void 0&&(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}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ei.DEFAULT_ORDER="XYZ";class Ad{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(a.type="BatchedMesh",a.perObjectFrustumCulled=this.perObjectFrustumCulled,a.sortObjects=this.sortObjects,a.drawRanges=this._drawRanges,a.reservedRanges=this._reservedRanges,a.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),a.instanceInfo=this._instanceInfo.map(o=>({...o})),a.availableInstanceIds=this._availableInstanceIds.slice(),a.availableGeometryIds=this._availableGeometryIds.slice(),a.nextIndexStart=this._nextIndexStart,a.nextVertexStart=this._nextVertexStart,a.geometryCount=this._geometryCount,a.maxInstanceCount=this._maxInstanceCount,a.maxVertexCount=this._maxVertexCount,a.maxIndexCount=this._maxIndexCount,a.geometryInitialized=this._geometryInitialized,a.matricesTexture=this._matricesTexture.toJSON(e),a.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(a.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(a.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(a.boundingBox=this.boundingBox.toJSON()));function r(o,c){return o[c.uuid]===void 0&&(o[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=r(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const c=o.shapes;if(Array.isArray(c))for(let h=0,f=c.length;h0){a.children=[];for(let o=0;o0){a.animations=[];for(let o=0;o0&&(i.geometries=o),c.length>0&&(i.materials=c),h.length>0&&(i.textures=h),f.length>0&&(i.images=f),d.length>0&&(i.shapes=d),m.length>0&&(i.skeletons=m),g.length>0&&(i.animations=g),x.length>0&&(i.nodes=x)}return i.object=a,i;function s(o){const c=[];for(const h in o){const f=o[h];delete f.metadata,c.push(f)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?a.multiplyScalar(1/Math.sqrt(r)):a.set(0,0,0)}static getBarycoord(e,t,i,a,r){vs.subVectors(a,t),Do.subVectors(i,t),zT.subVectors(e,t);const s=vs.dot(vs),o=vs.dot(Do),c=vs.dot(zT),h=Do.dot(Do),f=Do.dot(zT),d=s*h-o*o;if(d===0)return r.set(0,0,0),null;const m=1/d,g=(h*c-o*f)*m,x=(s*f-o*c)*m;return r.set(1-g-x,x,g)}static containsPoint(e,t,i,a){return this.getBarycoord(e,t,i,a,Oo)===null?!1:Oo.x>=0&&Oo.y>=0&&Oo.x+Oo.y<=1}static getInterpolation(e,t,i,a,r,s,o,c){return this.getBarycoord(e,t,i,a,Oo)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,Oo.x),c.addScaledVector(s,Oo.y),c.addScaledVector(o,Oo.z),c)}static getInterpolatedAttribute(e,t,i,a,r,s){return GT.setScalar(0),VT.setScalar(0),kT.setScalar(0),GT.fromBufferAttribute(e,t),VT.fromBufferAttribute(e,i),kT.fromBufferAttribute(e,a),s.setScalar(0),s.addScaledVector(GT,r.x),s.addScaledVector(VT,r.y),s.addScaledVector(kT,r.z),s}static isFrontFacing(e,t,i,a){return vs.subVectors(i,t),Do.subVectors(e,t),vs.cross(Do).dot(a)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,a){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[a]),this}setFromAttributeAndIndices(e,t,i,a){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,a),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 vs.subVectors(this.c,this.b),Do.subVectors(this.a,this.b),vs.cross(Do).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Qa.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Qa.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,a,r){return Qa.getInterpolation(e,this.a,this.b,this.c,t,i,a,r)}containsPoint(e){return Qa.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Qa.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,a=this.b,r=this.c;let s,o;Jh.subVectors(a,i),$h.subVectors(r,i),BT.subVectors(e,i);const c=Jh.dot(BT),h=$h.dot(BT);if(c<=0&&h<=0)return t.copy(i);HT.subVectors(e,a);const f=Jh.dot(HT),d=$h.dot(HT);if(f>=0&&d<=f)return t.copy(a);const m=c*d-f*h;if(m<=0&&c>=0&&f<=0)return s=c/(c-f),t.copy(i).addScaledVector(Jh,s);FT.subVectors(e,r);const g=Jh.dot(FT),x=$h.dot(FT);if(x>=0&&g<=x)return t.copy(r);const T=g*h-c*x;if(T<=0&&h>=0&&x<=0)return o=h/(h-x),t.copy(i).addScaledVector($h,o);const y=f*x-g*d;if(y<=0&&d-f>=0&&g-x>=0)return S4.subVectors(r,a),o=(d-f)/(d-f+(g-x)),t.copy(a).addScaledVector(S4,o);const v=1/(y+T+m);return s=T*v,o=m*v,t.copy(i).addScaledVector(Jh,s).addScaledVector($h,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const FU={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},Dl={h:0,s:0,l:0},$g={h:0,s:0,l:0};function WT(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class je{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const a=e;a&&a.isColor?this.copy(a):typeof a=="number"?this.setHex(a):typeof a=="string"&&this.setStyle(a)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=En){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,rn.colorSpaceToWorking(this,t),this}setRGB(e,t,i,a=rn.workingColorSpace){return this.r=e,this.g=t,this.b=i,rn.colorSpaceToWorking(this,a),this}setHSL(e,t,i,a=rn.workingColorSpace){if(e=yb(e,1),t=Lt(t,0,1),i=Lt(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,s=2*i-r;this.r=WT(s,r,e+1/3),this.g=WT(s,r,e),this.b=WT(s,r,e-1/3)}return rn.colorSpaceToWorking(this,a),this}setStyle(e,t=En){function i(r){r!==void 0&&parseFloat(r)<1&&ut("Color: Alpha component of "+e+" will be ignored.")}let a;if(a=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const s=a[1],o=a[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:ut("Color: Unknown color model "+e)}}else if(a=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=a[1],s=r.length;if(s===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(s===6)return this.setHex(parseInt(r,16),t);ut("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=En){const i=FU[e.toLowerCase()];return i!==void 0?this.setHex(i,t):ut("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}copySRGBToLinear(e){return this.r=Jo(e.r),this.g=Jo(e.g),this.b=Jo(e.b),this}copyLinearToSRGB(e){return this.r=ad(e.r),this.g=ad(e.g),this.b=ad(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=En){return rn.workingToColorSpace(xa.copy(this),e),Math.round(Lt(xa.r*255,0,255))*65536+Math.round(Lt(xa.g*255,0,255))*256+Math.round(Lt(xa.b*255,0,255))}getHexString(e=En){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=rn.workingColorSpace){rn.workingToColorSpace(xa.copy(this),t);const i=xa.r,a=xa.g,r=xa.b,s=Math.max(i,a,r),o=Math.min(i,a,r);let c,h;const f=(o+s)/2;if(o===s)c=0,h=0;else{const d=s-o;switch(h=f<=.5?d/(s+o):d/(2-s-o),s){case i:c=(a-r)/d+(a0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){ut(`Material: parameter '${t}' has value of undefined.`);continue}const a=this[t];if(a===void 0){ut(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}a&&a.isColor?a.set(i):a&&a.isVector3&&i&&i.isVector3?a.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(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.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),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,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Iu&&(i.blending=this.blending),this.side!==Ns&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==ex&&(i.blendSrc=this.blendSrc),this.blendDst!==tx&&(i.blendDst=this.blendDst),this.blendEquation!==Js&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Xu&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==sE&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==xu&&(i.stencilFail=this.stencilFail),this.stencilZFail!==xu&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==xu&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function a(r){const s=[];for(const o in r){const c=r[o];delete c.metadata,s.push(c)}return s}if(t){const r=a(e.textures),s=a(e.images);r.length>0&&(i.textures=r),s.length>0&&(i.images=s)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const a=t.length;i=new Array(a);for(let r=0;r!==a;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Ia extends qn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new je(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.envMapRotation=new Ei,this.combine=O0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,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.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}}const Wo=_G();function _G(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),a=new Uint32Array(512);for(let c=0;c<256;++c){const h=c-127;h<-27?(i[c]=0,i[c|256]=32768,a[c]=24,a[c|256]=24):h<-14?(i[c]=1024>>-h-14,i[c|256]=1024>>-h-14|32768,a[c]=-h-1,a[c|256]=-h-1):h<=15?(i[c]=h+15<<10,i[c|256]=h+15<<10|32768,a[c]=13,a[c|256]=13):h<128?(i[c]=31744,i[c|256]=64512,a[c]=24,a[c|256]=24):(i[c]=31744,i[c|256]=64512,a[c]=13,a[c|256]=13)}const r=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let c=1;c<1024;++c){let h=c<<13,f=0;for(;!(h&8388608);)h<<=1,f-=8388608;h&=-8388609,f+=947912704,r[c]=h|f}for(let c=1024;c<2048;++c)r[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)s[c]=c<<23;s[31]=1199570944,s[32]=2147483648;for(let c=33;c<63;++c)s[c]=2147483648+(c-32<<23);s[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(o[c]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:a,mantissaTable:r,exponentTable:s,offsetTable:o}}function Ya(n){Math.abs(n)>65504&&ut("DataUtils.toHalfFloat(): Value out of range."),n=Lt(n,-65504,65504),Wo.floatView[0]=n;const e=Wo.uint32View[0],t=e>>23&511;return Wo.baseTable[t]+((e&8388607)>>Wo.shiftTable[t])}function cm(n){const e=n>>10;return Wo.uint32View[0]=Wo.mantissaTable[Wo.offsetTable[e]+(n&1023)]+Wo.exponentTable[e],Wo.floatView[0]}class oE{static toHalfFloat(e){return Ya(e)}static fromHalfFloat(e){return cm(e)}}const Ci=new L,ev=new de;let xG=0;class Ot{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:xG++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=u0,this.updateRanges=[],this.gpuType=si,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}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.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let a=0,r=this.itemSize;at.count&&ut("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ta);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Bt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new L(-1/0,-1/0,-1/0),new L(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,a=t.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const h in c)c[h]!==void 0&&(e[h]=c[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const c in i){const h=i[c];e.data.attributes[c]=h.toJSON(e.data)}const a={};let r=!1;for(const c in this.morphAttributes){const h=this.morphAttributes[c],f=[];for(let d=0,m=h.length;d0&&(a[c]=f,r=!0)}r&&(e.data.morphAttributes=a,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}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 t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const a=e.attributes;for(const h in a){const f=a[h];this.setAttribute(h,f.clone(t))}const r=e.morphAttributes;for(const h in r){const f=[],d=r[h];for(let m=0,g=d.length;m0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,s=a.length;r(e.far-e.near)**2))&&(T4.copy(r).invert(),Kc.copy(e.ray).applyMatrix4(T4),!(i.boundingBox!==null&&Kc.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Kc)))}_computeIntersections(e,t,i){let a;const r=this.geometry,s=this.material,o=r.index,c=r.attributes.position,h=r.attributes.uv,f=r.attributes.uv1,d=r.attributes.normal,m=r.groups,g=r.drawRange;if(o!==null)if(Array.isArray(s))for(let x=0,T=m.length;xt.far?null:{distance:h,point:sv.clone(),object:n}}function ov(n,e,t,i,a,r,s,o,c,h){n.getVertexPosition(o,nv),n.getVertexPosition(c,iv),n.getVertexPosition(h,av);const f=wG(n,e,t,i,nv,iv,av,M4);if(f){const d=new L;Qa.getBarycoord(M4,nv,iv,av,d),a&&(f.uv=Qa.getInterpolatedAttribute(a,o,c,h,d,new de)),r&&(f.uv1=Qa.getInterpolatedAttribute(r,o,c,h,d,new de)),s&&(f.normal=Qa.getInterpolatedAttribute(s,o,c,h,d,new L),f.normal.dot(i.direction)>0&&f.normal.multiplyScalar(-1));const m={a:o,b:c,c:h,normal:new L,materialIndex:0};Qa.getNormal(nv,iv,av,m.normal),f.face=m,f.barycoord=d}return f}class ch extends Ct{constructor(e=1,t=1,i=1,a=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:a,heightSegments:r,depthSegments:s};const o=this;a=Math.floor(a),r=Math.floor(r),s=Math.floor(s);const c=[],h=[],f=[],d=[];let m=0,g=0;x("z","y","x",-1,-1,i,t,e,s,r,0),x("z","y","x",1,-1,i,t,-e,s,r,1),x("x","z","y",1,1,e,i,t,a,s,2),x("x","z","y",1,-1,e,i,-t,a,s,3),x("x","y","z",1,-1,e,t,i,a,r,4),x("x","y","z",-1,-1,e,t,-i,a,r,5),this.setIndex(c),this.setAttribute("position",new xt(h,3)),this.setAttribute("normal",new xt(f,3)),this.setAttribute("uv",new xt(d,2));function x(T,y,v,S,E,b,D,C,I,P,O){const w=b/I,B=D/P,j=b/2,ee=D/2,se=C/2,re=I+1,W=P+1;let te=0,K=0;const oe=new L;for(let ie=0;ie0?1:-1,f.push(oe.x,oe.y,oe.z),d.push(Xe/I),d.push(1-ie/P),te+=1}}for(let ie=0;ie0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const a in this.extensions)this.extensions[a]===!0&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class Tc extends Zt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ke,this.projectionMatrix=new ke,this.projectionMatrixInverse=new ke,this.coordinateSystem=Mr,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}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)}}const Nl=new L,T4=new de,E4=new de;let ui=class extends Tc{constructor(e=50,t=1,i=.1,a=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=a,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=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Ed*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Lu*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ed*2*Math.atan(Math.tan(Lu*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Nl.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Nl.x,Nl.y).multiplyScalar(-e/Nl.z),Nl.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Nl.x,Nl.y).multiplyScalar(-e/Nl.z)}getViewSize(e,t){return this.getViewBounds(e,T4,E4),t.subVectors(E4,T4)}setViewOffset(e,t,i,a,r,s){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=a,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Lu*.5*this.fov)/this.zoom,i=2*t,a=this.aspect*i,r=-.5*a;const s=this.view;if(this.view!==null&&this.view.enabled){const c=s.fullWidth,h=s.fullHeight;r+=s.offsetX*a/c,t-=s.offsetY*i/h,a*=s.width/c,i*=s.height/h}const o=this.filmOffset;o!==0&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+a,t,t-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};const $h=-90,ef=1;class FU extends Zt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const a=new ui($h,ef,e,t);a.layers=this.layers,this.add(a);const r=new ui($h,ef,e,t);r.layers=this.layers,this.add(r);const s=new ui($h,ef,e,t);s.layers=this.layers,this.add(s);const o=new ui($h,ef,e,t);o.layers=this.layers,this.add(o);const c=new ui($h,ef,e,t);c.layers=this.layers,this.add(c);const h=new ui($h,ef,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,a,r,s,o,c]=t;for(const h of t)this.remove(h);if(e===Mr)i.up.set(0,1,0),i.lookAt(1,0,0),a.up.set(0,1,0),a.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===Sd)i.up.set(0,-1,0),i.lookAt(-1,0,0),a.up.set(0,-1,0),a.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const h of t)this.add(h),h.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:a}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,s,o,c,h,f]=this.children,d=e.getRenderTarget(),m=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),x=e.xr.enabled;e.xr.enabled=!1;const T=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,a),e.render(t,r),e.setRenderTarget(i,1,a),e.render(t,s),e.setRenderTarget(i,2,a),e.render(t,o),e.setRenderTarget(i,3,a),e.render(t,c),e.setRenderTarget(i,4,a),e.render(t,h),i.texture.generateMipmaps=T,e.setRenderTarget(i,5,a),e.render(t,f),e.setRenderTarget(d,m,g),e.xr.enabled=x,i.texture.needsPMREMUpdate=!0}}class L0 extends Nn{constructor(e=[],t=al,i,a,r,s,o,c,h,f){super(e,t,i,a,r,s,o,c,h,f),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class GU extends _i{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},a=[i,i,i,i,i,i];this.texture=new L0(a),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class Vi extends qn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=CG,this.fragmentShader=NG,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=wd(e.uniforms),this.uniformsGroups=RG(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const a in this.uniforms){const s=this.uniforms[a].value;s&&s.isTexture?t.uniforms[a]={type:"t",value:s.toJSON(e).uuid}:s&&s.isColor?t.uniforms[a]={type:"c",value:s.getHex()}:s&&s.isVector2?t.uniforms[a]={type:"v2",value:s.toArray()}:s&&s.isVector3?t.uniforms[a]={type:"v3",value:s.toArray()}:s&&s.isVector4?t.uniforms[a]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?t.uniforms[a]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?t.uniforms[a]={type:"m4",value:s.toArray()}:t.uniforms[a]={value:s}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const a in this.extensions)this.extensions[a]===!0&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class bc extends Wt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ke,this.projectionMatrix=new ke,this.projectionMatrixInverse=new ke,this.coordinateSystem=br,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}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)}}const Ol=new L,b4=new de,A4=new de;let hi=class extends bc{constructor(e=50,t=1,i=.1,a=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=a,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=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=bd*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Uu*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return bd*2*Math.atan(Math.tan(Uu*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Ol.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ol.x,Ol.y).multiplyScalar(-e/Ol.z),Ol.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Ol.x,Ol.y).multiplyScalar(-e/Ol.z)}getViewSize(e,t){return this.getViewBounds(e,b4,A4),t.subVectors(A4,b4)}setViewOffset(e,t,i,a,r,s){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=a,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Uu*.5*this.fov)/this.zoom,i=2*t,a=this.aspect*i,r=-.5*a;const s=this.view;if(this.view!==null&&this.view.enabled){const c=s.fullWidth,h=s.fullHeight;r+=s.offsetX*a/c,t-=s.offsetY*i/h,a*=s.width/c,i*=s.height/h}const o=this.filmOffset;o!==0&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+a,t,t-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};const tf=-90,nf=1;class VU extends Wt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const a=new hi(tf,nf,e,t);a.layers=this.layers,this.add(a);const r=new hi(tf,nf,e,t);r.layers=this.layers,this.add(r);const s=new hi(tf,nf,e,t);s.layers=this.layers,this.add(s);const o=new hi(tf,nf,e,t);o.layers=this.layers,this.add(o);const c=new hi(tf,nf,e,t);c.layers=this.layers,this.add(c);const h=new hi(tf,nf,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,a,r,s,o,c]=t;for(const h of t)this.remove(h);if(e===br)i.up.set(0,1,0),i.lookAt(1,0,0),a.up.set(0,1,0),a.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===Ed)i.up.set(0,-1,0),i.lookAt(-1,0,0),a.up.set(0,-1,0),a.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const h of t)this.add(h),h.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:a}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,s,o,c,h,f]=this.children,d=e.getRenderTarget(),m=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),x=e.xr.enabled;e.xr.enabled=!1;const T=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,a),e.render(t,r),e.setRenderTarget(i,1,a),e.render(t,s),e.setRenderTarget(i,2,a),e.render(t,o),e.setRenderTarget(i,3,a),e.render(t,c),e.setRenderTarget(i,4,a),e.render(t,h),i.texture.generateMipmaps=T,e.setRenderTarget(i,5,a),e.render(t,f),e.setRenderTarget(d,m,g),e.xr.enabled=x,i.texture.needsPMREMUpdate=!0}}class U0 extends Nn{constructor(e=[],t=rl,i,a,r,s,o,c,h,f){super(e,t,i,a,r,s,o,c,h,f),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class kU extends xi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},a=[i,i,i,i,i,i];this.texture=new U0(a),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -97,13 +97,13 @@ Error generating stack: `+i.message+` gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},a=new oh(5,5,5),r=new Fi({name:"CubemapFromEquirect",uniforms:bd(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Oi,blending:Sa});r.uniforms.tEquirect.value=t;const s=new si(a,r),o=t.minFilter;return t.minFilter===Er&&(t.minFilter=Ht),new FU(1,10,this).update(e,s),t.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,t=!0,i=!0,a=!0){const r=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,i,a);e.setRenderTarget(r)}}class Ia extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const NG={type:"move"};class p_{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ia,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Ia,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new L,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new L),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ia,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new L,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new L),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let a=null,r=null,s=null;const o=this._targetRay,c=this._grip,h=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(h&&e.hand){s=!0;for(const T of e.hand.values()){const S=t.getJointPose(T,i),v=this._getHandJoint(h,T);S!==null&&(v.matrix.fromArray(S.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=S.radius),v.visible=S!==null}const f=h.joints["index-finger-tip"],d=h.joints["thumb-tip"],m=f.position.distanceTo(d.position),g=.02,x=.005;h.inputState.pinching&&m>g+x?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&m<=g-x&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(a=t.getPose(e.targetRaySpace,i),a===null&&r!==null&&(a=r),a!==null&&(o.matrix.fromArray(a.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,a.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(a.linearVelocity)):o.hasLinearVelocity=!1,a.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(a.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(NG)))}return o!==null&&(o.visible=a!==null),c!==null&&(c.visible=r!==null),h!==null&&(h.visible=s!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Ia;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class P1{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new je(e),this.density=t}clone(){return new P1(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class z1{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new je(e),this.near=t,this.far=i}clone(){return new z1(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Ad extends Zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ui,this.environmentIntensity=1,this.environmentRotation=new Ui,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class I0{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=l0,this.updateRanges=[],this.version=0,this.uuid=Cr()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}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(e,t,i){e*=this.stride,i*=t.stride;for(let a=0,r=this.stride;ae.far||t.push({distance:c,point:Up.clone(),uv:Ka.getInterpolation(Up,sv,zp,ov,M4,WT,b4,new de),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function lv(n,e,t,i,a,r){rf.subVectors(n,t).addScalar(.5).multiply(i),a!==void 0?(Pp.x=r*rf.x-a*rf.y,Pp.y=a*rf.x+r*rf.y):Pp.copy(rf),n.copy(e),n.x+=Pp.x,n.y+=Pp.y,n.applyMatrix4(VU)}const cv=new L,A4=new L;class WU extends Zt{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,a=t.length;i0){let i,a;for(i=1,a=t.length;i0){cv.setFromMatrixPosition(this.matrixWorld);const a=e.ray.origin.distanceTo(cv);this.getObjectForDistance(a).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){cv.setFromMatrixPosition(e.matrixWorld),A4.setFromMatrixPosition(this.matrixWorld);const i=cv.distanceTo(A4)/e.zoom;t[0].object.visible=!0;let a,r;for(a=1,r=t.length;a=s)t[a-1].object.visible=!1,t[a].object.visible=!0;else break}for(this._currentLevel=a-1;a1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}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){const i=t||UG.getNormalMatrix(e),a=this.coplanarPoint(qT).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(r),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)}}const Zc=new ta,PG=new de(.5,.5),fv=new L;class Wd{constructor(e=new Fo,t=new Fo,i=new Fo,a=new Fo,r=new Fo,s=new Fo){this.planes=[e,t,i,a,r,s]}set(e,t,i,a,r,s){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(a),o[4].copy(r),o[5].copy(s),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Mr,i=!1){const a=this.planes,r=e.elements,s=r[0],o=r[1],c=r[2],h=r[3],f=r[4],d=r[5],m=r[6],g=r[7],x=r[8],T=r[9],S=r[10],v=r[11],y=r[12],E=r[13],b=r[14],D=r[15];if(a[0].setComponents(h-s,g-f,v-x,D-y).normalize(),a[1].setComponents(h+s,g+f,v+x,D+y).normalize(),a[2].setComponents(h+o,g+d,v+T,D+E).normalize(),a[3].setComponents(h-o,g-d,v-T,D-E).normalize(),i)a[4].setComponents(c,m,S,b).normalize(),a[5].setComponents(h-c,g-m,v-S,D-b).normalize();else if(a[4].setComponents(h-c,g-m,v-S,D-b).normalize(),t===Mr)a[5].setComponents(h+c,g+m,v+S,D+b).normalize();else if(t===Sd)a[5].setComponents(c,m,S,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Zc.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Zc.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Zc)}intersectsSprite(e){Zc.center.set(0,0,0);const t=PG.distanceTo(e.center);return Zc.radius=.7071067811865476+t,Zc.applyMatrix4(e.matrixWorld),this.intersectsSphere(Zc)}intersectsSphere(e){const t=this.planes,i=e.center,a=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,fv.y=a.normal.y>0?e.max.y:e.min.y,fv.z=a.normal.z>0?e.max.z:e.min.z,a.distanceToPoint(fv)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const Vs=new ke,ks=new Wd;class F1{constructor(){this.coordinateSystem=Mr}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let i=0;i=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];s.push(o),this.index++,o.start=e,o.count=t,o.z=i,o.index=a}reset(){this.list.length=0,this.index=0}}const Wa=new ke,FG=new je(1,1,1),U4=new Wd,GG=new F1,dv=new ea,Kc=new ta,Fp=new L,P4=new L,VG=new L,ZT=new HG,xa=new si,pv=[];function kG(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const a=n.count;for(let r=0;r65535?new Uint32Array(a):new Uint16Array(a);t.setIndex(new Ot(r,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const a=e.getAttribute(i),r=t.getAttribute(i);if(a.itemSize!==r.itemSize||a.normalized!==r.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ea);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,a=t.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let a=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(jT),a=this._availableInstanceIds.shift(),this._instanceInfo[a]=i):(a=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;Wa.identity().toArray(r.image.data,a*16),r.needsUpdate=!0;const s=this._colorsTexture;return s&&(FG.toArray(s.image.data,a*4),s.needsUpdate=!0),this._visibilityChanged=!0,a}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const a={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;a.vertexStart=this._nextVertexStart,a.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const s=e.getIndex();if(s!==null&&(a.indexStart=this._nextIndexStart,a.reservedIndexCount=i===-1?s.count:i),a.indexStart!==-1&&a.indexStart+a.reservedIndexCount>this._maxIndexCount||a.vertexStart+a.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let c;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(jT),c=this._availableGeometryIds.shift(),r[c]=a):(c=this._geometryCount,this._geometryCount++,r.push(a)),this.setGeometryAt(c,e),this._nextIndexStart=a.indexStart+a.reservedIndexCount,this._nextVertexStart=a.vertexStart+a.reservedVertexCount,c}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,a=i.getIndex()!==null,r=i.getIndex(),s=t.getIndex(),o=this._geometryInfo[e];if(a&&s.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const c=o.vertexStart,h=o.reservedVertexCount;o.vertexCount=t.getAttribute("position").count;for(const f in i.attributes){const d=t.getAttribute(f),m=i.getAttribute(f);kG(d,m,c);const g=d.itemSize;for(let x=d.count,T=h;x=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let a=0,r=i.length;ao).sort((s,o)=>i[s].vertexStart-i[o].vertexStart),r=this.geometry;for(let s=0,o=i.length;s=this._geometryCount)return null;const i=this.geometry,a=this._geometryInfo[e];if(a.boundingBox===null){const r=new ea,s=i.index,o=i.attributes.position;for(let c=a.start,h=a.start+a.count;c=this._geometryCount)return null;const i=this.geometry,a=this._geometryInfo[e];if(a.boundingSphere===null){const r=new ta;this.getBoundingBoxAt(e,dv),dv.getCenter(r.center);const s=i.index,o=i.attributes.position;let c=0;for(let h=a.start,f=a.start+a.count;ho.active);if(Math.max(...i.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(c=>c.indexStart+c.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new wt,this._initializeGeometry(r));const s=this.geometry;r.index&&Qc(r.index.array,s.index.array);for(const o in r.attributes)Qc(r.attributes[o].array,s.attributes[o].array)}raycast(e,t){const i=this._instanceInfo,a=this._geometryInfo,r=this.matrixWorld,s=this.geometry;xa.material=this.material,xa.geometry.index=s.index,xa.geometry.attributes=s.attributes,xa.geometry.boundingBox===null&&(xa.geometry.boundingBox=new ea),xa.geometry.boundingSphere===null&&(xa.geometry.boundingSphere=new ta);for(let o=0,c=i.length;o({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,a,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=a.getIndex(),o=s===null?1:s.array.BYTES_PER_ELEMENT,c=this._instanceInfo,h=this._multiDrawStarts,f=this._multiDrawCounts,d=this._geometryInfo,m=this.perObjectFrustumCulled,g=this._indirectTexture,x=g.image.data,T=i.isArrayCamera?GG:U4;m&&!i.isArrayCamera&&(Wa.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),U4.setFromProjectionMatrix(Wa,i.coordinateSystem,i.reversedDepth));let S=0;if(this.sortObjects){Wa.copy(this.matrixWorld).invert(),Fp.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Wa),P4.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Wa);for(let E=0,b=c.length;E0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,s=a.length;ri)return;KT.applyMatrix4(n.matrixWorld);const h=e.ray.origin.distanceTo(KT);if(!(he.far))return{distance:h,point:B4.clone().applyMatrix4(n.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:n}}const H4=new L,F4=new L;class nr extends ro{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let a=0,r=t.count;a0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,s=a.length;ra.far)return;r.push({distance:h,distanceToRay:Math.sqrt(o),point:c,index:e,face:null,faceIndex:null,barycoord:null,object:s})}}class YU extends Nn{constructor(e,t,i,a,r=Ht,s=Ht,o,c,h){super(e,t,i,a,r,s,o,c,h),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const f=this;function d(){f.needsUpdate=!0,f._requestVideoFrameCallbackId=e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(d))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class WG extends YU{constructor(e,t,i,a,r,s,o,c){super({},e,t,i,a,r,s,o,c),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class XG extends Nn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Fn,this.minFilter=Fn,this.generateMipmaps=!1,this.needsUpdate=!0}}class V1 extends Nn{constructor(e,t,i,a,r,s,o,c,h,f,d,m){super(null,s,o,c,h,f,a,r,d,m),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class YG extends V1{constructor(e,t,i,a,r,s){super(e,t,i,r,s),this.isCompressedArrayTexture=!0,this.image.depth=a,this.wrapR=Li,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class qG extends V1{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,al),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class jG extends Nn{constructor(e,t,i,a,r,s,o,c,h){super(e,t,i,a,r,s,o,c,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}class U0 extends Nn{constructor(e,t,i=Ns,a,r,s,o=Fn,c=Fn,h,f=_d,d=1){if(f!==_d&&f!==Yu)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const m={width:e,height:t,depth:d};super(m,a,r,s,o,c,f,i,h),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Zl(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Ab extends Nn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class k1 extends wt{constructor(e=1,t=1,i=4,a=8,r=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:a,heightSegments:r},t=Math.max(0,t),i=Math.max(1,Math.floor(i)),a=Math.max(3,Math.floor(a)),r=Math.max(1,Math.floor(r));const s=[],o=[],c=[],h=[],f=t/2,d=Math.PI/2*e,m=t,g=2*d+m,x=i*2+r,T=a+1,S=new L,v=new L;for(let y=0;y<=x;y++){let E=0,b=0,D=0,C=0;if(y<=i){const O=y/i,R=O*Math.PI/2;b=-f-e*Math.cos(R),D=e*Math.sin(R),C=-e*Math.cos(R),E=O*d}else if(y<=i+r){const O=(y-i)/r;b=-f+O*t,D=e,C=0,E=d+O*m}else{const O=(y-i-r)/i,R=O*Math.PI/2;b=f+e*Math.sin(R),D=e*Math.cos(R),C=e*Math.sin(R),E=d+m+O*d}const I=Math.max(0,Math.min(1,E/g));let P=0;y===0?P=.5/a:y===x&&(P=-.5/a);for(let O=0;O<=a;O++){const R=O/a,B=R*Math.PI*2,j=Math.sin(B),ee=Math.cos(B);v.x=-D*ee,v.y=b,v.z=D*j,o.push(v.x,v.y,v.z),S.set(-D*ee,C,D*j),S.normalize(),c.push(S.x,S.y,S.z),h.push(R+P,I)}if(y>0){const O=(y-1)*T;for(let R=0;R0&&E(!0),t>0&&E(!1)),this.setIndex(f),this.setAttribute("position",new xt(d,3)),this.setAttribute("normal",new xt(m,3)),this.setAttribute("uv",new xt(g,2));function y(){const b=new L,D=new L;let C=0;const I=(t-e)/i;for(let P=0;P<=r;P++){const O=[],R=P/r,B=R*(t-e)+e;for(let j=0;j<=a;j++){const ee=j/a,se=ee*c+o,re=Math.sin(se),W=Math.cos(se);D.x=B*re,D.y=-R*i+S,D.z=B*W,d.push(D.x,D.y,D.z),b.set(re,I,W).normalize(),m.push(b.x,b.y,b.z),g.push(ee,1-R),O.push(x++)}T.push(O)}for(let P=0;P0||O!==0)&&(f.push(R,B,ee),C+=3),(t>0||O!==r-1)&&(f.push(B,j,ee),C+=3)}h.addGroup(v,C,0),v+=C}function E(b){const D=x,C=new de,I=new L;let P=0;const O=b===!0?e:t,R=b===!0?1:-1;for(let j=1;j<=a;j++)d.push(0,S*R,0),m.push(0,R,0),g.push(.5,.5),x++;const B=x;for(let j=0;j<=a;j++){const se=j/a*c+o,re=Math.cos(se),W=Math.sin(se);I.x=O*W,I.y=S*R,I.z=O*re,d.push(I.x,I.y,I.z),m.push(0,R,0),C.x=re*.5+.5,C.y=W*.5*R+.5,g.push(C.x,C.y),x++}for(let j=0;j.9&&I<.1&&(E<.2&&(s[y+0]+=1),b<.2&&(s[y+2]+=1),D<.2&&(s[y+4]+=1))}}function m(y){r.push(y.x,y.y,y.z)}function g(y,E){const b=y*3;E.x=e[b+0],E.y=e[b+1],E.z=e[b+2]}function x(){const y=new L,E=new L,b=new L,D=new L,C=new de,I=new de,P=new de;for(let O=0,R=0;O0)c=a-1;else{c=a;break}if(a=c,i[a]===s)return a/(r-1);const f=i[a],m=i[a+1]-f,g=(s-f)/m;return(a+g)/(r-1)}getTangent(e,t){let a=e-1e-4,r=e+1e-4;a<0&&(a=0),r>1&&(r=1);const s=this.getPoint(a),o=this.getPoint(r),c=t||(s.isVector2?new de:new L);return c.copy(o).sub(s).normalize(),c}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new L,a=[],r=[],s=[],o=new L,c=new ke;for(let g=0;g<=e;g++){const x=g/e;a[g]=this.getTangentAt(x,new L)}r[0]=new L,s[0]=new L;let h=Number.MAX_VALUE;const f=Math.abs(a[0].x),d=Math.abs(a[0].y),m=Math.abs(a[0].z);f<=h&&(h=f,i.set(1,0,0)),d<=h&&(h=d,i.set(0,1,0)),m<=h&&i.set(0,0,1),o.crossVectors(a[0],i).normalize(),r[0].crossVectors(a[0],o),s[0].crossVectors(a[0],r[0]);for(let g=1;g<=e;g++){if(r[g]=r[g-1].clone(),s[g]=s[g-1].clone(),o.crossVectors(a[g-1],a[g]),o.length()>Number.EPSILON){o.normalize();const x=Math.acos(Lt(a[g-1].dot(a[g]),-1,1));r[g].applyMatrix4(c.makeRotationAxis(o,x))}s[g].crossVectors(a[g],r[g])}if(t===!0){let g=Math.acos(Lt(r[0].dot(r[e]),-1,1));g/=e,a[0].dot(o.crossVectors(r[0],r[e]))>0&&(g=-g);for(let x=1;x<=e;x++)r[x].applyMatrix4(c.makeRotationAxis(a[x],g*x)),s[x].crossVectors(a[x],r[x])}return{tangents:a,normals:r,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Y1 extends Os{constructor(e=0,t=0,i=1,a=1,r=0,s=Math.PI*2,o=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=a,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=o,this.aRotation=c}getPoint(e,t=new de){const i=t,a=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)a;)r-=a;r0?0:(Math.floor(Math.abs(o)/r)+1)*r:c===0&&o===r-1&&(o=r-2,c=1);let h,f;this.closed||o>0?h=a[(o-1)%r]:(Tv.subVectors(a[0],a[1]).add(a[0]),h=Tv);const d=a[o%r],m=a[(o+1)%r];if(this.closed||o+2a.length-2?a.length-1:s+1],d=a[s>a.length-3?a.length-1:s+2];return i.set(k4(o,c.x,h.x,f.x,d.x),k4(o,c.y,h.y,f.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const s=a[r]-i,o=this.curves[r],c=o.getLength(),h=c===0?0:1-s/c;return o.getPointAt(h,t)}r++}return null}getLength(){const 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;const e=[];let t=0;for(let i=0,a=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const d=h.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(h);const f=h.getPoint(1);return this.currentPoint.copy(f),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Iu extends zx{constructor(e){super(e),this.uuid=Cr(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,a=this.holes.length;i80*t){o=n[0],c=n[1];let f=o,d=c;for(let m=t;mf&&(f=g),x>d&&(d=x)}h=Math.max(f-o,d-c),h=h!==0?32767/h:0}return h0(r,s,t,o,c,h,0),s}function $U(n,e,t,i,a){let r;if(a===_V(n,e,t,i)>0)for(let s=e;s=e;s-=i)r=W4(s/i|0,n[s],n[s+1],r);return r&&Rd(r,r.next)&&(d0(r),r=r.next),r}function ju(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Rd(t,t.next)||hi(t.prev,t,t.next)===0)){if(d0(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function h0(n,e,t,i,a,r,s){if(!n)return;!s&&r&&fV(n,i,a,r);let o=n;for(;n.prev!==n.next;){const c=n.prev,h=n.next;if(r?aV(n,i,a,r):iV(n)){e.push(c.i,n.i,h.i),d0(n),n=h.next,o=h.next;continue}if(n=h,n===o){s?s===1?(n=rV(ju(n),e),h0(n,e,t,i,a,r,2)):s===2&&sV(n,e,t,i,a,r):h0(ju(n),e,t,i,a,r,1);break}}}function iV(n){const e=n.prev,t=n,i=n.next;if(hi(e,t,i)>=0)return!1;const a=e.x,r=t.x,s=i.x,o=e.y,c=t.y,h=i.y,f=Math.min(a,r,s),d=Math.min(o,c,h),m=Math.max(a,r,s),g=Math.max(o,c,h);let x=i.next;for(;x!==e;){if(x.x>=f&&x.x<=m&&x.y>=d&&x.y<=g&&lm(a,o,r,c,s,h,x.x,x.y)&&hi(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function aV(n,e,t,i){const a=n.prev,r=n,s=n.next;if(hi(a,r,s)>=0)return!1;const o=a.x,c=r.x,h=s.x,f=a.y,d=r.y,m=s.y,g=Math.min(o,c,h),x=Math.min(f,d,m),T=Math.max(o,c,h),S=Math.max(f,d,m),v=sE(g,x,e,t,i),y=sE(T,S,e,t,i);let E=n.prevZ,b=n.nextZ;for(;E&&E.z>=v&&b&&b.z<=y;){if(E.x>=g&&E.x<=T&&E.y>=x&&E.y<=S&&E!==a&&E!==s&&lm(o,f,c,d,h,m,E.x,E.y)&&hi(E.prev,E,E.next)>=0||(E=E.prevZ,b.x>=g&&b.x<=T&&b.y>=x&&b.y<=S&&b!==a&&b!==s&&lm(o,f,c,d,h,m,b.x,b.y)&&hi(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;E&&E.z>=v;){if(E.x>=g&&E.x<=T&&E.y>=x&&E.y<=S&&E!==a&&E!==s&&lm(o,f,c,d,h,m,E.x,E.y)&&hi(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;b&&b.z<=y;){if(b.x>=g&&b.x<=T&&b.y>=x&&b.y<=S&&b!==a&&b!==s&&lm(o,f,c,d,h,m,b.x,b.y)&&hi(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function rV(n,e){let t=n;do{const i=t.prev,a=t.next.next;!Rd(i,a)&&t6(i,t,t.next,a)&&f0(i,a)&&f0(a,i)&&(e.push(i.i,t.i,a.i),d0(t),d0(t.next),t=n=a),t=t.next}while(t!==n);return ju(t)}function sV(n,e,t,i,a,r){let s=n;do{let o=s.next.next;for(;o!==s.prev;){if(s.i!==o.i&&mV(s,o)){let c=n6(s,o);s=ju(s,s.next),c=ju(c,c.next),h0(s,e,t,i,a,r,0),h0(c,e,t,i,a,r,0);return}o=o.next}s=s.next}while(s!==n)}function oV(n,e,t,i){const a=[];for(let r=0,s=e.length;r=t.next.y&&t.next.y!==t.y){const d=t.x+(a-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=i&&d>r&&(r=d,s=t.x=t.x&&t.x>=c&&i!==t.x&&e6(as.x||t.x===s.x&&hV(s,t)))&&(s=t,f=d)}t=t.next}while(t!==o);return s}function hV(n,e){return hi(n.prev,n,e.prev)<0&&hi(e.next,n,n.next)<0}function fV(n,e,t,i){let a=n;do a.z===0&&(a.z=sE(a.x,a.y,e,t,i)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==n);a.prevZ.nextZ=null,a.prevZ=null,dV(a)}function dV(n){let e,t=1;do{let i=n,a;n=null;let r=null;for(e=0;i;){e++;let s=i,o=0;for(let h=0;h0||c>0&&s;)o!==0&&(c===0||!s||i.z<=s.z)?(a=i,i=i.nextZ,o--):(a=s,s=s.nextZ,c--),r?r.nextZ=a:n=a,a.prevZ=r,r=a;i=s}r.nextZ=null,t*=2}while(e>1);return n}function sE(n,e,t,i,a){return n=(n-t)*a|0,e=(e-i)*a|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function pV(n){let e=n,t=n;do(e.x=(n-s)*(r-o)&&(n-s)*(i-o)>=(t-s)*(e-o)&&(t-s)*(r-o)>=(a-s)*(i-o)}function lm(n,e,t,i,a,r,s,o){return!(n===s&&e===o)&&e6(n,e,t,i,a,r,s,o)}function mV(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!gV(n,e)&&(f0(n,e)&&f0(e,n)&&vV(n,e)&&(hi(n.prev,n,e.prev)||hi(n,e.prev,e))||Rd(n,e)&&hi(n.prev,n,n.next)>0&&hi(e.prev,e,e.next)>0)}function hi(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Rd(n,e){return n.x===e.x&&n.y===e.y}function t6(n,e,t,i){const a=Mv(hi(n,e,t)),r=Mv(hi(n,e,i)),s=Mv(hi(t,i,n)),o=Mv(hi(t,i,e));return!!(a!==r&&s!==o||a===0&&Ev(n,t,e)||r===0&&Ev(n,i,e)||s===0&&Ev(t,n,i)||o===0&&Ev(t,e,i))}function Ev(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Mv(n){return n>0?1:n<0?-1:0}function gV(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&t6(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function f0(n,e){return hi(n.prev,n,n.next)<0?hi(n,e,n.next)>=0&&hi(n,n.prev,e)>=0:hi(n,e,n.prev)<0||hi(n,n.next,e)<0}function vV(n,e){let t=n,i=!1;const a=(n.x+e.x)/2,r=(n.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&a<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function n6(n,e){const t=oE(n.i,n.x,n.y),i=oE(e.i,e.x,e.y),a=n.next,r=e.prev;return n.next=e,e.prev=n,t.next=a,a.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function W4(n,e,t,i){const a=oE(n,e,t);return i?(a.next=i.next,a.prev=i,i.next.prev=a,i.next=a):(a.prev=a,a.next=a),a}function d0(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function oE(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function _V(n,e,t,i){let a=0;for(let r=e,s=t-i;r2&&n[e-1].equals(n[0])&&n.pop()}function Y4(n,e){for(let t=0;tNumber.EPSILON){const Ee=Math.sqrt(U),Le=Math.sqrt(ct*ct+k*k),ye=G.x-Je/Ee,vt=G.y+$e/Ee,qe=Me.x-k/Le,_t=Me.y+ct/Le,pt=((qe-ye)*k-(_t-vt)*ct)/($e*k-Je*ct);De=ye+$e*pt-Te.x,Fe=vt+Je*pt-Te.y;const Ie=De*De+Fe*Fe;if(Ie<=2)return new de(De,Fe);Be=Math.sqrt(Ie/2)}else{let Ee=!1;$e>Number.EPSILON?ct>Number.EPSILON&&(Ee=!0):$e<-Number.EPSILON?ct<-Number.EPSILON&&(Ee=!0):Math.sign(Je)===Math.sign(k)&&(Ee=!0),Ee?(De=-Je,Fe=$e,Be=Math.sqrt(U)):(De=$e,Fe=Je,Be=Math.sqrt(U/2))}return new de(De/Be,Fe/Be)}const oe=[];for(let Te=0,G=re.length,Me=G-1,De=Te+1;Te=0;Te--){const G=Te/S,Me=g*Math.cos(G*Math.PI/2),De=x*Math.sin(G*Math.PI/2)+T;for(let Fe=0,Be=re.length;Fe=0;){const De=Me;let Fe=Me-1;Fe<0&&(Fe=Te.length-1);for(let Be=0,$e=f+S*2;Be<$e;Be++){const Je=te*Be,ct=te*(Be+1),k=G+De+Je,U=G+Fe+Je,ce=G+Fe+ct,Ee=G+De+ct;Mt(k,U,ce,Ee)}}}function ue(Te,G,Me){c.push(Te),c.push(G),c.push(Me)}function it(Te,G,Me){ot(Te),ot(G),ot(Me);const De=a.length/3,Fe=y.generateTopUV(i,a,De-3,De-2,De-1);Ke(Fe[0]),Ke(Fe[1]),Ke(Fe[2])}function Mt(Te,G,Me,De){ot(Te),ot(G),ot(De),ot(G),ot(Me),ot(De);const Fe=a.length/3,Be=y.generateSideWallUV(i,a,Fe-6,Fe-3,Fe-2,Fe-1);Ke(Be[0]),Ke(Be[1]),Ke(Be[3]),Ke(Be[1]),Ke(Be[2]),Ke(Be[3])}function ot(Te){a.push(c[Te*3+0]),a.push(c[Te*3+1]),a.push(c[Te*3+2])}function Ke(Te){r.push(Te.x),r.push(Te.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return SV(t,i,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r0)&&g.push(E,b,C),(v!==i-1||c0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,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.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,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}}class r6 extends qn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new je(16777215),this.specular=new je(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new je(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ol,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ui,this.combine=N0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,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.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}}class s6 extends qn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new je(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new je(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ol,this.normalScale=new de(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.fog=!0,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.fog=e.fog,this}}class Lb extends qn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ol,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=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}}class o6 extends qn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new je(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new je(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ol,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ui,this.combine=N0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,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.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.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}}class Ib extends qn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Sc,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=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}}class Ub extends qn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class l6 extends qn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new je(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ol,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class c6 extends Pi{constructor(e){super(),this.isLineDashedMaterial=!0,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}}function Eu(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function u6(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function h6(n){function e(a,r){return n[a]-n[r]}const t=n.length,i=new Array(t);for(let a=0;a!==t;++a)i[a]=a;return i.sort(e),i}function lE(n,e,t){const i=n.length,a=new n.constructor(i);for(let r=0,s=0;s!==i;++r){const o=t[r]*e;for(let c=0;c!==e;++c)a[s++]=n[o+c]}return a}function Pb(n,e,t,i){let a=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[a++];if(r===void 0)return;let s=r[i];if(s!==void 0)if(Array.isArray(s))do s=r[i],s!==void 0&&(e.push(r.time),t.push(...s)),r=n[a++];while(r!==void 0);else if(s.toArray!==void 0)do s=r[i],s!==void 0&&(e.push(r.time),s.toArray(t,t.length)),r=n[a++];while(r!==void 0);else do s=r[i],s!==void 0&&(e.push(r.time),t.push(s)),r=n[a++];while(r!==void 0)}function EV(n,e,t,i,a=30){const r=n.clone();r.name=e;const s=[];for(let c=0;c=i)){d.push(h.times[g]);for(let T=0;Tr.tracks[c].times[0]&&(o=r.tracks[c].times[0]);for(let c=0;c=o.times[x]){const v=x*d+f,y=v+d-f;T=o.values.slice(v,y)}else{const v=o.createInterpolant(),y=f,E=d-f;v.evaluate(r),T=v.resultBuffer.slice(y,E)}c==="quaternion"&&new Tt().fromArray(T).normalize().conjugate().toArray(T);const S=h.times.length;for(let v=0;v=r)){const o=t[1];e=r)break t}s=i,i=0;break n}break e}for(;i>>1;et;)--s;if(++s,r!==0||s!==a){r>=s&&(s=Math.max(s,1),r=s-1);const o=this.getValueSize();this.times=i.slice(r,s),this.values=this.values.slice(r*o,s*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(Bt("KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,a=this.values,r=i.length;r===0&&(Bt("KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let o=0;o!==r;o++){const c=i[o];if(typeof c=="number"&&isNaN(c)){Bt("KeyframeTrack: Time is not a valid number.",this,o,c),e=!1;break}if(s!==null&&s>c){Bt("KeyframeTrack: Out of order keys.",this,o,c,s),e=!1;break}s=c}if(a!==void 0&&u6(a))for(let o=0,c=a.length;o!==c;++o){const h=a[o];if(isNaN(h)){Bt("KeyframeTrack: Value is not a valid number.",this,o,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),a=this.getInterpolation()===d_,r=e.length-1;let s=1;for(let o=1;o0){e[s]=e[r];for(let o=r*i,c=s*i,h=0;h!==i;++h)t[c+h]=t[o+h];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=t.slice(0,s*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,a=new i(this.name,e,t);return a.createInterpolant=this.createInterpolant,a}}ls.prototype.ValueTypeName="";ls.prototype.TimeBufferType=Float32Array;ls.prototype.ValueBufferType=Float32Array;ls.prototype.DefaultInterpolation=yd;class uh extends ls{constructor(e,t,i){super(e,t,i)}}uh.prototype.ValueTypeName="bool";uh.prototype.ValueBufferType=Array;uh.prototype.DefaultInterpolation=xd;uh.prototype.InterpolantFactoryMethodLinear=void 0;uh.prototype.InterpolantFactoryMethodSmooth=void 0;class Bb extends ls{constructor(e,t,i,a){super(e,t,i,a)}}Bb.prototype.ValueTypeName="color";class gc extends ls{constructor(e,t,i,a){super(e,t,i,a)}}gc.prototype.ValueTypeName="number";class p6 extends Xd{constructor(e,t,i,a){super(e,t,i,a)}interpolate_(e,t,i,a){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,c=(i-t)/(a-t);let h=e*o;for(let f=h+o;h!==f;h+=4)Tt.slerpFlat(r,0,s,h-o,s,h,c);return r}}class vc extends ls{constructor(e,t,i,a){super(e,t,i,a)}InterpolantFactoryMethodLinear(e){return new p6(this.times,this.values,this.getValueSize(),e)}}vc.prototype.ValueTypeName="quaternion";vc.prototype.InterpolantFactoryMethodSmooth=void 0;class hh extends ls{constructor(e,t,i){super(e,t,i)}}hh.prototype.ValueTypeName="string";hh.prototype.ValueBufferType=Array;hh.prototype.DefaultInterpolation=xd;hh.prototype.InterpolantFactoryMethodLinear=void 0;hh.prototype.InterpolantFactoryMethodSmooth=void 0;class Zu extends ls{constructor(e,t,i,a){super(e,t,i,a)}}Zu.prototype.ValueTypeName="vector";class Ku{constructor(e="",t=-1,i=[],a=I1){this.name=e,this.tracks=i,this.duration=t,this.blendMode=a,this.uuid=Cr(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,a=1/(e.fps||1);for(let s=0,o=i.length;s!==o;++s)t.push(RV(i[s]).scale(a));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r.userData=JSON.parse(e.userData||"{}"),r}static toJSON(e){const t=[],i=e.tracks,a={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let r=0,s=i.length;r!==s;++r)t.push(ls.toJSON(i[r]));return a}static CreateFromMorphTargetSequence(e,t,i,a){const r=t.length,s=[];for(let o=0;o1){const d=f[1];let m=a[d];m||(a[d]=m=[]),m.push(h)}}const s=[];for(const o in a)s.push(this.CreateFromMorphTargetSequence(o,a[o],t,i));return s}static parseAnimation(e,t){if(ut("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return Bt("AnimationClip: No animation in JSONLoader data."),null;const i=function(d,m,g,x,T){if(g.length!==0){const S=[],v=[];Pb(g,S,v,x),S.length!==0&&T.push(new d(m,S,v))}},a=[],r=e.name||"default",s=e.fps||30,o=e.blendMode;let c=e.length||-1;const h=e.hierarchy||[];for(let d=0;d{t&&t(r),this.manager.itemEnd(e)},0),r;if(Oo[e]!==void 0){Oo[e].push({onLoad:t,onProgress:i,onError:a});return}Oo[e]=[],Oo[e].push({onLoad:t,onProgress:i,onError:a});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,c=this.responseType;fetch(s).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&ut("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const f=Oo[e],d=h.body.getReader(),m=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),g=m?parseInt(m):0,x=g!==0;let T=0;const S=new ReadableStream({start(v){y();function y(){d.read().then(({done:E,value:b})=>{if(E)v.close();else{T+=b.byteLength;const D=new ProgressEvent("progress",{lengthComputable:x,loaded:T,total:g});for(let C=0,I=f.length;C{v.error(E)})}}});return new Response(S)}else throw new wV(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(c){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(f=>new DOMParser().parseFromString(f,o));case"json":return h.json();default:if(o==="")return h.text();{const d=/charset="?([^;"\s]*)"?/i.exec(o),m=d&&d[1]?d[1].toLowerCase():void 0,g=new TextDecoder(m);return h.arrayBuffer().then(x=>g.decode(x))}}}).then(h=>{to.add(`file:${e}`,h);const f=Oo[e];delete Oo[e];for(let d=0,m=f.length;d{const f=Oo[e];if(f===void 0)throw this.manager.itemError(e),h;delete Oo[e];for(let d=0,m=f.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class CV extends Ti{constructor(e){super(e)}load(e,t,i,a){const r=this,s=new ss(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(o){try{t(r.parse(JSON.parse(o)))}catch(c){a?a(c):Bt(c),r.manager.itemError(e)}},i,a)}parse(e){const t=[];for(let i=0;i0:a.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const r in e.uniforms){const s=e.uniforms[r];switch(a.uniforms[r]={},s.type){case"t":a.uniforms[r].value=i(s.value);break;case"c":a.uniforms[r].value=new je().setHex(s.value);break;case"v2":a.uniforms[r].value=new de().fromArray(s.value);break;case"v3":a.uniforms[r].value=new L().fromArray(s.value);break;case"v4":a.uniforms[r].value=new zt().fromArray(s.value);break;case"m3":a.uniforms[r].value=new Et().fromArray(s.value);break;case"m4":a.uniforms[r].value=new ke().fromArray(s.value);break;default:a.uniforms[r].value=s.value}}if(e.defines!==void 0&&(a.defines=e.defines),e.vertexShader!==void 0&&(a.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(a.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(a.glslVersion=e.glslVersion),e.extensions!==void 0)for(const r in e.extensions)a.extensions[r]=e.extensions[r];if(e.lights!==void 0&&(a.lights=e.lights),e.clipping!==void 0&&(a.clipping=e.clipping),e.size!==void 0&&(a.size=e.size),e.sizeAttenuation!==void 0&&(a.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(a.map=i(e.map)),e.matcap!==void 0&&(a.matcap=i(e.matcap)),e.alphaMap!==void 0&&(a.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(a.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(a.bumpScale=e.bumpScale),e.normalMap!==void 0&&(a.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(a.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),a.normalScale=new de().fromArray(r)}return e.displacementMap!==void 0&&(a.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(a.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(a.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(a.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(a.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(a.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(a.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(a.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(a.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(a.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(a.envMap=i(e.envMap)),e.envMapRotation!==void 0&&a.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(a.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(a.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(a.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(a.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(a.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(a.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(a.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(a.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(a.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(a.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(a.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(a.clearcoatNormalScale=new de().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(a.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(a.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(a.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(a.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(a.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(a.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(a.sheenRoughnessMap=i(e.sheenRoughnessMap)),a}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return ny.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:a6,SpriteMaterial:Tb,RawShaderMaterial:ch,ShaderMaterial:Fi,PointsMaterial:G1,MeshPhysicalMaterial:os,MeshStandardMaterial:F0,MeshPhongMaterial:r6,MeshToonMaterial:s6,MeshNormalMaterial:Lb,MeshLambertMaterial:o6,MeshDepthMaterial:Ib,MeshDistanceMaterial:Ub,MeshBasicMaterial:La,MeshMatcapMaterial:l6,LineDashedMaterial:c6,LineBasicMaterial:Pi,Material:qn};return new t[e]}}class oc{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||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 T6 extends wt{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class E6 extends Ti{constructor(e){super(e)}load(e,t,i,a){const r=this,s=new ss(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(e,function(o){try{t(r.parse(JSON.parse(o)))}catch(c){a?a(c):Bt(c),r.manager.itemError(e)}},i,a)}parse(e){const t={},i={};function a(g,x){if(t[x]!==void 0)return t[x];const S=g.interleavedBuffers[x],v=r(g,S.buffer),y=Vf(S.type,v),E=new I0(y,S.stride);return E.uuid=S.uuid,t[x]=E,E}function r(g,x){if(i[x]!==void 0)return i[x];const S=g.arrayBuffers[x],v=new Uint32Array(S).buffer;return i[x]=v,v}const s=e.isInstancedBufferGeometry?new T6:new wt,o=e.data.index;if(o!==void 0){const g=Vf(o.type,o.array);s.setIndex(new Ot(g,1))}const c=e.data.attributes;for(const g in c){const x=c[g];let T;if(x.isInterleavedBufferAttribute){const S=a(e.data,x.data);T=new mc(S,x.itemSize,x.offset,x.normalized)}else{const S=Vf(x.type,x.array),v=x.isInstancedBufferAttribute?qu:Ot;T=new v(S,x.itemSize,x.normalized)}x.name!==void 0&&(T.name=x.name),x.usage!==void 0&&T.setUsage(x.usage),s.setAttribute(g,T)}const h=e.data.morphAttributes;if(h)for(const g in h){const x=h[g],T=[];for(let S=0,v=x.length;S0){const c=new Hb(t);r=new wd(c),r.setCrossOrigin(this.crossOrigin);for(let h=0,f=e.length;h0){a=new wd(this.manager),a.setCrossOrigin(this.crossOrigin);for(let s=0,o=e.length;s{let S=null,v=null;return T.boundingBox!==void 0&&(S=new ea().fromJSON(T.boundingBox)),T.boundingSphere!==void 0&&(v=new ta().fromJSON(T.boundingSphere)),{...T,boundingBox:S,boundingSphere:v}}),s._instanceInfo=e.instanceInfo,s._availableInstanceIds=e._availableInstanceIds,s._availableGeometryIds=e._availableGeometryIds,s._nextIndexStart=e.nextIndexStart,s._nextVertexStart=e.nextVertexStart,s._geometryCount=e.geometryCount,s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._matricesTexture=h(e.matricesTexture.uuid),s._indirectTexture=h(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(s._colorsTexture=h(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(s.boundingSphere=new ta().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(s.boundingBox=new ea().fromJSON(e.boundingBox));break;case"LOD":s=new WU;break;case"Line":s=new ro(o(e.geometry),c(e.material));break;case"LineLoop":s=new Mb(o(e.geometry),c(e.material));break;case"LineSegments":s=new nr(o(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new bb(o(e.geometry),c(e.material));break;case"Sprite":s=new kU(c(e.material));break;case"Group":s=new Ia;break;case"Bone":s=new H1;break;default:s=new Zt}if(s.uuid=e.uuid,e.name!==void 0&&(s.name=e.name),e.matrix!==void 0?(s.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(e.position!==void 0&&s.position.fromArray(e.position),e.rotation!==void 0&&s.rotation.fromArray(e.rotation),e.quaternion!==void 0&&s.quaternion.fromArray(e.quaternion),e.scale!==void 0&&s.scale.fromArray(e.scale)),e.up!==void 0&&s.up.fromArray(e.up),e.castShadow!==void 0&&(s.castShadow=e.castShadow),e.receiveShadow!==void 0&&(s.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(s.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(s.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(s.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(s.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(s.visible=e.visible),e.frustumCulled!==void 0&&(s.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(s.renderOrder=e.renderOrder),e.userData!==void 0&&(s.userData=e.userData),e.layers!==void 0&&(s.layers.mask=e.layers),e.children!==void 0){const m=e.children;for(let g=0;g"u"&&ut("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&ut("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,i,a){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,s=to.get(`image-bitmap:${e}`);if(s!==void 0){if(r.manager.itemStart(e),s.then){s.then(h=>{if(i2.has(s)===!0)a&&a(i2.get(s)),r.manager.itemError(e),r.manager.itemEnd(e);else return t&&t(h),r.manager.itemEnd(e),h});return}return setTimeout(function(){t&&t(s),r.manager.itemEnd(e)},0),s}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader,o.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const c=fetch(e,o).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(h){return to.add(`image-bitmap:${e}`,h),t&&t(h),r.manager.itemEnd(e),h}).catch(function(h){a&&a(h),i2.set(c,h),to.remove(`image-bitmap:${e}`),r.manager.itemError(e),r.manager.itemEnd(e)});to.add(`image-bitmap:${e}`,c),r.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let bv;class Xb{static getContext(){return bv===void 0&&(bv=new(window.AudioContext||window.webkitAudioContext)),bv}static setContext(e){bv=e}}class zV extends Ti{constructor(e){super(e)}load(e,t,i,a){const r=this,s=new ss(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(c){try{const h=c.slice(0);Xb.getContext().decodeAudioData(h,function(d){t(d)}).catch(o)}catch(h){o(h)}},i,a);function o(c){a?a(c):Bt(c),r.manager.itemError(e)}}}const eN=new ke,tN=new ke,Jc=new ke;class BV{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ui,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ui,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){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Jc.copy(e.projectionMatrix);const a=t.eyeSep/2,r=a*t.near/t.focus,s=t.near*Math.tan(Lu*t.fov*.5)/t.zoom;let o,c;tN.elements[12]=-a,eN.elements[12]=a,o=-s*t.aspect+r,c=s*t.aspect+r,Jc.elements[0]=2*t.near/(c-o),Jc.elements[8]=(c+o)/(c-o),this.cameraL.projectionMatrix.copy(Jc),o=-s*t.aspect-r,c=s*t.aspect-r,Jc.elements[0]=2*t.near/(c-o),Jc.elements[8]=(c+o)/(c-o),this.cameraR.projectionMatrix.copy(Jc)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(tN),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(eN)}}class b6 extends ui{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Yb{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),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;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}const $c=new L,a2=new Tt,HV=new L,eu=new L,tu=new L;class FV extends Zt{constructor(){super(),this.type="AudioListener",this.context=Xb.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Yb}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose($c,a2,HV),eu.set(0,0,-1).applyQuaternion(a2),tu.set(0,1,0).applyQuaternion(a2),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime($c.x,i),t.positionY.linearRampToValueAtTime($c.y,i),t.positionZ.linearRampToValueAtTime($c.z,i),t.forwardX.linearRampToValueAtTime(eu.x,i),t.forwardY.linearRampToValueAtTime(eu.y,i),t.forwardZ.linearRampToValueAtTime(eu.z,i),t.upX.linearRampToValueAtTime(tu.x,i),t.upY.linearRampToValueAtTime(tu.y,i),t.upZ.linearRampToValueAtTime(tu.z,i)}else t.setPosition($c.x,$c.y,$c.z),t.setOrientation(eu.x,eu.y,eu.z,tu.x,tu.y,tu.z)}}class A6 extends Zt{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(this.isPlaying===!0){ut("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){ut("Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){ut("Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){ut("Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,a,this._addIndex*t,1,t);for(let c=t,h=t+t;c!==h;++c)if(i[c]!==i[c+t]){o.setValue(i,a);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,a=i*this._origIndex;e.getValue(t,a);for(let r=i,s=a;r!==s;++r)t[r]=t[a+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let s=0;s!==r;++s)e[t+s]=e[i+s]}_slerp(e,t,i,a){Tt.slerpFlat(e,t,e,t,e,i,a)}_slerpAdditive(e,t,i,a,r){const s=this._workIndex*r;Tt.multiplyQuaternionsFlat(e,s,e,t,e,i),Tt.slerpFlat(e,t,e,t,e,s,a)}_lerp(e,t,i,a,r){const s=1-a;for(let o=0;o!==r;++o){const c=t+o;e[c]=e[c]*s+e[i+o]*a}}_lerpAdditive(e,t,i,a,r){for(let s=0;s!==r;++s){const o=t+s;e[o]=e[o]+e[i+s]*a}}}const qb="\\[\\]\\.:\\/",WV=new RegExp("["+qb+"]","g"),jb="[^"+qb+"]",XV="[^"+qb.replace("\\.","")+"]",YV=/((?:WC+[\/:])*)/.source.replace("WC",jb),qV=/(WCOD+)?/.source.replace("WCOD",XV),jV=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",jb),ZV=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",jb),KV=new RegExp("^"+YV+qV+jV+ZV+"$"),QV=["material","materials","bones","map"];class JV{constructor(e,t,i){const a=i||fn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,a)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,a=this._bindings[i];a!==void 0&&a.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let a=this._targetGroup.nCachedObjects_,r=i.length;a!==r;++a)i[a].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class fn{constructor(e,t,i){this.path=t,this.parsedPath=i||fn.parseTrackName(t),this.node=fn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new fn.Composite(e,t,i):new fn(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(WV,"")}static parseTrackName(e){const t=KV.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},a=i.nodeName&&i.nodeName.lastIndexOf(".");if(a!==void 0&&a!==-1){const r=i.nodeName.substring(a+1);QV.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,a),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let s=0;s=r){const d=r++,m=e[d];t[m.uuid]=f,e[f]=m,t[h]=d,e[d]=c;for(let g=0,x=a;g!==x;++g){const T=i[g],S=T[d],v=T[f];T[f]=S,T[d]=v}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,a=i.length;let r=this.nCachedObjects_,s=e.length;for(let o=0,c=arguments.length;o!==c;++o){const h=arguments[o],f=h.uuid,d=t[f];if(d!==void 0)if(delete t[f],d0&&(t[g.uuid]=d),e[d]=g,e.pop();for(let x=0,T=a;x!==T;++x){const S=i[x];S[d]=S[m],S.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const i=this._bindingsIndicesByPath;let a=i[e];const r=this._bindings;if(a!==void 0)return r[a];const s=this._paths,o=this._parsedPaths,c=this._objects,h=c.length,f=this.nCachedObjects_,d=new Array(h);a=r.length,i[e]=a,s.push(e),o.push(t),r.push(d);for(let m=f,g=c.length;m!==g;++m){const x=c[m];d[m]=new fn(x,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const a=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length-1,c=s[o],h=e[o];t[h]=i,s[i]=c,s.pop(),r[i]=r[o],r.pop(),a[i]=a[o],a.pop()}}}class w6{constructor(e,t,i=null,a=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=a;const r=t.tracks,s=r.length,o=new Array(s),c={endingStart:Su,endingEnd:Su};for(let h=0;h!==s;++h){const f=r[h].createInterpolant(null);o[h]=f,f.settings=c}this._interpolantSettings=c,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=yU,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&&this.timeScale!==0&&this._startTime===null&&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=!1){if(e.fadeOut(t),this.fadeIn(t),i===!0){const a=this._clip.duration,r=e._clip.duration,s=r/a,o=a/r;e.warp(1,s,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,i=!1){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(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){const a=this._mixer,r=a.time,s=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=a._lendControlInterpolant(),this._timeScaleInterpolant=o);const c=o.parameterPositions,h=o.sampleValues;return c[0]=r,c[1]=r+i,h[0]=e/s,h[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,a){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const c=(e-r)*i;c<0||i===0?t=0:(this._startTime=null,t=i*c)}t*=this._updateTimeScale(e);const s=this._updateTime(t),o=this._updateWeight(e);if(o>0){const c=this._interpolants,h=this._propertyBindings;switch(this.blendMode){case pb:for(let f=0,d=c.length;f!==d;++f)c[f].evaluate(s),h[f].accumulateAdditive(o);break;case I1:default:for(let f=0,d=c.length;f!==d;++f)c[f].evaluate(s),h[f].accumulate(a,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const a=i.evaluate(e)[0];t*=a,e>i.parameterPositions[1]&&(this.stopFading(),a===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const a=i.evaluate(e)[0];t*=a,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let a=this.time+e,r=this._loopCount;const s=i===SU;if(e===0)return r===-1?a:s&&(r&1)===1?t-a:a;if(i===xU){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(a>=t)a=t;else if(a<0)a=0;else{this.time=a;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),a>=t||a<0){const o=Math.floor(a/t);a-=t*o,r+=Math.abs(o);const c=this.repetitions-r;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,a=e>0?t:0,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){const h=e<0;this._setEndings(h,!h,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=a,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=a;if(s&&(r&1)===1)return t-a}return a}_setEndings(e,t,i){const a=this._interpolantSettings;i?(a.endingStart=Tu,a.endingEnd=Tu):(e?a.endingStart=this.zeroSlopeAtStart?Tu:Su:a.endingStart=s0,t?a.endingEnd=this.zeroSlopeAtEnd?Tu:Su:a.endingEnd=s0)}_scheduleFading(e,t,i){const a=this._mixer,r=a.time;let s=this._weightInterpolant;s===null&&(s=a._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,c=s.sampleValues;return o[0]=r,c[0]=t,o[1]=r+e,c[1]=i,this}}const ek=new Float32Array(1);class C6 extends tr{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,a=e._clip.tracks,r=a.length,s=e._propertyBindings,o=e._interpolants,c=i.uuid,h=this._bindingsByRootAndName;let f=h[c];f===void 0&&(f={},h[c]=f);for(let d=0;d!==r;++d){const m=a[d],g=m.name;let x=f[g];if(x!==void 0)++x.referenceCount,s[d]=x;else{if(x=s[d],x!==void 0){x._cacheIndex===null&&(++x.referenceCount,this._addInactiveBinding(x,c,g));continue}const T=t&&t._propertyBindings[d].binding.parsedPath;x=new R6(fn.create(i,g,T),m.ValueTypeName,m.getValueSize()),++x.referenceCount,this._addInactiveBinding(x,c,g),s[d]=x}o[d].resultBuffer=x.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,a=e._clip.uuid,r=this._actionsByClip[a];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,a,i)}const t=e._propertyBindings;for(let i=0,a=t.length;i!==a;++i){const r=t[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,a=t.length;i!==a;++i){const r=t[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}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){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,a=this.time+=e,r=Math.sign(e),s=this._accuIndex^=1;for(let h=0;h!==i;++h)t[h]._update(a,e,r,s);const o=this._bindings,c=this._nActiveBindings;for(let h=0;h!==c;++h)o[h].apply(s);return this}setTime(e){this.time=0;for(let t=0;t=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 this.clampPoint(e,rN).distanceTo(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}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)}}const sN=new L,Av=new L,lf=new L,cf=new L,r2=new L,ck=new L,uk=new L;class hk{constructor(e=new L,t=new L){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){sN.subVectors(e,this.start),Av.subVectors(this.end,this.start);const i=Av.dot(Av);let r=Av.dot(sN)/i;return t&&(r=Lt(r,0,1)),r}closestPointToPoint(e,t,i){const a=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(a).add(this.start)}distanceSqToLine3(e,t=ck,i=uk){const a=10000000000000001e-32;let r,s;const o=this.start,c=e.start,h=this.end,f=e.end;lf.subVectors(h,o),cf.subVectors(f,c),r2.subVectors(o,c);const d=lf.dot(lf),m=cf.dot(cf),g=cf.dot(r2);if(d<=a&&m<=a)return t.copy(o),i.copy(c),t.sub(i),t.dot(t);if(d<=a)r=0,s=g/m,s=Lt(s,0,1);else{const x=lf.dot(r2);if(m<=a)s=0,r=Lt(-x/d,0,1);else{const T=lf.dot(cf),S=d*m-T*T;S!==0?r=Lt((T*g-x*m)/S,0,1):r=0,s=(T*r+g)/m,s<0?(s=0,r=Lt(-x/d,0,1)):s>1&&(s=1,r=Lt((T-x)/d,0,1))}}return t.copy(o).add(lf.multiplyScalar(r)),i.copy(c).add(cf.multiplyScalar(s)),t.sub(i),t.dot(t)}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 oN=new L;class fk extends Zt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new wt,a=[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 s=0,o=1,c=32;s1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{fN.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(fN,t)}}setLength(e,t=e*.2,i=t*.2){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}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class O6 extends nr{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],a=new wt;a.setAttribute("position",new xt(t,3)),a.setAttribute("color",new xt(i,3));const r=new Pi({vertexColors:!0,toneMapped:!1});super(a,r),this.type="AxesHelper"}setColors(e,t,i){const a=new je,r=this.geometry.attributes.color.array;return a.set(e),a.toArray(r,0),a.toArray(r,3),a.set(t),a.toArray(r,6),a.toArray(r,9),a.set(i),a.toArray(r,12),a.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class bk{constructor(){this.type="ShapePath",this.color=new je,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new zx,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,a){return this.currentPath.quadraticCurveTo(e,t,i,a),this}bezierCurveTo(e,t,i,a,r,s){return this.currentPath.bezierCurveTo(e,t,i,a,r,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(v){const y=[];for(let E=0,b=v.length;ENumber.EPSILON){if(R<0&&(I=y[C],O=-O,P=y[D],R=-R),v.yP.y)continue;if(v.y===I.y){if(v.x===I.x)return!0}else{const B=R*(v.x-I.x)-O*(v.y-I.y);if(B===0)return!0;if(B<0)continue;b=!b}}else{if(v.y!==I.y)continue;if(P.x<=v.x&&v.x<=I.x||I.x<=v.x&&v.x<=P.x)return!0}}return b}const a=As.isClockWise,r=this.subPaths;if(r.length===0)return[];let s,o,c;const h=[];if(r.length===1)return o=r[0],c=new Iu,c.curves=o.curves,h.push(c),h;let f=!a(r[0].getPoints());f=e?!f:f;const d=[],m=[];let g=[],x=0,T;m[x]=void 0,g[x]=[];for(let v=0,y=r.length;v1){let v=!1,y=0;for(let E=0,b=m.length;E0&&v===!1&&(g=d)}let S;for(let v=0,y=m.length;ve?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function wk(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function Ck(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function fE(n,e,t,i){const a=Nk(i);switch(t){case fb:return n*e;case bs:return n*e/a.components*a.byteLength;case O0:return n*e/a.components*a.byteLength;case Vo:return n*e*2/a.components*a.byteLength;case O1:return n*e*2/a.components*a.byteLength;case db:return n*e*3/a.components*a.byteLength;case Jn:return n*e*4/a.components*a.byteLength;case L1:return n*e*4/a.components*a.byteLength;case Nm:case Dm:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Om:case Lm:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case sx:case lx:return Math.max(n,16)*Math.max(e,8)/4;case rx:case ox:return Math.max(n,8)*Math.max(e,8)/2;case cx:case ux:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case hx:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case fx:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case dx:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case px:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case mx:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case gx:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case vx:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case _x:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case xx:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case yx:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case Sx:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Tx:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case Ex:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Mx:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case bx:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Ax:case Rx:case wx:return Math.ceil(n/4)*Math.ceil(e/4)*16;case Cx:case Nx:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Dx:case Ox:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Nk(n){switch(n){case Ii:case w1:return{byteLength:1,components:1};case Wu:case C1:case Xn:return{byteLength:2,components:1};case N1:case D1:return{byteLength:2,components:4};case Ns:case D0:case ri:return{byteLength:4,components:1};case ub:case hb:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class Dk{static contain(e,t){return Rk(e,t)}static cover(e,t){return wk(e,t)}static fill(e){return Ck(e)}static getByteLength(e,t,i,a){return fE(e,t,i,a)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ws}}));typeof window<"u"&&(window.__THREE__?ut("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ws);/** + `},a=new ch(5,5,5),r=new Vi({name:"CubemapFromEquirect",uniforms:wd(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Ui,blending:Ta});r.uniforms.tEquirect.value=t;const s=new oi(a,r),o=t.minFilter;return t.minFilter===Mr&&(t.minFilter=Ht),new VU(1,10,this).update(e,s),t.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,t=!0,i=!0,a=!0){const r=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,i,a);e.setRenderTarget(r)}}class Ua extends Wt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const DG={type:"move"};class g_{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ua,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Ua,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new L,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new L),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ua,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new L,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new L),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let a=null,r=null,s=null;const o=this._targetRay,c=this._grip,h=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(h&&e.hand){s=!0;for(const T of e.hand.values()){const y=t.getJointPose(T,i),v=this._getHandJoint(h,T);y!==null&&(v.matrix.fromArray(y.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=y.radius),v.visible=y!==null}const f=h.joints["index-finger-tip"],d=h.joints["thumb-tip"],m=f.position.distanceTo(d.position),g=.02,x=.005;h.inputState.pinching&&m>g+x?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&m<=g-x&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(a=t.getPose(e.targetRaySpace,i),a===null&&r!==null&&(a=r),a!==null&&(o.matrix.fromArray(a.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,a.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(a.linearVelocity)):o.hasLinearVelocity=!1,a.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(a.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(DG)))}return o!==null&&(o.visible=a!==null),c!==null&&(c.visible=r!==null),h!==null&&(h.visible=s!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Ua;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class H1{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new je(e),this.density=t}clone(){return new H1(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class F1{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new je(e),this.near=t,this.far=i}clone(){return new F1(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Rd extends Wt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ei,this.environmentIntensity=1,this.environmentRotation=new Ei,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class P0{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=u0,this.updateRanges=[],this.version=0,this.uuid=Nr()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}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(e,t,i){e*=this.stride,i*=t.stride;for(let a=0,r=this.stride;ae.far||t.push({distance:c,point:zp.clone(),uv:Qa.getInterpolation(zp,lv,Hp,cv,w4,qT,R4,new de),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function uv(n,e,t,i,a,r){of.subVectors(n,t).addScalar(.5).multiply(i),a!==void 0?(Bp.x=r*of.x-a*of.y,Bp.y=a*of.x+r*of.y):Bp.copy(of),n.copy(e),n.x+=Bp.x,n.y+=Bp.y,n.applyMatrix4(WU)}const hv=new L,C4=new L;class YU extends Wt{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,a=t.length;i0){let i,a;for(i=1,a=t.length;i0){hv.setFromMatrixPosition(this.matrixWorld);const a=e.ray.origin.distanceTo(hv);this.getObjectForDistance(a).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){hv.setFromMatrixPosition(e.matrixWorld),C4.setFromMatrixPosition(this.matrixWorld);const i=hv.distanceTo(C4)/e.zoom;t[0].object.visible=!0;let a,r;for(a=1,r=t.length;a=s)t[a-1].object.visible=!1,t[a].object.visible=!0;else break}for(this._currentLevel=a-1;a1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}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){const i=t||PG.getNormalMatrix(e),a=this.coplanarPoint(KT).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(r),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)}}const Qc=new na,zG=new de(.5,.5),pv=new L;class Yd{constructor(e=new Go,t=new Go,i=new Go,a=new Go,r=new Go,s=new Go){this.planes=[e,t,i,a,r,s]}set(e,t,i,a,r,s){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(a),o[4].copy(r),o[5].copy(s),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=br,i=!1){const a=this.planes,r=e.elements,s=r[0],o=r[1],c=r[2],h=r[3],f=r[4],d=r[5],m=r[6],g=r[7],x=r[8],T=r[9],y=r[10],v=r[11],S=r[12],E=r[13],b=r[14],D=r[15];if(a[0].setComponents(h-s,g-f,v-x,D-S).normalize(),a[1].setComponents(h+s,g+f,v+x,D+S).normalize(),a[2].setComponents(h+o,g+d,v+T,D+E).normalize(),a[3].setComponents(h-o,g-d,v-T,D-E).normalize(),i)a[4].setComponents(c,m,y,b).normalize(),a[5].setComponents(h-c,g-m,v-y,D-b).normalize();else if(a[4].setComponents(h-c,g-m,v-y,D-b).normalize(),t===br)a[5].setComponents(h+c,g+m,v+y,D+b).normalize();else if(t===Ed)a[5].setComponents(c,m,y,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Qc.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Qc.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Qc)}intersectsSprite(e){Qc.center.set(0,0,0);const t=zG.distanceTo(e.center);return Qc.radius=.7071067811865476+t,Qc.applyMatrix4(e.matrixWorld),this.intersectsSphere(Qc)}intersectsSphere(e){const t=this.planes,i=e.center,a=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,pv.y=a.normal.y>0?e.max.y:e.min.y,pv.z=a.normal.z>0?e.max.z:e.min.z,a.distanceToPoint(pv)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const ks=new ke,Ws=new Yd;class k1{constructor(){this.coordinateSystem=br}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let i=0;i=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];s.push(o),this.index++,o.start=e,o.count=t,o.z=i,o.index=a}reset(){this.list.length=0,this.index=0}}const Xa=new ke,GG=new je(1,1,1),B4=new Yd,VG=new k1,mv=new ta,Jc=new na,Vp=new L,H4=new L,kG=new L,JT=new FG,ya=new oi,gv=[];function WG(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const a=n.count;for(let r=0;r65535?new Uint32Array(a):new Uint16Array(a);t.setIndex(new Ot(r,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const a=e.getAttribute(i),r=t.getAttribute(i);if(a.itemSize!==r.itemSize||a.normalized!==r.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ta);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,a=t.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let a=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(QT),a=this._availableInstanceIds.shift(),this._instanceInfo[a]=i):(a=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;Xa.identity().toArray(r.image.data,a*16),r.needsUpdate=!0;const s=this._colorsTexture;return s&&(GG.toArray(s.image.data,a*4),s.needsUpdate=!0),this._visibilityChanged=!0,a}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const a={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;a.vertexStart=this._nextVertexStart,a.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const s=e.getIndex();if(s!==null&&(a.indexStart=this._nextIndexStart,a.reservedIndexCount=i===-1?s.count:i),a.indexStart!==-1&&a.indexStart+a.reservedIndexCount>this._maxIndexCount||a.vertexStart+a.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let c;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(QT),c=this._availableGeometryIds.shift(),r[c]=a):(c=this._geometryCount,this._geometryCount++,r.push(a)),this.setGeometryAt(c,e),this._nextIndexStart=a.indexStart+a.reservedIndexCount,this._nextVertexStart=a.vertexStart+a.reservedVertexCount,c}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,a=i.getIndex()!==null,r=i.getIndex(),s=t.getIndex(),o=this._geometryInfo[e];if(a&&s.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const c=o.vertexStart,h=o.reservedVertexCount;o.vertexCount=t.getAttribute("position").count;for(const f in i.attributes){const d=t.getAttribute(f),m=i.getAttribute(f);WG(d,m,c);const g=d.itemSize;for(let x=d.count,T=h;x=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let a=0,r=i.length;ao).sort((s,o)=>i[s].vertexStart-i[o].vertexStart),r=this.geometry;for(let s=0,o=i.length;s=this._geometryCount)return null;const i=this.geometry,a=this._geometryInfo[e];if(a.boundingBox===null){const r=new ta,s=i.index,o=i.attributes.position;for(let c=a.start,h=a.start+a.count;c=this._geometryCount)return null;const i=this.geometry,a=this._geometryInfo[e];if(a.boundingSphere===null){const r=new na;this.getBoundingBoxAt(e,mv),mv.getCenter(r.center);const s=i.index,o=i.attributes.position;let c=0;for(let h=a.start,f=a.start+a.count;ho.active);if(Math.max(...i.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(c=>c.indexStart+c.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new Ct,this._initializeGeometry(r));const s=this.geometry;r.index&&$c(r.index.array,s.index.array);for(const o in r.attributes)$c(r.attributes[o].array,s.attributes[o].array)}raycast(e,t){const i=this._instanceInfo,a=this._geometryInfo,r=this.matrixWorld,s=this.geometry;ya.material=this.material,ya.geometry.index=s.index,ya.geometry.attributes=s.attributes,ya.geometry.boundingBox===null&&(ya.geometry.boundingBox=new ta),ya.geometry.boundingSphere===null&&(ya.geometry.boundingSphere=new na);for(let o=0,c=i.length;o({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,a,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=a.getIndex(),o=s===null?1:s.array.BYTES_PER_ELEMENT,c=this._instanceInfo,h=this._multiDrawStarts,f=this._multiDrawCounts,d=this._geometryInfo,m=this.perObjectFrustumCulled,g=this._indirectTexture,x=g.image.data,T=i.isArrayCamera?VG:B4;m&&!i.isArrayCamera&&(Xa.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),B4.setFromProjectionMatrix(Xa,i.coordinateSystem,i.reversedDepth));let y=0;if(this.sortObjects){Xa.copy(this.matrixWorld).invert(),Vp.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Xa),H4.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Xa);for(let E=0,b=c.length;E0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,s=a.length;ri)return;$T.applyMatrix4(n.matrixWorld);const h=e.ray.origin.distanceTo($T);if(!(he.far))return{distance:h,point:G4.clone().applyMatrix4(n.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:n}}const V4=new L,k4=new L;class ir extends so{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let a=0,r=t.count;a0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,s=a.length;ra.far)return;r.push({distance:h,distanceToRay:Math.sqrt(o),point:c,index:e,face:null,faceIndex:null,barycoord:null,object:s})}}class jU extends Nn{constructor(e,t,i,a,r=Ht,s=Ht,o,c,h){super(e,t,i,a,r,s,o,c,h),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const f=this;function d(){f.needsUpdate=!0,f._requestVideoFrameCallbackId=e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(d))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class XG extends jU{constructor(e,t,i,a,r,s,o,c){super({},e,t,i,a,r,s,o,c),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class YG extends Nn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Fn,this.minFilter=Fn,this.generateMipmaps=!1,this.needsUpdate=!0}}class X1 extends Nn{constructor(e,t,i,a,r,s,o,c,h,f,d,m){super(null,s,o,c,h,f,a,r,d,m),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class qG extends X1{constructor(e,t,i,a,r,s){super(e,t,i,r,s),this.isCompressedArrayTexture=!0,this.image.depth=a,this.wrapR=Pi,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class jG extends X1{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,rl),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class ZG extends Nn{constructor(e,t,i,a,r,s,o,c,h){super(e,t,i,a,r,s,o,c,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}class z0 extends Nn{constructor(e,t,i=Ds,a,r,s,o=Fn,c=Fn,h,f=yd,d=1){if(f!==yd&&f!==ju)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const m={width:e,height:t,depth:d};super(m,a,r,s,o,c,f,i,h),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Jl(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Cb extends Nn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Y1 extends Ct{constructor(e=1,t=1,i=4,a=8,r=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:a,heightSegments:r},t=Math.max(0,t),i=Math.max(1,Math.floor(i)),a=Math.max(3,Math.floor(a)),r=Math.max(1,Math.floor(r));const s=[],o=[],c=[],h=[],f=t/2,d=Math.PI/2*e,m=t,g=2*d+m,x=i*2+r,T=a+1,y=new L,v=new L;for(let S=0;S<=x;S++){let E=0,b=0,D=0,C=0;if(S<=i){const O=S/i,w=O*Math.PI/2;b=-f-e*Math.cos(w),D=e*Math.sin(w),C=-e*Math.cos(w),E=O*d}else if(S<=i+r){const O=(S-i)/r;b=-f+O*t,D=e,C=0,E=d+O*m}else{const O=(S-i-r)/i,w=O*Math.PI/2;b=f+e*Math.sin(w),D=e*Math.cos(w),C=e*Math.sin(w),E=d+m+O*d}const I=Math.max(0,Math.min(1,E/g));let P=0;S===0?P=.5/a:S===x&&(P=-.5/a);for(let O=0;O<=a;O++){const w=O/a,B=w*Math.PI*2,j=Math.sin(B),ee=Math.cos(B);v.x=-D*ee,v.y=b,v.z=D*j,o.push(v.x,v.y,v.z),y.set(-D*ee,C,D*j),y.normalize(),c.push(y.x,y.y,y.z),h.push(w+P,I)}if(S>0){const O=(S-1)*T;for(let w=0;w0&&E(!0),t>0&&E(!1)),this.setIndex(f),this.setAttribute("position",new xt(d,3)),this.setAttribute("normal",new xt(m,3)),this.setAttribute("uv",new xt(g,2));function S(){const b=new L,D=new L;let C=0;const I=(t-e)/i;for(let P=0;P<=r;P++){const O=[],w=P/r,B=w*(t-e)+e;for(let j=0;j<=a;j++){const ee=j/a,se=ee*c+o,re=Math.sin(se),W=Math.cos(se);D.x=B*re,D.y=-w*i+y,D.z=B*W,d.push(D.x,D.y,D.z),b.set(re,I,W).normalize(),m.push(b.x,b.y,b.z),g.push(ee,1-w),O.push(x++)}T.push(O)}for(let P=0;P0||O!==0)&&(f.push(w,B,ee),C+=3),(t>0||O!==r-1)&&(f.push(B,j,ee),C+=3)}h.addGroup(v,C,0),v+=C}function E(b){const D=x,C=new de,I=new L;let P=0;const O=b===!0?e:t,w=b===!0?1:-1;for(let j=1;j<=a;j++)d.push(0,y*w,0),m.push(0,w,0),g.push(.5,.5),x++;const B=x;for(let j=0;j<=a;j++){const se=j/a*c+o,re=Math.cos(se),W=Math.sin(se);I.x=O*W,I.y=y*w,I.z=O*re,d.push(I.x,I.y,I.z),m.push(0,w,0),C.x=re*.5+.5,C.y=W*.5*w+.5,g.push(C.x,C.y),x++}for(let j=0;j.9&&I<.1&&(E<.2&&(s[S+0]+=1),b<.2&&(s[S+2]+=1),D<.2&&(s[S+4]+=1))}}function m(S){r.push(S.x,S.y,S.z)}function g(S,E){const b=S*3;E.x=e[b+0],E.y=e[b+1],E.z=e[b+2]}function x(){const S=new L,E=new L,b=new L,D=new L,C=new de,I=new de,P=new de;for(let O=0,w=0;O0)c=a-1;else{c=a;break}if(a=c,i[a]===s)return a/(r-1);const f=i[a],m=i[a+1]-f,g=(s-f)/m;return(a+g)/(r-1)}getTangent(e,t){let a=e-1e-4,r=e+1e-4;a<0&&(a=0),r>1&&(r=1);const s=this.getPoint(a),o=this.getPoint(r),c=t||(s.isVector2?new de:new L);return c.copy(o).sub(s).normalize(),c}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new L,a=[],r=[],s=[],o=new L,c=new ke;for(let g=0;g<=e;g++){const x=g/e;a[g]=this.getTangentAt(x,new L)}r[0]=new L,s[0]=new L;let h=Number.MAX_VALUE;const f=Math.abs(a[0].x),d=Math.abs(a[0].y),m=Math.abs(a[0].z);f<=h&&(h=f,i.set(1,0,0)),d<=h&&(h=d,i.set(0,1,0)),m<=h&&i.set(0,0,1),o.crossVectors(a[0],i).normalize(),r[0].crossVectors(a[0],o),s[0].crossVectors(a[0],r[0]);for(let g=1;g<=e;g++){if(r[g]=r[g-1].clone(),s[g]=s[g-1].clone(),o.crossVectors(a[g-1],a[g]),o.length()>Number.EPSILON){o.normalize();const x=Math.acos(Lt(a[g-1].dot(a[g]),-1,1));r[g].applyMatrix4(c.makeRotationAxis(o,x))}s[g].crossVectors(a[g],r[g])}if(t===!0){let g=Math.acos(Lt(r[0].dot(r[e]),-1,1));g/=e,a[0].dot(o.crossVectors(r[0],r[e]))>0&&(g=-g);for(let x=1;x<=e;x++)r[x].applyMatrix4(c.makeRotationAxis(a[x],g*x)),s[x].crossVectors(a[x],r[x])}return{tangents:a,normals:r,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Z1 extends Ls{constructor(e=0,t=0,i=1,a=1,r=0,s=Math.PI*2,o=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=a,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=o,this.aRotation=c}getPoint(e,t=new de){const i=t,a=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)a;)r-=a;r0?0:(Math.floor(Math.abs(o)/r)+1)*r:c===0&&o===r-1&&(o=r-2,c=1);let h,f;this.closed||o>0?h=a[(o-1)%r]:(Mv.subVectors(a[0],a[1]).add(a[0]),h=Mv);const d=a[o%r],m=a[(o+1)%r];if(this.closed||o+2a.length-2?a.length-1:s+1],d=a[s>a.length-3?a.length-1:s+2];return i.set(Y4(o,c.x,h.x,f.x,d.x),Y4(o,c.y,h.y,f.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const s=a[r]-i,o=this.curves[r],c=o.getLength(),h=c===0?0:1-s/c;return o.getPointAt(h,t)}r++}return null}getLength(){const 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;const e=[];let t=0;for(let i=0,a=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const d=h.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(h);const f=h.getPoint(1);return this.currentPoint.copy(f),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Pu extends Fx{constructor(e){super(e),this.uuid=Nr(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,a=this.holes.length;i80*t){o=n[0],c=n[1];let f=o,d=c;for(let m=t;mf&&(f=g),x>d&&(d=x)}h=Math.max(f-o,d-c),h=h!==0?32767/h:0}return d0(r,s,t,o,c,h,0),s}function t6(n,e,t,i,a){let r;if(a===xV(n,e,t,i)>0)for(let s=e;s=e;s-=i)r=q4(s/i|0,n[s],n[s+1],r);return r&&Cd(r,r.next)&&(m0(r),r=r.next),r}function Ku(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Cd(t,t.next)||fi(t.prev,t,t.next)===0)){if(m0(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function d0(n,e,t,i,a,r,s){if(!n)return;!s&&r&&dV(n,i,a,r);let o=n;for(;n.prev!==n.next;){const c=n.prev,h=n.next;if(r?rV(n,i,a,r):aV(n)){e.push(c.i,n.i,h.i),m0(n),n=h.next,o=h.next;continue}if(n=h,n===o){s?s===1?(n=sV(Ku(n),e),d0(n,e,t,i,a,r,2)):s===2&&oV(n,e,t,i,a,r):d0(Ku(n),e,t,i,a,r,1);break}}}function aV(n){const e=n.prev,t=n,i=n.next;if(fi(e,t,i)>=0)return!1;const a=e.x,r=t.x,s=i.x,o=e.y,c=t.y,h=i.y,f=Math.min(a,r,s),d=Math.min(o,c,h),m=Math.max(a,r,s),g=Math.max(o,c,h);let x=i.next;for(;x!==e;){if(x.x>=f&&x.x<=m&&x.y>=d&&x.y<=g&&um(a,o,r,c,s,h,x.x,x.y)&&fi(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function rV(n,e,t,i){const a=n.prev,r=n,s=n.next;if(fi(a,r,s)>=0)return!1;const o=a.x,c=r.x,h=s.x,f=a.y,d=r.y,m=s.y,g=Math.min(o,c,h),x=Math.min(f,d,m),T=Math.max(o,c,h),y=Math.max(f,d,m),v=cE(g,x,e,t,i),S=cE(T,y,e,t,i);let E=n.prevZ,b=n.nextZ;for(;E&&E.z>=v&&b&&b.z<=S;){if(E.x>=g&&E.x<=T&&E.y>=x&&E.y<=y&&E!==a&&E!==s&&um(o,f,c,d,h,m,E.x,E.y)&&fi(E.prev,E,E.next)>=0||(E=E.prevZ,b.x>=g&&b.x<=T&&b.y>=x&&b.y<=y&&b!==a&&b!==s&&um(o,f,c,d,h,m,b.x,b.y)&&fi(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;E&&E.z>=v;){if(E.x>=g&&E.x<=T&&E.y>=x&&E.y<=y&&E!==a&&E!==s&&um(o,f,c,d,h,m,E.x,E.y)&&fi(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;b&&b.z<=S;){if(b.x>=g&&b.x<=T&&b.y>=x&&b.y<=y&&b!==a&&b!==s&&um(o,f,c,d,h,m,b.x,b.y)&&fi(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function sV(n,e){let t=n;do{const i=t.prev,a=t.next.next;!Cd(i,a)&&i6(i,t,t.next,a)&&p0(i,a)&&p0(a,i)&&(e.push(i.i,t.i,a.i),m0(t),m0(t.next),t=n=a),t=t.next}while(t!==n);return Ku(t)}function oV(n,e,t,i,a,r){let s=n;do{let o=s.next.next;for(;o!==s.prev;){if(s.i!==o.i&&gV(s,o)){let c=a6(s,o);s=Ku(s,s.next),c=Ku(c,c.next),d0(s,e,t,i,a,r,0),d0(c,e,t,i,a,r,0);return}o=o.next}s=s.next}while(s!==n)}function lV(n,e,t,i){const a=[];for(let r=0,s=e.length;r=t.next.y&&t.next.y!==t.y){const d=t.x+(a-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=i&&d>r&&(r=d,s=t.x=t.x&&t.x>=c&&i!==t.x&&n6(as.x||t.x===s.x&&fV(s,t)))&&(s=t,f=d)}t=t.next}while(t!==o);return s}function fV(n,e){return fi(n.prev,n,e.prev)<0&&fi(e.next,n,n.next)<0}function dV(n,e,t,i){let a=n;do a.z===0&&(a.z=cE(a.x,a.y,e,t,i)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==n);a.prevZ.nextZ=null,a.prevZ=null,pV(a)}function pV(n){let e,t=1;do{let i=n,a;n=null;let r=null;for(e=0;i;){e++;let s=i,o=0;for(let h=0;h0||c>0&&s;)o!==0&&(c===0||!s||i.z<=s.z)?(a=i,i=i.nextZ,o--):(a=s,s=s.nextZ,c--),r?r.nextZ=a:n=a,a.prevZ=r,r=a;i=s}r.nextZ=null,t*=2}while(e>1);return n}function cE(n,e,t,i,a){return n=(n-t)*a|0,e=(e-i)*a|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function mV(n){let e=n,t=n;do(e.x=(n-s)*(r-o)&&(n-s)*(i-o)>=(t-s)*(e-o)&&(t-s)*(r-o)>=(a-s)*(i-o)}function um(n,e,t,i,a,r,s,o){return!(n===s&&e===o)&&n6(n,e,t,i,a,r,s,o)}function gV(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!vV(n,e)&&(p0(n,e)&&p0(e,n)&&_V(n,e)&&(fi(n.prev,n,e.prev)||fi(n,e.prev,e))||Cd(n,e)&&fi(n.prev,n,n.next)>0&&fi(e.prev,e,e.next)>0)}function fi(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Cd(n,e){return n.x===e.x&&n.y===e.y}function i6(n,e,t,i){const a=Av(fi(n,e,t)),r=Av(fi(n,e,i)),s=Av(fi(t,i,n)),o=Av(fi(t,i,e));return!!(a!==r&&s!==o||a===0&&bv(n,t,e)||r===0&&bv(n,i,e)||s===0&&bv(t,n,i)||o===0&&bv(t,e,i))}function bv(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Av(n){return n>0?1:n<0?-1:0}function vV(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&i6(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function p0(n,e){return fi(n.prev,n,n.next)<0?fi(n,e,n.next)>=0&&fi(n,n.prev,e)>=0:fi(n,e,n.prev)<0||fi(n,n.next,e)<0}function _V(n,e){let t=n,i=!1;const a=(n.x+e.x)/2,r=(n.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&a<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function a6(n,e){const t=uE(n.i,n.x,n.y),i=uE(e.i,e.x,e.y),a=n.next,r=e.prev;return n.next=e,e.prev=n,t.next=a,a.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function q4(n,e,t,i){const a=uE(n,e,t);return i?(a.next=i.next,a.prev=i,i.next.prev=a,i.next=a):(a.prev=a,a.next=a),a}function m0(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function uE(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function xV(n,e,t,i){let a=0;for(let r=e,s=t-i;r2&&n[e-1].equals(n[0])&&n.pop()}function Z4(n,e){for(let t=0;tNumber.EPSILON){const Ee=Math.sqrt(U),Le=Math.sqrt(ct*ct+k*k),ye=G.x-Je/Ee,vt=G.y+$e/Ee,qe=be.x-k/Le,_t=be.y+ct/Le,pt=((qe-ye)*k-(_t-vt)*ct)/($e*k-Je*ct);De=ye+$e*pt-Te.x,Fe=vt+Je*pt-Te.y;const Ie=De*De+Fe*Fe;if(Ie<=2)return new de(De,Fe);Be=Math.sqrt(Ie/2)}else{let Ee=!1;$e>Number.EPSILON?ct>Number.EPSILON&&(Ee=!0):$e<-Number.EPSILON?ct<-Number.EPSILON&&(Ee=!0):Math.sign(Je)===Math.sign(k)&&(Ee=!0),Ee?(De=-Je,Fe=$e,Be=Math.sqrt(U)):(De=$e,Fe=Je,Be=Math.sqrt(U/2))}return new de(De/Be,Fe/Be)}const oe=[];for(let Te=0,G=re.length,be=G-1,De=Te+1;Te=0;Te--){const G=Te/y,be=g*Math.cos(G*Math.PI/2),De=x*Math.sin(G*Math.PI/2)+T;for(let Fe=0,Be=re.length;Fe=0;){const De=be;let Fe=be-1;Fe<0&&(Fe=Te.length-1);for(let Be=0,$e=f+y*2;Be<$e;Be++){const Je=te*Be,ct=te*(Be+1),k=G+De+Je,U=G+Fe+Je,ce=G+Fe+ct,Ee=G+De+ct;Mt(k,U,ce,Ee)}}}function ue(Te,G,be){c.push(Te),c.push(G),c.push(be)}function it(Te,G,be){ot(Te),ot(G),ot(be);const De=a.length/3,Fe=S.generateTopUV(i,a,De-3,De-2,De-1);Ke(Fe[0]),Ke(Fe[1]),Ke(Fe[2])}function Mt(Te,G,be,De){ot(Te),ot(G),ot(De),ot(G),ot(be),ot(De);const Fe=a.length/3,Be=S.generateSideWallUV(i,a,Fe-6,Fe-3,Fe-2,Fe-1);Ke(Be[0]),Ke(Be[1]),Ke(Be[3]),Ke(Be[1]),Ke(Be[2]),Ke(Be[3])}function ot(Te){a.push(c[Te*3+0]),a.push(c[Te*3+1]),a.push(c[Te*3+2])}function Ke(Te){r.push(Te.x),r.push(Te.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return TV(t,i,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r0)&&g.push(E,b,C),(v!==i-1||c0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,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.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,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}}class o6 extends qn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new je(16777215),this.specular=new je(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new je(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ll,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ei,this.combine=O0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,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.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}}class l6 extends qn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new je(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new je(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ll,this.normalScale=new de(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.fog=!0,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.fog=e.fog,this}}class Pb extends qn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ll,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=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}}class c6 extends qn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new je(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new je(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ll,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ei,this.combine=O0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,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.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.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}}class zb extends qn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Mc,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=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}}class Bb extends qn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class u6 extends qn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new je(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ll,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class h6 extends Bi{constructor(e){super(),this.isLineDashedMaterial=!0,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}}function bu(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function f6(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function d6(n){function e(a,r){return n[a]-n[r]}const t=n.length,i=new Array(t);for(let a=0;a!==t;++a)i[a]=a;return i.sort(e),i}function hE(n,e,t){const i=n.length,a=new n.constructor(i);for(let r=0,s=0;s!==i;++r){const o=t[r]*e;for(let c=0;c!==e;++c)a[s++]=n[o+c]}return a}function Hb(n,e,t,i){let a=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[a++];if(r===void 0)return;let s=r[i];if(s!==void 0)if(Array.isArray(s))do s=r[i],s!==void 0&&(e.push(r.time),t.push(...s)),r=n[a++];while(r!==void 0);else if(s.toArray!==void 0)do s=r[i],s!==void 0&&(e.push(r.time),s.toArray(t,t.length)),r=n[a++];while(r!==void 0);else do s=r[i],s!==void 0&&(e.push(r.time),t.push(s)),r=n[a++];while(r!==void 0)}function MV(n,e,t,i,a=30){const r=n.clone();r.name=e;const s=[];for(let c=0;c=i)){d.push(h.times[g]);for(let T=0;Tr.tracks[c].times[0]&&(o=r.tracks[c].times[0]);for(let c=0;c=o.times[x]){const v=x*d+f,S=v+d-f;T=o.values.slice(v,S)}else{const v=o.createInterpolant(),S=f,E=d-f;v.evaluate(r),T=v.resultBuffer.slice(S,E)}c==="quaternion"&&new St().fromArray(T).normalize().conjugate().toArray(T);const y=h.times.length;for(let v=0;v=r)){const o=t[1];e=r)break t}s=i,i=0;break n}break e}for(;i>>1;et;)--s;if(++s,r!==0||s!==a){r>=s&&(s=Math.max(s,1),r=s-1);const o=this.getValueSize();this.times=i.slice(r,s),this.values=this.values.slice(r*o,s*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(Bt("KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,a=this.values,r=i.length;r===0&&(Bt("KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let o=0;o!==r;o++){const c=i[o];if(typeof c=="number"&&isNaN(c)){Bt("KeyframeTrack: Time is not a valid number.",this,o,c),e=!1;break}if(s!==null&&s>c){Bt("KeyframeTrack: Out of order keys.",this,o,c,s),e=!1;break}s=c}if(a!==void 0&&f6(a))for(let o=0,c=a.length;o!==c;++o){const h=a[o];if(isNaN(h)){Bt("KeyframeTrack: Value is not a valid number.",this,o,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),a=this.getInterpolation()===m_,r=e.length-1;let s=1;for(let o=1;o0){e[s]=e[r];for(let o=r*i,c=s*i,h=0;h!==i;++h)t[c+h]=t[o+h];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=t.slice(0,s*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,a=new i(this.name,e,t);return a.createInterpolant=this.createInterpolant,a}}cs.prototype.ValueTypeName="";cs.prototype.TimeBufferType=Float32Array;cs.prototype.ValueBufferType=Float32Array;cs.prototype.DefaultInterpolation=Td;class fh extends cs{constructor(e,t,i){super(e,t,i)}}fh.prototype.ValueTypeName="bool";fh.prototype.ValueBufferType=Array;fh.prototype.DefaultInterpolation=Sd;fh.prototype.InterpolantFactoryMethodLinear=void 0;fh.prototype.InterpolantFactoryMethodSmooth=void 0;class Gb extends cs{constructor(e,t,i,a){super(e,t,i,a)}}Gb.prototype.ValueTypeName="color";class xc extends cs{constructor(e,t,i,a){super(e,t,i,a)}}xc.prototype.ValueTypeName="number";class g6 extends qd{constructor(e,t,i,a){super(e,t,i,a)}interpolate_(e,t,i,a){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,c=(i-t)/(a-t);let h=e*o;for(let f=h+o;h!==f;h+=4)St.slerpFlat(r,0,s,h-o,s,h,c);return r}}class yc extends cs{constructor(e,t,i,a){super(e,t,i,a)}InterpolantFactoryMethodLinear(e){return new g6(this.times,this.values,this.getValueSize(),e)}}yc.prototype.ValueTypeName="quaternion";yc.prototype.InterpolantFactoryMethodSmooth=void 0;class dh extends cs{constructor(e,t,i){super(e,t,i)}}dh.prototype.ValueTypeName="string";dh.prototype.ValueBufferType=Array;dh.prototype.DefaultInterpolation=Sd;dh.prototype.InterpolantFactoryMethodLinear=void 0;dh.prototype.InterpolantFactoryMethodSmooth=void 0;class Qu extends cs{constructor(e,t,i,a){super(e,t,i,a)}}Qu.prototype.ValueTypeName="vector";class Ju{constructor(e="",t=-1,i=[],a=z1){this.name=e,this.tracks=i,this.duration=t,this.blendMode=a,this.uuid=Nr(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,a=1/(e.fps||1);for(let s=0,o=i.length;s!==o;++s)t.push(RV(i[s]).scale(a));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r.userData=JSON.parse(e.userData||"{}"),r}static toJSON(e){const t=[],i=e.tracks,a={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let r=0,s=i.length;r!==s;++r)t.push(cs.toJSON(i[r]));return a}static CreateFromMorphTargetSequence(e,t,i,a){const r=t.length,s=[];for(let o=0;o1){const d=f[1];let m=a[d];m||(a[d]=m=[]),m.push(h)}}const s=[];for(const o in a)s.push(this.CreateFromMorphTargetSequence(o,a[o],t,i));return s}static parseAnimation(e,t){if(ut("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return Bt("AnimationClip: No animation in JSONLoader data."),null;const i=function(d,m,g,x,T){if(g.length!==0){const y=[],v=[];Hb(g,y,v,x),y.length!==0&&T.push(new d(m,y,v))}},a=[],r=e.name||"default",s=e.fps||30,o=e.blendMode;let c=e.length||-1;const h=e.hierarchy||[];for(let d=0;d{t&&t(r),this.manager.itemEnd(e)},0),r;if(Lo[e]!==void 0){Lo[e].push({onLoad:t,onProgress:i,onError:a});return}Lo[e]=[],Lo[e].push({onLoad:t,onProgress:i,onError:a});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,c=this.responseType;fetch(s).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&ut("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const f=Lo[e],d=h.body.getReader(),m=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),g=m?parseInt(m):0,x=g!==0;let T=0;const y=new ReadableStream({start(v){S();function S(){d.read().then(({done:E,value:b})=>{if(E)v.close();else{T+=b.byteLength;const D=new ProgressEvent("progress",{lengthComputable:x,loaded:T,total:g});for(let C=0,I=f.length;C{v.error(E)})}}});return new Response(y)}else throw new CV(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(c){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(f=>new DOMParser().parseFromString(f,o));case"json":return h.json();default:if(o==="")return h.text();{const d=/charset="?([^;"\s]*)"?/i.exec(o),m=d&&d[1]?d[1].toLowerCase():void 0,g=new TextDecoder(m);return h.arrayBuffer().then(x=>g.decode(x))}}}).then(h=>{no.add(`file:${e}`,h);const f=Lo[e];delete Lo[e];for(let d=0,m=f.length;d{const f=Lo[e];if(f===void 0)throw this.manager.itemError(e),h;delete Lo[e];for(let d=0,m=f.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class NV extends Mi{constructor(e){super(e)}load(e,t,i,a){const r=this,s=new os(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(o){try{t(r.parse(JSON.parse(o)))}catch(c){a?a(c):Bt(c),r.manager.itemError(e)}},i,a)}parse(e){const t=[];for(let i=0;i0:a.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const r in e.uniforms){const s=e.uniforms[r];switch(a.uniforms[r]={},s.type){case"t":a.uniforms[r].value=i(s.value);break;case"c":a.uniforms[r].value=new je().setHex(s.value);break;case"v2":a.uniforms[r].value=new de().fromArray(s.value);break;case"v3":a.uniforms[r].value=new L().fromArray(s.value);break;case"v4":a.uniforms[r].value=new zt().fromArray(s.value);break;case"m3":a.uniforms[r].value=new Et().fromArray(s.value);break;case"m4":a.uniforms[r].value=new ke().fromArray(s.value);break;default:a.uniforms[r].value=s.value}}if(e.defines!==void 0&&(a.defines=e.defines),e.vertexShader!==void 0&&(a.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(a.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(a.glslVersion=e.glslVersion),e.extensions!==void 0)for(const r in e.extensions)a.extensions[r]=e.extensions[r];if(e.lights!==void 0&&(a.lights=e.lights),e.clipping!==void 0&&(a.clipping=e.clipping),e.size!==void 0&&(a.size=e.size),e.sizeAttenuation!==void 0&&(a.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(a.map=i(e.map)),e.matcap!==void 0&&(a.matcap=i(e.matcap)),e.alphaMap!==void 0&&(a.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(a.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(a.bumpScale=e.bumpScale),e.normalMap!==void 0&&(a.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(a.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),a.normalScale=new de().fromArray(r)}return e.displacementMap!==void 0&&(a.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(a.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(a.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(a.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(a.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(a.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(a.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(a.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(a.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(a.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(a.envMap=i(e.envMap)),e.envMapRotation!==void 0&&a.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(a.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(a.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(a.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(a.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(a.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(a.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(a.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(a.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(a.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(a.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(a.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(a.clearcoatNormalScale=new de().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(a.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(a.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(a.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(a.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(a.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(a.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(a.sheenRoughnessMap=i(e.sheenRoughnessMap)),a}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return ry.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:s6,SpriteMaterial:bb,RawShaderMaterial:hh,ShaderMaterial:Vi,PointsMaterial:W1,MeshPhysicalMaterial:ls,MeshStandardMaterial:V0,MeshPhongMaterial:o6,MeshToonMaterial:l6,MeshNormalMaterial:Pb,MeshLambertMaterial:c6,MeshDepthMaterial:zb,MeshDistanceMaterial:Bb,MeshBasicMaterial:Ia,MeshMatcapMaterial:u6,LineDashedMaterial:h6,LineBasicMaterial:Bi,Material:qn};return new t[e]}}class uc{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||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 M6 extends Ct{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class b6 extends Mi{constructor(e){super(e)}load(e,t,i,a){const r=this,s=new os(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(e,function(o){try{t(r.parse(JSON.parse(o)))}catch(c){a?a(c):Bt(c),r.manager.itemError(e)}},i,a)}parse(e){const t={},i={};function a(g,x){if(t[x]!==void 0)return t[x];const y=g.interleavedBuffers[x],v=r(g,y.buffer),S=Wf(y.type,v),E=new P0(S,y.stride);return E.uuid=y.uuid,t[x]=E,E}function r(g,x){if(i[x]!==void 0)return i[x];const y=g.arrayBuffers[x],v=new Uint32Array(y).buffer;return i[x]=v,v}const s=e.isInstancedBufferGeometry?new M6:new Ct,o=e.data.index;if(o!==void 0){const g=Wf(o.type,o.array);s.setIndex(new Ot(g,1))}const c=e.data.attributes;for(const g in c){const x=c[g];let T;if(x.isInterleavedBufferAttribute){const y=a(e.data,x.data);T=new _c(y,x.itemSize,x.offset,x.normalized)}else{const y=Wf(x.type,x.array),v=x.isInstancedBufferAttribute?Zu:Ot;T=new v(y,x.itemSize,x.normalized)}x.name!==void 0&&(T.name=x.name),x.usage!==void 0&&T.setUsage(x.usage),s.setAttribute(g,T)}const h=e.data.morphAttributes;if(h)for(const g in h){const x=h[g],T=[];for(let y=0,v=x.length;y0){const c=new Vb(t);r=new Nd(c),r.setCrossOrigin(this.crossOrigin);for(let h=0,f=e.length;h0){a=new Nd(this.manager),a.setCrossOrigin(this.crossOrigin);for(let s=0,o=e.length;s{let y=null,v=null;return T.boundingBox!==void 0&&(y=new ta().fromJSON(T.boundingBox)),T.boundingSphere!==void 0&&(v=new na().fromJSON(T.boundingSphere)),{...T,boundingBox:y,boundingSphere:v}}),s._instanceInfo=e.instanceInfo,s._availableInstanceIds=e._availableInstanceIds,s._availableGeometryIds=e._availableGeometryIds,s._nextIndexStart=e.nextIndexStart,s._nextVertexStart=e.nextVertexStart,s._geometryCount=e.geometryCount,s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._matricesTexture=h(e.matricesTexture.uuid),s._indirectTexture=h(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(s._colorsTexture=h(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(s.boundingSphere=new na().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(s.boundingBox=new ta().fromJSON(e.boundingBox));break;case"LOD":s=new YU;break;case"Line":s=new so(o(e.geometry),c(e.material));break;case"LineLoop":s=new wb(o(e.geometry),c(e.material));break;case"LineSegments":s=new ir(o(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new Rb(o(e.geometry),c(e.material));break;case"Sprite":s=new XU(c(e.material));break;case"Group":s=new Ua;break;case"Bone":s=new V1;break;default:s=new Wt}if(s.uuid=e.uuid,e.name!==void 0&&(s.name=e.name),e.matrix!==void 0?(s.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(e.position!==void 0&&s.position.fromArray(e.position),e.rotation!==void 0&&s.rotation.fromArray(e.rotation),e.quaternion!==void 0&&s.quaternion.fromArray(e.quaternion),e.scale!==void 0&&s.scale.fromArray(e.scale)),e.up!==void 0&&s.up.fromArray(e.up),e.castShadow!==void 0&&(s.castShadow=e.castShadow),e.receiveShadow!==void 0&&(s.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(s.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(s.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(s.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(s.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(s.visible=e.visible),e.frustumCulled!==void 0&&(s.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(s.renderOrder=e.renderOrder),e.userData!==void 0&&(s.userData=e.userData),e.layers!==void 0&&(s.layers.mask=e.layers),e.children!==void 0){const m=e.children;for(let g=0;g"u"&&ut("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&ut("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,i,a){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,s=no.get(`image-bitmap:${e}`);if(s!==void 0){if(r.manager.itemStart(e),s.then){s.then(h=>{if(s2.has(s)===!0)a&&a(s2.get(s)),r.manager.itemError(e),r.manager.itemEnd(e);else return t&&t(h),r.manager.itemEnd(e),h});return}return setTimeout(function(){t&&t(s),r.manager.itemEnd(e)},0),s}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader,o.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const c=fetch(e,o).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(h){return no.add(`image-bitmap:${e}`,h),t&&t(h),r.manager.itemEnd(e),h}).catch(function(h){a&&a(h),s2.set(c,h),no.remove(`image-bitmap:${e}`),r.manager.itemError(e),r.manager.itemEnd(e)});no.add(`image-bitmap:${e}`,c),r.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let wv;class jb{static getContext(){return wv===void 0&&(wv=new(window.AudioContext||window.webkitAudioContext)),wv}static setContext(e){wv=e}}class BV extends Mi{constructor(e){super(e)}load(e,t,i,a){const r=this,s=new os(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(c){try{const h=c.slice(0);jb.getContext().decodeAudioData(h,function(d){t(d)}).catch(o)}catch(h){o(h)}},i,a);function o(c){a?a(c):Bt(c),r.manager.itemError(e)}}}const iN=new ke,aN=new ke,eu=new ke;class HV{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new hi,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new hi,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){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,eu.copy(e.projectionMatrix);const a=t.eyeSep/2,r=a*t.near/t.focus,s=t.near*Math.tan(Uu*t.fov*.5)/t.zoom;let o,c;aN.elements[12]=-a,iN.elements[12]=a,o=-s*t.aspect+r,c=s*t.aspect+r,eu.elements[0]=2*t.near/(c-o),eu.elements[8]=(c+o)/(c-o),this.cameraL.projectionMatrix.copy(eu),o=-s*t.aspect-r,c=s*t.aspect-r,eu.elements[0]=2*t.near/(c-o),eu.elements[8]=(c+o)/(c-o),this.cameraR.projectionMatrix.copy(eu)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(aN),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(iN)}}class w6 extends hi{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Zb{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),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;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}const tu=new L,o2=new St,FV=new L,nu=new L,iu=new L;class GV extends Wt{constructor(){super(),this.type="AudioListener",this.context=jb.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Zb}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(tu,o2,FV),nu.set(0,0,-1).applyQuaternion(o2),iu.set(0,1,0).applyQuaternion(o2),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(tu.x,i),t.positionY.linearRampToValueAtTime(tu.y,i),t.positionZ.linearRampToValueAtTime(tu.z,i),t.forwardX.linearRampToValueAtTime(nu.x,i),t.forwardY.linearRampToValueAtTime(nu.y,i),t.forwardZ.linearRampToValueAtTime(nu.z,i),t.upX.linearRampToValueAtTime(iu.x,i),t.upY.linearRampToValueAtTime(iu.y,i),t.upZ.linearRampToValueAtTime(iu.z,i)}else t.setPosition(tu.x,tu.y,tu.z),t.setOrientation(nu.x,nu.y,nu.z,iu.x,iu.y,iu.z)}}class R6 extends Wt{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(this.isPlaying===!0){ut("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){ut("Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){ut("Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){ut("Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,a,this._addIndex*t,1,t);for(let c=t,h=t+t;c!==h;++c)if(i[c]!==i[c+t]){o.setValue(i,a);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,a=i*this._origIndex;e.getValue(t,a);for(let r=i,s=a;r!==s;++r)t[r]=t[a+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let s=0;s!==r;++s)e[t+s]=e[i+s]}_slerp(e,t,i,a){St.slerpFlat(e,t,e,t,e,i,a)}_slerpAdditive(e,t,i,a,r){const s=this._workIndex*r;St.multiplyQuaternionsFlat(e,s,e,t,e,i),St.slerpFlat(e,t,e,t,e,s,a)}_lerp(e,t,i,a,r){const s=1-a;for(let o=0;o!==r;++o){const c=t+o;e[c]=e[c]*s+e[i+o]*a}}_lerpAdditive(e,t,i,a,r){for(let s=0;s!==r;++s){const o=t+s;e[o]=e[o]+e[i+s]*a}}}const Kb="\\[\\]\\.:\\/",XV=new RegExp("["+Kb+"]","g"),Qb="[^"+Kb+"]",YV="[^"+Kb.replace("\\.","")+"]",qV=/((?:WC+[\/:])*)/.source.replace("WC",Qb),jV=/(WCOD+)?/.source.replace("WCOD",YV),ZV=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Qb),KV=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Qb),QV=new RegExp("^"+qV+jV+ZV+KV+"$"),JV=["material","materials","bones","map"];class $V{constructor(e,t,i){const a=i||fn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,a)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,a=this._bindings[i];a!==void 0&&a.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let a=this._targetGroup.nCachedObjects_,r=i.length;a!==r;++a)i[a].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class fn{constructor(e,t,i){this.path=t,this.parsedPath=i||fn.parseTrackName(t),this.node=fn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new fn.Composite(e,t,i):new fn(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(XV,"")}static parseTrackName(e){const t=QV.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},a=i.nodeName&&i.nodeName.lastIndexOf(".");if(a!==void 0&&a!==-1){const r=i.nodeName.substring(a+1);JV.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,a),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let s=0;s=r){const d=r++,m=e[d];t[m.uuid]=f,e[f]=m,t[h]=d,e[d]=c;for(let g=0,x=a;g!==x;++g){const T=i[g],y=T[d],v=T[f];T[f]=y,T[d]=v}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,a=i.length;let r=this.nCachedObjects_,s=e.length;for(let o=0,c=arguments.length;o!==c;++o){const h=arguments[o],f=h.uuid,d=t[f];if(d!==void 0)if(delete t[f],d0&&(t[g.uuid]=d),e[d]=g,e.pop();for(let x=0,T=a;x!==T;++x){const y=i[x];y[d]=y[m],y.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const i=this._bindingsIndicesByPath;let a=i[e];const r=this._bindings;if(a!==void 0)return r[a];const s=this._paths,o=this._parsedPaths,c=this._objects,h=c.length,f=this.nCachedObjects_,d=new Array(h);a=r.length,i[e]=a,s.push(e),o.push(t),r.push(d);for(let m=f,g=c.length;m!==g;++m){const x=c[m];d[m]=new fn(x,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const a=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length-1,c=s[o],h=e[o];t[h]=i,s[i]=c,s.pop(),r[i]=r[o],r.pop(),a[i]=a[o],a.pop()}}}class N6{constructor(e,t,i=null,a=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=a;const r=t.tracks,s=r.length,o=new Array(s),c={endingStart:Eu,endingEnd:Eu};for(let h=0;h!==s;++h){const f=r[h].createInterpolant(null);o[h]=f,f.settings=c}this._interpolantSettings=c,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=TU,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&&this.timeScale!==0&&this._startTime===null&&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=!1){if(e.fadeOut(t),this.fadeIn(t),i===!0){const a=this._clip.duration,r=e._clip.duration,s=r/a,o=a/r;e.warp(1,s,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,i=!1){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(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){const a=this._mixer,r=a.time,s=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=a._lendControlInterpolant(),this._timeScaleInterpolant=o);const c=o.parameterPositions,h=o.sampleValues;return c[0]=r,c[1]=r+i,h[0]=e/s,h[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,a){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const c=(e-r)*i;c<0||i===0?t=0:(this._startTime=null,t=i*c)}t*=this._updateTimeScale(e);const s=this._updateTime(t),o=this._updateWeight(e);if(o>0){const c=this._interpolants,h=this._propertyBindings;switch(this.blendMode){case vb:for(let f=0,d=c.length;f!==d;++f)c[f].evaluate(s),h[f].accumulateAdditive(o);break;case z1:default:for(let f=0,d=c.length;f!==d;++f)c[f].evaluate(s),h[f].accumulate(a,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const a=i.evaluate(e)[0];t*=a,e>i.parameterPositions[1]&&(this.stopFading(),a===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const a=i.evaluate(e)[0];t*=a,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let a=this.time+e,r=this._loopCount;const s=i===EU;if(e===0)return r===-1?a:s&&(r&1)===1?t-a:a;if(i===gb){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(a>=t)a=t;else if(a<0)a=0;else{this.time=a;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),a>=t||a<0){const o=Math.floor(a/t);a-=t*o,r+=Math.abs(o);const c=this.repetitions-r;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,a=e>0?t:0,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){const h=e<0;this._setEndings(h,!h,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=a,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=a;if(s&&(r&1)===1)return t-a}return a}_setEndings(e,t,i){const a=this._interpolantSettings;i?(a.endingStart=Mu,a.endingEnd=Mu):(e?a.endingStart=this.zeroSlopeAtStart?Mu:Eu:a.endingStart=l0,t?a.endingEnd=this.zeroSlopeAtEnd?Mu:Eu:a.endingEnd=l0)}_scheduleFading(e,t,i){const a=this._mixer,r=a.time;let s=this._weightInterpolant;s===null&&(s=a._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,c=s.sampleValues;return o[0]=r,c[0]=t,o[1]=r+e,c[1]=i,this}}const tk=new Float32Array(1);class D6 extends nr{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,a=e._clip.tracks,r=a.length,s=e._propertyBindings,o=e._interpolants,c=i.uuid,h=this._bindingsByRootAndName;let f=h[c];f===void 0&&(f={},h[c]=f);for(let d=0;d!==r;++d){const m=a[d],g=m.name;let x=f[g];if(x!==void 0)++x.referenceCount,s[d]=x;else{if(x=s[d],x!==void 0){x._cacheIndex===null&&(++x.referenceCount,this._addInactiveBinding(x,c,g));continue}const T=t&&t._propertyBindings[d].binding.parsedPath;x=new C6(fn.create(i,g,T),m.ValueTypeName,m.getValueSize()),++x.referenceCount,this._addInactiveBinding(x,c,g),s[d]=x}o[d].resultBuffer=x.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,a=e._clip.uuid,r=this._actionsByClip[a];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,a,i)}const t=e._propertyBindings;for(let i=0,a=t.length;i!==a;++i){const r=t[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,a=t.length;i!==a;++i){const r=t[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}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){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,a=this.time+=e,r=Math.sign(e),s=this._accuIndex^=1;for(let h=0;h!==i;++h)t[h]._update(a,e,r,s);const o=this._bindings,c=this._nActiveBindings;for(let h=0;h!==c;++h)o[h].apply(s);return this}setTime(e){this.time=0;for(let t=0;t=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 this.clampPoint(e,lN).distanceTo(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}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)}}const cN=new L,Rv=new L,uf=new L,hf=new L,l2=new L,uk=new L,hk=new L;class fk{constructor(e=new L,t=new L){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){cN.subVectors(e,this.start),Rv.subVectors(this.end,this.start);const i=Rv.dot(Rv);let r=Rv.dot(cN)/i;return t&&(r=Lt(r,0,1)),r}closestPointToPoint(e,t,i){const a=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(a).add(this.start)}distanceSqToLine3(e,t=uk,i=hk){const a=10000000000000001e-32;let r,s;const o=this.start,c=e.start,h=this.end,f=e.end;uf.subVectors(h,o),hf.subVectors(f,c),l2.subVectors(o,c);const d=uf.dot(uf),m=hf.dot(hf),g=hf.dot(l2);if(d<=a&&m<=a)return t.copy(o),i.copy(c),t.sub(i),t.dot(t);if(d<=a)r=0,s=g/m,s=Lt(s,0,1);else{const x=uf.dot(l2);if(m<=a)s=0,r=Lt(-x/d,0,1);else{const T=uf.dot(hf),y=d*m-T*T;y!==0?r=Lt((T*g-x*m)/y,0,1):r=0,s=(T*r+g)/m,s<0?(s=0,r=Lt(-x/d,0,1)):s>1&&(s=1,r=Lt((T-x)/d,0,1))}}return t.copy(o).add(uf.multiplyScalar(r)),i.copy(c).add(hf.multiplyScalar(s)),t.sub(i),t.dot(t)}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 uN=new L;class dk extends Wt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Ct,a=[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 s=0,o=1,c=32;s1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{mN.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(mN,t)}}setLength(e,t=e*.2,i=t*.2){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}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class I6 extends ir{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],a=new Ct;a.setAttribute("position",new xt(t,3)),a.setAttribute("color",new xt(i,3));const r=new Bi({vertexColors:!0,toneMapped:!1});super(a,r),this.type="AxesHelper"}setColors(e,t,i){const a=new je,r=this.geometry.attributes.color.array;return a.set(e),a.toArray(r,0),a.toArray(r,3),a.set(t),a.toArray(r,6),a.toArray(r,9),a.set(i),a.toArray(r,12),a.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Ak{constructor(){this.type="ShapePath",this.color=new je,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Fx,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,a){return this.currentPath.quadraticCurveTo(e,t,i,a),this}bezierCurveTo(e,t,i,a,r,s){return this.currentPath.bezierCurveTo(e,t,i,a,r,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(v){const S=[];for(let E=0,b=v.length;ENumber.EPSILON){if(w<0&&(I=S[C],O=-O,P=S[D],w=-w),v.yP.y)continue;if(v.y===I.y){if(v.x===I.x)return!0}else{const B=w*(v.x-I.x)-O*(v.y-I.y);if(B===0)return!0;if(B<0)continue;b=!b}}else{if(v.y!==I.y)continue;if(P.x<=v.x&&v.x<=I.x||I.x<=v.x&&v.x<=P.x)return!0}}return b}const a=ws.isClockWise,r=this.subPaths;if(r.length===0)return[];let s,o,c;const h=[];if(r.length===1)return o=r[0],c=new Pu,c.curves=o.curves,h.push(c),h;let f=!a(r[0].getPoints());f=e?!f:f;const d=[],m=[];let g=[],x=0,T;m[x]=void 0,g[x]=[];for(let v=0,S=r.length;v1){let v=!1,S=0;for(let E=0,b=m.length;E0&&v===!1&&(g=d)}let y;for(let v=0,S=m.length;ve?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function Ck(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function Nk(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function mE(n,e,t,i){const a=Dk(i);switch(t){case pb:return n*e;case As:return n*e/a.components*a.byteLength;case I0:return n*e/a.components*a.byteLength;case ko:return n*e*2/a.components*a.byteLength;case U1:return n*e*2/a.components*a.byteLength;case mb:return n*e*3/a.components*a.byteLength;case $n:return n*e*4/a.components*a.byteLength;case P1:return n*e*4/a.components*a.byteLength;case Om:case Lm:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Im:case Um:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case cx:case hx:return Math.max(n,16)*Math.max(e,8)/4;case lx:case ux:return Math.max(n,8)*Math.max(e,8)/2;case fx:case dx:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case px:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case mx:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case gx:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case vx:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case _x:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case xx:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case yx:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case Sx:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case Tx:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case Ex:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case Mx:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case bx:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case Ax:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case wx:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case Rx:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Cx:case Nx:case Dx:return Math.ceil(n/4)*Math.ceil(e/4)*16;case Ox:case Lx:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Ix:case Ux:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Dk(n){switch(n){case zi:case D1:return{byteLength:1,components:1};case Yu:case O1:case Xn:return{byteLength:2,components:1};case L1:case I1:return{byteLength:2,components:4};case Ds:case L0:case si:return{byteLength:4,components:1};case fb:case db:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class Ok{static contain(e,t){return Rk(e,t)}static cover(e,t){return Ck(e,t)}static fill(e){return Nk(e)}static getByteLength(e,t,i,a){return mE(e,t,i,a)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Cs}}));typeof window<"u"&&(window.__THREE__?ut("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Cs);/** * @license * Copyright 2010-2025 Three.js Authors * SPDX-License-Identifier: MIT - */function L6(){let n=null,e=!1,t=null,i=null;function a(r,s){t(r,s),i=n.requestAnimationFrame(a)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(a),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function Ok(n){const e=new WeakMap;function t(o,c){const h=o.array,f=o.usage,d=h.byteLength,m=n.createBuffer();n.bindBuffer(c,m),n.bufferData(c,h,f),o.onUploadCallback();let g;if(h instanceof Float32Array)g=n.FLOAT;else if(typeof Float16Array<"u"&&h instanceof Float16Array)g=n.HALF_FLOAT;else if(h instanceof Uint16Array)o.isFloat16BufferAttribute?g=n.HALF_FLOAT:g=n.UNSIGNED_SHORT;else if(h instanceof Int16Array)g=n.SHORT;else if(h instanceof Uint32Array)g=n.UNSIGNED_INT;else if(h instanceof Int32Array)g=n.INT;else if(h instanceof Int8Array)g=n.BYTE;else if(h instanceof Uint8Array)g=n.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)g=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:m,type:g,bytesPerElement:h.BYTES_PER_ELEMENT,version:o.version,size:d}}function i(o,c,h){const f=c.array,d=c.updateRanges;if(n.bindBuffer(h,o),d.length===0)n.bufferSubData(h,0,f);else{d.sort((g,x)=>g.start-x.start);let m=0;for(let g=1;gg.start-x.start);let m=0;for(let g=1;g 0 +#endif`,Zk=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; @@ -353,26 +353,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve if ( clipped ) discard; #endif #endif -#endif`,Zk=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,Kk=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,Qk=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,Jk=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,Jk=`#if defined( USE_COLOR_ALPHA ) +#endif`,$k=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,$k=`#if defined( USE_COLOR_ALPHA ) +#endif`,eW=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,eW=`#if defined( USE_COLOR_ALPHA ) +#endif`,tW=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; -#endif`,tW=`#if defined( USE_COLOR_ALPHA ) +#endif`,nW=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) vColor = vec3( 1.0 ); @@ -386,7 +386,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #ifdef USE_BATCHING_COLOR vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); vColor.xyz *= batchingColor.xyz; -#endif`,nW=`#define PI 3.141592653589793 +#endif`,iW=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -453,7 +453,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,iW=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,aW=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -546,7 +546,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,aW=`vec3 transformedNormal = objectNormal; +#endif`,rW=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -575,21 +575,21 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,rW=`#ifdef USE_DISPLACEMENTMAP +#endif`,sW=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,sW=`#ifdef USE_DISPLACEMENTMAP +#endif`,oW=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,oW=`#ifdef USE_EMISSIVEMAP +#endif`,lW=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE emissiveColor = sRGBTransferEOTF( emissiveColor ); #endif totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,lW=`#ifdef USE_EMISSIVEMAP +#endif`,cW=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,cW="gl_FragColor = linearToOutputTexel( gl_FragColor );",uW=`vec4 LinearTransferOETF( in vec4 value ) { +#endif`,uW="gl_FragColor = linearToOutputTexel( gl_FragColor );",hW=`vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferEOTF( in vec4 value ) { @@ -597,7 +597,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) { } vec4 sRGBTransferOETF( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,hW=`#ifdef USE_ENVMAP +}`,fW=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -626,7 +626,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,fW=`#ifdef USE_ENVMAP +#endif`,dW=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; @@ -635,7 +635,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #else uniform sampler2D envMap; #endif -#endif`,dW=`#ifdef USE_ENVMAP +#endif`,pW=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -646,7 +646,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,pW=`#ifdef USE_ENVMAP +#endif`,mW=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -657,7 +657,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,mW=`#ifdef USE_ENVMAP +#endif`,gW=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -674,18 +674,18 @@ vec4 sRGBTransferOETF( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,gW=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; #endif`,vW=`#ifdef USE_FOG - varying float vFogDepth; + vFogDepth = - mvPosition.z; #endif`,_W=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,xW=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,xW=`#ifdef USE_FOG +#endif`,yW=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -694,7 +694,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,yW=`#ifdef USE_GRADIENTMAP +#endif`,SW=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -706,12 +706,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,SW=`#ifdef USE_LIGHTMAP +}`,TW=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,TW=`LambertMaterial material; +#endif`,EW=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,EW=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,MW=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -725,7 +725,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,MW=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,bW=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -841,7 +841,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,bW=`#ifdef USE_ENVMAP +#endif`,AW=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -874,7 +874,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,AW=`ToonMaterial material; +#endif`,wW=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,RW=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; @@ -887,11 +887,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,wW=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,CW=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,CW=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,NW=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -908,7 +908,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,NW=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,DW=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -994,7 +994,7 @@ material.roughness = min( material.roughness, 1.0 ); material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,DW=`uniform sampler2D dfgLUT; +#endif`,OW=`uniform sampler2D dfgLUT; struct PhysicalMaterial { vec3 diffuseColor; float roughness; @@ -1310,7 +1310,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,OW=` +}`,LW=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1425,7 +1425,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,LW=`#if defined( RE_IndirectDiffuse ) +#endif`,IW=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1444,32 +1444,32 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,IW=`#if defined( RE_IndirectDiffuse ) +#endif`,UW=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,UW=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) - gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,PW=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,zW=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,zW=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER +#endif`,BW=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER varying float vFragDepth; varying float vIsPerspective; -#endif`,BW=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER +#endif`,HW=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,HW=`#ifdef USE_MAP +#endif`,FW=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,FW=`#ifdef USE_MAP +#endif`,GW=`#ifdef USE_MAP uniform sampler2D map; -#endif`,GW=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,VW=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1481,7 +1481,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,VW=`#if defined( USE_POINTS_UV ) +#endif`,kW=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1493,19 +1493,19 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,kW=`float metalnessFactor = metalness; +#endif`,WW=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,WW=`#ifdef USE_METALNESSMAP +#endif`,XW=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,XW=`#ifdef USE_INSTANCING_MORPH +#endif`,YW=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[ MORPHTARGETS_COUNT ]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } -#endif`,YW=`#if defined( USE_MORPHCOLORS ) +#endif`,qW=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1514,12 +1514,12 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,qW=`#ifdef USE_MORPHNORMALS +#endif`,jW=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } -#endif`,jW=`#ifdef USE_MORPHTARGETS +#endif`,ZW=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1533,12 +1533,12 @@ IncidentLight directLight; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } -#endif`,ZW=`#ifdef USE_MORPHTARGETS +#endif`,KW=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } -#endif`,KW=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,QW=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1579,7 +1579,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,QW=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,JW=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1594,12 +1594,6 @@ vec3 nonPerturbedNormal = normal;`,QW=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,JW=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif #endif`,$W=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT @@ -1607,12 +1601,18 @@ vec3 nonPerturbedNormal = normal;`,QW=`#ifdef USE_NORMALMAP_OBJECTSPACE varying vec3 vBitangent; #endif #endif`,eX=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,tX=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,tX=`#ifdef USE_NORMALMAP +#endif`,nX=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1634,13 +1634,13 @@ vec3 nonPerturbedNormal = normal;`,QW=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,nX=`#ifdef USE_CLEARCOAT +#endif`,iX=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,iX=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,aX=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,aX=`#ifdef USE_CLEARCOATMAP +#endif`,rX=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1649,18 +1649,18 @@ vec3 nonPerturbedNormal = normal;`,QW=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,rX=`#ifdef USE_IRIDESCENCEMAP +#endif`,sX=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,sX=`#ifdef OPAQUE +#endif`,oX=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,oX=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,lX=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1729,9 +1729,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,lX=`#ifdef PREMULTIPLIED_ALPHA +}`,cX=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,cX=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,uX=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1739,22 +1739,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,uX=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,hX=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,hX=`#ifdef DITHERING +#endif`,fX=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,fX=`float roughnessFactor = roughness; +#endif`,dX=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,dX=`#ifdef USE_ROUGHNESSMAP +#endif`,pX=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,pX=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,mX=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -1949,7 +1949,7 @@ gl_Position = projectionMatrix * mvPosition;`,uX=`#ifdef DITHERING } return mix( 1.0, shadow, shadowIntensity ); } -#endif`,mX=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,gX=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -1990,7 +1990,7 @@ gl_Position = projectionMatrix * mvPosition;`,uX=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,gX=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,vX=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -2022,7 +2022,7 @@ gl_Position = projectionMatrix * mvPosition;`,uX=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,vX=`float getShadowMask() { +#endif`,_X=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2054,12 +2054,12 @@ gl_Position = projectionMatrix * mvPosition;`,uX=`#ifdef DITHERING #endif #endif return shadow; -}`,_X=`#ifdef USE_SKINNING +}`,xX=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,xX=`#ifdef USE_SKINNING +#endif`,yX=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2074,7 +2074,7 @@ gl_Position = projectionMatrix * mvPosition;`,uX=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,yX=`#ifdef USE_SKINNING +#endif`,SX=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2082,7 +2082,7 @@ gl_Position = projectionMatrix * mvPosition;`,uX=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,SX=`#ifdef USE_SKINNING +#endif`,TX=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2093,17 +2093,17 @@ gl_Position = projectionMatrix * mvPosition;`,uX=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,TX=`float specularStrength; +#endif`,EX=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,EX=`#ifdef USE_SPECULARMAP +#endif`,MX=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,MX=`#if defined( TONE_MAPPING ) +#endif`,bX=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,bX=`#ifndef saturate +#endif`,AX=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2200,7 +2200,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,AX=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,wX=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2347,7 +2347,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,AX=`#ifdef USE_TRANSMISS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,wX=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,CX=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2417,7 +2417,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,AX=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,CX=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,NX=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2511,7 +2511,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,AX=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,NX=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,DX=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2582,7 +2582,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,AX=`#ifdef USE_TRANSMISS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,DX=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,OX=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -2591,12 +2591,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,AX=`#ifdef USE_TRANSMISS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const OX=`varying vec2 vUv; +#endif`;const LX=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,LX=`uniform sampler2D t2D; +}`,IX=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2608,14 +2608,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,IX=`varying vec3 vWorldDirection; +}`,UX=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,UX=`#ifdef ENVMAP_TYPE_CUBE +}`,PX=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2638,14 +2638,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,PX=`varying vec3 vWorldDirection; +}`,zX=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,zX=`uniform samplerCube tCube; +}`,BX=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2655,7 +2655,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,BX=`#include +}`,HX=`#include #include #include #include @@ -2682,7 +2682,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,HX=`#if DEPTH_PACKING == 3200 +}`,FX=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2720,7 +2720,7 @@ void main() { #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif -}`,FX=`#define DISTANCE +}`,GX=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2747,7 +2747,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,GX=`#define DISTANCE +}`,VX=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2771,13 +2771,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,VX=`varying vec3 vWorldDirection; +}`,kX=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,kX=`uniform sampler2D tEquirect; +}`,WX=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2786,7 +2786,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,WX=`uniform float scale; +}`,XX=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2808,7 +2808,7 @@ void main() { #include #include #include -}`,XX=`uniform vec3 diffuse; +}`,YX=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2836,7 +2836,7 @@ void main() { #include #include #include -}`,YX=`#include +}`,qX=`#include #include #include #include @@ -2868,7 +2868,7 @@ void main() { #include #include #include -}`,qX=`uniform vec3 diffuse; +}`,jX=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2916,7 +2916,7 @@ void main() { #include #include #include -}`,jX=`#define LAMBERT +}`,ZX=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2955,7 +2955,7 @@ void main() { #include #include #include -}`,ZX=`#define LAMBERT +}`,KX=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3012,7 +3012,7 @@ void main() { #include #include #include -}`,KX=`#define MATCAP +}`,QX=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3046,7 +3046,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,QX=`#define MATCAP +}`,JX=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3092,7 +3092,7 @@ void main() { #include #include #include -}`,JX=`#define NORMAL +}`,$X=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3125,7 +3125,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,$X=`#define NORMAL +}`,eY=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3147,7 +3147,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,eY=`#define PHONG +}`,tY=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3186,7 +3186,7 @@ void main() { #include #include #include -}`,tY=`#define PHONG +}`,nY=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3245,7 +3245,7 @@ void main() { #include #include #include -}`,nY=`#define STANDARD +}`,iY=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3288,7 +3288,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,iY=`#define STANDARD +}`,aY=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3413,7 +3413,7 @@ void main() { #include #include #include -}`,aY=`#define TOON +}`,rY=`#define TOON varying vec3 vViewPosition; #include #include @@ -3450,7 +3450,7 @@ void main() { #include #include #include -}`,rY=`#define TOON +}`,sY=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3503,7 +3503,7 @@ void main() { #include #include #include -}`,sY=`uniform float size; +}`,oY=`uniform float size; uniform float scale; #include #include @@ -3534,7 +3534,7 @@ void main() { #include #include #include -}`,oY=`uniform vec3 diffuse; +}`,lY=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3559,7 +3559,7 @@ void main() { #include #include #include -}`,lY=`#include +}`,cY=`#include #include #include #include @@ -3582,7 +3582,7 @@ void main() { #include #include #include -}`,cY=`uniform vec3 color; +}`,uY=`uniform vec3 color; uniform float opacity; #include #include @@ -3598,7 +3598,7 @@ void main() { #include #include #include -}`,uY=`uniform float rotation; +}`,hY=`uniform float rotation; uniform vec2 center; #include #include @@ -3622,7 +3622,7 @@ void main() { #include #include #include -}`,hY=`uniform vec3 diffuse; +}`,fY=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3647,7 +3647,7 @@ void main() { #include #include #include -}`,Qt={alphahash_fragment:Lk,alphahash_pars_fragment:Ik,alphamap_fragment:Uk,alphamap_pars_fragment:Pk,alphatest_fragment:zk,alphatest_pars_fragment:Bk,aomap_fragment:Hk,aomap_pars_fragment:Fk,batching_pars_vertex:Gk,batching_vertex:Vk,begin_vertex:kk,beginnormal_vertex:Wk,bsdfs:Xk,iridescence_fragment:Yk,bumpmap_pars_fragment:qk,clipping_planes_fragment:jk,clipping_planes_pars_fragment:Zk,clipping_planes_pars_vertex:Kk,clipping_planes_vertex:Qk,color_fragment:Jk,color_pars_fragment:$k,color_pars_vertex:eW,color_vertex:tW,common:nW,cube_uv_reflection_fragment:iW,defaultnormal_vertex:aW,displacementmap_pars_vertex:rW,displacementmap_vertex:sW,emissivemap_fragment:oW,emissivemap_pars_fragment:lW,colorspace_fragment:cW,colorspace_pars_fragment:uW,envmap_fragment:hW,envmap_common_pars_fragment:fW,envmap_pars_fragment:dW,envmap_pars_vertex:pW,envmap_physical_pars_fragment:bW,envmap_vertex:mW,fog_vertex:gW,fog_pars_vertex:vW,fog_fragment:_W,fog_pars_fragment:xW,gradientmap_pars_fragment:yW,lightmap_pars_fragment:SW,lights_lambert_fragment:TW,lights_lambert_pars_fragment:EW,lights_pars_begin:MW,lights_toon_fragment:AW,lights_toon_pars_fragment:RW,lights_phong_fragment:wW,lights_phong_pars_fragment:CW,lights_physical_fragment:NW,lights_physical_pars_fragment:DW,lights_fragment_begin:OW,lights_fragment_maps:LW,lights_fragment_end:IW,logdepthbuf_fragment:UW,logdepthbuf_pars_fragment:PW,logdepthbuf_pars_vertex:zW,logdepthbuf_vertex:BW,map_fragment:HW,map_pars_fragment:FW,map_particle_fragment:GW,map_particle_pars_fragment:VW,metalnessmap_fragment:kW,metalnessmap_pars_fragment:WW,morphinstance_vertex:XW,morphcolor_vertex:YW,morphnormal_vertex:qW,morphtarget_pars_vertex:jW,morphtarget_vertex:ZW,normal_fragment_begin:KW,normal_fragment_maps:QW,normal_pars_fragment:JW,normal_pars_vertex:$W,normal_vertex:eX,normalmap_pars_fragment:tX,clearcoat_normal_fragment_begin:nX,clearcoat_normal_fragment_maps:iX,clearcoat_pars_fragment:aX,iridescence_pars_fragment:rX,opaque_fragment:sX,packing:oX,premultiplied_alpha_fragment:lX,project_vertex:cX,dithering_fragment:uX,dithering_pars_fragment:hX,roughnessmap_fragment:fX,roughnessmap_pars_fragment:dX,shadowmap_pars_fragment:pX,shadowmap_pars_vertex:mX,shadowmap_vertex:gX,shadowmask_pars_fragment:vX,skinbase_vertex:_X,skinning_pars_vertex:xX,skinning_vertex:yX,skinnormal_vertex:SX,specularmap_fragment:TX,specularmap_pars_fragment:EX,tonemapping_fragment:MX,tonemapping_pars_fragment:bX,transmission_fragment:AX,transmission_pars_fragment:RX,uv_pars_fragment:wX,uv_pars_vertex:CX,uv_vertex:NX,worldpos_vertex:DX,background_vert:OX,background_frag:LX,backgroundCube_vert:IX,backgroundCube_frag:UX,cube_vert:PX,cube_frag:zX,depth_vert:BX,depth_frag:HX,distanceRGBA_vert:FX,distanceRGBA_frag:GX,equirect_vert:VX,equirect_frag:kX,linedashed_vert:WX,linedashed_frag:XX,meshbasic_vert:YX,meshbasic_frag:qX,meshlambert_vert:jX,meshlambert_frag:ZX,meshmatcap_vert:KX,meshmatcap_frag:QX,meshnormal_vert:JX,meshnormal_frag:$X,meshphong_vert:eY,meshphong_frag:tY,meshphysical_vert:nY,meshphysical_frag:iY,meshtoon_vert:aY,meshtoon_frag:rY,points_vert:sY,points_frag:oY,shadow_vert:lY,shadow_frag:cY,sprite_vert:uY,sprite_frag:hY},at={common:{diffuse:{value:new je(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Et},alphaMap:{value:null},alphaMapTransform:{value:new Et},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Et}},envmap:{envMap:{value:null},envMapRotation:{value:new Et},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Et}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Et}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Et},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Et},normalScale:{value:new de(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Et},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Et}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Et}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Et}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new je(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 je(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Et},alphaTest:{value:0},uvTransform:{value:new Et}},sprite:{diffuse:{value:new je(16777215)},opacity:{value:1},center:{value:new de(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Et},alphaMap:{value:null},alphaMapTransform:{value:new Et},alphaTest:{value:0}}},Ms={basic:{uniforms:Aa([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.fog]),vertexShader:Qt.meshbasic_vert,fragmentShader:Qt.meshbasic_frag},lambert:{uniforms:Aa([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.fog,at.lights,{emissive:{value:new je(0)}}]),vertexShader:Qt.meshlambert_vert,fragmentShader:Qt.meshlambert_frag},phong:{uniforms:Aa([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.fog,at.lights,{emissive:{value:new je(0)},specular:{value:new je(1118481)},shininess:{value:30}}]),vertexShader:Qt.meshphong_vert,fragmentShader:Qt.meshphong_frag},standard:{uniforms:Aa([at.common,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.roughnessmap,at.metalnessmap,at.fog,at.lights,{emissive:{value:new je(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag},toon:{uniforms:Aa([at.common,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.gradientmap,at.fog,at.lights,{emissive:{value:new je(0)}}]),vertexShader:Qt.meshtoon_vert,fragmentShader:Qt.meshtoon_frag},matcap:{uniforms:Aa([at.common,at.bumpmap,at.normalmap,at.displacementmap,at.fog,{matcap:{value:null}}]),vertexShader:Qt.meshmatcap_vert,fragmentShader:Qt.meshmatcap_frag},points:{uniforms:Aa([at.points,at.fog]),vertexShader:Qt.points_vert,fragmentShader:Qt.points_frag},dashed:{uniforms:Aa([at.common,at.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qt.linedashed_vert,fragmentShader:Qt.linedashed_frag},depth:{uniforms:Aa([at.common,at.displacementmap]),vertexShader:Qt.depth_vert,fragmentShader:Qt.depth_frag},normal:{uniforms:Aa([at.common,at.bumpmap,at.normalmap,at.displacementmap,{opacity:{value:1}}]),vertexShader:Qt.meshnormal_vert,fragmentShader:Qt.meshnormal_frag},sprite:{uniforms:Aa([at.sprite,at.fog]),vertexShader:Qt.sprite_vert,fragmentShader:Qt.sprite_frag},background:{uniforms:{uvTransform:{value:new Et},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Qt.background_vert,fragmentShader:Qt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Et}},vertexShader:Qt.backgroundCube_vert,fragmentShader:Qt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Qt.cube_vert,fragmentShader:Qt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qt.equirect_vert,fragmentShader:Qt.equirect_frag},distanceRGBA:{uniforms:Aa([at.common,at.displacementmap,{referencePosition:{value:new L},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qt.distanceRGBA_vert,fragmentShader:Qt.distanceRGBA_frag},shadow:{uniforms:Aa([at.lights,at.fog,{color:{value:new je(0)},opacity:{value:1}}]),vertexShader:Qt.shadow_vert,fragmentShader:Qt.shadow_frag}};Ms.physical={uniforms:Aa([Ms.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Et},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Et},clearcoatNormalScale:{value:new de(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Et},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Et},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Et},sheen:{value:0},sheenColor:{value:new je(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Et},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Et},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Et},transmissionSamplerSize:{value:new de},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Et},attenuationDistance:{value:0},attenuationColor:{value:new je(0)},specularColor:{value:new je(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Et},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Et},anisotropyVector:{value:new de},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Et}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag};const Ov={r:0,b:0,g:0},au=new Ui,fY=new ke;function dY(n,e,t,i,a,r,s){const o=new je(0);let c=r===!0?0:1,h,f,d=null,m=0,g=null;function x(E){let b=E.isScene===!0?E.background:null;return b&&b.isTexture&&(b=(E.backgroundBlurriness>0?t:e).get(b)),b}function T(E){let b=!1;const D=x(E);D===null?v(o,c):D&&D.isColor&&(v(D,1),b=!0);const C=n.xr.getEnvironmentBlendMode();C==="additive"?i.buffers.color.setClear(0,0,0,1,s):C==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,s),(n.autoClear||b)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function S(E,b){const D=x(b);D&&(D.isCubeTexture||D.mapping===kd)?(f===void 0&&(f=new si(new oh(1,1,1),new Fi({name:"BackgroundCubeMaterial",uniforms:bd(Ms.backgroundCube.uniforms),vertexShader:Ms.backgroundCube.vertexShader,fragmentShader:Ms.backgroundCube.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(C,I,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),a.update(f)),au.copy(b.backgroundRotation),au.x*=-1,au.y*=-1,au.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(au.y*=-1,au.z*=-1),f.material.uniforms.envMap.value=D,f.material.uniforms.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,f.material.uniforms.backgroundRotation.value.setFromMatrix4(fY.makeRotationFromEuler(au)),f.material.toneMapped=rn.getTransfer(D.colorSpace)!==Rn,(d!==D||m!==D.version||g!==n.toneMapping)&&(f.material.needsUpdate=!0,d=D,m=D.version,g=n.toneMapping),f.layers.enableAll(),E.unshift(f,f.geometry,f.material,0,0,null)):D&&D.isTexture&&(h===void 0&&(h=new si(new lh(2,2),new Fi({name:"BackgroundMaterial",uniforms:bd(Ms.background.uniforms),vertexShader:Ms.background.vertexShader,fragmentShader:Ms.background.fragmentShader,side:Cs,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),a.update(h)),h.material.uniforms.t2D.value=D,h.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,h.material.toneMapped=rn.getTransfer(D.colorSpace)!==Rn,D.matrixAutoUpdate===!0&&D.updateMatrix(),h.material.uniforms.uvTransform.value.copy(D.matrix),(d!==D||m!==D.version||g!==n.toneMapping)&&(h.material.needsUpdate=!0,d=D,m=D.version,g=n.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null))}function v(E,b){E.getRGB(Ov,HU(n)),i.buffers.color.setClear(Ov.r,Ov.g,Ov.b,b,s)}function y(){f!==void 0&&(f.geometry.dispose(),f.material.dispose(),f=void 0),h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0)}return{getClearColor:function(){return o},setClearColor:function(E,b=1){o.set(E),c=b,v(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(E){c=E,v(o,c)},render:T,addToRenderList:S,dispose:y}}function pY(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},a=m(null);let r=a,s=!1;function o(R,B,j,ee,se){let re=!1;const W=d(ee,j,B);r!==W&&(r=W,h(r.object)),re=g(R,ee,j,se),re&&x(R,ee,j,se),se!==null&&e.update(se,n.ELEMENT_ARRAY_BUFFER),(re||s)&&(s=!1,b(R,B,j,ee),se!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(se).buffer))}function c(){return n.createVertexArray()}function h(R){return n.bindVertexArray(R)}function f(R){return n.deleteVertexArray(R)}function d(R,B,j){const ee=j.wireframe===!0;let se=i[R.id];se===void 0&&(se={},i[R.id]=se);let re=se[B.id];re===void 0&&(re={},se[B.id]=re);let W=re[ee];return W===void 0&&(W=m(c()),re[ee]=W),W}function m(R){const B=[],j=[],ee=[];for(let se=0;se=0){const ie=se[K];let Ce=re[K];if(Ce===void 0&&(K==="instanceMatrix"&&R.instanceMatrix&&(Ce=R.instanceMatrix),K==="instanceColor"&&R.instanceColor&&(Ce=R.instanceColor)),ie===void 0||ie.attribute!==Ce||Ce&&ie.data!==Ce.data)return!0;W++}return r.attributesNum!==W||r.index!==ee}function x(R,B,j,ee){const se={},re=B.attributes;let W=0;const te=j.getAttributes();for(const K in te)if(te[K].location>=0){let ie=re[K];ie===void 0&&(K==="instanceMatrix"&&R.instanceMatrix&&(ie=R.instanceMatrix),K==="instanceColor"&&R.instanceColor&&(ie=R.instanceColor));const Ce={};Ce.attribute=ie,ie&&ie.data&&(Ce.data=ie.data),se[K]=Ce,W++}r.attributes=se,r.attributesNum=W,r.index=ee}function T(){const R=r.newAttributes;for(let B=0,j=R.length;B=0){let oe=se[te];if(oe===void 0&&(te==="instanceMatrix"&&R.instanceMatrix&&(oe=R.instanceMatrix),te==="instanceColor"&&R.instanceColor&&(oe=R.instanceColor)),oe!==void 0){const ie=oe.normalized,Ce=oe.itemSize,Xe=e.get(oe);if(Xe===void 0)continue;const nt=Xe.buffer,tt=Xe.type,gt=Xe.bytesPerElement,ge=tt===n.INT||tt===n.UNSIGNED_INT||oe.gpuType===D0;if(oe.isInterleavedBufferAttribute){const Ae=oe.data,Ze=Ae.stride,ue=oe.offset;if(Ae.isInstancedInterleavedBuffer){for(let it=0;it0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";I="mediump"}return I==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let h=t.precision!==void 0?t.precision:"highp";const f=c(h);f!==h&&(ut("WebGLRenderer:",h,"not supported, using",f,"instead."),h=f);const d=t.logarithmicDepthBuffer===!0,m=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),g=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),x=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),T=n.getParameter(n.MAX_TEXTURE_SIZE),S=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),v=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),E=n.getParameter(n.MAX_VARYING_VECTORS),b=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),D=x>0,C=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:c,textureFormatReadable:s,textureTypeReadable:o,precision:h,logarithmicDepthBuffer:d,reversedDepthBuffer:m,maxTextures:g,maxVertexTextures:x,maxTextureSize:T,maxCubemapSize:S,maxAttributes:v,maxVertexUniforms:y,maxVaryings:E,maxFragmentUniforms:b,vertexTextures:D,maxSamples:C}}function vY(n){const e=this;let t=null,i=0,a=!1,r=!1;const s=new Fo,o=new Et,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(d,m){const g=d.length!==0||m||i!==0||a;return a=m,i=d.length,g},this.beginShadows=function(){r=!0,f(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,m){t=f(d,m,0)},this.setState=function(d,m,g){const x=d.clippingPlanes,T=d.clipIntersection,S=d.clipShadows,v=n.get(d);if(!a||x===null||x.length===0||r&&!S)r?f(null):h();else{const y=r?0:i,E=y*4;let b=v.clippingState||null;c.value=b,b=f(x,m,E,g);for(let D=0;D!==E;++D)b[D]=t[D];v.clippingState=b,this.numIntersection=T?this.numPlanes:0,this.numPlanes+=y}};function h(){c.value!==t&&(c.value=t,c.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function f(d,m,g,x){const T=d!==null?d.length:0;let S=null;if(T!==0){if(S=c.value,x!==!0||S===null){const v=g+T*4,y=m.matrixWorldInverse;o.getNormalMatrix(y),(S===null||S.length0){const h=new GU(c.height);return h.fromEquirectangularTexture(n,s),e.set(s,h),s.addEventListener("dispose",a),t(h.texture,s.mapping)}else return null}}return s}function a(s){const o=s.target;o.removeEventListener("dispose",a);const c=e.get(o);c!==void 0&&(e.delete(o),c.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}const Kl=4,dN=[.125,.215,.35,.446,.526,.582],_u=20,xY=256,kp=new io,pN=new je;let l2=null,c2=0,u2=0,h2=!1;const yY=new L;class dE{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,i=.1,a=100,r={}){const{size:s=256,position:o=yY}=r;l2=this._renderer.getRenderTarget(),c2=this._renderer.getActiveCubeFace(),u2=this._renderer.getActiveMipmapLevel(),h2=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(s);const c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,i,a,c,o),t>0&&this._blur(c,0,0,t),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=vN(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=gN(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?D:0,D,D),d.setRenderTarget(a),v&&d.render(T,c),d.render(e,c)}d.toneMapping=g,d.autoClear=m,e.background=y}_textureToCubeUV(e,t){const i=this._renderer,a=e.mapping===al||e.mapping===dc;a?(this._cubemapMaterial===null&&(this._cubemapMaterial=vN()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=gN());const r=a?this._cubemapMaterial:this._equirectMaterial,s=this._lodMeshes[0];s.material=r;const o=r.uniforms;o.envMap.value=e;const c=this._cubeSize;uf(t,0,0,3*c,2*c),i.setRenderTarget(t),i.render(s,kp)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const a=this._lodMeshes.length;for(let r=1;rx-Kl?i-x+Kl:0),v=4*(this._cubeSize-T);c.envMap.value=e.texture,c.roughness.value=g,c.mipInt.value=x-t,uf(r,S,v,3*T,2*T),a.setRenderTarget(r),a.render(o,kp),c.envMap.value=r.texture,c.roughness.value=0,c.mipInt.value=x-i,uf(e,S,v,3*T,2*T),a.setRenderTarget(e),a.render(o,kp)}_blur(e,t,i,a,r){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,i,a,"latitudinal",r),this._halfBlur(s,e,i,i,a,"longitudinal",r)}_halfBlur(e,t,i,a,r,s,o){const c=this._renderer,h=this._blurMaterial;s!=="latitudinal"&&s!=="longitudinal"&&Bt("blur direction must be either latitudinal or longitudinal!");const f=3,d=this._lodMeshes[a];d.material=h;const m=h.uniforms,g=this._sizeLods[i]-1,x=isFinite(r)?Math.PI/(2*g):2*Math.PI/(2*_u-1),T=r/x,S=isFinite(r)?1+Math.floor(f*T):_u;S>_u&&ut(`sigmaRadians, ${r}, is too large and will clip, as it requested ${S} samples when the maximum is set to ${_u}`);const v=[];let y=0;for(let I=0;I<_u;++I){const P=I/T,O=Math.exp(-P*P/2);v.push(O),I===0?y+=O:IE-Kl?a-E+Kl:0),C=4*(this._cubeSize-b);uf(t,D,C,3*b,2*b),c.setRenderTarget(t),c.render(d,kp)}}function SY(n){const e=[],t=[],i=[];let a=n;const r=n-Kl+1+dN.length;for(let s=0;sn-Kl?c=dN[s-n+Kl-1]:s===0&&(c=0),t.push(c);const h=1/(o-2),f=-h,d=1+h,m=[f,f,d,f,d,d,f,f,d,d,f,d],g=6,x=6,T=3,S=2,v=1,y=new Float32Array(T*x*g),E=new Float32Array(S*x*g),b=new Float32Array(v*x*g);for(let C=0;C2?0:-1,O=[I,P,0,I+2/3,P,0,I+2/3,P+1,0,I,P,0,I+2/3,P+1,0,I,P+1,0];y.set(O,T*x*C),E.set(m,S*x*C);const R=[C,C,C,C,C,C];b.set(R,v*x*C)}const D=new wt;D.setAttribute("position",new Ot(y,T)),D.setAttribute("uv",new Ot(E,S)),D.setAttribute("faceIndex",new Ot(b,v)),i.push(new si(D,null)),a>Kl&&a--}return{lodMeshes:i,sizeLods:e,sigmas:t}}function mN(n,e,t){const i=new _i(n,e,t);return i.texture.mapping=kd,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function uf(n,e,t,i,a){n.viewport.set(e,t,i,a),n.scissor.set(e,t,i,a)}function TY(n,e,t){return new Fi({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:xY,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:iy(),fragmentShader:` +}`,Qt={alphahash_fragment:Ik,alphahash_pars_fragment:Uk,alphamap_fragment:Pk,alphamap_pars_fragment:zk,alphatest_fragment:Bk,alphatest_pars_fragment:Hk,aomap_fragment:Fk,aomap_pars_fragment:Gk,batching_pars_vertex:Vk,batching_vertex:kk,begin_vertex:Wk,beginnormal_vertex:Xk,bsdfs:Yk,iridescence_fragment:qk,bumpmap_pars_fragment:jk,clipping_planes_fragment:Zk,clipping_planes_pars_fragment:Kk,clipping_planes_pars_vertex:Qk,clipping_planes_vertex:Jk,color_fragment:$k,color_pars_fragment:eW,color_pars_vertex:tW,color_vertex:nW,common:iW,cube_uv_reflection_fragment:aW,defaultnormal_vertex:rW,displacementmap_pars_vertex:sW,displacementmap_vertex:oW,emissivemap_fragment:lW,emissivemap_pars_fragment:cW,colorspace_fragment:uW,colorspace_pars_fragment:hW,envmap_fragment:fW,envmap_common_pars_fragment:dW,envmap_pars_fragment:pW,envmap_pars_vertex:mW,envmap_physical_pars_fragment:AW,envmap_vertex:gW,fog_vertex:vW,fog_pars_vertex:_W,fog_fragment:xW,fog_pars_fragment:yW,gradientmap_pars_fragment:SW,lightmap_pars_fragment:TW,lights_lambert_fragment:EW,lights_lambert_pars_fragment:MW,lights_pars_begin:bW,lights_toon_fragment:wW,lights_toon_pars_fragment:RW,lights_phong_fragment:CW,lights_phong_pars_fragment:NW,lights_physical_fragment:DW,lights_physical_pars_fragment:OW,lights_fragment_begin:LW,lights_fragment_maps:IW,lights_fragment_end:UW,logdepthbuf_fragment:PW,logdepthbuf_pars_fragment:zW,logdepthbuf_pars_vertex:BW,logdepthbuf_vertex:HW,map_fragment:FW,map_pars_fragment:GW,map_particle_fragment:VW,map_particle_pars_fragment:kW,metalnessmap_fragment:WW,metalnessmap_pars_fragment:XW,morphinstance_vertex:YW,morphcolor_vertex:qW,morphnormal_vertex:jW,morphtarget_pars_vertex:ZW,morphtarget_vertex:KW,normal_fragment_begin:QW,normal_fragment_maps:JW,normal_pars_fragment:$W,normal_pars_vertex:eX,normal_vertex:tX,normalmap_pars_fragment:nX,clearcoat_normal_fragment_begin:iX,clearcoat_normal_fragment_maps:aX,clearcoat_pars_fragment:rX,iridescence_pars_fragment:sX,opaque_fragment:oX,packing:lX,premultiplied_alpha_fragment:cX,project_vertex:uX,dithering_fragment:hX,dithering_pars_fragment:fX,roughnessmap_fragment:dX,roughnessmap_pars_fragment:pX,shadowmap_pars_fragment:mX,shadowmap_pars_vertex:gX,shadowmap_vertex:vX,shadowmask_pars_fragment:_X,skinbase_vertex:xX,skinning_pars_vertex:yX,skinning_vertex:SX,skinnormal_vertex:TX,specularmap_fragment:EX,specularmap_pars_fragment:MX,tonemapping_fragment:bX,tonemapping_pars_fragment:AX,transmission_fragment:wX,transmission_pars_fragment:RX,uv_pars_fragment:CX,uv_pars_vertex:NX,uv_vertex:DX,worldpos_vertex:OX,background_vert:LX,background_frag:IX,backgroundCube_vert:UX,backgroundCube_frag:PX,cube_vert:zX,cube_frag:BX,depth_vert:HX,depth_frag:FX,distanceRGBA_vert:GX,distanceRGBA_frag:VX,equirect_vert:kX,equirect_frag:WX,linedashed_vert:XX,linedashed_frag:YX,meshbasic_vert:qX,meshbasic_frag:jX,meshlambert_vert:ZX,meshlambert_frag:KX,meshmatcap_vert:QX,meshmatcap_frag:JX,meshnormal_vert:$X,meshnormal_frag:eY,meshphong_vert:tY,meshphong_frag:nY,meshphysical_vert:iY,meshphysical_frag:aY,meshtoon_vert:rY,meshtoon_frag:sY,points_vert:oY,points_frag:lY,shadow_vert:cY,shadow_frag:uY,sprite_vert:hY,sprite_frag:fY},at={common:{diffuse:{value:new je(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Et},alphaMap:{value:null},alphaMapTransform:{value:new Et},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Et}},envmap:{envMap:{value:null},envMapRotation:{value:new Et},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Et}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Et}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Et},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Et},normalScale:{value:new de(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Et},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Et}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Et}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Et}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new je(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 je(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Et},alphaTest:{value:0},uvTransform:{value:new Et}},sprite:{diffuse:{value:new je(16777215)},opacity:{value:1},center:{value:new de(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Et},alphaMap:{value:null},alphaMapTransform:{value:new Et},alphaTest:{value:0}}},bs={basic:{uniforms:wa([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.fog]),vertexShader:Qt.meshbasic_vert,fragmentShader:Qt.meshbasic_frag},lambert:{uniforms:wa([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.fog,at.lights,{emissive:{value:new je(0)}}]),vertexShader:Qt.meshlambert_vert,fragmentShader:Qt.meshlambert_frag},phong:{uniforms:wa([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.fog,at.lights,{emissive:{value:new je(0)},specular:{value:new je(1118481)},shininess:{value:30}}]),vertexShader:Qt.meshphong_vert,fragmentShader:Qt.meshphong_frag},standard:{uniforms:wa([at.common,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.roughnessmap,at.metalnessmap,at.fog,at.lights,{emissive:{value:new je(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag},toon:{uniforms:wa([at.common,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.gradientmap,at.fog,at.lights,{emissive:{value:new je(0)}}]),vertexShader:Qt.meshtoon_vert,fragmentShader:Qt.meshtoon_frag},matcap:{uniforms:wa([at.common,at.bumpmap,at.normalmap,at.displacementmap,at.fog,{matcap:{value:null}}]),vertexShader:Qt.meshmatcap_vert,fragmentShader:Qt.meshmatcap_frag},points:{uniforms:wa([at.points,at.fog]),vertexShader:Qt.points_vert,fragmentShader:Qt.points_frag},dashed:{uniforms:wa([at.common,at.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qt.linedashed_vert,fragmentShader:Qt.linedashed_frag},depth:{uniforms:wa([at.common,at.displacementmap]),vertexShader:Qt.depth_vert,fragmentShader:Qt.depth_frag},normal:{uniforms:wa([at.common,at.bumpmap,at.normalmap,at.displacementmap,{opacity:{value:1}}]),vertexShader:Qt.meshnormal_vert,fragmentShader:Qt.meshnormal_frag},sprite:{uniforms:wa([at.sprite,at.fog]),vertexShader:Qt.sprite_vert,fragmentShader:Qt.sprite_frag},background:{uniforms:{uvTransform:{value:new Et},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Qt.background_vert,fragmentShader:Qt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Et}},vertexShader:Qt.backgroundCube_vert,fragmentShader:Qt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Qt.cube_vert,fragmentShader:Qt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qt.equirect_vert,fragmentShader:Qt.equirect_frag},distanceRGBA:{uniforms:wa([at.common,at.displacementmap,{referencePosition:{value:new L},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qt.distanceRGBA_vert,fragmentShader:Qt.distanceRGBA_frag},shadow:{uniforms:wa([at.lights,at.fog,{color:{value:new je(0)},opacity:{value:1}}]),vertexShader:Qt.shadow_vert,fragmentShader:Qt.shadow_frag}};bs.physical={uniforms:wa([bs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Et},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Et},clearcoatNormalScale:{value:new de(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Et},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Et},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Et},sheen:{value:0},sheenColor:{value:new je(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Et},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Et},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Et},transmissionSamplerSize:{value:new de},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Et},attenuationDistance:{value:0},attenuationColor:{value:new je(0)},specularColor:{value:new je(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Et},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Et},anisotropyVector:{value:new de},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Et}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag};const Iv={r:0,b:0,g:0},su=new Ei,dY=new ke;function pY(n,e,t,i,a,r,s){const o=new je(0);let c=r===!0?0:1,h,f,d=null,m=0,g=null;function x(E){let b=E.isScene===!0?E.background:null;return b&&b.isTexture&&(b=(E.backgroundBlurriness>0?t:e).get(b)),b}function T(E){let b=!1;const D=x(E);D===null?v(o,c):D&&D.isColor&&(v(D,1),b=!0);const C=n.xr.getEnvironmentBlendMode();C==="additive"?i.buffers.color.setClear(0,0,0,1,s):C==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,s),(n.autoClear||b)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function y(E,b){const D=x(b);D&&(D.isCubeTexture||D.mapping===Xd)?(f===void 0&&(f=new oi(new ch(1,1,1),new Vi({name:"BackgroundCubeMaterial",uniforms:wd(bs.backgroundCube.uniforms),vertexShader:bs.backgroundCube.vertexShader,fragmentShader:bs.backgroundCube.fragmentShader,side:Ui,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(C,I,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),a.update(f)),su.copy(b.backgroundRotation),su.x*=-1,su.y*=-1,su.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(su.y*=-1,su.z*=-1),f.material.uniforms.envMap.value=D,f.material.uniforms.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,f.material.uniforms.backgroundRotation.value.setFromMatrix4(dY.makeRotationFromEuler(su)),f.material.toneMapped=rn.getTransfer(D.colorSpace)!==wn,(d!==D||m!==D.version||g!==n.toneMapping)&&(f.material.needsUpdate=!0,d=D,m=D.version,g=n.toneMapping),f.layers.enableAll(),E.unshift(f,f.geometry,f.material,0,0,null)):D&&D.isTexture&&(h===void 0&&(h=new oi(new uh(2,2),new Vi({name:"BackgroundMaterial",uniforms:wd(bs.background.uniforms),vertexShader:bs.background.vertexShader,fragmentShader:bs.background.fragmentShader,side:Ns,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),a.update(h)),h.material.uniforms.t2D.value=D,h.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,h.material.toneMapped=rn.getTransfer(D.colorSpace)!==wn,D.matrixAutoUpdate===!0&&D.updateMatrix(),h.material.uniforms.uvTransform.value.copy(D.matrix),(d!==D||m!==D.version||g!==n.toneMapping)&&(h.material.needsUpdate=!0,d=D,m=D.version,g=n.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null))}function v(E,b){E.getRGB(Iv,GU(n)),i.buffers.color.setClear(Iv.r,Iv.g,Iv.b,b,s)}function S(){f!==void 0&&(f.geometry.dispose(),f.material.dispose(),f=void 0),h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0)}return{getClearColor:function(){return o},setClearColor:function(E,b=1){o.set(E),c=b,v(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(E){c=E,v(o,c)},render:T,addToRenderList:y,dispose:S}}function mY(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},a=m(null);let r=a,s=!1;function o(w,B,j,ee,se){let re=!1;const W=d(ee,j,B);r!==W&&(r=W,h(r.object)),re=g(w,ee,j,se),re&&x(w,ee,j,se),se!==null&&e.update(se,n.ELEMENT_ARRAY_BUFFER),(re||s)&&(s=!1,b(w,B,j,ee),se!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(se).buffer))}function c(){return n.createVertexArray()}function h(w){return n.bindVertexArray(w)}function f(w){return n.deleteVertexArray(w)}function d(w,B,j){const ee=j.wireframe===!0;let se=i[w.id];se===void 0&&(se={},i[w.id]=se);let re=se[B.id];re===void 0&&(re={},se[B.id]=re);let W=re[ee];return W===void 0&&(W=m(c()),re[ee]=W),W}function m(w){const B=[],j=[],ee=[];for(let se=0;se=0){const ie=se[K];let Ce=re[K];if(Ce===void 0&&(K==="instanceMatrix"&&w.instanceMatrix&&(Ce=w.instanceMatrix),K==="instanceColor"&&w.instanceColor&&(Ce=w.instanceColor)),ie===void 0||ie.attribute!==Ce||Ce&&ie.data!==Ce.data)return!0;W++}return r.attributesNum!==W||r.index!==ee}function x(w,B,j,ee){const se={},re=B.attributes;let W=0;const te=j.getAttributes();for(const K in te)if(te[K].location>=0){let ie=re[K];ie===void 0&&(K==="instanceMatrix"&&w.instanceMatrix&&(ie=w.instanceMatrix),K==="instanceColor"&&w.instanceColor&&(ie=w.instanceColor));const Ce={};Ce.attribute=ie,ie&&ie.data&&(Ce.data=ie.data),se[K]=Ce,W++}r.attributes=se,r.attributesNum=W,r.index=ee}function T(){const w=r.newAttributes;for(let B=0,j=w.length;B=0){let oe=se[te];if(oe===void 0&&(te==="instanceMatrix"&&w.instanceMatrix&&(oe=w.instanceMatrix),te==="instanceColor"&&w.instanceColor&&(oe=w.instanceColor)),oe!==void 0){const ie=oe.normalized,Ce=oe.itemSize,Xe=e.get(oe);if(Xe===void 0)continue;const nt=Xe.buffer,tt=Xe.type,gt=Xe.bytesPerElement,ge=tt===n.INT||tt===n.UNSIGNED_INT||oe.gpuType===L0;if(oe.isInterleavedBufferAttribute){const Ae=oe.data,Ze=Ae.stride,ue=oe.offset;if(Ae.isInstancedInterleavedBuffer){for(let it=0;it0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";I="mediump"}return I==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let h=t.precision!==void 0?t.precision:"highp";const f=c(h);f!==h&&(ut("WebGLRenderer:",h,"not supported, using",f,"instead."),h=f);const d=t.logarithmicDepthBuffer===!0,m=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),g=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),x=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),T=n.getParameter(n.MAX_TEXTURE_SIZE),y=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),v=n.getParameter(n.MAX_VERTEX_ATTRIBS),S=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),E=n.getParameter(n.MAX_VARYING_VECTORS),b=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),D=x>0,C=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:c,textureFormatReadable:s,textureTypeReadable:o,precision:h,logarithmicDepthBuffer:d,reversedDepthBuffer:m,maxTextures:g,maxVertexTextures:x,maxTextureSize:T,maxCubemapSize:y,maxAttributes:v,maxVertexUniforms:S,maxVaryings:E,maxFragmentUniforms:b,vertexTextures:D,maxSamples:C}}function _Y(n){const e=this;let t=null,i=0,a=!1,r=!1;const s=new Go,o=new Et,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(d,m){const g=d.length!==0||m||i!==0||a;return a=m,i=d.length,g},this.beginShadows=function(){r=!0,f(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,m){t=f(d,m,0)},this.setState=function(d,m,g){const x=d.clippingPlanes,T=d.clipIntersection,y=d.clipShadows,v=n.get(d);if(!a||x===null||x.length===0||r&&!y)r?f(null):h();else{const S=r?0:i,E=S*4;let b=v.clippingState||null;c.value=b,b=f(x,m,E,g);for(let D=0;D!==E;++D)b[D]=t[D];v.clippingState=b,this.numIntersection=T?this.numPlanes:0,this.numPlanes+=S}};function h(){c.value!==t&&(c.value=t,c.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function f(d,m,g,x){const T=d!==null?d.length:0;let y=null;if(T!==0){if(y=c.value,x!==!0||y===null){const v=g+T*4,S=m.matrixWorldInverse;o.getNormalMatrix(S),(y===null||y.length0){const h=new kU(c.height);return h.fromEquirectangularTexture(n,s),e.set(s,h),s.addEventListener("dispose",a),t(h.texture,s.mapping)}else return null}}return s}function a(s){const o=s.target;o.removeEventListener("dispose",a);const c=e.get(o);c!==void 0&&(e.delete(o),c.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}const $l=4,gN=[.125,.215,.35,.446,.526,.582],yu=20,yY=256,Xp=new ao,vN=new je;let h2=null,f2=0,d2=0,p2=!1;const SY=new L;class gE{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,i=.1,a=100,r={}){const{size:s=256,position:o=SY}=r;h2=this._renderer.getRenderTarget(),f2=this._renderer.getActiveCubeFace(),d2=this._renderer.getActiveMipmapLevel(),p2=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(s);const c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,i,a,c,o),t>0&&this._blur(c,0,0,t),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=yN(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=xN(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?D:0,D,D),d.setRenderTarget(a),v&&d.render(T,c),d.render(e,c)}d.toneMapping=g,d.autoClear=m,e.background=S}_textureToCubeUV(e,t){const i=this._renderer,a=e.mapping===rl||e.mapping===gc;a?(this._cubemapMaterial===null&&(this._cubemapMaterial=yN()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=xN());const r=a?this._cubemapMaterial:this._equirectMaterial,s=this._lodMeshes[0];s.material=r;const o=r.uniforms;o.envMap.value=e;const c=this._cubeSize;ff(t,0,0,3*c,2*c),i.setRenderTarget(t),i.render(s,Xp)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const a=this._lodMeshes.length;for(let r=1;rx-$l?i-x+$l:0),v=4*(this._cubeSize-T);c.envMap.value=e.texture,c.roughness.value=g,c.mipInt.value=x-t,ff(r,y,v,3*T,2*T),a.setRenderTarget(r),a.render(o,Xp),c.envMap.value=r.texture,c.roughness.value=0,c.mipInt.value=x-i,ff(e,y,v,3*T,2*T),a.setRenderTarget(e),a.render(o,Xp)}_blur(e,t,i,a,r){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,i,a,"latitudinal",r),this._halfBlur(s,e,i,i,a,"longitudinal",r)}_halfBlur(e,t,i,a,r,s,o){const c=this._renderer,h=this._blurMaterial;s!=="latitudinal"&&s!=="longitudinal"&&Bt("blur direction must be either latitudinal or longitudinal!");const f=3,d=this._lodMeshes[a];d.material=h;const m=h.uniforms,g=this._sizeLods[i]-1,x=isFinite(r)?Math.PI/(2*g):2*Math.PI/(2*yu-1),T=r/x,y=isFinite(r)?1+Math.floor(f*T):yu;y>yu&&ut(`sigmaRadians, ${r}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${yu}`);const v=[];let S=0;for(let I=0;IE-$l?a-E+$l:0),C=4*(this._cubeSize-b);ff(t,D,C,3*b,2*b),c.setRenderTarget(t),c.render(d,Xp)}}function TY(n){const e=[],t=[],i=[];let a=n;const r=n-$l+1+gN.length;for(let s=0;sn-$l?c=gN[s-n+$l-1]:s===0&&(c=0),t.push(c);const h=1/(o-2),f=-h,d=1+h,m=[f,f,d,f,d,d,f,f,d,d,f,d],g=6,x=6,T=3,y=2,v=1,S=new Float32Array(T*x*g),E=new Float32Array(y*x*g),b=new Float32Array(v*x*g);for(let C=0;C2?0:-1,O=[I,P,0,I+2/3,P,0,I+2/3,P+1,0,I,P,0,I+2/3,P+1,0,I,P+1,0];S.set(O,T*x*C),E.set(m,y*x*C);const w=[C,C,C,C,C,C];b.set(w,v*x*C)}const D=new Ct;D.setAttribute("position",new Ot(S,T)),D.setAttribute("uv",new Ot(E,y)),D.setAttribute("faceIndex",new Ot(b,v)),i.push(new oi(D,null)),a>$l&&a--}return{lodMeshes:i,sizeLods:e,sigmas:t}}function _N(n,e,t){const i=new xi(n,e,t);return i.texture.mapping=Xd,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function ff(n,e,t,i,a){n.viewport.set(e,t,i,a),n.scissor.set(e,t,i,a)}function EY(n,e,t){return new Vi({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:yY,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:sy(),fragmentShader:` precision highp float; precision highp int; @@ -3755,7 +3755,7 @@ void main() { gl_FragColor = vec4(prefilteredColor, 1.0); } - `,blending:Sa,depthTest:!1,depthWrite:!1})}function EY(n,e,t){const i=new Float32Array(_u),a=new L(0,1,0);return new Fi({name:"SphericalGaussianBlur",defines:{n:_u,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:a}},vertexShader:iy(),fragmentShader:` + `,blending:Ta,depthTest:!1,depthWrite:!1})}function MY(n,e,t){const i=new Float32Array(yu),a=new L(0,1,0);return new Vi({name:"SphericalGaussianBlur",defines:{n:yu,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:a}},vertexShader:sy(),fragmentShader:` precision mediump float; precision mediump int; @@ -3815,7 +3815,7 @@ void main() { } } - `,blending:Sa,depthTest:!1,depthWrite:!1})}function gN(){return new Fi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:iy(),fragmentShader:` + `,blending:Ta,depthTest:!1,depthWrite:!1})}function xN(){return new Vi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:sy(),fragmentShader:` precision mediump float; precision mediump int; @@ -3834,7 +3834,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:Sa,depthTest:!1,depthWrite:!1})}function vN(){return new Fi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:iy(),fragmentShader:` + `,blending:Ta,depthTest:!1,depthWrite:!1})}function yN(){return new Vi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:sy(),fragmentShader:` precision mediump float; precision mediump int; @@ -3850,7 +3850,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:Sa,depthTest:!1,depthWrite:!1})}function iy(){return` + `,blending:Ta,depthTest:!1,depthWrite:!1})}function sy(){return` precision mediump float; precision mediump int; @@ -3905,17 +3905,17 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function MY(n){let e=new WeakMap,t=null;function i(o){if(o&&o.isTexture){const c=o.mapping,h=c===a0||c===r0,f=c===al||c===dc;if(h||f){let d=e.get(o);const m=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==m)return t===null&&(t=new dE(n)),d=h?t.fromEquirectangular(o,d):t.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),d.texture;if(d!==void 0)return d.texture;{const g=o.image;return h&&g&&g.height>0||f&&g&&a(g)?(t===null&&(t=new dE(n)),d=h?t.fromEquirectangular(o):t.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),o.addEventListener("dispose",r),d.texture):null}}}return o}function a(o){let c=0;const h=6;for(let f=0;fe.maxTextureSize&&(C=Math.ceil(D/e.maxTextureSize),D=e.maxTextureSize);const I=new Float32Array(D*C*4*d),P=new U1(I,D,C,d);P.type=ri,P.needsUpdate=!0;const O=b*4;for(let B=0;B0)return n;const a=e*t;let r=xN[a];if(r===void 0&&(r=new Float32Array(a),xN[a]=r),e!==0){i.toArray(r,0);for(let s=1,o=0;s!==e;++s)o+=t,n[s].toArray(r,o)}return r}function Gi(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t0||f&&g&&a(g)?(t===null&&(t=new gE(n)),d=h?t.fromEquirectangular(o):t.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),o.addEventListener("dispose",r),d.texture):null}}}return o}function a(o){let c=0;const h=6;for(let f=0;fe.maxTextureSize&&(C=Math.ceil(D/e.maxTextureSize),D=e.maxTextureSize);const I=new Float32Array(D*C*4*d),P=new B1(I,D,C,d);P.type=si,P.needsUpdate=!0;const O=b*4;for(let B=0;B0)return n;const a=e*t;let r=TN[a];if(r===void 0&&(r=new Float32Array(a),TN[a]=r),e!==0){i.toArray(r,0);for(let s=1,o=0;s!==e;++s)o+=t,n[s].toArray(r,o)}return r}function ki(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${o}: ${t[s]}`)}return i.join(` -`)}const AN=new Et;function Mq(n){rn._getMatrix(AN,rn.workingColorSpace,n);const e=`mat3( ${AN.elements.map(t=>t.toFixed(4))} )`;switch(rn.getTransfer(n)){case o0:return[e,"LinearTransferOETF"];case Rn:return[e,"sRGBTransferOETF"];default:return ut("WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function RN(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=(n.getShaderInfoLog(e)||"").trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` +`)}const CN=new Et;function bq(n){rn._getMatrix(CN,rn.workingColorSpace,n);const e=`mat3( ${CN.elements.map(t=>t.toFixed(4))} )`;switch(rn.getTransfer(n)){case c0:return[e,"LinearTransferOETF"];case wn:return[e,"sRGBTransferOETF"];default:return ut("WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function NN(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=(n.getShaderInfoLog(e)||"").trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` `+r+` -`+Eq(n.getShaderSource(e),o)}else return r}function bq(n,e){const t=Mq(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` -`)}function Aq(n,e){let t;switch(e){case hU:t="Linear";break;case fU:t="Reinhard";break;case dU:t="Cineon";break;case cb:t="ACESFilmic";break;case mU:t="AgX";break;case gU:t="Neutral";break;case pU:t="Custom";break;default:ut("WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Lv=new L;function Rq(){rn.getLuminanceCoefficients(Lv);const n=Lv.x.toFixed(4),e=Lv.y.toFixed(4),t=Lv.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` -`)}function wq(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(cm).join(` -`)}function Cq(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function Nq(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let a=0;a/gm;function pE(n){return n.replace(Dq,Lq)}const Oq=new Map;function Lq(n,e){let t=Qt[e];if(t===void 0){const i=Oq.get(e);if(i!==void 0)t=Qt[i],ut('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return pE(t)}const Iq=/#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 NN(n){return n.replace(Iq,Uq)}function Uq(n,e,t,i){let a="";for(let r=parseInt(e);r/gm;function vE(n){return n.replace(Oq,Iq)}const Lq=new Map;function Iq(n,e){let t=Qt[e];if(t===void 0){const i=Lq.get(e);if(i!==void 0)t=Qt[i],ut('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return vE(t)}const Uq=/#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 LN(n){return n.replace(Uq,Pq)}function Pq(n,e,t,i){let a="";for(let r=parseInt(e);r0&&(S+=` -`),v=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x].filter(cm).join(` +#define LOW_PRECISION`),e}function zq(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===R1?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===Dm?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Ss&&(e="SHADOWMAP_TYPE_VSM"),e}function Bq(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case rl:case gc:e="ENVMAP_TYPE_CUBE";break;case Xd:e="ENVMAP_TYPE_CUBE_UV";break}return e}function Hq(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case gc:e="ENVMAP_MODE_REFRACTION";break}return e}function Fq(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case O0:e="ENVMAP_BLENDING_MULTIPLY";break;case fU:e="ENVMAP_BLENDING_MIX";break;case dU:e="ENVMAP_BLENDING_ADD";break}return e}function Gq(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:i,maxMip:t}}function Vq(n,e,t,i){const a=n.getContext(),r=t.defines;let s=t.vertexShader,o=t.fragmentShader;const c=zq(t),h=Bq(t),f=Hq(t),d=Fq(t),m=Gq(t),g=Cq(t),x=Nq(r),T=a.createProgram();let y,v,S=t.glslVersion?"#version "+t.glslVersion+` +`:"";t.isRawShaderMaterial?(y=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x].filter(hm).join(` +`),y.length>0&&(y+=` +`),v=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x].filter(hm).join(` `),v.length>0&&(v+=` -`)):(S=[DN(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(cm).join(` -`),v=[DN(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.envMap?"#define "+f:"",t.envMap?"#define "+d:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ns?"#define TONE_MAPPING":"",t.toneMapping!==ns?Qt.tonemapping_pars_fragment:"",t.toneMapping!==ns?Aq("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Qt.colorspace_pars_fragment,bq("linearToOutputTexel",t.outputColorSpace),Rq(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(cm).join(` -`)),s=pE(s),s=wN(s,t),s=CN(s,t),o=pE(o),o=wN(o,t),o=CN(o,t),s=NN(s),o=NN(o),t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,S=[g,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)):(y=[IN(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(hm).join(` +`),v=[IN(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.envMap?"#define "+f:"",t.envMap?"#define "+d:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==is?"#define TONE_MAPPING":"",t.toneMapping!==is?Qt.tonemapping_pars_fragment:"",t.toneMapping!==is?wq("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Qt.colorspace_pars_fragment,Aq("linearToOutputTexel",t.outputColorSpace),Rq(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(hm).join(` +`)),s=vE(s),s=DN(s,t),s=ON(s,t),o=vE(o),o=DN(o,t),o=ON(o,t),s=LN(s),o=LN(o),t.isRawShaderMaterial!==!0&&(S=`#version 300 es +`,y=[g,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+S,v=["#define varying in",t.glslVersion===ao?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===ao?"":"#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(` +`+y,v=["#define varying in",t.glslVersion===ro?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===ro?"":"#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(` `)+` -`+v);const E=y+S+s,b=y+v+o,D=bN(a,a.VERTEX_SHADER,E),C=bN(a,a.FRAGMENT_SHADER,b);a.attachShader(T,D),a.attachShader(T,C),t.index0AttributeName!==void 0?a.bindAttribLocation(T,0,t.index0AttributeName):t.morphTargets===!0&&a.bindAttribLocation(T,0,"position"),a.linkProgram(T);function I(B){if(n.debug.checkShaderErrors){const j=a.getProgramInfoLog(T)||"",ee=a.getShaderInfoLog(D)||"",se=a.getShaderInfoLog(C)||"",re=j.trim(),W=ee.trim(),te=se.trim();let K=!0,oe=!0;if(a.getProgramParameter(T,a.LINK_STATUS)===!1)if(K=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(a,T,D,C);else{const ie=RN(a,D,"vertex"),Ce=RN(a,C,"fragment");Bt("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(T,a.VALIDATE_STATUS)+` +`+v);const E=S+y+s,b=S+v+o,D=RN(a,a.VERTEX_SHADER,E),C=RN(a,a.FRAGMENT_SHADER,b);a.attachShader(T,D),a.attachShader(T,C),t.index0AttributeName!==void 0?a.bindAttribLocation(T,0,t.index0AttributeName):t.morphTargets===!0&&a.bindAttribLocation(T,0,"position"),a.linkProgram(T);function I(B){if(n.debug.checkShaderErrors){const j=a.getProgramInfoLog(T)||"",ee=a.getShaderInfoLog(D)||"",se=a.getShaderInfoLog(C)||"",re=j.trim(),W=ee.trim(),te=se.trim();let K=!0,oe=!0;if(a.getProgramParameter(T,a.LINK_STATUS)===!1)if(K=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(a,T,D,C);else{const ie=NN(a,D,"vertex"),Ce=NN(a,C,"fragment");Bt("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(T,a.VALIDATE_STATUS)+` Material Name: `+B.name+` Material Type: `+B.type+` Program Info Log: `+re+` `+ie+` -`+Ce)}else re!==""?ut("WebGLProgram: Program Info Log:",re):(W===""||te==="")&&(oe=!1);oe&&(B.diagnostics={runnable:K,programLog:re,vertexShader:{log:W,prefix:S},fragmentShader:{log:te,prefix:v}})}a.deleteShader(D),a.deleteShader(C),P=new m_(a,T),O=Nq(a,T)}let P;this.getUniforms=function(){return P===void 0&&I(this),P};let O;this.getAttributes=function(){return O===void 0&&I(this),O};let R=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return R===!1&&(R=a.getProgramParameter(T,Sq)),R},this.destroy=function(){i.releaseStatesOfProgram(this),a.deleteProgram(T),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Tq++,this.cacheKey=e,this.usedTimes=1,this.program=T,this.vertexShader=D,this.fragmentShader=C,this}let Vq=0;class kq{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,a=this._getShaderStage(t),r=this._getShaderStage(i),s=this._getShaderCacheForMaterial(e);return s.has(a)===!1&&(s.add(a),a.usedTimes++),s.has(r)===!1&&(s.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new Wq(e),t.set(e,i)),i}}class Wq{constructor(e){this.id=Vq++,this.code=e,this.usedTimes=0}}function Xq(n,e,t,i,a,r,s){const o=new Md,c=new kq,h=new Set,f=[],d=a.logarithmicDepthBuffer,m=a.vertexTextures;let g=a.precision;const x={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"};function T(O){return h.add(O),O===0?"uv":`uv${O}`}function S(O,R,B,j,ee){const se=j.fog,re=ee.geometry,W=O.isMeshStandardMaterial?j.environment:null,te=(O.isMeshStandardMaterial?t:e).get(O.envMap||W),K=te&&te.mapping===kd?te.image.height:null,oe=x[O.type];O.precision!==null&&(g=a.getMaxPrecision(O.precision),g!==O.precision&&ut("WebGLProgram.getParameters:",O.precision,"not supported, using",g,"instead."));const ie=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,Ce=ie!==void 0?ie.length:0;let Xe=0;re.morphAttributes.position!==void 0&&(Xe=1),re.morphAttributes.normal!==void 0&&(Xe=2),re.morphAttributes.color!==void 0&&(Xe=3);let nt,tt,gt,ge;if(oe){const Vt=Ms[oe];nt=Vt.vertexShader,tt=Vt.fragmentShader}else nt=O.vertexShader,tt=O.fragmentShader,c.update(O),gt=c.getVertexShaderID(O),ge=c.getFragmentShaderID(O);const Ae=n.getRenderTarget(),Ze=n.state.buffers.depth.getReversed(),ue=ee.isInstancedMesh===!0,it=ee.isBatchedMesh===!0,Mt=!!O.map,ot=!!O.matcap,Ke=!!te,Te=!!O.aoMap,G=!!O.lightMap,Me=!!O.bumpMap,De=!!O.normalMap,Fe=!!O.displacementMap,Be=!!O.emissiveMap,$e=!!O.metalnessMap,Je=!!O.roughnessMap,ct=O.anisotropy>0,k=O.clearcoat>0,U=O.dispersion>0,ce=O.iridescence>0,Ee=O.sheen>0,Le=O.transmission>0,ye=ct&&!!O.anisotropyMap,vt=k&&!!O.clearcoatMap,qe=k&&!!O.clearcoatNormalMap,_t=k&&!!O.clearcoatRoughnessMap,pt=ce&&!!O.iridescenceMap,Ie=ce&&!!O.iridescenceThicknessMap,He=Ee&&!!O.sheenColorMap,ht=Ee&&!!O.sheenRoughnessMap,Q=!!O.specularMap,pe=!!O.specularColorMap,Oe=!!O.specularIntensityMap,q=Le&&!!O.transmissionMap,Ve=Le&&!!O.thicknessMap,me=!!O.gradientMap,We=!!O.alphaMap,Ge=O.alphaTest>0,Re=!!O.alphaHash,rt=!!O.extensions;let yt=ns;O.toneMapped&&(Ae===null||Ae.isXRRenderTarget===!0)&&(yt=n.toneMapping);const Gt={shaderID:oe,shaderType:O.type,shaderName:O.name,vertexShader:nt,fragmentShader:tt,defines:O.defines,customVertexShaderID:gt,customFragmentShaderID:ge,isRawShaderMaterial:O.isRawShaderMaterial===!0,glslVersion:O.glslVersion,precision:g,batching:it,batchingColor:it&&ee._colorsTexture!==null,instancing:ue,instancingColor:ue&&ee.instanceColor!==null,instancingMorph:ue&&ee.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:Ae===null?n.outputColorSpace:Ae.isXRRenderTarget===!0?Ae.texture.colorSpace:Wn,alphaToCoverage:!!O.alphaToCoverage,map:Mt,matcap:ot,envMap:Ke,envMapMode:Ke&&te.mapping,envMapCubeUVHeight:K,aoMap:Te,lightMap:G,bumpMap:Me,normalMap:De,displacementMap:m&&Fe,emissiveMap:Be,normalMapObjectSpace:De&&O.normalMapType===MU,normalMapTangentSpace:De&&O.normalMapType===ol,metalnessMap:$e,roughnessMap:Je,anisotropy:ct,anisotropyMap:ye,clearcoat:k,clearcoatMap:vt,clearcoatNormalMap:qe,clearcoatRoughnessMap:_t,dispersion:U,iridescence:ce,iridescenceMap:pt,iridescenceThicknessMap:Ie,sheen:Ee,sheenColorMap:He,sheenRoughnessMap:ht,specularMap:Q,specularColorMap:pe,specularIntensityMap:Oe,transmission:Le,transmissionMap:q,thicknessMap:Ve,gradientMap:me,opaque:O.transparent===!1&&O.blending===Ou&&O.alphaToCoverage===!1,alphaMap:We,alphaTest:Ge,alphaHash:Re,combine:O.combine,mapUv:Mt&&T(O.map.channel),aoMapUv:Te&&T(O.aoMap.channel),lightMapUv:G&&T(O.lightMap.channel),bumpMapUv:Me&&T(O.bumpMap.channel),normalMapUv:De&&T(O.normalMap.channel),displacementMapUv:Fe&&T(O.displacementMap.channel),emissiveMapUv:Be&&T(O.emissiveMap.channel),metalnessMapUv:$e&&T(O.metalnessMap.channel),roughnessMapUv:Je&&T(O.roughnessMap.channel),anisotropyMapUv:ye&&T(O.anisotropyMap.channel),clearcoatMapUv:vt&&T(O.clearcoatMap.channel),clearcoatNormalMapUv:qe&&T(O.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_t&&T(O.clearcoatRoughnessMap.channel),iridescenceMapUv:pt&&T(O.iridescenceMap.channel),iridescenceThicknessMapUv:Ie&&T(O.iridescenceThicknessMap.channel),sheenColorMapUv:He&&T(O.sheenColorMap.channel),sheenRoughnessMapUv:ht&&T(O.sheenRoughnessMap.channel),specularMapUv:Q&&T(O.specularMap.channel),specularColorMapUv:pe&&T(O.specularColorMap.channel),specularIntensityMapUv:Oe&&T(O.specularIntensityMap.channel),transmissionMapUv:q&&T(O.transmissionMap.channel),thicknessMapUv:Ve&&T(O.thicknessMap.channel),alphaMapUv:We&&T(O.alphaMap.channel),vertexTangents:!!re.attributes.tangent&&(De||ct),vertexColors:O.vertexColors,vertexAlphas:O.vertexColors===!0&&!!re.attributes.color&&re.attributes.color.itemSize===4,pointsUvs:ee.isPoints===!0&&!!re.attributes.uv&&(Mt||We),fog:!!se,useFog:O.fog===!0,fogExp2:!!se&&se.isFogExp2,flatShading:O.flatShading===!0&&O.wireframe===!1,sizeAttenuation:O.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:Ze,skinning:ee.isSkinnedMesh===!0,morphTargets:re.morphAttributes.position!==void 0,morphNormals:re.morphAttributes.normal!==void 0,morphColors:re.morphAttributes.color!==void 0,morphTargetsCount:Ce,morphTextureStride:Xe,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:O.dithering,shadowMapEnabled:n.shadowMap.enabled&&B.length>0,shadowMapType:n.shadowMap.type,toneMapping:yt,decodeVideoTexture:Mt&&O.map.isVideoTexture===!0&&rn.getTransfer(O.map.colorSpace)===Rn,decodeVideoTextureEmissive:Be&&O.emissiveMap.isVideoTexture===!0&&rn.getTransfer(O.emissiveMap.colorSpace)===Rn,premultipliedAlpha:O.premultipliedAlpha,doubleSided:O.side===la,flipSided:O.side===Oi,useDepthPacking:O.depthPacking>=0,depthPacking:O.depthPacking||0,index0AttributeName:O.index0AttributeName,extensionClipCullDistance:rt&&O.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(rt&&O.extensions.multiDraw===!0||it)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:O.customProgramCacheKey()};return Gt.vertexUv1s=h.has(1),Gt.vertexUv2s=h.has(2),Gt.vertexUv3s=h.has(3),h.clear(),Gt}function v(O){const R=[];if(O.shaderID?R.push(O.shaderID):(R.push(O.customVertexShaderID),R.push(O.customFragmentShaderID)),O.defines!==void 0)for(const B in O.defines)R.push(B),R.push(O.defines[B]);return O.isRawShaderMaterial===!1&&(y(R,O),E(R,O),R.push(n.outputColorSpace)),R.push(O.customProgramCacheKey),R.join()}function y(O,R){O.push(R.precision),O.push(R.outputColorSpace),O.push(R.envMapMode),O.push(R.envMapCubeUVHeight),O.push(R.mapUv),O.push(R.alphaMapUv),O.push(R.lightMapUv),O.push(R.aoMapUv),O.push(R.bumpMapUv),O.push(R.normalMapUv),O.push(R.displacementMapUv),O.push(R.emissiveMapUv),O.push(R.metalnessMapUv),O.push(R.roughnessMapUv),O.push(R.anisotropyMapUv),O.push(R.clearcoatMapUv),O.push(R.clearcoatNormalMapUv),O.push(R.clearcoatRoughnessMapUv),O.push(R.iridescenceMapUv),O.push(R.iridescenceThicknessMapUv),O.push(R.sheenColorMapUv),O.push(R.sheenRoughnessMapUv),O.push(R.specularMapUv),O.push(R.specularColorMapUv),O.push(R.specularIntensityMapUv),O.push(R.transmissionMapUv),O.push(R.thicknessMapUv),O.push(R.combine),O.push(R.fogExp2),O.push(R.sizeAttenuation),O.push(R.morphTargetsCount),O.push(R.morphAttributeCount),O.push(R.numDirLights),O.push(R.numPointLights),O.push(R.numSpotLights),O.push(R.numSpotLightMaps),O.push(R.numHemiLights),O.push(R.numRectAreaLights),O.push(R.numDirLightShadows),O.push(R.numPointLightShadows),O.push(R.numSpotLightShadows),O.push(R.numSpotLightShadowsWithMaps),O.push(R.numLightProbes),O.push(R.shadowMapType),O.push(R.toneMapping),O.push(R.numClippingPlanes),O.push(R.numClipIntersection),O.push(R.depthPacking)}function E(O,R){o.disableAll(),R.supportsVertexTextures&&o.enable(0),R.instancing&&o.enable(1),R.instancingColor&&o.enable(2),R.instancingMorph&&o.enable(3),R.matcap&&o.enable(4),R.envMap&&o.enable(5),R.normalMapObjectSpace&&o.enable(6),R.normalMapTangentSpace&&o.enable(7),R.clearcoat&&o.enable(8),R.iridescence&&o.enable(9),R.alphaTest&&o.enable(10),R.vertexColors&&o.enable(11),R.vertexAlphas&&o.enable(12),R.vertexUv1s&&o.enable(13),R.vertexUv2s&&o.enable(14),R.vertexUv3s&&o.enable(15),R.vertexTangents&&o.enable(16),R.anisotropy&&o.enable(17),R.alphaHash&&o.enable(18),R.batching&&o.enable(19),R.dispersion&&o.enable(20),R.batchingColor&&o.enable(21),R.gradientMap&&o.enable(22),O.push(o.mask),o.disableAll(),R.fog&&o.enable(0),R.useFog&&o.enable(1),R.flatShading&&o.enable(2),R.logarithmicDepthBuffer&&o.enable(3),R.reversedDepthBuffer&&o.enable(4),R.skinning&&o.enable(5),R.morphTargets&&o.enable(6),R.morphNormals&&o.enable(7),R.morphColors&&o.enable(8),R.premultipliedAlpha&&o.enable(9),R.shadowMapEnabled&&o.enable(10),R.doubleSided&&o.enable(11),R.flipSided&&o.enable(12),R.useDepthPacking&&o.enable(13),R.dithering&&o.enable(14),R.transmission&&o.enable(15),R.sheen&&o.enable(16),R.opaque&&o.enable(17),R.pointsUvs&&o.enable(18),R.decodeVideoTexture&&o.enable(19),R.decodeVideoTextureEmissive&&o.enable(20),R.alphaToCoverage&&o.enable(21),O.push(o.mask)}function b(O){const R=x[O.type];let B;if(R){const j=Ms[R];B=Sb.clone(j.uniforms)}else B=O.uniforms;return B}function D(O,R){let B;for(let j=0,ee=f.length;j0?i.push(v):g.transparent===!0?a.push(v):t.push(v)}function c(d,m,g,x,T,S){const v=s(d,m,g,x,T,S);g.transmission>0?i.unshift(v):g.transparent===!0?a.unshift(v):t.unshift(v)}function h(d,m){t.length>1&&t.sort(d||qq),i.length>1&&i.sort(m||ON),a.length>1&&a.sort(m||ON)}function f(){for(let d=e,m=n.length;d=r.length?(s=new LN,r.push(s)):s=r[a],s}function t(){n=new WeakMap}return{get:e,dispose:t}}function Zq(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new L,color:new je};break;case"SpotLight":t={position:new L,direction:new L,color:new je,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new L,color:new je,distance:0,decay:0};break;case"HemisphereLight":t={direction:new L,skyColor:new je,groundColor:new je};break;case"RectAreaLight":t={color:new je,position:new L,halfWidth:new L,halfHeight:new L};break}return n[e.id]=t,t}}}function Kq(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let Qq=0;function Jq(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function $q(n){const e=new Zq,t=Kq(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let h=0;h<9;h++)i.probe.push(new L);const a=new L,r=new ke,s=new ke;function o(h){let f=0,d=0,m=0;for(let O=0;O<9;O++)i.probe[O].set(0,0,0);let g=0,x=0,T=0,S=0,v=0,y=0,E=0,b=0,D=0,C=0,I=0;h.sort(Jq);for(let O=0,R=h.length;O0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=at.LTC_FLOAT_1,i.rectAreaLTC2=at.LTC_FLOAT_2):(i.rectAreaLTC1=at.LTC_HALF_1,i.rectAreaLTC2=at.LTC_HALF_2)),i.ambient[0]=f,i.ambient[1]=d,i.ambient[2]=m;const P=i.hash;(P.directionalLength!==g||P.pointLength!==x||P.spotLength!==T||P.rectAreaLength!==S||P.hemiLength!==v||P.numDirectionalShadows!==y||P.numPointShadows!==E||P.numSpotShadows!==b||P.numSpotMaps!==D||P.numLightProbes!==I)&&(i.directional.length=g,i.spot.length=T,i.rectArea.length=S,i.point.length=x,i.hemi.length=v,i.directionalShadow.length=y,i.directionalShadowMap.length=y,i.pointShadow.length=E,i.pointShadowMap.length=E,i.spotShadow.length=b,i.spotShadowMap.length=b,i.directionalShadowMatrix.length=y,i.pointShadowMatrix.length=E,i.spotLightMatrix.length=b+D-C,i.spotLightMap.length=D,i.numSpotLightShadowsWithMaps=C,i.numLightProbes=I,P.directionalLength=g,P.pointLength=x,P.spotLength=T,P.rectAreaLength=S,P.hemiLength=v,P.numDirectionalShadows=y,P.numPointShadows=E,P.numSpotShadows=b,P.numSpotMaps=D,P.numLightProbes=I,i.version=Qq++)}function c(h,f){let d=0,m=0,g=0,x=0,T=0;const S=f.matrixWorldInverse;for(let v=0,y=h.length;v=s.length?(o=new IN(n),s.push(o)):o=s[r],o}function i(){e=new WeakMap}return{get:t,dispose:i}}const tj=`void main() { +`+Ce)}else re!==""?ut("WebGLProgram: Program Info Log:",re):(W===""||te==="")&&(oe=!1);oe&&(B.diagnostics={runnable:K,programLog:re,vertexShader:{log:W,prefix:y},fragmentShader:{log:te,prefix:v}})}a.deleteShader(D),a.deleteShader(C),P=new v_(a,T),O=Dq(a,T)}let P;this.getUniforms=function(){return P===void 0&&I(this),P};let O;this.getAttributes=function(){return O===void 0&&I(this),O};let w=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return w===!1&&(w=a.getProgramParameter(T,Tq)),w},this.destroy=function(){i.releaseStatesOfProgram(this),a.deleteProgram(T),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Eq++,this.cacheKey=e,this.usedTimes=1,this.program=T,this.vertexShader=D,this.fragmentShader=C,this}let kq=0;class Wq{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,a=this._getShaderStage(t),r=this._getShaderStage(i),s=this._getShaderCacheForMaterial(e);return s.has(a)===!1&&(s.add(a),a.usedTimes++),s.has(r)===!1&&(s.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new Xq(e),t.set(e,i)),i}}class Xq{constructor(e){this.id=kq++,this.code=e,this.usedTimes=0}}function Yq(n,e,t,i,a,r,s){const o=new Ad,c=new Wq,h=new Set,f=[],d=a.logarithmicDepthBuffer,m=a.vertexTextures;let g=a.precision;const x={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"};function T(O){return h.add(O),O===0?"uv":`uv${O}`}function y(O,w,B,j,ee){const se=j.fog,re=ee.geometry,W=O.isMeshStandardMaterial?j.environment:null,te=(O.isMeshStandardMaterial?t:e).get(O.envMap||W),K=te&&te.mapping===Xd?te.image.height:null,oe=x[O.type];O.precision!==null&&(g=a.getMaxPrecision(O.precision),g!==O.precision&&ut("WebGLProgram.getParameters:",O.precision,"not supported, using",g,"instead."));const ie=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,Ce=ie!==void 0?ie.length:0;let Xe=0;re.morphAttributes.position!==void 0&&(Xe=1),re.morphAttributes.normal!==void 0&&(Xe=2),re.morphAttributes.color!==void 0&&(Xe=3);let nt,tt,gt,ge;if(oe){const Vt=bs[oe];nt=Vt.vertexShader,tt=Vt.fragmentShader}else nt=O.vertexShader,tt=O.fragmentShader,c.update(O),gt=c.getVertexShaderID(O),ge=c.getFragmentShaderID(O);const Ae=n.getRenderTarget(),Ze=n.state.buffers.depth.getReversed(),ue=ee.isInstancedMesh===!0,it=ee.isBatchedMesh===!0,Mt=!!O.map,ot=!!O.matcap,Ke=!!te,Te=!!O.aoMap,G=!!O.lightMap,be=!!O.bumpMap,De=!!O.normalMap,Fe=!!O.displacementMap,Be=!!O.emissiveMap,$e=!!O.metalnessMap,Je=!!O.roughnessMap,ct=O.anisotropy>0,k=O.clearcoat>0,U=O.dispersion>0,ce=O.iridescence>0,Ee=O.sheen>0,Le=O.transmission>0,ye=ct&&!!O.anisotropyMap,vt=k&&!!O.clearcoatMap,qe=k&&!!O.clearcoatNormalMap,_t=k&&!!O.clearcoatRoughnessMap,pt=ce&&!!O.iridescenceMap,Ie=ce&&!!O.iridescenceThicknessMap,He=Ee&&!!O.sheenColorMap,ht=Ee&&!!O.sheenRoughnessMap,Q=!!O.specularMap,pe=!!O.specularColorMap,Oe=!!O.specularIntensityMap,q=Le&&!!O.transmissionMap,Ve=Le&&!!O.thicknessMap,me=!!O.gradientMap,We=!!O.alphaMap,Ge=O.alphaTest>0,we=!!O.alphaHash,rt=!!O.extensions;let yt=is;O.toneMapped&&(Ae===null||Ae.isXRRenderTarget===!0)&&(yt=n.toneMapping);const Gt={shaderID:oe,shaderType:O.type,shaderName:O.name,vertexShader:nt,fragmentShader:tt,defines:O.defines,customVertexShaderID:gt,customFragmentShaderID:ge,isRawShaderMaterial:O.isRawShaderMaterial===!0,glslVersion:O.glslVersion,precision:g,batching:it,batchingColor:it&&ee._colorsTexture!==null,instancing:ue,instancingColor:ue&&ee.instanceColor!==null,instancingMorph:ue&&ee.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:Ae===null?n.outputColorSpace:Ae.isXRRenderTarget===!0?Ae.texture.colorSpace:Wn,alphaToCoverage:!!O.alphaToCoverage,map:Mt,matcap:ot,envMap:Ke,envMapMode:Ke&&te.mapping,envMapCubeUVHeight:K,aoMap:Te,lightMap:G,bumpMap:be,normalMap:De,displacementMap:m&&Fe,emissiveMap:Be,normalMapObjectSpace:De&&O.normalMapType===AU,normalMapTangentSpace:De&&O.normalMapType===ll,metalnessMap:$e,roughnessMap:Je,anisotropy:ct,anisotropyMap:ye,clearcoat:k,clearcoatMap:vt,clearcoatNormalMap:qe,clearcoatRoughnessMap:_t,dispersion:U,iridescence:ce,iridescenceMap:pt,iridescenceThicknessMap:Ie,sheen:Ee,sheenColorMap:He,sheenRoughnessMap:ht,specularMap:Q,specularColorMap:pe,specularIntensityMap:Oe,transmission:Le,transmissionMap:q,thicknessMap:Ve,gradientMap:me,opaque:O.transparent===!1&&O.blending===Iu&&O.alphaToCoverage===!1,alphaMap:We,alphaTest:Ge,alphaHash:we,combine:O.combine,mapUv:Mt&&T(O.map.channel),aoMapUv:Te&&T(O.aoMap.channel),lightMapUv:G&&T(O.lightMap.channel),bumpMapUv:be&&T(O.bumpMap.channel),normalMapUv:De&&T(O.normalMap.channel),displacementMapUv:Fe&&T(O.displacementMap.channel),emissiveMapUv:Be&&T(O.emissiveMap.channel),metalnessMapUv:$e&&T(O.metalnessMap.channel),roughnessMapUv:Je&&T(O.roughnessMap.channel),anisotropyMapUv:ye&&T(O.anisotropyMap.channel),clearcoatMapUv:vt&&T(O.clearcoatMap.channel),clearcoatNormalMapUv:qe&&T(O.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_t&&T(O.clearcoatRoughnessMap.channel),iridescenceMapUv:pt&&T(O.iridescenceMap.channel),iridescenceThicknessMapUv:Ie&&T(O.iridescenceThicknessMap.channel),sheenColorMapUv:He&&T(O.sheenColorMap.channel),sheenRoughnessMapUv:ht&&T(O.sheenRoughnessMap.channel),specularMapUv:Q&&T(O.specularMap.channel),specularColorMapUv:pe&&T(O.specularColorMap.channel),specularIntensityMapUv:Oe&&T(O.specularIntensityMap.channel),transmissionMapUv:q&&T(O.transmissionMap.channel),thicknessMapUv:Ve&&T(O.thicknessMap.channel),alphaMapUv:We&&T(O.alphaMap.channel),vertexTangents:!!re.attributes.tangent&&(De||ct),vertexColors:O.vertexColors,vertexAlphas:O.vertexColors===!0&&!!re.attributes.color&&re.attributes.color.itemSize===4,pointsUvs:ee.isPoints===!0&&!!re.attributes.uv&&(Mt||We),fog:!!se,useFog:O.fog===!0,fogExp2:!!se&&se.isFogExp2,flatShading:O.flatShading===!0&&O.wireframe===!1,sizeAttenuation:O.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:Ze,skinning:ee.isSkinnedMesh===!0,morphTargets:re.morphAttributes.position!==void 0,morphNormals:re.morphAttributes.normal!==void 0,morphColors:re.morphAttributes.color!==void 0,morphTargetsCount:Ce,morphTextureStride:Xe,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numSpotLightMaps:w.spotLightMap.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numSpotLightShadowsWithMaps:w.numSpotLightShadowsWithMaps,numLightProbes:w.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:O.dithering,shadowMapEnabled:n.shadowMap.enabled&&B.length>0,shadowMapType:n.shadowMap.type,toneMapping:yt,decodeVideoTexture:Mt&&O.map.isVideoTexture===!0&&rn.getTransfer(O.map.colorSpace)===wn,decodeVideoTextureEmissive:Be&&O.emissiveMap.isVideoTexture===!0&&rn.getTransfer(O.emissiveMap.colorSpace)===wn,premultipliedAlpha:O.premultipliedAlpha,doubleSided:O.side===ca,flipSided:O.side===Ui,useDepthPacking:O.depthPacking>=0,depthPacking:O.depthPacking||0,index0AttributeName:O.index0AttributeName,extensionClipCullDistance:rt&&O.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(rt&&O.extensions.multiDraw===!0||it)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:O.customProgramCacheKey()};return Gt.vertexUv1s=h.has(1),Gt.vertexUv2s=h.has(2),Gt.vertexUv3s=h.has(3),h.clear(),Gt}function v(O){const w=[];if(O.shaderID?w.push(O.shaderID):(w.push(O.customVertexShaderID),w.push(O.customFragmentShaderID)),O.defines!==void 0)for(const B in O.defines)w.push(B),w.push(O.defines[B]);return O.isRawShaderMaterial===!1&&(S(w,O),E(w,O),w.push(n.outputColorSpace)),w.push(O.customProgramCacheKey),w.join()}function S(O,w){O.push(w.precision),O.push(w.outputColorSpace),O.push(w.envMapMode),O.push(w.envMapCubeUVHeight),O.push(w.mapUv),O.push(w.alphaMapUv),O.push(w.lightMapUv),O.push(w.aoMapUv),O.push(w.bumpMapUv),O.push(w.normalMapUv),O.push(w.displacementMapUv),O.push(w.emissiveMapUv),O.push(w.metalnessMapUv),O.push(w.roughnessMapUv),O.push(w.anisotropyMapUv),O.push(w.clearcoatMapUv),O.push(w.clearcoatNormalMapUv),O.push(w.clearcoatRoughnessMapUv),O.push(w.iridescenceMapUv),O.push(w.iridescenceThicknessMapUv),O.push(w.sheenColorMapUv),O.push(w.sheenRoughnessMapUv),O.push(w.specularMapUv),O.push(w.specularColorMapUv),O.push(w.specularIntensityMapUv),O.push(w.transmissionMapUv),O.push(w.thicknessMapUv),O.push(w.combine),O.push(w.fogExp2),O.push(w.sizeAttenuation),O.push(w.morphTargetsCount),O.push(w.morphAttributeCount),O.push(w.numDirLights),O.push(w.numPointLights),O.push(w.numSpotLights),O.push(w.numSpotLightMaps),O.push(w.numHemiLights),O.push(w.numRectAreaLights),O.push(w.numDirLightShadows),O.push(w.numPointLightShadows),O.push(w.numSpotLightShadows),O.push(w.numSpotLightShadowsWithMaps),O.push(w.numLightProbes),O.push(w.shadowMapType),O.push(w.toneMapping),O.push(w.numClippingPlanes),O.push(w.numClipIntersection),O.push(w.depthPacking)}function E(O,w){o.disableAll(),w.supportsVertexTextures&&o.enable(0),w.instancing&&o.enable(1),w.instancingColor&&o.enable(2),w.instancingMorph&&o.enable(3),w.matcap&&o.enable(4),w.envMap&&o.enable(5),w.normalMapObjectSpace&&o.enable(6),w.normalMapTangentSpace&&o.enable(7),w.clearcoat&&o.enable(8),w.iridescence&&o.enable(9),w.alphaTest&&o.enable(10),w.vertexColors&&o.enable(11),w.vertexAlphas&&o.enable(12),w.vertexUv1s&&o.enable(13),w.vertexUv2s&&o.enable(14),w.vertexUv3s&&o.enable(15),w.vertexTangents&&o.enable(16),w.anisotropy&&o.enable(17),w.alphaHash&&o.enable(18),w.batching&&o.enable(19),w.dispersion&&o.enable(20),w.batchingColor&&o.enable(21),w.gradientMap&&o.enable(22),O.push(o.mask),o.disableAll(),w.fog&&o.enable(0),w.useFog&&o.enable(1),w.flatShading&&o.enable(2),w.logarithmicDepthBuffer&&o.enable(3),w.reversedDepthBuffer&&o.enable(4),w.skinning&&o.enable(5),w.morphTargets&&o.enable(6),w.morphNormals&&o.enable(7),w.morphColors&&o.enable(8),w.premultipliedAlpha&&o.enable(9),w.shadowMapEnabled&&o.enable(10),w.doubleSided&&o.enable(11),w.flipSided&&o.enable(12),w.useDepthPacking&&o.enable(13),w.dithering&&o.enable(14),w.transmission&&o.enable(15),w.sheen&&o.enable(16),w.opaque&&o.enable(17),w.pointsUvs&&o.enable(18),w.decodeVideoTexture&&o.enable(19),w.decodeVideoTextureEmissive&&o.enable(20),w.alphaToCoverage&&o.enable(21),O.push(o.mask)}function b(O){const w=x[O.type];let B;if(w){const j=bs[w];B=Mb.clone(j.uniforms)}else B=O.uniforms;return B}function D(O,w){let B;for(let j=0,ee=f.length;j0?i.push(v):g.transparent===!0?a.push(v):t.push(v)}function c(d,m,g,x,T,y){const v=s(d,m,g,x,T,y);g.transmission>0?i.unshift(v):g.transparent===!0?a.unshift(v):t.unshift(v)}function h(d,m){t.length>1&&t.sort(d||jq),i.length>1&&i.sort(m||UN),a.length>1&&a.sort(m||UN)}function f(){for(let d=e,m=n.length;d=r.length?(s=new PN,r.push(s)):s=r[a],s}function t(){n=new WeakMap}return{get:e,dispose:t}}function Kq(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new L,color:new je};break;case"SpotLight":t={position:new L,direction:new L,color:new je,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new L,color:new je,distance:0,decay:0};break;case"HemisphereLight":t={direction:new L,skyColor:new je,groundColor:new je};break;case"RectAreaLight":t={color:new je,position:new L,halfWidth:new L,halfHeight:new L};break}return n[e.id]=t,t}}}function Qq(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let Jq=0;function $q(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function ej(n){const e=new Kq,t=Qq(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let h=0;h<9;h++)i.probe.push(new L);const a=new L,r=new ke,s=new ke;function o(h){let f=0,d=0,m=0;for(let O=0;O<9;O++)i.probe[O].set(0,0,0);let g=0,x=0,T=0,y=0,v=0,S=0,E=0,b=0,D=0,C=0,I=0;h.sort($q);for(let O=0,w=h.length;O0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=at.LTC_FLOAT_1,i.rectAreaLTC2=at.LTC_FLOAT_2):(i.rectAreaLTC1=at.LTC_HALF_1,i.rectAreaLTC2=at.LTC_HALF_2)),i.ambient[0]=f,i.ambient[1]=d,i.ambient[2]=m;const P=i.hash;(P.directionalLength!==g||P.pointLength!==x||P.spotLength!==T||P.rectAreaLength!==y||P.hemiLength!==v||P.numDirectionalShadows!==S||P.numPointShadows!==E||P.numSpotShadows!==b||P.numSpotMaps!==D||P.numLightProbes!==I)&&(i.directional.length=g,i.spot.length=T,i.rectArea.length=y,i.point.length=x,i.hemi.length=v,i.directionalShadow.length=S,i.directionalShadowMap.length=S,i.pointShadow.length=E,i.pointShadowMap.length=E,i.spotShadow.length=b,i.spotShadowMap.length=b,i.directionalShadowMatrix.length=S,i.pointShadowMatrix.length=E,i.spotLightMatrix.length=b+D-C,i.spotLightMap.length=D,i.numSpotLightShadowsWithMaps=C,i.numLightProbes=I,P.directionalLength=g,P.pointLength=x,P.spotLength=T,P.rectAreaLength=y,P.hemiLength=v,P.numDirectionalShadows=S,P.numPointShadows=E,P.numSpotShadows=b,P.numSpotMaps=D,P.numLightProbes=I,i.version=Jq++)}function c(h,f){let d=0,m=0,g=0,x=0,T=0;const y=f.matrixWorldInverse;for(let v=0,S=h.length;v=s.length?(o=new zN(n),s.push(o)):o=s[r],o}function i(){e=new WeakMap}return{get:t,dispose:i}}const nj=`void main() { gl_Position = vec4( position, 1.0 ); -}`,nj=`uniform sampler2D shadow_pass; +}`,ij=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3984,12 +3984,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function ij(n,e,t){let i=new Wd;const a=new de,r=new de,s=new zt,o=new Ib({depthPacking:EU}),c=new Ub,h={},f=t.maxTextureSize,d={[Cs]:Oi,[Oi]:Cs,[la]:la},m=new Fi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new de},radius:{value:4}},vertexShader:tj,fragmentShader:nj}),g=m.clone();g.defines.HORIZONTAL_PASS=1;const x=new wt;x.setAttribute("position",new Ot(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const T=new si(x,m),S=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=b1;let v=this.type;this.render=function(C,I,P){if(S.enabled===!1||S.autoUpdate===!1&&S.needsUpdate===!1||C.length===0)return;const O=n.getRenderTarget(),R=n.getActiveCubeFace(),B=n.getActiveMipmapLevel(),j=n.state;j.setBlending(Sa),j.buffers.depth.getReversed()===!0?j.buffers.color.setClear(0,0,0,0):j.buffers.color.setClear(1,1,1,1),j.buffers.depth.setTest(!0),j.setScissorTest(!1);const ee=v!==ys&&this.type===ys,se=v===ys&&this.type!==ys;for(let re=0,W=C.length;ref||a.y>f)&&(a.x>f&&(r.x=Math.floor(f/oe.x),a.x=r.x*oe.x,K.mapSize.x=r.x),a.y>f&&(r.y=Math.floor(f/oe.y),a.y=r.y*oe.y,K.mapSize.y=r.y)),K.map===null||ee===!0||se===!0){const Ce=this.type!==ys?{minFilter:Fn,magFilter:Fn}:{};K.map!==null&&K.map.dispose(),K.map=new _i(a.x,a.y,Ce),K.map.texture.name=te.name+".shadowMap",K.camera.updateProjectionMatrix()}n.setRenderTarget(K.map),n.clear();const ie=K.getViewportCount();for(let Ce=0;Ce0||I.map&&I.alphaTest>0||I.alphaToCoverage===!0){const j=R.uuid,ee=I.uuid;let se=h[j];se===void 0&&(se={},h[j]=se);let re=se[ee];re===void 0&&(re=R.clone(),se[ee]=re,I.addEventListener("dispose",D)),R=re}if(R.visible=I.visible,R.wireframe=I.wireframe,O===ys?R.side=I.shadowSide!==null?I.shadowSide:I.side:R.side=I.shadowSide!==null?I.shadowSide:d[I.side],R.alphaMap=I.alphaMap,R.alphaTest=I.alphaToCoverage===!0?.5:I.alphaTest,R.map=I.map,R.clipShadows=I.clipShadows,R.clippingPlanes=I.clippingPlanes,R.clipIntersection=I.clipIntersection,R.displacementMap=I.displacementMap,R.displacementScale=I.displacementScale,R.displacementBias=I.displacementBias,R.wireframeLinewidth=I.wireframeLinewidth,R.linewidth=I.linewidth,P.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const j=n.properties.get(R);j.light=P}return R}function b(C,I,P,O,R){if(C.visible===!1)return;if(C.layers.test(I.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&R===ys)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,C.matrixWorld);const ee=e.update(C),se=C.material;if(Array.isArray(se)){const re=ee.groups;for(let W=0,te=re.length;W=1):K.indexOf("OpenGL ES")!==-1&&(te=parseFloat(/^OpenGL ES (\d)/.exec(K)[1]),W=te>=2);let oe=null,ie={};const Ce=n.getParameter(n.SCISSOR_BOX),Xe=n.getParameter(n.VIEWPORT),nt=new zt().fromArray(Ce),tt=new zt().fromArray(Xe);function gt(q,Ve,me,We){const Ge=new Uint8Array(4),Re=n.createTexture();n.bindTexture(q,Re),n.texParameteri(q,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(q,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let rt=0;rt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new de,f=new WeakMap;let d;const m=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(k,U){return g?new OffscreenCanvas(k,U):c0("canvas")}function T(k,U,ce){let Ee=1;const Le=ct(k);if((Le.width>ce||Le.height>ce)&&(Ee=ce/Math.max(Le.width,Le.height)),Ee<1)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap||typeof VideoFrame<"u"&&k instanceof VideoFrame){const ye=Math.floor(Ee*Le.width),vt=Math.floor(Ee*Le.height);d===void 0&&(d=x(ye,vt));const qe=U?x(ye,vt):d;return qe.width=ye,qe.height=vt,qe.getContext("2d").drawImage(k,0,0,ye,vt),ut("WebGLRenderer: Texture has been resized from ("+Le.width+"x"+Le.height+") to ("+ye+"x"+vt+")."),qe}else return"data"in k&&ut("WebGLRenderer: Image in DataTexture is too big ("+Le.width+"x"+Le.height+")."),k;return k}function S(k){return k.generateMipmaps}function v(k){n.generateMipmap(k)}function y(k){return k.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:k.isWebGL3DRenderTarget?n.TEXTURE_3D:k.isWebGLArrayRenderTarget||k.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function E(k,U,ce,Ee,Le=!1){if(k!==null){if(n[k]!==void 0)return n[k];ut("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let ye=U;if(U===n.RED&&(ce===n.FLOAT&&(ye=n.R32F),ce===n.HALF_FLOAT&&(ye=n.R16F),ce===n.UNSIGNED_BYTE&&(ye=n.R8)),U===n.RED_INTEGER&&(ce===n.UNSIGNED_BYTE&&(ye=n.R8UI),ce===n.UNSIGNED_SHORT&&(ye=n.R16UI),ce===n.UNSIGNED_INT&&(ye=n.R32UI),ce===n.BYTE&&(ye=n.R8I),ce===n.SHORT&&(ye=n.R16I),ce===n.INT&&(ye=n.R32I)),U===n.RG&&(ce===n.FLOAT&&(ye=n.RG32F),ce===n.HALF_FLOAT&&(ye=n.RG16F),ce===n.UNSIGNED_BYTE&&(ye=n.RG8)),U===n.RG_INTEGER&&(ce===n.UNSIGNED_BYTE&&(ye=n.RG8UI),ce===n.UNSIGNED_SHORT&&(ye=n.RG16UI),ce===n.UNSIGNED_INT&&(ye=n.RG32UI),ce===n.BYTE&&(ye=n.RG8I),ce===n.SHORT&&(ye=n.RG16I),ce===n.INT&&(ye=n.RG32I)),U===n.RGB_INTEGER&&(ce===n.UNSIGNED_BYTE&&(ye=n.RGB8UI),ce===n.UNSIGNED_SHORT&&(ye=n.RGB16UI),ce===n.UNSIGNED_INT&&(ye=n.RGB32UI),ce===n.BYTE&&(ye=n.RGB8I),ce===n.SHORT&&(ye=n.RGB16I),ce===n.INT&&(ye=n.RGB32I)),U===n.RGBA_INTEGER&&(ce===n.UNSIGNED_BYTE&&(ye=n.RGBA8UI),ce===n.UNSIGNED_SHORT&&(ye=n.RGBA16UI),ce===n.UNSIGNED_INT&&(ye=n.RGBA32UI),ce===n.BYTE&&(ye=n.RGBA8I),ce===n.SHORT&&(ye=n.RGBA16I),ce===n.INT&&(ye=n.RGBA32I)),U===n.RGB&&(ce===n.UNSIGNED_INT_5_9_9_9_REV&&(ye=n.RGB9_E5),ce===n.UNSIGNED_INT_10F_11F_11F_REV&&(ye=n.R11F_G11F_B10F)),U===n.RGBA){const vt=Le?o0:rn.getTransfer(Ee);ce===n.FLOAT&&(ye=n.RGBA32F),ce===n.HALF_FLOAT&&(ye=n.RGBA16F),ce===n.UNSIGNED_BYTE&&(ye=vt===Rn?n.SRGB8_ALPHA8:n.RGBA8),ce===n.UNSIGNED_SHORT_4_4_4_4&&(ye=n.RGBA4),ce===n.UNSIGNED_SHORT_5_5_5_1&&(ye=n.RGB5_A1)}return(ye===n.R16F||ye===n.R32F||ye===n.RG16F||ye===n.RG32F||ye===n.RGBA16F||ye===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ye}function b(k,U){let ce;return k?U===null||U===Ns||U===Xu?ce=n.DEPTH24_STENCIL8:U===ri?ce=n.DEPTH32F_STENCIL8:U===Wu&&(ce=n.DEPTH24_STENCIL8,ut("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):U===null||U===Ns||U===Xu?ce=n.DEPTH_COMPONENT24:U===ri?ce=n.DEPTH_COMPONENT32F:U===Wu&&(ce=n.DEPTH_COMPONENT16),ce}function D(k,U){return S(k)===!0||k.isFramebufferTexture&&k.minFilter!==Fn&&k.minFilter!==Ht?Math.log2(Math.max(U.width,U.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?U.mipmaps.length:1}function C(k){const U=k.target;U.removeEventListener("dispose",C),P(U),U.isVideoTexture&&f.delete(U)}function I(k){const U=k.target;U.removeEventListener("dispose",I),R(U)}function P(k){const U=i.get(k);if(U.__webglInit===void 0)return;const ce=k.source,Ee=m.get(ce);if(Ee){const Le=Ee[U.__cacheKey];Le.usedTimes--,Le.usedTimes===0&&O(k),Object.keys(Ee).length===0&&m.delete(ce)}i.remove(k)}function O(k){const U=i.get(k);n.deleteTexture(U.__webglTexture);const ce=k.source,Ee=m.get(ce);delete Ee[U.__cacheKey],s.memory.textures--}function R(k){const U=i.get(k);if(k.depthTexture&&(k.depthTexture.dispose(),i.remove(k.depthTexture)),k.isWebGLCubeRenderTarget)for(let Ee=0;Ee<6;Ee++){if(Array.isArray(U.__webglFramebuffer[Ee]))for(let Le=0;Le=a.maxTextures&&ut("WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+a.maxTextures),B+=1,k}function se(k){const U=[];return U.push(k.wrapS),U.push(k.wrapT),U.push(k.wrapR||0),U.push(k.magFilter),U.push(k.minFilter),U.push(k.anisotropy),U.push(k.internalFormat),U.push(k.format),U.push(k.type),U.push(k.generateMipmaps),U.push(k.premultiplyAlpha),U.push(k.flipY),U.push(k.unpackAlignment),U.push(k.colorSpace),U.join()}function re(k,U){const ce=i.get(k);if(k.isVideoTexture&&$e(k),k.isRenderTargetTexture===!1&&k.isExternalTexture!==!0&&k.version>0&&ce.__version!==k.version){const Ee=k.image;if(Ee===null)ut("WebGLRenderer: Texture marked for update but no image data found.");else if(Ee.complete===!1)ut("WebGLRenderer: Texture marked for update but image is incomplete");else{ge(ce,k,U);return}}else k.isExternalTexture&&(ce.__webglTexture=k.sourceTexture?k.sourceTexture:null);t.bindTexture(n.TEXTURE_2D,ce.__webglTexture,n.TEXTURE0+U)}function W(k,U){const ce=i.get(k);if(k.isRenderTargetTexture===!1&&k.version>0&&ce.__version!==k.version){ge(ce,k,U);return}else k.isExternalTexture&&(ce.__webglTexture=k.sourceTexture?k.sourceTexture:null);t.bindTexture(n.TEXTURE_2D_ARRAY,ce.__webglTexture,n.TEXTURE0+U)}function te(k,U){const ce=i.get(k);if(k.isRenderTargetTexture===!1&&k.version>0&&ce.__version!==k.version){ge(ce,k,U);return}t.bindTexture(n.TEXTURE_3D,ce.__webglTexture,n.TEXTURE0+U)}function K(k,U){const ce=i.get(k);if(k.version>0&&ce.__version!==k.version){Ae(ce,k,U);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ce.__webglTexture,n.TEXTURE0+U)}const oe={[Ta]:n.REPEAT,[Li]:n.CLAMP_TO_EDGE,[vd]:n.MIRRORED_REPEAT},ie={[Fn]:n.NEAREST,[R1]:n.NEAREST_MIPMAP_NEAREST,[yu]:n.NEAREST_MIPMAP_LINEAR,[Ht]:n.LINEAR,[td]:n.LINEAR_MIPMAP_NEAREST,[Er]:n.LINEAR_MIPMAP_LINEAR},Ce={[bU]:n.NEVER,[DU]:n.ALWAYS,[AU]:n.LESS,[gb]:n.LEQUAL,[RU]:n.EQUAL,[NU]:n.GEQUAL,[wU]:n.GREATER,[CU]:n.NOTEQUAL};function Xe(k,U){if(U.type===ri&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===Ht||U.magFilter===td||U.magFilter===yu||U.magFilter===Er||U.minFilter===Ht||U.minFilter===td||U.minFilter===yu||U.minFilter===Er)&&ut("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(k,n.TEXTURE_WRAP_S,oe[U.wrapS]),n.texParameteri(k,n.TEXTURE_WRAP_T,oe[U.wrapT]),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,oe[U.wrapR]),n.texParameteri(k,n.TEXTURE_MAG_FILTER,ie[U.magFilter]),n.texParameteri(k,n.TEXTURE_MIN_FILTER,ie[U.minFilter]),U.compareFunction&&(n.texParameteri(k,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(k,n.TEXTURE_COMPARE_FUNC,Ce[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===Fn||U.minFilter!==yu&&U.minFilter!==Er||U.type===ri&&e.has("OES_texture_float_linear")===!1)return;if(U.anisotropy>1||i.get(U).__currentAnisotropy){const ce=e.get("EXT_texture_filter_anisotropic");n.texParameterf(k,ce.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,a.getMaxAnisotropy())),i.get(U).__currentAnisotropy=U.anisotropy}}}function nt(k,U){let ce=!1;k.__webglInit===void 0&&(k.__webglInit=!0,U.addEventListener("dispose",C));const Ee=U.source;let Le=m.get(Ee);Le===void 0&&(Le={},m.set(Ee,Le));const ye=se(U);if(ye!==k.__cacheKey){Le[ye]===void 0&&(Le[ye]={texture:n.createTexture(),usedTimes:0},s.memory.textures++,ce=!0),Le[ye].usedTimes++;const vt=Le[k.__cacheKey];vt!==void 0&&(Le[k.__cacheKey].usedTimes--,vt.usedTimes===0&&O(U)),k.__cacheKey=ye,k.__webglTexture=Le[ye].texture}return ce}function tt(k,U,ce){return Math.floor(Math.floor(k/ce)/U)}function gt(k,U,ce,Ee){const ye=k.updateRanges;if(ye.length===0)t.texSubImage2D(n.TEXTURE_2D,0,0,0,U.width,U.height,ce,Ee,U.data);else{ye.sort((Ie,He)=>Ie.start-He.start);let vt=0;for(let Ie=1;Ie0){q&&Ve&&t.texStorage2D(n.TEXTURE_2D,We,Q,Oe[0].width,Oe[0].height);for(let Ge=0,Re=Oe.length;Ge0){const rt=fE(pe.width,pe.height,U.format,U.type);for(const yt of U.layerUpdates){const Gt=pe.data.subarray(yt*rt/pe.data.BYTES_PER_ELEMENT,(yt+1)*rt/pe.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,Ge,0,0,yt,pe.width,pe.height,1,He,Gt)}U.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,Ge,0,0,0,pe.width,pe.height,Ie.depth,He,pe.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,Ge,Q,pe.width,pe.height,Ie.depth,0,pe.data,0,0);else ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else q?me&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,Ge,0,0,0,pe.width,pe.height,Ie.depth,He,ht,pe.data):t.texImage3D(n.TEXTURE_2D_ARRAY,Ge,Q,pe.width,pe.height,Ie.depth,0,He,ht,pe.data)}else{q&&Ve&&t.texStorage2D(n.TEXTURE_2D,We,Q,Oe[0].width,Oe[0].height);for(let Ge=0,Re=Oe.length;Ge0){const Ge=fE(Ie.width,Ie.height,U.format,U.type);for(const Re of U.layerUpdates){const rt=Ie.data.subarray(Re*Ge/Ie.data.BYTES_PER_ELEMENT,(Re+1)*Ge/Ie.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,Re,Ie.width,Ie.height,1,He,ht,rt)}U.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Ie.width,Ie.height,Ie.depth,He,ht,Ie.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,Q,Ie.width,Ie.height,Ie.depth,0,He,ht,Ie.data);else if(U.isData3DTexture)q?(Ve&&t.texStorage3D(n.TEXTURE_3D,We,Q,Ie.width,Ie.height,Ie.depth),me&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Ie.width,Ie.height,Ie.depth,He,ht,Ie.data)):t.texImage3D(n.TEXTURE_3D,0,Q,Ie.width,Ie.height,Ie.depth,0,He,ht,Ie.data);else if(U.isFramebufferTexture){if(Ve)if(q)t.texStorage2D(n.TEXTURE_2D,We,Q,Ie.width,Ie.height);else{let Ge=Ie.width,Re=Ie.height;for(let rt=0;rt>=1,Re>>=1}}else if(Oe.length>0){if(q&&Ve){const Ge=ct(Oe[0]);t.texStorage2D(n.TEXTURE_2D,We,Q,Ge.width,Ge.height)}for(let Ge=0,Re=Oe.length;Ge0&&We++;const Re=ct(He[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,We,Oe,Re.width,Re.height)}for(let Re=0;Re<6;Re++)if(Ie){q?me&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,0,0,0,He[Re].width,He[Re].height,Q,pe,He[Re].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,0,Oe,He[Re].width,He[Re].height,0,Q,pe,He[Re].data);for(let rt=0;rt>ye),ht=Math.max(1,U.height>>ye);Le===n.TEXTURE_3D||Le===n.TEXTURE_2D_ARRAY?t.texImage3D(Le,ye,_t,He,ht,U.depth,0,vt,qe,null):t.texImage2D(Le,ye,_t,He,ht,0,vt,qe,null)}t.bindFramebuffer(n.FRAMEBUFFER,k),Be(U)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,Ee,Le,Ie.__webglTexture,0,Fe(U)):(Le===n.TEXTURE_2D||Le>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Le<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,Ee,Le,Ie.__webglTexture,ye),t.bindFramebuffer(n.FRAMEBUFFER,null)}function ue(k,U,ce){if(n.bindRenderbuffer(n.RENDERBUFFER,k),U.depthBuffer){const Ee=U.depthTexture,Le=Ee&&Ee.isDepthTexture?Ee.type:null,ye=b(U.stencilBuffer,Le),vt=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,qe=Fe(U);Be(U)?o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,qe,ye,U.width,U.height):ce?n.renderbufferStorageMultisample(n.RENDERBUFFER,qe,ye,U.width,U.height):n.renderbufferStorage(n.RENDERBUFFER,ye,U.width,U.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,vt,n.RENDERBUFFER,k)}else{const Ee=U.textures;for(let Le=0;Le{delete U.__boundDepthTexture,delete U.__depthDisposeCallback,Ee.removeEventListener("dispose",Le)};Ee.addEventListener("dispose",Le),U.__depthDisposeCallback=Le}U.__boundDepthTexture=Ee}if(k.depthTexture&&!U.__autoAllocateDepthBuffer){if(ce)throw new Error("target.depthTexture not supported in Cube render targets");const Ee=k.texture.mipmaps;Ee&&Ee.length>0?it(U.__webglFramebuffer[0],k):it(U.__webglFramebuffer,k)}else if(ce){U.__webglDepthbuffer=[];for(let Ee=0;Ee<6;Ee++)if(t.bindFramebuffer(n.FRAMEBUFFER,U.__webglFramebuffer[Ee]),U.__webglDepthbuffer[Ee]===void 0)U.__webglDepthbuffer[Ee]=n.createRenderbuffer(),ue(U.__webglDepthbuffer[Ee],k,!1);else{const Le=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ye=U.__webglDepthbuffer[Ee];n.bindRenderbuffer(n.RENDERBUFFER,ye),n.framebufferRenderbuffer(n.FRAMEBUFFER,Le,n.RENDERBUFFER,ye)}}else{const Ee=k.texture.mipmaps;if(Ee&&Ee.length>0?t.bindFramebuffer(n.FRAMEBUFFER,U.__webglFramebuffer[0]):t.bindFramebuffer(n.FRAMEBUFFER,U.__webglFramebuffer),U.__webglDepthbuffer===void 0)U.__webglDepthbuffer=n.createRenderbuffer(),ue(U.__webglDepthbuffer,k,!1);else{const Le=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ye=U.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,ye),n.framebufferRenderbuffer(n.FRAMEBUFFER,Le,n.RENDERBUFFER,ye)}}t.bindFramebuffer(n.FRAMEBUFFER,null)}function ot(k,U,ce){const Ee=i.get(k);U!==void 0&&Ze(Ee.__webglFramebuffer,k,k.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),ce!==void 0&&Mt(k)}function Ke(k){const U=k.texture,ce=i.get(k),Ee=i.get(U);k.addEventListener("dispose",I);const Le=k.textures,ye=k.isWebGLCubeRenderTarget===!0,vt=Le.length>1;if(vt||(Ee.__webglTexture===void 0&&(Ee.__webglTexture=n.createTexture()),Ee.__version=U.version,s.memory.textures++),ye){ce.__webglFramebuffer=[];for(let qe=0;qe<6;qe++)if(U.mipmaps&&U.mipmaps.length>0){ce.__webglFramebuffer[qe]=[];for(let _t=0;_t0){ce.__webglFramebuffer=[];for(let qe=0;qe0&&Be(k)===!1){ce.__webglMultisampledFramebuffer=n.createFramebuffer(),ce.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ce.__webglMultisampledFramebuffer);for(let qe=0;qe0)for(let _t=0;_t0)for(let _t=0;_t0){if(Be(k)===!1){const U=k.textures,ce=k.width,Ee=k.height;let Le=n.COLOR_BUFFER_BIT;const ye=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,vt=i.get(k),qe=U.length>1;if(qe)for(let pt=0;pt0?t.bindFramebuffer(n.DRAW_FRAMEBUFFER,vt.__webglFramebuffer[0]):t.bindFramebuffer(n.DRAW_FRAMEBUFFER,vt.__webglFramebuffer);for(let pt=0;pt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&U.__useRenderToTexture!==!1}function $e(k){const U=s.render.frame;f.get(k)!==U&&(f.set(k,U),k.update())}function Je(k,U){const ce=k.colorSpace,Ee=k.format,Le=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||ce!==Wn&&ce!==Na&&(rn.getTransfer(ce)===Rn?(Ee!==Jn||Le!==Ii)&&ut("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Bt("WebGLTextures: Unsupported texture color space:",ce)),U}function ct(k){return typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement?(h.width=k.naturalWidth||k.width,h.height=k.naturalHeight||k.height):typeof VideoFrame<"u"&&k instanceof VideoFrame?(h.width=k.displayWidth,h.height=k.displayHeight):(h.width=k.width,h.height=k.height),h}this.allocateTextureUnit=ee,this.resetTextureUnits=j,this.setTexture2D=re,this.setTexture2DArray=W,this.setTexture3D=te,this.setTextureCube=K,this.rebindTextures=ot,this.setupRenderTarget=Ke,this.updateRenderTargetMipmap=Te,this.updateMultisampleRenderTarget=De,this.setupDepthRenderbuffer=Mt,this.setupFrameBufferTexture=Ze,this.useMultisampledRTT=Be}function B6(n,e){function t(i,a=Na){let r;const s=rn.getTransfer(a);if(i===Ii)return n.UNSIGNED_BYTE;if(i===N1)return n.UNSIGNED_SHORT_4_4_4_4;if(i===D1)return n.UNSIGNED_SHORT_5_5_5_1;if(i===ub)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===hb)return n.UNSIGNED_INT_10F_11F_11F_REV;if(i===w1)return n.BYTE;if(i===C1)return n.SHORT;if(i===Wu)return n.UNSIGNED_SHORT;if(i===D0)return n.INT;if(i===Ns)return n.UNSIGNED_INT;if(i===ri)return n.FLOAT;if(i===Xn)return n.HALF_FLOAT;if(i===fb)return n.ALPHA;if(i===db)return n.RGB;if(i===Jn)return n.RGBA;if(i===_d)return n.DEPTH_COMPONENT;if(i===Yu)return n.DEPTH_STENCIL;if(i===bs)return n.RED;if(i===O0)return n.RED_INTEGER;if(i===Vo)return n.RG;if(i===O1)return n.RG_INTEGER;if(i===L1)return n.RGBA_INTEGER;if(i===Nm||i===Dm||i===Om||i===Lm)if(s===Rn)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===Nm)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Dm)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Om)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Lm)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===Nm)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Dm)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Om)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Lm)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===rx||i===sx||i===ox||i===lx)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===rx)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===sx)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===ox)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===lx)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===cx||i===ux||i===hx)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(i===cx||i===ux)return s===Rn?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===hx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===fx||i===dx||i===px||i===mx||i===gx||i===vx||i===_x||i===xx||i===yx||i===Sx||i===Tx||i===Ex||i===Mx||i===bx)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(i===fx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===dx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===px)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===mx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===gx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===vx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===_x)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===xx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===yx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Sx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Tx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Ex)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Mx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===bx)return s===Rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Ax||i===Rx||i===wx)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(i===Ax)return s===Rn?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Rx)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===wx)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Cx||i===Nx||i===Dx||i===Ox)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(i===Cx)return r.COMPRESSED_RED_RGTC1_EXT;if(i===Nx)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Dx)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Ox)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Xu?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const oj=` +}`;function aj(n,e,t){let i=new Yd;const a=new de,r=new de,s=new zt,o=new zb({depthPacking:bU}),c=new Bb,h={},f=t.maxTextureSize,d={[Ns]:Ui,[Ui]:Ns,[ca]:ca},m=new Vi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new de},radius:{value:4}},vertexShader:nj,fragmentShader:ij}),g=m.clone();g.defines.HORIZONTAL_PASS=1;const x=new Ct;x.setAttribute("position",new Ot(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const T=new oi(x,m),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=R1;let v=this.type;this.render=function(C,I,P){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||C.length===0)return;const O=n.getRenderTarget(),w=n.getActiveCubeFace(),B=n.getActiveMipmapLevel(),j=n.state;j.setBlending(Ta),j.buffers.depth.getReversed()===!0?j.buffers.color.setClear(0,0,0,0):j.buffers.color.setClear(1,1,1,1),j.buffers.depth.setTest(!0),j.setScissorTest(!1);const ee=v!==Ss&&this.type===Ss,se=v===Ss&&this.type!==Ss;for(let re=0,W=C.length;ref||a.y>f)&&(a.x>f&&(r.x=Math.floor(f/oe.x),a.x=r.x*oe.x,K.mapSize.x=r.x),a.y>f&&(r.y=Math.floor(f/oe.y),a.y=r.y*oe.y,K.mapSize.y=r.y)),K.map===null||ee===!0||se===!0){const Ce=this.type!==Ss?{minFilter:Fn,magFilter:Fn}:{};K.map!==null&&K.map.dispose(),K.map=new xi(a.x,a.y,Ce),K.map.texture.name=te.name+".shadowMap",K.camera.updateProjectionMatrix()}n.setRenderTarget(K.map),n.clear();const ie=K.getViewportCount();for(let Ce=0;Ce0||I.map&&I.alphaTest>0||I.alphaToCoverage===!0){const j=w.uuid,ee=I.uuid;let se=h[j];se===void 0&&(se={},h[j]=se);let re=se[ee];re===void 0&&(re=w.clone(),se[ee]=re,I.addEventListener("dispose",D)),w=re}if(w.visible=I.visible,w.wireframe=I.wireframe,O===Ss?w.side=I.shadowSide!==null?I.shadowSide:I.side:w.side=I.shadowSide!==null?I.shadowSide:d[I.side],w.alphaMap=I.alphaMap,w.alphaTest=I.alphaToCoverage===!0?.5:I.alphaTest,w.map=I.map,w.clipShadows=I.clipShadows,w.clippingPlanes=I.clippingPlanes,w.clipIntersection=I.clipIntersection,w.displacementMap=I.displacementMap,w.displacementScale=I.displacementScale,w.displacementBias=I.displacementBias,w.wireframeLinewidth=I.wireframeLinewidth,w.linewidth=I.linewidth,P.isPointLight===!0&&w.isMeshDistanceMaterial===!0){const j=n.properties.get(w);j.light=P}return w}function b(C,I,P,O,w){if(C.visible===!1)return;if(C.layers.test(I.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&w===Ss)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,C.matrixWorld);const ee=e.update(C),se=C.material;if(Array.isArray(se)){const re=ee.groups;for(let W=0,te=re.length;W=1):K.indexOf("OpenGL ES")!==-1&&(te=parseFloat(/^OpenGL ES (\d)/.exec(K)[1]),W=te>=2);let oe=null,ie={};const Ce=n.getParameter(n.SCISSOR_BOX),Xe=n.getParameter(n.VIEWPORT),nt=new zt().fromArray(Ce),tt=new zt().fromArray(Xe);function gt(q,Ve,me,We){const Ge=new Uint8Array(4),we=n.createTexture();n.bindTexture(q,we),n.texParameteri(q,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(q,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let rt=0;rt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new de,f=new WeakMap;let d;const m=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(k,U){return g?new OffscreenCanvas(k,U):h0("canvas")}function T(k,U,ce){let Ee=1;const Le=ct(k);if((Le.width>ce||Le.height>ce)&&(Ee=ce/Math.max(Le.width,Le.height)),Ee<1)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap||typeof VideoFrame<"u"&&k instanceof VideoFrame){const ye=Math.floor(Ee*Le.width),vt=Math.floor(Ee*Le.height);d===void 0&&(d=x(ye,vt));const qe=U?x(ye,vt):d;return qe.width=ye,qe.height=vt,qe.getContext("2d").drawImage(k,0,0,ye,vt),ut("WebGLRenderer: Texture has been resized from ("+Le.width+"x"+Le.height+") to ("+ye+"x"+vt+")."),qe}else return"data"in k&&ut("WebGLRenderer: Image in DataTexture is too big ("+Le.width+"x"+Le.height+")."),k;return k}function y(k){return k.generateMipmaps}function v(k){n.generateMipmap(k)}function S(k){return k.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:k.isWebGL3DRenderTarget?n.TEXTURE_3D:k.isWebGLArrayRenderTarget||k.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function E(k,U,ce,Ee,Le=!1){if(k!==null){if(n[k]!==void 0)return n[k];ut("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let ye=U;if(U===n.RED&&(ce===n.FLOAT&&(ye=n.R32F),ce===n.HALF_FLOAT&&(ye=n.R16F),ce===n.UNSIGNED_BYTE&&(ye=n.R8)),U===n.RED_INTEGER&&(ce===n.UNSIGNED_BYTE&&(ye=n.R8UI),ce===n.UNSIGNED_SHORT&&(ye=n.R16UI),ce===n.UNSIGNED_INT&&(ye=n.R32UI),ce===n.BYTE&&(ye=n.R8I),ce===n.SHORT&&(ye=n.R16I),ce===n.INT&&(ye=n.R32I)),U===n.RG&&(ce===n.FLOAT&&(ye=n.RG32F),ce===n.HALF_FLOAT&&(ye=n.RG16F),ce===n.UNSIGNED_BYTE&&(ye=n.RG8)),U===n.RG_INTEGER&&(ce===n.UNSIGNED_BYTE&&(ye=n.RG8UI),ce===n.UNSIGNED_SHORT&&(ye=n.RG16UI),ce===n.UNSIGNED_INT&&(ye=n.RG32UI),ce===n.BYTE&&(ye=n.RG8I),ce===n.SHORT&&(ye=n.RG16I),ce===n.INT&&(ye=n.RG32I)),U===n.RGB_INTEGER&&(ce===n.UNSIGNED_BYTE&&(ye=n.RGB8UI),ce===n.UNSIGNED_SHORT&&(ye=n.RGB16UI),ce===n.UNSIGNED_INT&&(ye=n.RGB32UI),ce===n.BYTE&&(ye=n.RGB8I),ce===n.SHORT&&(ye=n.RGB16I),ce===n.INT&&(ye=n.RGB32I)),U===n.RGBA_INTEGER&&(ce===n.UNSIGNED_BYTE&&(ye=n.RGBA8UI),ce===n.UNSIGNED_SHORT&&(ye=n.RGBA16UI),ce===n.UNSIGNED_INT&&(ye=n.RGBA32UI),ce===n.BYTE&&(ye=n.RGBA8I),ce===n.SHORT&&(ye=n.RGBA16I),ce===n.INT&&(ye=n.RGBA32I)),U===n.RGB&&(ce===n.UNSIGNED_INT_5_9_9_9_REV&&(ye=n.RGB9_E5),ce===n.UNSIGNED_INT_10F_11F_11F_REV&&(ye=n.R11F_G11F_B10F)),U===n.RGBA){const vt=Le?c0:rn.getTransfer(Ee);ce===n.FLOAT&&(ye=n.RGBA32F),ce===n.HALF_FLOAT&&(ye=n.RGBA16F),ce===n.UNSIGNED_BYTE&&(ye=vt===wn?n.SRGB8_ALPHA8:n.RGBA8),ce===n.UNSIGNED_SHORT_4_4_4_4&&(ye=n.RGBA4),ce===n.UNSIGNED_SHORT_5_5_5_1&&(ye=n.RGB5_A1)}return(ye===n.R16F||ye===n.R32F||ye===n.RG16F||ye===n.RG32F||ye===n.RGBA16F||ye===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ye}function b(k,U){let ce;return k?U===null||U===Ds||U===qu?ce=n.DEPTH24_STENCIL8:U===si?ce=n.DEPTH32F_STENCIL8:U===Yu&&(ce=n.DEPTH24_STENCIL8,ut("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):U===null||U===Ds||U===qu?ce=n.DEPTH_COMPONENT24:U===si?ce=n.DEPTH_COMPONENT32F:U===Yu&&(ce=n.DEPTH_COMPONENT16),ce}function D(k,U){return y(k)===!0||k.isFramebufferTexture&&k.minFilter!==Fn&&k.minFilter!==Ht?Math.log2(Math.max(U.width,U.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?U.mipmaps.length:1}function C(k){const U=k.target;U.removeEventListener("dispose",C),P(U),U.isVideoTexture&&f.delete(U)}function I(k){const U=k.target;U.removeEventListener("dispose",I),w(U)}function P(k){const U=i.get(k);if(U.__webglInit===void 0)return;const ce=k.source,Ee=m.get(ce);if(Ee){const Le=Ee[U.__cacheKey];Le.usedTimes--,Le.usedTimes===0&&O(k),Object.keys(Ee).length===0&&m.delete(ce)}i.remove(k)}function O(k){const U=i.get(k);n.deleteTexture(U.__webglTexture);const ce=k.source,Ee=m.get(ce);delete Ee[U.__cacheKey],s.memory.textures--}function w(k){const U=i.get(k);if(k.depthTexture&&(k.depthTexture.dispose(),i.remove(k.depthTexture)),k.isWebGLCubeRenderTarget)for(let Ee=0;Ee<6;Ee++){if(Array.isArray(U.__webglFramebuffer[Ee]))for(let Le=0;Le=a.maxTextures&&ut("WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+a.maxTextures),B+=1,k}function se(k){const U=[];return U.push(k.wrapS),U.push(k.wrapT),U.push(k.wrapR||0),U.push(k.magFilter),U.push(k.minFilter),U.push(k.anisotropy),U.push(k.internalFormat),U.push(k.format),U.push(k.type),U.push(k.generateMipmaps),U.push(k.premultiplyAlpha),U.push(k.flipY),U.push(k.unpackAlignment),U.push(k.colorSpace),U.join()}function re(k,U){const ce=i.get(k);if(k.isVideoTexture&&$e(k),k.isRenderTargetTexture===!1&&k.isExternalTexture!==!0&&k.version>0&&ce.__version!==k.version){const Ee=k.image;if(Ee===null)ut("WebGLRenderer: Texture marked for update but no image data found.");else if(Ee.complete===!1)ut("WebGLRenderer: Texture marked for update but image is incomplete");else{ge(ce,k,U);return}}else k.isExternalTexture&&(ce.__webglTexture=k.sourceTexture?k.sourceTexture:null);t.bindTexture(n.TEXTURE_2D,ce.__webglTexture,n.TEXTURE0+U)}function W(k,U){const ce=i.get(k);if(k.isRenderTargetTexture===!1&&k.version>0&&ce.__version!==k.version){ge(ce,k,U);return}else k.isExternalTexture&&(ce.__webglTexture=k.sourceTexture?k.sourceTexture:null);t.bindTexture(n.TEXTURE_2D_ARRAY,ce.__webglTexture,n.TEXTURE0+U)}function te(k,U){const ce=i.get(k);if(k.isRenderTargetTexture===!1&&k.version>0&&ce.__version!==k.version){ge(ce,k,U);return}t.bindTexture(n.TEXTURE_3D,ce.__webglTexture,n.TEXTURE0+U)}function K(k,U){const ce=i.get(k);if(k.version>0&&ce.__version!==k.version){Ae(ce,k,U);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ce.__webglTexture,n.TEXTURE0+U)}const oe={[Ea]:n.REPEAT,[Pi]:n.CLAMP_TO_EDGE,[xd]:n.MIRRORED_REPEAT},ie={[Fn]:n.NEAREST,[N1]:n.NEAREST_MIPMAP_NEAREST,[Tu]:n.NEAREST_MIPMAP_LINEAR,[Ht]:n.LINEAR,[id]:n.LINEAR_MIPMAP_NEAREST,[Mr]:n.LINEAR_MIPMAP_LINEAR},Ce={[wU]:n.NEVER,[LU]:n.ALWAYS,[RU]:n.LESS,[xb]:n.LEQUAL,[CU]:n.EQUAL,[OU]:n.GEQUAL,[NU]:n.GREATER,[DU]:n.NOTEQUAL};function Xe(k,U){if(U.type===si&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===Ht||U.magFilter===id||U.magFilter===Tu||U.magFilter===Mr||U.minFilter===Ht||U.minFilter===id||U.minFilter===Tu||U.minFilter===Mr)&&ut("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(k,n.TEXTURE_WRAP_S,oe[U.wrapS]),n.texParameteri(k,n.TEXTURE_WRAP_T,oe[U.wrapT]),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,oe[U.wrapR]),n.texParameteri(k,n.TEXTURE_MAG_FILTER,ie[U.magFilter]),n.texParameteri(k,n.TEXTURE_MIN_FILTER,ie[U.minFilter]),U.compareFunction&&(n.texParameteri(k,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(k,n.TEXTURE_COMPARE_FUNC,Ce[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===Fn||U.minFilter!==Tu&&U.minFilter!==Mr||U.type===si&&e.has("OES_texture_float_linear")===!1)return;if(U.anisotropy>1||i.get(U).__currentAnisotropy){const ce=e.get("EXT_texture_filter_anisotropic");n.texParameterf(k,ce.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,a.getMaxAnisotropy())),i.get(U).__currentAnisotropy=U.anisotropy}}}function nt(k,U){let ce=!1;k.__webglInit===void 0&&(k.__webglInit=!0,U.addEventListener("dispose",C));const Ee=U.source;let Le=m.get(Ee);Le===void 0&&(Le={},m.set(Ee,Le));const ye=se(U);if(ye!==k.__cacheKey){Le[ye]===void 0&&(Le[ye]={texture:n.createTexture(),usedTimes:0},s.memory.textures++,ce=!0),Le[ye].usedTimes++;const vt=Le[k.__cacheKey];vt!==void 0&&(Le[k.__cacheKey].usedTimes--,vt.usedTimes===0&&O(U)),k.__cacheKey=ye,k.__webglTexture=Le[ye].texture}return ce}function tt(k,U,ce){return Math.floor(Math.floor(k/ce)/U)}function gt(k,U,ce,Ee){const ye=k.updateRanges;if(ye.length===0)t.texSubImage2D(n.TEXTURE_2D,0,0,0,U.width,U.height,ce,Ee,U.data);else{ye.sort((Ie,He)=>Ie.start-He.start);let vt=0;for(let Ie=1;Ie0){q&&Ve&&t.texStorage2D(n.TEXTURE_2D,We,Q,Oe[0].width,Oe[0].height);for(let Ge=0,we=Oe.length;Ge0){const rt=mE(pe.width,pe.height,U.format,U.type);for(const yt of U.layerUpdates){const Gt=pe.data.subarray(yt*rt/pe.data.BYTES_PER_ELEMENT,(yt+1)*rt/pe.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,Ge,0,0,yt,pe.width,pe.height,1,He,Gt)}U.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,Ge,0,0,0,pe.width,pe.height,Ie.depth,He,pe.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,Ge,Q,pe.width,pe.height,Ie.depth,0,pe.data,0,0);else ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else q?me&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,Ge,0,0,0,pe.width,pe.height,Ie.depth,He,ht,pe.data):t.texImage3D(n.TEXTURE_2D_ARRAY,Ge,Q,pe.width,pe.height,Ie.depth,0,He,ht,pe.data)}else{q&&Ve&&t.texStorage2D(n.TEXTURE_2D,We,Q,Oe[0].width,Oe[0].height);for(let Ge=0,we=Oe.length;Ge0){const Ge=mE(Ie.width,Ie.height,U.format,U.type);for(const we of U.layerUpdates){const rt=Ie.data.subarray(we*Ge/Ie.data.BYTES_PER_ELEMENT,(we+1)*Ge/Ie.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,we,Ie.width,Ie.height,1,He,ht,rt)}U.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Ie.width,Ie.height,Ie.depth,He,ht,Ie.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,Q,Ie.width,Ie.height,Ie.depth,0,He,ht,Ie.data);else if(U.isData3DTexture)q?(Ve&&t.texStorage3D(n.TEXTURE_3D,We,Q,Ie.width,Ie.height,Ie.depth),me&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Ie.width,Ie.height,Ie.depth,He,ht,Ie.data)):t.texImage3D(n.TEXTURE_3D,0,Q,Ie.width,Ie.height,Ie.depth,0,He,ht,Ie.data);else if(U.isFramebufferTexture){if(Ve)if(q)t.texStorage2D(n.TEXTURE_2D,We,Q,Ie.width,Ie.height);else{let Ge=Ie.width,we=Ie.height;for(let rt=0;rt>=1,we>>=1}}else if(Oe.length>0){if(q&&Ve){const Ge=ct(Oe[0]);t.texStorage2D(n.TEXTURE_2D,We,Q,Ge.width,Ge.height)}for(let Ge=0,we=Oe.length;Ge0&&We++;const we=ct(He[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,We,Oe,we.width,we.height)}for(let we=0;we<6;we++)if(Ie){q?me&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,0,0,He[we].width,He[we].height,Q,pe,He[we].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,Oe,He[we].width,He[we].height,0,Q,pe,He[we].data);for(let rt=0;rt>ye),ht=Math.max(1,U.height>>ye);Le===n.TEXTURE_3D||Le===n.TEXTURE_2D_ARRAY?t.texImage3D(Le,ye,_t,He,ht,U.depth,0,vt,qe,null):t.texImage2D(Le,ye,_t,He,ht,0,vt,qe,null)}t.bindFramebuffer(n.FRAMEBUFFER,k),Be(U)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,Ee,Le,Ie.__webglTexture,0,Fe(U)):(Le===n.TEXTURE_2D||Le>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Le<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,Ee,Le,Ie.__webglTexture,ye),t.bindFramebuffer(n.FRAMEBUFFER,null)}function ue(k,U,ce){if(n.bindRenderbuffer(n.RENDERBUFFER,k),U.depthBuffer){const Ee=U.depthTexture,Le=Ee&&Ee.isDepthTexture?Ee.type:null,ye=b(U.stencilBuffer,Le),vt=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,qe=Fe(U);Be(U)?o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,qe,ye,U.width,U.height):ce?n.renderbufferStorageMultisample(n.RENDERBUFFER,qe,ye,U.width,U.height):n.renderbufferStorage(n.RENDERBUFFER,ye,U.width,U.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,vt,n.RENDERBUFFER,k)}else{const Ee=U.textures;for(let Le=0;Le{delete U.__boundDepthTexture,delete U.__depthDisposeCallback,Ee.removeEventListener("dispose",Le)};Ee.addEventListener("dispose",Le),U.__depthDisposeCallback=Le}U.__boundDepthTexture=Ee}if(k.depthTexture&&!U.__autoAllocateDepthBuffer){if(ce)throw new Error("target.depthTexture not supported in Cube render targets");const Ee=k.texture.mipmaps;Ee&&Ee.length>0?it(U.__webglFramebuffer[0],k):it(U.__webglFramebuffer,k)}else if(ce){U.__webglDepthbuffer=[];for(let Ee=0;Ee<6;Ee++)if(t.bindFramebuffer(n.FRAMEBUFFER,U.__webglFramebuffer[Ee]),U.__webglDepthbuffer[Ee]===void 0)U.__webglDepthbuffer[Ee]=n.createRenderbuffer(),ue(U.__webglDepthbuffer[Ee],k,!1);else{const Le=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ye=U.__webglDepthbuffer[Ee];n.bindRenderbuffer(n.RENDERBUFFER,ye),n.framebufferRenderbuffer(n.FRAMEBUFFER,Le,n.RENDERBUFFER,ye)}}else{const Ee=k.texture.mipmaps;if(Ee&&Ee.length>0?t.bindFramebuffer(n.FRAMEBUFFER,U.__webglFramebuffer[0]):t.bindFramebuffer(n.FRAMEBUFFER,U.__webglFramebuffer),U.__webglDepthbuffer===void 0)U.__webglDepthbuffer=n.createRenderbuffer(),ue(U.__webglDepthbuffer,k,!1);else{const Le=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ye=U.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,ye),n.framebufferRenderbuffer(n.FRAMEBUFFER,Le,n.RENDERBUFFER,ye)}}t.bindFramebuffer(n.FRAMEBUFFER,null)}function ot(k,U,ce){const Ee=i.get(k);U!==void 0&&Ze(Ee.__webglFramebuffer,k,k.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),ce!==void 0&&Mt(k)}function Ke(k){const U=k.texture,ce=i.get(k),Ee=i.get(U);k.addEventListener("dispose",I);const Le=k.textures,ye=k.isWebGLCubeRenderTarget===!0,vt=Le.length>1;if(vt||(Ee.__webglTexture===void 0&&(Ee.__webglTexture=n.createTexture()),Ee.__version=U.version,s.memory.textures++),ye){ce.__webglFramebuffer=[];for(let qe=0;qe<6;qe++)if(U.mipmaps&&U.mipmaps.length>0){ce.__webglFramebuffer[qe]=[];for(let _t=0;_t0){ce.__webglFramebuffer=[];for(let qe=0;qe0&&Be(k)===!1){ce.__webglMultisampledFramebuffer=n.createFramebuffer(),ce.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ce.__webglMultisampledFramebuffer);for(let qe=0;qe0)for(let _t=0;_t0)for(let _t=0;_t0){if(Be(k)===!1){const U=k.textures,ce=k.width,Ee=k.height;let Le=n.COLOR_BUFFER_BIT;const ye=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,vt=i.get(k),qe=U.length>1;if(qe)for(let pt=0;pt0?t.bindFramebuffer(n.DRAW_FRAMEBUFFER,vt.__webglFramebuffer[0]):t.bindFramebuffer(n.DRAW_FRAMEBUFFER,vt.__webglFramebuffer);for(let pt=0;pt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&U.__useRenderToTexture!==!1}function $e(k){const U=s.render.frame;f.get(k)!==U&&(f.set(k,U),k.update())}function Je(k,U){const ce=k.colorSpace,Ee=k.format,Le=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||ce!==Wn&&ce!==Da&&(rn.getTransfer(ce)===wn?(Ee!==$n||Le!==zi)&&ut("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Bt("WebGLTextures: Unsupported texture color space:",ce)),U}function ct(k){return typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement?(h.width=k.naturalWidth||k.width,h.height=k.naturalHeight||k.height):typeof VideoFrame<"u"&&k instanceof VideoFrame?(h.width=k.displayWidth,h.height=k.displayHeight):(h.width=k.width,h.height=k.height),h}this.allocateTextureUnit=ee,this.resetTextureUnits=j,this.setTexture2D=re,this.setTexture2DArray=W,this.setTexture3D=te,this.setTextureCube=K,this.rebindTextures=ot,this.setupRenderTarget=Ke,this.updateRenderTargetMipmap=Te,this.updateMultisampleRenderTarget=De,this.setupDepthRenderbuffer=Mt,this.setupFrameBufferTexture=Ze,this.useMultisampledRTT=Be}function F6(n,e){function t(i,a=Da){let r;const s=rn.getTransfer(a);if(i===zi)return n.UNSIGNED_BYTE;if(i===L1)return n.UNSIGNED_SHORT_4_4_4_4;if(i===I1)return n.UNSIGNED_SHORT_5_5_5_1;if(i===fb)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===db)return n.UNSIGNED_INT_10F_11F_11F_REV;if(i===D1)return n.BYTE;if(i===O1)return n.SHORT;if(i===Yu)return n.UNSIGNED_SHORT;if(i===L0)return n.INT;if(i===Ds)return n.UNSIGNED_INT;if(i===si)return n.FLOAT;if(i===Xn)return n.HALF_FLOAT;if(i===pb)return n.ALPHA;if(i===mb)return n.RGB;if(i===$n)return n.RGBA;if(i===yd)return n.DEPTH_COMPONENT;if(i===ju)return n.DEPTH_STENCIL;if(i===As)return n.RED;if(i===I0)return n.RED_INTEGER;if(i===ko)return n.RG;if(i===U1)return n.RG_INTEGER;if(i===P1)return n.RGBA_INTEGER;if(i===Om||i===Lm||i===Im||i===Um)if(s===wn)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===Om)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Lm)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Im)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Um)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===Om)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Lm)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Im)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Um)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===lx||i===cx||i===ux||i===hx)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===lx)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===cx)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===ux)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===hx)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===fx||i===dx||i===px)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(i===fx||i===dx)return s===wn?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===px)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===mx||i===gx||i===vx||i===_x||i===xx||i===yx||i===Sx||i===Tx||i===Ex||i===Mx||i===bx||i===Ax||i===wx||i===Rx)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(i===mx)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===gx)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===vx)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===_x)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===xx)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===yx)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Sx)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Tx)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Ex)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Mx)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===bx)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Ax)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===wx)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Rx)return s===wn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Cx||i===Nx||i===Dx)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(i===Cx)return s===wn?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Nx)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===Dx)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Ox||i===Lx||i===Ix||i===Ux)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(i===Ox)return r.COMPRESSED_RED_RGTC1_EXT;if(i===Lx)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Ix)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Ux)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===qu?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const lj=` void main() { gl_Position = vec4( position, 1.0 ); -}`,lj=` +}`,cj=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -4008,7 +4008,7 @@ void main() { } -}`;class cj{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const i=new Ab(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new Fi({vertexShader:oj,fragmentShader:lj,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new si(new lh(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class uj extends tr{constructor(e,t){super();const i=this;let a=null,r=1,s=null,o="local-floor",c=1,h=null,f=null,d=null,m=null,g=null,x=null;const T=typeof XRWebGLBinding<"u",S=new cj,v={},y=t.getContextAttributes();let E=null,b=null;const D=[],C=[],I=new de;let P=null;const O=new ui;O.viewport=new zt;const R=new ui;R.viewport=new zt;const B=[O,R],j=new b6;let ee=null,se=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ge){let Ae=D[ge];return Ae===void 0&&(Ae=new p_,D[ge]=Ae),Ae.getTargetRaySpace()},this.getControllerGrip=function(ge){let Ae=D[ge];return Ae===void 0&&(Ae=new p_,D[ge]=Ae),Ae.getGripSpace()},this.getHand=function(ge){let Ae=D[ge];return Ae===void 0&&(Ae=new p_,D[ge]=Ae),Ae.getHandSpace()};function re(ge){const Ae=C.indexOf(ge.inputSource);if(Ae===-1)return;const Ze=D[Ae];Ze!==void 0&&(Ze.update(ge.inputSource,ge.frame,h||s),Ze.dispatchEvent({type:ge.type,data:ge.inputSource}))}function W(){a.removeEventListener("select",re),a.removeEventListener("selectstart",re),a.removeEventListener("selectend",re),a.removeEventListener("squeeze",re),a.removeEventListener("squeezestart",re),a.removeEventListener("squeezeend",re),a.removeEventListener("end",W),a.removeEventListener("inputsourceschange",te);for(let ge=0;ge=0&&(C[ue]=null,D[ue].disconnect(Ze))}for(let Ae=0;Ae=C.length){C.push(Ze),ue=Mt;break}else if(C[Mt]===null){C[Mt]=Ze,ue=Mt;break}if(ue===-1)break}const it=D[ue];it&&it.connect(Ze)}}const K=new L,oe=new L;function ie(ge,Ae,Ze){K.setFromMatrixPosition(Ae.matrixWorld),oe.setFromMatrixPosition(Ze.matrixWorld);const ue=K.distanceTo(oe),it=Ae.projectionMatrix.elements,Mt=Ze.projectionMatrix.elements,ot=it[14]/(it[10]-1),Ke=it[14]/(it[10]+1),Te=(it[9]+1)/it[5],G=(it[9]-1)/it[5],Me=(it[8]-1)/it[0],De=(Mt[8]+1)/Mt[0],Fe=ot*Me,Be=ot*De,$e=ue/(-Me+De),Je=$e*-Me;if(Ae.matrixWorld.decompose(ge.position,ge.quaternion,ge.scale),ge.translateX(Je),ge.translateZ($e),ge.matrixWorld.compose(ge.position,ge.quaternion,ge.scale),ge.matrixWorldInverse.copy(ge.matrixWorld).invert(),it[10]===-1)ge.projectionMatrix.copy(Ae.projectionMatrix),ge.projectionMatrixInverse.copy(Ae.projectionMatrixInverse);else{const ct=ot+$e,k=Ke+$e,U=Fe-Je,ce=Be+(ue-Je),Ee=Te*Ke/k*ct,Le=G*Ke/k*ct;ge.projectionMatrix.makePerspective(U,ce,Ee,Le,ct,k),ge.projectionMatrixInverse.copy(ge.projectionMatrix).invert()}}function Ce(ge,Ae){Ae===null?ge.matrixWorld.copy(ge.matrix):ge.matrixWorld.multiplyMatrices(Ae.matrixWorld,ge.matrix),ge.matrixWorldInverse.copy(ge.matrixWorld).invert()}this.updateCamera=function(ge){if(a===null)return;let Ae=ge.near,Ze=ge.far;S.texture!==null&&(S.depthNear>0&&(Ae=S.depthNear),S.depthFar>0&&(Ze=S.depthFar)),j.near=R.near=O.near=Ae,j.far=R.far=O.far=Ze,(ee!==j.near||se!==j.far)&&(a.updateRenderState({depthNear:j.near,depthFar:j.far}),ee=j.near,se=j.far),j.layers.mask=ge.layers.mask|6,O.layers.mask=j.layers.mask&3,R.layers.mask=j.layers.mask&5;const ue=ge.parent,it=j.cameras;Ce(j,ue);for(let Mt=0;Mt0&&(S.alphaTest.value=v.alphaTest);const y=e.get(v),E=y.envMap,b=y.envMapRotation;E&&(S.envMap.value=E,ru.copy(b),ru.x*=-1,ru.y*=-1,ru.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(ru.y*=-1,ru.z*=-1),S.envMapRotation.value.setFromMatrix4(hj.makeRotationFromEuler(ru)),S.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,S.reflectivity.value=v.reflectivity,S.ior.value=v.ior,S.refractionRatio.value=v.refractionRatio),v.lightMap&&(S.lightMap.value=v.lightMap,S.lightMapIntensity.value=v.lightMapIntensity,t(v.lightMap,S.lightMapTransform)),v.aoMap&&(S.aoMap.value=v.aoMap,S.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,S.aoMapTransform))}function s(S,v){S.diffuse.value.copy(v.color),S.opacity.value=v.opacity,v.map&&(S.map.value=v.map,t(v.map,S.mapTransform))}function o(S,v){S.dashSize.value=v.dashSize,S.totalSize.value=v.dashSize+v.gapSize,S.scale.value=v.scale}function c(S,v,y,E){S.diffuse.value.copy(v.color),S.opacity.value=v.opacity,S.size.value=v.size*y,S.scale.value=E*.5,v.map&&(S.map.value=v.map,t(v.map,S.uvTransform)),v.alphaMap&&(S.alphaMap.value=v.alphaMap,t(v.alphaMap,S.alphaMapTransform)),v.alphaTest>0&&(S.alphaTest.value=v.alphaTest)}function h(S,v){S.diffuse.value.copy(v.color),S.opacity.value=v.opacity,S.rotation.value=v.rotation,v.map&&(S.map.value=v.map,t(v.map,S.mapTransform)),v.alphaMap&&(S.alphaMap.value=v.alphaMap,t(v.alphaMap,S.alphaMapTransform)),v.alphaTest>0&&(S.alphaTest.value=v.alphaTest)}function f(S,v){S.specular.value.copy(v.specular),S.shininess.value=Math.max(v.shininess,1e-4)}function d(S,v){v.gradientMap&&(S.gradientMap.value=v.gradientMap)}function m(S,v){S.metalness.value=v.metalness,v.metalnessMap&&(S.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,S.metalnessMapTransform)),S.roughness.value=v.roughness,v.roughnessMap&&(S.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,S.roughnessMapTransform)),v.envMap&&(S.envMapIntensity.value=v.envMapIntensity)}function g(S,v,y){S.ior.value=v.ior,v.sheen>0&&(S.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),S.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(S.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,S.sheenColorMapTransform)),v.sheenRoughnessMap&&(S.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,S.sheenRoughnessMapTransform))),v.clearcoat>0&&(S.clearcoat.value=v.clearcoat,S.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(S.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,S.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(S.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,S.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(S.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,S.clearcoatNormalMapTransform),S.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===Oi&&S.clearcoatNormalScale.value.negate())),v.dispersion>0&&(S.dispersion.value=v.dispersion),v.iridescence>0&&(S.iridescence.value=v.iridescence,S.iridescenceIOR.value=v.iridescenceIOR,S.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],S.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(S.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,S.iridescenceMapTransform)),v.iridescenceThicknessMap&&(S.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,S.iridescenceThicknessMapTransform))),v.transmission>0&&(S.transmission.value=v.transmission,S.transmissionSamplerMap.value=y.texture,S.transmissionSamplerSize.value.set(y.width,y.height),v.transmissionMap&&(S.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,S.transmissionMapTransform)),S.thickness.value=v.thickness,v.thicknessMap&&(S.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,S.thicknessMapTransform)),S.attenuationDistance.value=v.attenuationDistance,S.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(S.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(S.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,S.anisotropyMapTransform))),S.specularIntensity.value=v.specularIntensity,S.specularColor.value.copy(v.specularColor),v.specularColorMap&&(S.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,S.specularColorMapTransform)),v.specularIntensityMap&&(S.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,S.specularIntensityMapTransform))}function x(S,v){v.matcap&&(S.matcap.value=v.matcap)}function T(S,v){const y=e.get(v).light;S.referencePosition.value.setFromMatrixPosition(y.matrixWorld),S.nearDistance.value=y.shadow.camera.near,S.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:a}}function dj(n,e,t,i){let a={},r={},s=[];const o=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function c(y,E){const b=E.program;i.uniformBlockBinding(y,b)}function h(y,E){let b=a[y.id];b===void 0&&(x(y),b=f(y),a[y.id]=b,y.addEventListener("dispose",S));const D=E.program;i.updateUBOMapping(y,D);const C=e.render.frame;r[y.id]!==C&&(m(y),r[y.id]=C)}function f(y){const E=d();y.__bindingPointIndex=E;const b=n.createBuffer(),D=y.__size,C=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,b),n.bufferData(n.UNIFORM_BUFFER,D,C),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,E,b),b}function d(){for(let y=0;y0&&(b+=D-C),y.__size=b,y.__cache={},this}function T(y){const E={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(E.boundary=4,E.storage=4):y.isVector2?(E.boundary=8,E.storage=8):y.isVector3||y.isColor?(E.boundary=16,E.storage=12):y.isVector4?(E.boundary=16,E.storage=16):y.isMatrix3?(E.boundary=48,E.storage=48):y.isMatrix4?(E.boundary=64,E.storage=64):y.isTexture?ut("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ut("WebGLRenderer: Unsupported uniform value type.",y),E}function S(y){const E=y.target;E.removeEventListener("dispose",S);const b=s.indexOf(E.__bindingPointIndex);s.splice(b,1),n.deleteBuffer(a[E.id]),delete a[E.id],delete r[E.id]}function v(){for(const y in a)n.deleteBuffer(a[y]);s=[],a={},r={}}return{bind:c,update:h,dispose:v}}const pj=new Uint16Array([11481,15204,11534,15171,11808,15015,12385,14843,12894,14716,13396,14600,13693,14483,13976,14366,14237,14171,14405,13961,14511,13770,14605,13598,14687,13444,14760,13305,14822,13066,14876,12857,14923,12675,14963,12517,14997,12379,15025,12230,15049,12023,15070,11843,15086,11687,15100,11551,15111,11433,15120,11330,15127,11217,15132,11060,15135,10922,15138,10801,15139,10695,15139,10600,13012,14923,13020,14917,13064,14886,13176,14800,13349,14666,13513,14526,13724,14398,13960,14230,14200,14020,14383,13827,14488,13651,14583,13491,14667,13348,14740,13132,14803,12908,14856,12713,14901,12542,14938,12394,14968,12241,14992,12017,15010,11822,15024,11654,15034,11507,15041,11380,15044,11269,15044,11081,15042,10913,15037,10764,15031,10635,15023,10520,15014,10419,15003,10330,13657,14676,13658,14673,13670,14660,13698,14622,13750,14547,13834,14442,13956,14317,14112,14093,14291,13889,14407,13704,14499,13538,14586,13389,14664,13201,14733,12966,14792,12758,14842,12577,14882,12418,14915,12272,14940,12033,14959,11826,14972,11646,14980,11490,14983,11355,14983,11212,14979,11008,14971,10830,14961,10675,14950,10540,14936,10420,14923,10315,14909,10204,14894,10041,14089,14460,14090,14459,14096,14452,14112,14431,14141,14388,14186,14305,14252,14130,14341,13941,14399,13756,14467,13585,14539,13430,14610,13272,14677,13026,14737,12808,14790,12617,14833,12449,14869,12303,14896,12065,14916,11845,14929,11655,14937,11490,14939,11347,14936,11184,14930,10970,14921,10783,14912,10621,14900,10480,14885,10356,14867,10247,14848,10062,14827,9894,14805,9745,14400,14208,14400,14206,14402,14198,14406,14174,14415,14122,14427,14035,14444,13913,14469,13767,14504,13613,14548,13463,14598,13324,14651,13082,14704,12858,14752,12658,14795,12483,14831,12330,14860,12106,14881,11875,14895,11675,14903,11501,14905,11351,14903,11178,14900,10953,14892,10757,14880,10589,14865,10442,14847,10313,14827,10162,14805,9965,14782,9792,14757,9642,14731,9507,14562,13883,14562,13883,14563,13877,14566,13862,14570,13830,14576,13773,14584,13689,14595,13582,14613,13461,14637,13336,14668,13120,14704,12897,14741,12695,14776,12516,14808,12358,14835,12150,14856,11910,14870,11701,14878,11519,14882,11361,14884,11187,14880,10951,14871,10748,14858,10572,14842,10418,14823,10286,14801,10099,14777,9897,14751,9722,14725,9567,14696,9430,14666,9309,14702,13604,14702,13604,14702,13600,14703,13591,14705,13570,14707,13533,14709,13477,14712,13400,14718,13305,14727,13106,14743,12907,14762,12716,14784,12539,14807,12380,14827,12190,14844,11943,14855,11727,14863,11539,14870,11376,14871,11204,14868,10960,14858,10748,14845,10565,14829,10406,14809,10269,14786,10058,14761,9852,14734,9671,14705,9512,14674,9374,14641,9253,14608,9076,14821,13366,14821,13365,14821,13364,14821,13358,14821,13344,14821,13320,14819,13252,14817,13145,14815,13011,14814,12858,14817,12698,14823,12539,14832,12389,14841,12214,14850,11968,14856,11750,14861,11558,14866,11390,14867,11226,14862,10972,14853,10754,14840,10565,14823,10401,14803,10259,14780,10032,14754,9820,14725,9635,14694,9473,14661,9333,14627,9203,14593,8988,14557,8798,14923,13014,14922,13014,14922,13012,14922,13004,14920,12987,14919,12957,14915,12907,14909,12834,14902,12738,14894,12623,14888,12498,14883,12370,14880,12203,14878,11970,14875,11759,14873,11569,14874,11401,14872,11243,14865,10986,14855,10762,14842,10568,14825,10401,14804,10255,14781,10017,14754,9799,14725,9611,14692,9445,14658,9301,14623,9139,14587,8920,14548,8729,14509,8562,15008,12672,15008,12672,15008,12671,15007,12667,15005,12656,15001,12637,14997,12605,14989,12556,14978,12490,14966,12407,14953,12313,14940,12136,14927,11934,14914,11742,14903,11563,14896,11401,14889,11247,14879,10992,14866,10767,14851,10570,14833,10400,14812,10252,14789,10007,14761,9784,14731,9592,14698,9424,14663,9279,14627,9088,14588,8868,14548,8676,14508,8508,14467,8360,15080,12386,15080,12386,15079,12385,15078,12383,15076,12378,15072,12367,15066,12347,15057,12315,15045,12253,15030,12138,15012,11998,14993,11845,14972,11685,14951,11530,14935,11383,14920,11228,14904,10981,14887,10762,14870,10567,14850,10397,14827,10248,14803,9997,14774,9771,14743,9578,14710,9407,14674,9259,14637,9048,14596,8826,14555,8632,14514,8464,14471,8317,14427,8182,15139,12008,15139,12008,15138,12008,15137,12007,15135,12003,15130,11990,15124,11969,15115,11929,15102,11872,15086,11794,15064,11693,15041,11581,15013,11459,14987,11336,14966,11170,14944,10944,14921,10738,14898,10552,14875,10387,14850,10239,14824,9983,14794,9758,14762,9563,14728,9392,14692,9244,14653,9014,14611,8791,14569,8597,14526,8427,14481,8281,14436,8110,14391,7885,15188,11617,15188,11617,15187,11617,15186,11618,15183,11617,15179,11612,15173,11601,15163,11581,15150,11546,15133,11495,15110,11427,15083,11346,15051,11246,15024,11057,14996,10868,14967,10687,14938,10517,14911,10362,14882,10206,14853,9956,14821,9737,14787,9543,14752,9375,14715,9228,14675,8980,14632,8760,14589,8565,14544,8395,14498,8248,14451,8049,14404,7824,14357,7630,15228,11298,15228,11298,15227,11299,15226,11301,15223,11303,15219,11302,15213,11299,15204,11290,15191,11271,15174,11217,15150,11129,15119,11015,15087,10886,15057,10744,15024,10599,14990,10455,14957,10318,14924,10143,14891,9911,14856,9701,14820,9516,14782,9352,14744,9200,14703,8946,14659,8725,14615,8533,14568,8366,14521,8220,14472,7992,14423,7770,14374,7578,14315,7408,15260,10819,15260,10819,15259,10822,15258,10826,15256,10832,15251,10836,15246,10841,15237,10838,15225,10821,15207,10788,15183,10734,15151,10660,15120,10571,15087,10469,15049,10359,15012,10249,14974,10041,14937,9837,14900,9647,14860,9475,14820,9320,14779,9147,14736,8902,14691,8688,14646,8499,14598,8335,14549,8189,14499,7940,14448,7720,14397,7529,14347,7363,14256,7218,15285,10410,15285,10411,15285,10413,15284,10418,15282,10425,15278,10434,15272,10442,15264,10449,15252,10445,15235,10433,15210,10403,15179,10358,15149,10301,15113,10218,15073,10059,15033,9894,14991,9726,14951,9565,14909,9413,14865,9273,14822,9073,14777,8845,14730,8641,14682,8459,14633,8300,14583,8129,14531,7883,14479,7670,14426,7482,14373,7321,14305,7176,14201,6939,15305,9939,15305,9940,15305,9945,15304,9955,15302,9967,15298,9989,15293,10010,15286,10033,15274,10044,15258,10045,15233,10022,15205,9975,15174,9903,15136,9808,15095,9697,15053,9578,15009,9451,14965,9327,14918,9198,14871,8973,14825,8766,14775,8579,14725,8408,14675,8259,14622,8058,14569,7821,14515,7615,14460,7435,14405,7276,14350,7108,14256,6866,14149,6653,15321,9444,15321,9445,15321,9448,15320,9458,15317,9470,15314,9490,15310,9515,15302,9540,15292,9562,15276,9579,15251,9577,15226,9559,15195,9519,15156,9463,15116,9389,15071,9304,15025,9208,14978,9023,14927,8838,14878,8661,14827,8496,14774,8344,14722,8206,14667,7973,14612,7749,14556,7555,14499,7382,14443,7229,14385,7025,14322,6791,14210,6588,14100,6409,15333,8920,15333,8921,15332,8927,15332,8943,15329,8965,15326,9002,15322,9048,15316,9106,15307,9162,15291,9204,15267,9221,15244,9221,15212,9196,15175,9134,15133,9043,15088,8930,15040,8801,14990,8665,14938,8526,14886,8391,14830,8261,14775,8087,14719,7866,14661,7664,14603,7482,14544,7322,14485,7178,14426,6936,14367,6713,14281,6517,14166,6348,14054,6198,15341,8360,15341,8361,15341,8366,15341,8379,15339,8399,15336,8431,15332,8473,15326,8527,15318,8585,15302,8632,15281,8670,15258,8690,15227,8690,15191,8664,15149,8612,15104,8543,15055,8456,15001,8360,14948,8259,14892,8122,14834,7923,14776,7734,14716,7558,14656,7397,14595,7250,14534,7070,14472,6835,14410,6628,14350,6443,14243,6283,14125,6135,14010,5889,15348,7715,15348,7717,15348,7725,15347,7745,15345,7780,15343,7836,15339,7905,15334,8e3,15326,8103,15310,8193,15293,8239,15270,8270,15240,8287,15204,8283,15163,8260,15118,8223,15067,8143,15014,8014,14958,7873,14899,7723,14839,7573,14778,7430,14715,7293,14652,7164,14588,6931,14524,6720,14460,6531,14396,6362,14330,6210,14207,6015,14086,5781,13969,5576,15352,7114,15352,7116,15352,7128,15352,7159,15350,7195,15348,7237,15345,7299,15340,7374,15332,7457,15317,7544,15301,7633,15280,7703,15251,7754,15216,7775,15176,7767,15131,7733,15079,7670,15026,7588,14967,7492,14906,7387,14844,7278,14779,7171,14714,6965,14648,6770,14581,6587,14515,6420,14448,6269,14382,6123,14299,5881,14172,5665,14049,5477,13929,5310,15355,6329,15355,6330,15355,6339,15355,6362,15353,6410,15351,6472,15349,6572,15344,6688,15337,6835,15323,6985,15309,7142,15287,7220,15260,7277,15226,7310,15188,7326,15142,7318,15090,7285,15036,7239,14976,7177,14914,7045,14849,6892,14782,6736,14714,6581,14645,6433,14576,6293,14506,6164,14438,5946,14369,5733,14270,5540,14140,5369,14014,5216,13892,5043,15357,5483,15357,5484,15357,5496,15357,5528,15356,5597,15354,5692,15351,5835,15347,6011,15339,6195,15328,6317,15314,6446,15293,6566,15268,6668,15235,6746,15197,6796,15152,6811,15101,6790,15046,6748,14985,6673,14921,6583,14854,6479,14785,6371,14714,6259,14643,6149,14571,5946,14499,5750,14428,5567,14358,5401,14242,5250,14109,5111,13980,4870,13856,4657,15359,4555,15359,4557,15358,4573,15358,4633,15357,4715,15355,4841,15353,5061,15349,5216,15342,5391,15331,5577,15318,5770,15299,5967,15274,6150,15243,6223,15206,6280,15161,6310,15111,6317,15055,6300,14994,6262,14928,6208,14860,6141,14788,5994,14715,5838,14641,5684,14566,5529,14492,5384,14418,5247,14346,5121,14216,4892,14079,4682,13948,4496,13822,4330,15359,3498,15359,3501,15359,3520,15359,3598,15358,3719,15356,3860,15355,4137,15351,4305,15344,4563,15334,4809,15321,5116,15303,5273,15280,5418,15250,5547,15214,5653,15170,5722,15120,5761,15064,5763,15002,5733,14935,5673,14865,5597,14792,5504,14716,5400,14640,5294,14563,5185,14486,5041,14410,4841,14335,4655,14191,4482,14051,4325,13918,4183,13790,4012,15360,2282,15360,2285,15360,2306,15360,2401,15359,2547,15357,2748,15355,3103,15352,3349,15345,3675,15336,4020,15324,4272,15307,4496,15285,4716,15255,4908,15220,5086,15178,5170,15128,5214,15072,5234,15010,5231,14943,5206,14871,5166,14796,5102,14718,4971,14639,4833,14559,4687,14480,4541,14402,4401,14315,4268,14167,4142,14025,3958,13888,3747,13759,3556,15360,923,15360,925,15360,946,15360,1052,15359,1214,15357,1494,15356,1892,15352,2274,15346,2663,15338,3099,15326,3393,15309,3679,15288,3980,15260,4183,15226,4325,15185,4437,15136,4517,15080,4570,15018,4591,14950,4581,14877,4545,14800,4485,14720,4411,14638,4325,14556,4231,14475,4136,14395,3988,14297,3803,14145,3628,13999,3465,13861,3314,13729,3177,15360,263,15360,264,15360,272,15360,325,15359,407,15358,548,15356,780,15352,1144,15347,1580,15339,2099,15328,2425,15312,2795,15292,3133,15264,3329,15232,3517,15191,3689,15143,3819,15088,3923,15025,3978,14956,3999,14882,3979,14804,3931,14722,3855,14639,3756,14554,3645,14470,3529,14388,3409,14279,3289,14124,3173,13975,3055,13834,2848,13701,2658,15360,49,15360,49,15360,52,15360,75,15359,111,15358,201,15356,283,15353,519,15348,726,15340,1045,15329,1415,15314,1795,15295,2173,15269,2410,15237,2649,15197,2866,15150,3054,15095,3140,15032,3196,14963,3228,14888,3236,14808,3224,14725,3191,14639,3146,14553,3088,14466,2976,14382,2836,14262,2692,14103,2549,13952,2409,13808,2278,13674,2154,15360,4,15360,4,15360,4,15360,13,15359,33,15358,59,15357,112,15353,199,15348,302,15341,456,15331,628,15316,827,15297,1082,15272,1332,15241,1601,15202,1851,15156,2069,15101,2172,15039,2256,14970,2314,14894,2348,14813,2358,14728,2344,14640,2311,14551,2263,14463,2203,14376,2133,14247,2059,14084,1915,13930,1761,13784,1609,13648,1464,15360,0,15360,0,15360,0,15360,3,15359,18,15358,26,15357,53,15354,80,15348,97,15341,165,15332,238,15318,326,15299,427,15275,529,15245,654,15207,771,15161,885,15108,994,15046,1089,14976,1170,14900,1229,14817,1266,14731,1284,14641,1282,14550,1260,14460,1223,14370,1174,14232,1116,14066,1050,13909,981,13761,910,13623,839]);let Lo=null;function mj(){return Lo===null&&(Lo=new Ja(pj,32,32,Vo,Xn),Lo.minFilter=Ht,Lo.magFilter=Ht,Lo.wrapS=Li,Lo.wrapT=Li,Lo.generateMipmaps=!1,Lo.needsUpdate=!0),Lo}class Kb{constructor(e={}){const{canvas:t=IU(),context:i=null,depth:a=!0,stencil:r=!1,alpha:s=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:h=!1,powerPreference:f="default",failIfMajorPerformanceCaveat:d=!1,reversedDepthBuffer:m=!1}=e;this.isWebGLRenderer=!0;let g;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=i.getContextAttributes().alpha}else g=s;const x=new Set([L1,O1,O0]),T=new Set([Ii,Ns,Wu,Xu,N1,D1]),S=new Uint32Array(4),v=new Int32Array(4);let y=null,E=null;const b=[],D=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ns,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const C=this;let I=!1;this._outputColorSpace=En;let P=0,O=0,R=null,B=-1,j=null;const ee=new zt,se=new zt;let re=null;const W=new je(0);let te=0,K=t.width,oe=t.height,ie=1,Ce=null,Xe=null;const nt=new zt(0,0,K,oe),tt=new zt(0,0,K,oe);let gt=!1;const ge=new Wd;let Ae=!1,Ze=!1;const ue=new ke,it=new L,Mt=new zt,ot={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ke=!1;function Te(){return R===null?ie:1}let G=i;function Me(N,V){return t.getContext(N,V)}try{const N={alpha:!0,depth:a,stencil:r,antialias:o,premultipliedAlpha:c,preserveDrawingBuffer:h,powerPreference:f,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${ws}`),t.addEventListener("webglcontextlost",Ge,!1),t.addEventListener("webglcontextrestored",Re,!1),t.addEventListener("webglcontextcreationerror",rt,!1),G===null){const V="webgl2";if(G=Me(V,N),G===null)throw Me(V)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(N){throw N("WebGLRenderer: "+N.message),N}let De,Fe,Be,$e,Je,ct,k,U,ce,Ee,Le,ye,vt,qe,_t,pt,Ie,He,ht,Q,pe,Oe,q,Ve;function me(){De=new bY(G),De.init(),Oe=new B6(G,De),Fe=new gY(G,De,e,Oe),Be=new rj(G,De),Fe.reversedDepthBuffer&&m&&Be.buffers.depth.setReversed(!0),$e=new wY(G),Je=new Yq,ct=new sj(G,De,Be,Je,Fe,Oe,$e),k=new _Y(C),U=new MY(C),ce=new Ok(G),q=new pY(G,ce),Ee=new AY(G,ce,$e,q),Le=new NY(G,Ee,ce,$e),ht=new CY(G,Fe,ct),pt=new vY(Je),ye=new Xq(C,k,U,De,Fe,q,pt),vt=new fj(C,Je),qe=new jq,_t=new ej(De),He=new dY(C,k,U,Be,Le,g,c),Ie=new ij(C,Le,Fe),Ve=new dj(G,$e,Fe,Be),Q=new mY(G,De,$e),pe=new RY(G,De,$e),$e.programs=ye.programs,C.capabilities=Fe,C.extensions=De,C.properties=Je,C.renderLists=qe,C.shadowMap=Ie,C.state=Be,C.info=$e}me();const We=new uj(C,G);this.xr=We,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const N=De.get("WEBGL_lose_context");N&&N.loseContext()},this.forceContextRestore=function(){const N=De.get("WEBGL_lose_context");N&&N.restoreContext()},this.getPixelRatio=function(){return ie},this.setPixelRatio=function(N){N!==void 0&&(ie=N,this.setSize(K,oe,!1))},this.getSize=function(N){return N.set(K,oe)},this.setSize=function(N,V,Z=!0){if(We.isPresenting){ut("WebGLRenderer: Can't change size while VR device is presenting.");return}K=N,oe=V,t.width=Math.floor(N*ie),t.height=Math.floor(V*ie),Z===!0&&(t.style.width=N+"px",t.style.height=V+"px"),this.setViewport(0,0,N,V)},this.getDrawingBufferSize=function(N){return N.set(K*ie,oe*ie).floor()},this.setDrawingBufferSize=function(N,V,Z){K=N,oe=V,ie=Z,t.width=Math.floor(N*Z),t.height=Math.floor(V*Z),this.setViewport(0,0,N,V)},this.getCurrentViewport=function(N){return N.copy(ee)},this.getViewport=function(N){return N.copy(nt)},this.setViewport=function(N,V,Z,H){N.isVector4?nt.set(N.x,N.y,N.z,N.w):nt.set(N,V,Z,H),Be.viewport(ee.copy(nt).multiplyScalar(ie).round())},this.getScissor=function(N){return N.copy(tt)},this.setScissor=function(N,V,Z,H){N.isVector4?tt.set(N.x,N.y,N.z,N.w):tt.set(N,V,Z,H),Be.scissor(se.copy(tt).multiplyScalar(ie).round())},this.getScissorTest=function(){return gt},this.setScissorTest=function(N){Be.setScissorTest(gt=N)},this.setOpaqueSort=function(N){Ce=N},this.setTransparentSort=function(N){Xe=N},this.getClearColor=function(N){return N.copy(He.getClearColor())},this.setClearColor=function(){He.setClearColor(...arguments)},this.getClearAlpha=function(){return He.getClearAlpha()},this.setClearAlpha=function(){He.setClearAlpha(...arguments)},this.clear=function(N=!0,V=!0,Z=!0){let H=0;if(N){let X=!1;if(R!==null){const ne=R.texture.format;X=x.has(ne)}if(X){const ne=R.texture.type,ae=T.has(ne),fe=He.getClearColor(),_e=He.getClearAlpha(),Se=fe.r,we=fe.g,Pe=fe.b;ae?(S[0]=Se,S[1]=we,S[2]=Pe,S[3]=_e,G.clearBufferuiv(G.COLOR,0,S)):(v[0]=Se,v[1]=we,v[2]=Pe,v[3]=_e,G.clearBufferiv(G.COLOR,0,v))}else H|=G.COLOR_BUFFER_BIT}V&&(H|=G.DEPTH_BUFFER_BIT),Z&&(H|=G.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G.clear(H)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Ge,!1),t.removeEventListener("webglcontextrestored",Re,!1),t.removeEventListener("webglcontextcreationerror",rt,!1),He.dispose(),qe.dispose(),_t.dispose(),Je.dispose(),k.dispose(),U.dispose(),Le.dispose(),q.dispose(),Ve.dispose(),ye.dispose(),We.dispose(),We.removeEventListener("sessionstart",Ls),We.removeEventListener("sessionend",Is),Ei.stop()};function Ge(N){N.preventDefault(),u0("WebGLRenderer: Context Lost."),I=!0}function Re(){u0("WebGLRenderer: Context Restored."),I=!1;const N=$e.autoReset,V=Ie.enabled,Z=Ie.autoUpdate,H=Ie.needsUpdate,X=Ie.type;me(),$e.autoReset=N,Ie.enabled=V,Ie.autoUpdate=Z,Ie.needsUpdate=H,Ie.type=X}function rt(N){Bt("WebGLRenderer: A WebGL context could not be created. Reason: ",N.statusMessage)}function yt(N){const V=N.target;V.removeEventListener("dispose",yt),Gt(V)}function Gt(N){Vt(N),Je.remove(N)}function Vt(N){const V=Je.get(N).programs;V!==void 0&&(V.forEach(function(Z){ye.releaseProgram(Z)}),N.isShaderMaterial&&ye.releaseShaderCache(N))}this.renderBufferDirect=function(N,V,Z,H,X,ne){V===null&&(V=ot);const ae=X.isMesh&&X.matrixWorld.determinant()<0,fe=uo(N,V,Z,H,X);Be.setMaterial(H,ae);let _e=Z.index,Se=1;if(H.wireframe===!0){if(_e=Ee.getWireframeAttribute(Z),_e===void 0)return;Se=2}const we=Z.drawRange,Pe=Z.attributes.position;let ze=we.start*Se,Ye=(we.start+we.count)*Se;ne!==null&&(ze=Math.max(ze,ne.start*Se),Ye=Math.min(Ye,(ne.start+ne.count)*Se)),_e!==null?(ze=Math.max(ze,0),Ye=Math.min(Ye,_e.count)):Pe!=null&&(ze=Math.max(ze,0),Ye=Math.min(Ye,Pe.count));const lt=Ye-ze;if(lt<0||lt===1/0)return;q.setup(X,H,fe,Z,_e);let St,bt=Q;if(_e!==null&&(St=ce.get(_e),bt=pe,bt.setIndex(St)),X.isMesh)H.wireframe===!0?(Be.setLineWidth(H.wireframeLinewidth*Te()),bt.setMode(G.LINES)):bt.setMode(G.TRIANGLES);else if(X.isLine){let ft=H.linewidth;ft===void 0&&(ft=1),Be.setLineWidth(ft*Te()),X.isLineSegments?bt.setMode(G.LINES):X.isLineLoop?bt.setMode(G.LINE_LOOP):bt.setMode(G.LINE_STRIP)}else X.isPoints?bt.setMode(G.POINTS):X.isSprite&&bt.setMode(G.TRIANGLES);if(X.isBatchedMesh)if(X._multiDrawInstances!==null)Td("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),bt.renderMultiDrawInstances(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount,X._multiDrawInstances);else if(De.get("WEBGL_multi_draw"))bt.renderMultiDraw(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount);else{const ft=X._multiDrawStarts,At=X._multiDrawCounts,st=X._multiDrawCount,Kt=_e?ce.get(_e).bytesPerElement:1,On=Je.get(H).currentProgram.getUniforms();for(let Xt=0;Xt{function ne(){if(H.forEach(function(ae){Je.get(ae).currentProgram.isReady()&&H.delete(ae)}),H.size===0){X(N);return}setTimeout(ne,10)}De.get("KHR_parallel_shader_compile")!==null?ne():setTimeout(ne,10)})};let li=null;function co(N){li&&li(N)}function Ls(){Ei.stop()}function Is(){Ei.start()}const Ei=new L6;Ei.setAnimationLoop(co),typeof self<"u"&&Ei.setContext(self),this.setAnimationLoop=function(N){li=N,We.setAnimationLoop(N),N===null?Ei.stop():Ei.start()},We.addEventListener("sessionstart",Ls),We.addEventListener("sessionend",Is),this.render=function(N,V){if(V!==void 0&&V.isCamera!==!0){Bt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;if(N.matrixWorldAutoUpdate===!0&&N.updateMatrixWorld(),V.parent===null&&V.matrixWorldAutoUpdate===!0&&V.updateMatrixWorld(),We.enabled===!0&&We.isPresenting===!0&&(We.cameraAutoUpdate===!0&&We.updateCamera(V),V=We.getCamera()),N.isScene===!0&&N.onBeforeRender(C,N,V,R),E=_t.get(N,D.length),E.init(V),D.push(E),ue.multiplyMatrices(V.projectionMatrix,V.matrixWorldInverse),ge.setFromProjectionMatrix(ue,Mr,V.reversedDepth),Ze=this.localClippingEnabled,Ae=pt.init(this.clippingPlanes,Ze),y=qe.get(N,b.length),y.init(),b.push(y),We.enabled===!0&&We.isPresenting===!0){const ne=C.xr.getDepthSensingMesh();ne!==null&&Us(ne,V,-1/0,C.sortObjects)}Us(N,V,0,C.sortObjects),y.finish(),C.sortObjects===!0&&y.sort(Ce,Xe),Ke=We.enabled===!1||We.isPresenting===!1||We.hasDepthSensing()===!1,Ke&&He.addToRenderList(y,N),this.info.render.frame++,Ae===!0&&pt.beginShadows();const Z=E.state.shadowsArray;Ie.render(Z,N,V),Ae===!0&&pt.endShadows(),this.info.autoReset===!0&&this.info.reset();const H=y.opaque,X=y.transmissive;if(E.setupLights(),V.isArrayCamera){const ne=V.cameras;if(X.length>0)for(let ae=0,fe=ne.length;ae0&&ki(H,X,N,V),Ke&&He.render(N),ha(y,N,V);R!==null&&O===0&&(ct.updateMultisampleRenderTarget(R),ct.updateRenderTargetMipmap(R)),N.isScene===!0&&N.onAfterRender(C,N,V),q.resetDefaultState(),B=-1,j=null,D.pop(),D.length>0?(E=D[D.length-1],Ae===!0&&pt.setGlobalState(C.clippingPlanes,E.state.camera)):E=null,b.pop(),b.length>0?y=b[b.length-1]:y=null};function Us(N,V,Z,H){if(N.visible===!1)return;if(N.layers.test(V.layers)){if(N.isGroup)Z=N.renderOrder;else if(N.isLOD)N.autoUpdate===!0&&N.update(V);else if(N.isLight)E.pushLight(N),N.castShadow&&E.pushShadow(N);else if(N.isSprite){if(!N.frustumCulled||ge.intersectsSprite(N)){H&&Mt.setFromMatrixPosition(N.matrixWorld).applyMatrix4(ue);const ae=Le.update(N),fe=N.material;fe.visible&&y.push(N,ae,fe,Z,Mt.z,null)}}else if((N.isMesh||N.isLine||N.isPoints)&&(!N.frustumCulled||ge.intersectsObject(N))){const ae=Le.update(N),fe=N.material;if(H&&(N.boundingSphere!==void 0?(N.boundingSphere===null&&N.computeBoundingSphere(),Mt.copy(N.boundingSphere.center)):(ae.boundingSphere===null&&ae.computeBoundingSphere(),Mt.copy(ae.boundingSphere.center)),Mt.applyMatrix4(N.matrixWorld).applyMatrix4(ue)),Array.isArray(fe)){const _e=ae.groups;for(let Se=0,we=_e.length;Se0&&Ha(X,V,Z),ne.length>0&&Ha(ne,V,Z),ae.length>0&&Ha(ae,V,Z),Be.buffers.depth.setTest(!0),Be.buffers.depth.setMask(!0),Be.buffers.color.setMask(!0),Be.setPolygonOffset(!1)}function ki(N,V,Z,H){if((Z.isScene===!0?Z.overrideMaterial:null)!==null)return;E.state.transmissionRenderTarget[H.id]===void 0&&(E.state.transmissionRenderTarget[H.id]=new _i(1,1,{generateMipmaps:!0,type:De.has("EXT_color_buffer_half_float")||De.has("EXT_color_buffer_float")?Xn:Ii,minFilter:Er,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:rn.workingColorSpace}));const ne=E.state.transmissionRenderTarget[H.id],ae=H.viewport||ee;ne.setSize(ae.z*C.transmissionResolutionScale,ae.w*C.transmissionResolutionScale);const fe=C.getRenderTarget(),_e=C.getActiveCubeFace(),Se=C.getActiveMipmapLevel();C.setRenderTarget(ne),C.getClearColor(W),te=C.getClearAlpha(),te<1&&C.setClearColor(16777215,.5),C.clear(),Ke&&He.render(Z);const we=C.toneMapping;C.toneMapping=ns;const Pe=H.viewport;if(H.viewport!==void 0&&(H.viewport=void 0),E.setupLightsView(H),Ae===!0&&pt.setGlobalState(C.clippingPlanes,H),Ha(N,Z,H),ct.updateMultisampleRenderTarget(ne),ct.updateRenderTargetMipmap(ne),De.has("WEBGL_multisampled_render_to_texture")===!1){let ze=!1;for(let Ye=0,lt=V.length;Ye0),Pe=!!Z.morphAttributes.position,ze=!!Z.morphAttributes.normal,Ye=!!Z.morphAttributes.color;let lt=ns;H.toneMapped&&(R===null||R.isXRRenderTarget===!0)&&(lt=C.toneMapping);const St=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,bt=St!==void 0?St.length:0,ft=Je.get(H),At=E.state.lights;if(Ae===!0&&(Ze===!0||N!==j)){const Mn=N===j&&H.id===B;pt.setState(H,N,Mn)}let st=!1;H.version===ft.__version?(ft.needsLights&&ft.lightsStateVersion!==At.state.version||ft.outputColorSpace!==fe||X.isBatchedMesh&&ft.batching===!1||!X.isBatchedMesh&&ft.batching===!0||X.isBatchedMesh&&ft.batchingColor===!0&&X.colorTexture===null||X.isBatchedMesh&&ft.batchingColor===!1&&X.colorTexture!==null||X.isInstancedMesh&&ft.instancing===!1||!X.isInstancedMesh&&ft.instancing===!0||X.isSkinnedMesh&&ft.skinning===!1||!X.isSkinnedMesh&&ft.skinning===!0||X.isInstancedMesh&&ft.instancingColor===!0&&X.instanceColor===null||X.isInstancedMesh&&ft.instancingColor===!1&&X.instanceColor!==null||X.isInstancedMesh&&ft.instancingMorph===!0&&X.morphTexture===null||X.isInstancedMesh&&ft.instancingMorph===!1&&X.morphTexture!==null||ft.envMap!==_e||H.fog===!0&&ft.fog!==ne||ft.numClippingPlanes!==void 0&&(ft.numClippingPlanes!==pt.numPlanes||ft.numIntersection!==pt.numIntersection)||ft.vertexAlphas!==Se||ft.vertexTangents!==we||ft.morphTargets!==Pe||ft.morphNormals!==ze||ft.morphColors!==Ye||ft.toneMapping!==lt||ft.morphTargetsCount!==bt)&&(st=!0):(st=!0,ft.__version=H.version);let Kt=ft.currentProgram;st===!0&&(Kt=Or(H,V,X));let On=!1,Xt=!1,kt=!1;const Ct=Kt.getUniforms(),Bn=ft.uniforms;if(Be.useProgram(Kt.program)&&(On=!0,Xt=!0,kt=!0),H.id!==B&&(B=H.id,Xt=!0),On||j!==N){Be.buffers.depth.getReversed()&&N.reversedDepth!==!0&&(N._reversedDepth=!0,N.updateProjectionMatrix()),Ct.setValue(G,"projectionMatrix",N.projectionMatrix),Ct.setValue(G,"viewMatrix",N.matrixWorldInverse);const Gn=Ct.map.cameraPosition;Gn!==void 0&&Gn.setValue(G,it.setFromMatrixPosition(N.matrixWorld)),Fe.logarithmicDepthBuffer&&Ct.setValue(G,"logDepthBufFC",2/(Math.log(N.far+1)/Math.LN2)),(H.isMeshPhongMaterial||H.isMeshToonMaterial||H.isMeshLambertMaterial||H.isMeshBasicMaterial||H.isMeshStandardMaterial||H.isShaderMaterial)&&Ct.setValue(G,"isOrthographic",N.isOrthographicCamera===!0),j!==N&&(j=N,Xt=!0,kt=!0)}if(X.isSkinnedMesh){Ct.setOptional(G,X,"bindMatrix"),Ct.setOptional(G,X,"bindMatrixInverse");const Mn=X.skeleton;Mn&&(Mn.boneTexture===null&&Mn.computeBoneTexture(),Ct.setValue(G,"boneTexture",Mn.boneTexture,ct))}X.isBatchedMesh&&(Ct.setOptional(G,X,"batchingTexture"),Ct.setValue(G,"batchingTexture",X._matricesTexture,ct),Ct.setOptional(G,X,"batchingIdTexture"),Ct.setValue(G,"batchingIdTexture",X._indirectTexture,ct),Ct.setOptional(G,X,"batchingColorTexture"),X._colorsTexture!==null&&Ct.setValue(G,"batchingColorTexture",X._colorsTexture,ct));const Mi=Z.morphAttributes;if((Mi.position!==void 0||Mi.normal!==void 0||Mi.color!==void 0)&&ht.update(X,Z,Kt),(Xt||ft.receiveShadow!==X.receiveShadow)&&(ft.receiveShadow=X.receiveShadow,Ct.setValue(G,"receiveShadow",X.receiveShadow)),H.isMeshGouraudMaterial&&H.envMap!==null&&(Bn.envMap.value=_e,Bn.flipEnvMap.value=_e.isCubeTexture&&_e.isRenderTargetTexture===!1?-1:1),H.isMeshStandardMaterial&&H.envMap===null&&V.environment!==null&&(Bn.envMapIntensity.value=V.environmentIntensity),Bn.dfgLUT!==void 0&&(Bn.dfgLUT.value=mj()),Xt&&(Ct.setValue(G,"toneMappingExposure",C.toneMappingExposure),ft.needsLights&&rr(Bn,kt),ne&&H.fog===!0&&vt.refreshFogUniforms(Bn,ne),vt.refreshMaterialUniforms(Bn,H,ie,oe,E.state.transmissionRenderTarget[N.id]),m_.upload(G,Ps(ft),Bn,ct)),H.isShaderMaterial&&H.uniformsNeedUpdate===!0&&(m_.upload(G,Ps(ft),Bn,ct),H.uniformsNeedUpdate=!1),H.isSpriteMaterial&&Ct.setValue(G,"center",X.center),Ct.setValue(G,"modelViewMatrix",X.modelViewMatrix),Ct.setValue(G,"normalMatrix",X.normalMatrix),Ct.setValue(G,"modelMatrix",X.matrixWorld),H.isShaderMaterial||H.isRawShaderMaterial){const Mn=H.uniformsGroups;for(let Gn=0,gh=Mn.length;Gn0&&ct.useMultisampledRTT(N)===!1?X=Je.get(N).__webglMultisampledFramebuffer:Array.isArray(we)?X=we[Z]:X=we,ee.copy(N.viewport),se.copy(N.scissor),re=N.scissorTest}else ee.copy(nt).multiplyScalar(ie).floor(),se.copy(tt).multiplyScalar(ie).floor(),re=gt;if(Z!==0&&(X=w),Be.bindFramebuffer(G.FRAMEBUFFER,X)&&H&&Be.drawBuffers(N,X),Be.viewport(ee),Be.scissor(se),Be.setScissorTest(re),ne){const _e=Je.get(N.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+V,_e.__webglTexture,Z)}else if(ae){const _e=V;for(let Se=0;Se=0&&V<=N.width-H&&Z>=0&&Z<=N.height-X&&(N.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+fe),G.readPixels(V,Z,H,X,Oe.convert(we),Oe.convert(Pe),ne))}finally{const Se=R!==null?Je.get(R).__webglFramebuffer:null;Be.bindFramebuffer(G.FRAMEBUFFER,Se)}}},this.readRenderTargetPixelsAsync=async function(N,V,Z,H,X,ne,ae,fe=0){if(!(N&&N.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let _e=Je.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&ae!==void 0&&(_e=_e[ae]),_e)if(V>=0&&V<=N.width-H&&Z>=0&&Z<=N.height-X){Be.bindFramebuffer(G.FRAMEBUFFER,_e);const Se=N.textures[fe],we=Se.format,Pe=Se.type;if(!Fe.textureFormatReadable(we))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Fe.textureTypeReadable(Pe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const ze=G.createBuffer();G.bindBuffer(G.PIXEL_PACK_BUFFER,ze),G.bufferData(G.PIXEL_PACK_BUFFER,ne.byteLength,G.STREAM_READ),N.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+fe),G.readPixels(V,Z,H,X,Oe.convert(we),Oe.convert(Pe),0);const Ye=R!==null?Je.get(R).__webglFramebuffer:null;Be.bindFramebuffer(G.FRAMEBUFFER,Ye);const lt=G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE,0);return G.flush(),await kF(G,lt,4),G.bindBuffer(G.PIXEL_PACK_BUFFER,ze),G.getBufferSubData(G.PIXEL_PACK_BUFFER,0,ne),G.deleteBuffer(ze),G.deleteSync(lt),ne}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(N,V=null,Z=0){const H=Math.pow(2,-Z),X=Math.floor(N.image.width*H),ne=Math.floor(N.image.height*H),ae=V!==null?V.x:0,fe=V!==null?V.y:0;ct.setTexture2D(N,0),G.copyTexSubImage2D(G.TEXTURE_2D,Z,0,0,ae,fe,X,ne),Be.unbindTexture()};const z=G.createFramebuffer(),Y=G.createFramebuffer();this.copyTextureToTexture=function(N,V,Z=null,H=null,X=0,ne=null){ne===null&&(X!==0?(Td("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ne=X,X=0):ne=0);let ae,fe,_e,Se,we,Pe,ze,Ye,lt;const St=N.isCompressedTexture?N.mipmaps[ne]:N.image;if(Z!==null)ae=Z.max.x-Z.min.x,fe=Z.max.y-Z.min.y,_e=Z.isBox3?Z.max.z-Z.min.z:1,Se=Z.min.x,we=Z.min.y,Pe=Z.isBox3?Z.min.z:0;else{const Mi=Math.pow(2,-X);ae=Math.floor(St.width*Mi),fe=Math.floor(St.height*Mi),N.isDataArrayTexture?_e=St.depth:N.isData3DTexture?_e=Math.floor(St.depth*Mi):_e=1,Se=0,we=0,Pe=0}H!==null?(ze=H.x,Ye=H.y,lt=H.z):(ze=0,Ye=0,lt=0);const bt=Oe.convert(V.format),ft=Oe.convert(V.type);let At;V.isData3DTexture?(ct.setTexture3D(V,0),At=G.TEXTURE_3D):V.isDataArrayTexture||V.isCompressedArrayTexture?(ct.setTexture2DArray(V,0),At=G.TEXTURE_2D_ARRAY):(ct.setTexture2D(V,0),At=G.TEXTURE_2D),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,V.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,V.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,V.unpackAlignment);const st=G.getParameter(G.UNPACK_ROW_LENGTH),Kt=G.getParameter(G.UNPACK_IMAGE_HEIGHT),On=G.getParameter(G.UNPACK_SKIP_PIXELS),Xt=G.getParameter(G.UNPACK_SKIP_ROWS),kt=G.getParameter(G.UNPACK_SKIP_IMAGES);G.pixelStorei(G.UNPACK_ROW_LENGTH,St.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,St.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,Se),G.pixelStorei(G.UNPACK_SKIP_ROWS,we),G.pixelStorei(G.UNPACK_SKIP_IMAGES,Pe);const Ct=N.isDataArrayTexture||N.isData3DTexture,Bn=V.isDataArrayTexture||V.isData3DTexture;if(N.isDepthTexture){const Mi=Je.get(N),Mn=Je.get(V),Gn=Je.get(Mi.__renderTarget),gh=Je.get(Mn.__renderTarget);Be.bindFramebuffer(G.READ_FRAMEBUFFER,Gn.__webglFramebuffer),Be.bindFramebuffer(G.DRAW_FRAMEBUFFER,gh.__webglFramebuffer);for(let Lr=0;Lr<_e;Lr++)Ct&&(G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Je.get(N).__webglTexture,X,Pe+Lr),G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Je.get(V).__webglTexture,ne,lt+Lr)),G.blitFramebuffer(Se,we,ae,fe,ze,Ye,ae,fe,G.DEPTH_BUFFER_BIT,G.NEAREST);Be.bindFramebuffer(G.READ_FRAMEBUFFER,null),Be.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else if(X!==0||N.isRenderTargetTexture||Je.has(N)){const Mi=Je.get(N),Mn=Je.get(V);Be.bindFramebuffer(G.READ_FRAMEBUFFER,z),Be.bindFramebuffer(G.DRAW_FRAMEBUFFER,Y);for(let Gn=0;Gn<_e;Gn++)Ct?G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Mi.__webglTexture,X,Pe+Gn):G.framebufferTexture2D(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,Mi.__webglTexture,X),Bn?G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Mn.__webglTexture,ne,lt+Gn):G.framebufferTexture2D(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,Mn.__webglTexture,ne),X!==0?G.blitFramebuffer(Se,we,ae,fe,ze,Ye,ae,fe,G.COLOR_BUFFER_BIT,G.NEAREST):Bn?G.copyTexSubImage3D(At,ne,ze,Ye,lt+Gn,Se,we,ae,fe):G.copyTexSubImage2D(At,ne,ze,Ye,Se,we,ae,fe);Be.bindFramebuffer(G.READ_FRAMEBUFFER,null),Be.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else Bn?N.isDataTexture||N.isData3DTexture?G.texSubImage3D(At,ne,ze,Ye,lt,ae,fe,_e,bt,ft,St.data):V.isCompressedArrayTexture?G.compressedTexSubImage3D(At,ne,ze,Ye,lt,ae,fe,_e,bt,St.data):G.texSubImage3D(At,ne,ze,Ye,lt,ae,fe,_e,bt,ft,St):N.isDataTexture?G.texSubImage2D(G.TEXTURE_2D,ne,ze,Ye,ae,fe,bt,ft,St.data):N.isCompressedTexture?G.compressedTexSubImage2D(G.TEXTURE_2D,ne,ze,Ye,St.width,St.height,bt,St.data):G.texSubImage2D(G.TEXTURE_2D,ne,ze,Ye,ae,fe,bt,ft,St);G.pixelStorei(G.UNPACK_ROW_LENGTH,st),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,Kt),G.pixelStorei(G.UNPACK_SKIP_PIXELS,On),G.pixelStorei(G.UNPACK_SKIP_ROWS,Xt),G.pixelStorei(G.UNPACK_SKIP_IMAGES,kt),ne===0&&V.generateMipmaps&&G.generateMipmap(At),Be.unbindTexture()},this.initRenderTarget=function(N){Je.get(N).__webglFramebuffer===void 0&&ct.setupRenderTarget(N)},this.initTexture=function(N){N.isCubeTexture?ct.setTextureCube(N,0):N.isData3DTexture?ct.setTexture3D(N,0):N.isDataArrayTexture||N.isCompressedArrayTexture?ct.setTexture2DArray(N,0):ct.setTexture2D(N,0),Be.unbindTexture()},this.resetState=function(){P=0,O=0,R=null,Be.reset(),q.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Mr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=rn._getDrawingBufferColorSpace(e),t.unpackColorSpace=rn._getUnpackColorSpace()}}const gj=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:cb,AddEquation:Qs,AddOperation:uU,AdditiveAnimationBlendMode:pb,AdditiveBlending:$3,AgXToneMapping:mU,AlphaFormat:fb,AlwaysCompare:DU,AlwaysDepth:i0,AlwaysStencilFunc:iE,AmbientLight:_6,AnimationAction:w6,AnimationClip:Ku,AnimationLoader:CV,AnimationMixer:C6,AnimationObjectGroup:$V,AnimationUtils:bV,ArcCurve:jU,ArrayCamera:b6,ArrowHelper:Mk,AttachedBindMode:nE,Audio:A6,AudioAnalyser:kV,AudioContext:Xb,AudioListener:FV,AudioLoader:zV,AxesHelper:O6,BackSide:Oi,BasicDepthPacking:Sc,BasicShadowMap:YI,BatchedMesh:XU,Bone:H1,BooleanKeyframeTrack:uh,Box2:lk,Box3:ea,Box3Helper:Tk,BoxGeometry:oh,BoxHelper:Sk,BufferAttribute:Ot,BufferGeometry:wt,BufferGeometryLoader:E6,ByteType:w1,Cache:to,Camera:Tc,CameraHelper:yk,CanvasTexture:jG,CapsuleGeometry:k1,CatmullRomCurve3:ZU,CineonToneMapping:dU,CircleGeometry:W1,ClampToEdgeWrapping:Li,Clock:Yb,Color:je,ColorKeyframeTrack:Bb,ColorManagement:rn,CompressedArrayTexture:YG,CompressedCubeTexture:qG,CompressedTexture:V1,CompressedTextureLoader:NV,ConeGeometry:z0,ConstantAlphaFactor:oU,ConstantColorFactor:rU,Controls:Ak,CubeCamera:FU,CubeReflectionMapping:al,CubeRefractionMapping:dc,CubeTexture:L0,CubeTextureLoader:DV,CubeUVReflectionMapping:kd,CubicBezierCurve:wb,CubicBezierCurve3:KU,CubicInterpolant:f6,CullFaceBack:J3,CullFaceFront:XI,CullFaceFrontBack:lF,CullFaceNone:WI,Curve:Os,CurvePath:JU,CustomBlending:lb,CustomToneMapping:pU,CylinderGeometry:P0,Cylindrical:ok,Data3DTexture:is,DataArrayTexture:U1,DataTexture:Ja,DataTextureLoader:g6,DataUtils:aE,DecrementStencilOp:_F,DecrementWrapStencilOp:yF,DefaultLoadingManager:m6,DepthFormat:_d,DepthStencilFormat:Yu,DepthTexture:U0,DetachedBindMode:vU,DirectionalLight:Wb,DirectionalLightHelper:xk,DiscreteInterpolant:d6,DodecahedronGeometry:X1,DoubleSide:la,DstAlphaFactor:eU,DstColorFactor:nU,DynamicCopyUsage:IF,DynamicDrawUsage:OU,DynamicReadUsage:DF,EdgesGeometry:qU,EllipseCurve:Y1,EqualCompare:RU,EqualDepth:tx,EqualStencilFunc:MF,EquirectangularReflectionMapping:a0,EquirectangularRefractionMapping:r0,Euler:Ui,EventDispatcher:tr,ExternalTexture:Ab,ExtrudeGeometry:q1,FileLoader:ss,Float16BufferAttribute:MG,Float32BufferAttribute:xt,FloatType:ri,Fog:z1,FogExp2:P1,FramebufferTexture:XG,FrontSide:Cs,Frustum:Wd,FrustumArray:F1,GLBufferAttribute:cE,GLSL1:PF,GLSL3:ao,GreaterCompare:wU,GreaterDepth:ix,GreaterEqualCompare:NU,GreaterEqualDepth:nx,GreaterEqualStencilFunc:wF,GreaterStencilFunc:AF,GridHelper:vk,Group:Ia,HalfFloatType:Xn,HemisphereLight:v6,HemisphereLightHelper:gk,IcosahedronGeometry:j1,ImageBitmapLoader:M6,ImageLoader:wd,ImageUtils:UU,IncrementStencilOp:vF,IncrementWrapStencilOp:xF,InstancedBufferAttribute:qu,InstancedBufferGeometry:T6,InstancedInterleavedBuffer:ak,InstancedMesh:Eb,Int16BufferAttribute:TG,Int32BufferAttribute:EG,Int8BufferAttribute:xG,IntType:D0,InterleavedBuffer:I0,InterleavedBufferAttribute:mc,Interpolant:Xd,InterpolateDiscrete:xd,InterpolateLinear:yd,InterpolateSmooth:d_,InterpolationSamplingMode:HF,InterpolationSamplingType:BF,InvertStencilOp:SF,KeepStencilOp:vu,KeyframeTrack:ls,LOD:WU,LatheGeometry:Z1,Layers:Md,LessCompare:AU,LessDepth:ex,LessEqualCompare:gb,LessEqualDepth:ku,LessEqualStencilFunc:bF,LessStencilFunc:EF,Light:bc,LightProbe:S6,Line:ro,Line3:hk,LineBasicMaterial:Pi,LineCurve:Cb,LineCurve3:QU,LineDashedMaterial:c6,LineLoop:Mb,LineSegments:nr,LinearFilter:Ht,LinearInterpolant:zb,LinearMipMapLinearFilter:_U,LinearMipMapNearestFilter:hF,LinearMipmapLinearFilter:Er,LinearMipmapNearestFilter:td,LinearSRGBColorSpace:Wn,LinearToneMapping:hU,LinearTransfer:o0,Loader:Ti,LoaderUtils:oc,LoadingManager:Hb,LoopOnce:xU,LoopPingPong:SU,LoopRepeat:yU,MOUSE:mu,Material:qn,MaterialLoader:ny,MathUtils:$t,Matrix2:Zb,Matrix3:Et,Matrix4:ke,MaxEquation:KI,Mesh:si,MeshBasicMaterial:La,MeshDepthMaterial:Ib,MeshDistanceMaterial:Ub,MeshLambertMaterial:o6,MeshMatcapMaterial:l6,MeshNormalMaterial:Lb,MeshPhongMaterial:r6,MeshPhysicalMaterial:os,MeshStandardMaterial:F0,MeshToonMaterial:s6,MinEquation:ZI,MirroredRepeatWrapping:vd,MixOperation:cU,MultiplyBlending:tE,MultiplyOperation:N0,NearestFilter:Fn,NearestMipMapLinearFilter:uF,NearestMipMapNearestFilter:cF,NearestMipmapLinearFilter:yu,NearestMipmapNearestFilter:R1,NeutralToneMapping:gU,NeverCompare:bU,NeverDepth:$_,NeverStencilFunc:TF,NoBlending:Sa,NoColorSpace:Na,NoToneMapping:ns,NormalAnimationBlendMode:I1,NormalBlending:Ou,NotEqualCompare:CU,NotEqualDepth:ax,NotEqualStencilFunc:RF,NumberKeyframeTrack:gc,Object3D:Zt,ObjectLoader:UV,ObjectSpaceNormalMap:MU,OctahedronGeometry:B0,OneFactor:Gf,OneMinusConstantAlphaFactor:lU,OneMinusConstantColorFactor:sU,OneMinusDstAlphaFactor:tU,OneMinusDstColorFactor:iU,OneMinusSrcAlphaFactor:J_,OneMinusSrcColorFactor:$I,OrthographicCamera:io,PCFShadowMap:b1,PCFSoftShadowMap:Cm,PMREMGenerator:dE,Path:zx,PerspectiveCamera:ui,Plane:Fo,PlaneGeometry:lh,PlaneHelper:Ek,PointLight:kb,PointLightHelper:pk,Points:bb,PointsMaterial:G1,PolarGridHelper:_k,PolyhedronGeometry:Mc,PositionalAudio:VV,PropertyBinding:fn,PropertyMixer:R6,QuadraticBezierCurve:Nb,QuadraticBezierCurve3:Db,Quaternion:Tt,QuaternionKeyframeTrack:vc,QuaternionLinearInterpolant:p6,RED_GREEN_RGTC2_Format:Dx,RED_RGTC1_Format:Cx,REVISION:ws,RGBADepthPacking:EU,RGBAFormat:Jn,RGBAIntegerFormat:L1,RGBA_ASTC_10x10_Format:Ex,RGBA_ASTC_10x5_Format:yx,RGBA_ASTC_10x6_Format:Sx,RGBA_ASTC_10x8_Format:Tx,RGBA_ASTC_12x10_Format:Mx,RGBA_ASTC_12x12_Format:bx,RGBA_ASTC_4x4_Format:fx,RGBA_ASTC_5x4_Format:dx,RGBA_ASTC_5x5_Format:px,RGBA_ASTC_6x5_Format:mx,RGBA_ASTC_6x6_Format:gx,RGBA_ASTC_8x5_Format:vx,RGBA_ASTC_8x6_Format:_x,RGBA_ASTC_8x8_Format:xx,RGBA_BPTC_Format:Ax,RGBA_ETC2_EAC_Format:hx,RGBA_PVRTC_2BPPV1_Format:lx,RGBA_PVRTC_4BPPV1_Format:ox,RGBA_S3TC_DXT1_Format:Dm,RGBA_S3TC_DXT3_Format:Om,RGBA_S3TC_DXT5_Format:Lm,RGBDepthPacking:dF,RGBFormat:db,RGBIntegerFormat:fF,RGB_BPTC_SIGNED_Format:Rx,RGB_BPTC_UNSIGNED_Format:wx,RGB_ETC1_Format:cx,RGB_ETC2_Format:ux,RGB_PVRTC_2BPPV1_Format:sx,RGB_PVRTC_4BPPV1_Format:rx,RGB_S3TC_DXT1_Format:Nm,RGDepthPacking:pF,RGFormat:Vo,RGIntegerFormat:O1,RawShaderMaterial:ch,Ray:sh,Raycaster:N6,RectAreaLight:x6,RedFormat:bs,RedIntegerFormat:O0,ReinhardToneMapping:fU,RenderTarget:_b,RenderTarget3D:tk,RepeatWrapping:Ta,ReplaceStencilOp:gF,ReverseSubtractEquation:jI,RingGeometry:K1,SIGNED_RED_GREEN_RGTC2_Format:Ox,SIGNED_RED_RGTC1_Format:Nx,SRGBColorSpace:En,SRGBTransfer:Rn,Scene:Ad,ShaderChunk:Qt,ShaderLib:Ms,ShaderMaterial:Fi,ShadowMaterial:a6,Shape:Iu,ShapeGeometry:Q1,ShapePath:bk,ShapeUtils:As,ShortType:C1,Skeleton:Ec,SkeletonHelper:dk,SkinnedMesh:B1,Source:Zl,Sphere:ta,SphereGeometry:H0,Spherical:hE,SphericalHarmonics3:y6,SplineCurve:Ob,SpotLight:Vb,SpotLightHelper:fk,Sprite:kU,SpriteMaterial:Tb,SrcAlphaFactor:Q_,SrcAlphaSaturateFactor:aU,SrcColorFactor:JI,StaticCopyUsage:LF,StaticDrawUsage:l0,StaticReadUsage:NF,StereoCamera:BV,StreamCopyUsage:UF,StreamDrawUsage:CF,StreamReadUsage:OF,StringKeyframeTrack:hh,SubtractEquation:qI,SubtractiveBlending:eE,TOUCH:gu,TangentSpaceNormalMap:ol,TetrahedronGeometry:J1,Texture:Nn,TextureLoader:Fb,TextureUtils:Dk,Timer:rk,TimestampQuery:zF,TorusGeometry:$1,TorusKnotGeometry:ey,Triangle:Ka,TriangleFanDrawMode:Lx,TriangleStripDrawMode:mb,TrianglesDrawMode:TU,TubeGeometry:ty,UVMapping:A1,Uint16BufferAttribute:xb,Uint32BufferAttribute:yb,Uint8BufferAttribute:yG,Uint8ClampedBufferAttribute:SG,Uniform:J,UniformsGroup:ik,UniformsLib:at,UniformsUtils:Sb,UnsignedByteType:Ii,UnsignedInt101111Type:hb,UnsignedInt248Type:Xu,UnsignedInt5999Type:ub,UnsignedIntType:Ns,UnsignedShort4444Type:N1,UnsignedShort5551Type:D1,UnsignedShortType:Wu,VSMShadowMap:ys,Vector2:de,Vector3:L,Vector4:zt,VectorKeyframeTrack:Zu,VideoFrameTexture:WG,VideoTexture:YU,WebGL3DRenderTarget:zU,WebGLArrayRenderTarget:PU,WebGLCoordinateSystem:Mr,WebGLCubeRenderTarget:GU,WebGLRenderTarget:_i,WebGLRenderer:Kb,WebGLUtils:B6,WebGPUCoordinateSystem:Sd,WebXRController:p_,WireframeGeometry:i6,WrapAroundEnding:s0,ZeroCurvatureEnding:Su,ZeroFactor:QI,ZeroSlopeEnding:Tu,ZeroStencilOp:mF,createCanvasElement:IU,error:Bt,getConsoleFunction:VF,log:u0,setConsoleFunction:GF,warn:ut,warnOnce:Td},Symbol.toStringTag,{value:"Module"}));var H6={exports:{}},F6={},G6={exports:{}},V6={};/** +}`;class uj{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const i=new Cb(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new Vi({vertexShader:lj,fragmentShader:cj,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new oi(new uh(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class hj extends nr{constructor(e,t){super();const i=this;let a=null,r=1,s=null,o="local-floor",c=1,h=null,f=null,d=null,m=null,g=null,x=null;const T=typeof XRWebGLBinding<"u",y=new uj,v={},S=t.getContextAttributes();let E=null,b=null;const D=[],C=[],I=new de;let P=null;const O=new hi;O.viewport=new zt;const w=new hi;w.viewport=new zt;const B=[O,w],j=new w6;let ee=null,se=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ge){let Ae=D[ge];return Ae===void 0&&(Ae=new g_,D[ge]=Ae),Ae.getTargetRaySpace()},this.getControllerGrip=function(ge){let Ae=D[ge];return Ae===void 0&&(Ae=new g_,D[ge]=Ae),Ae.getGripSpace()},this.getHand=function(ge){let Ae=D[ge];return Ae===void 0&&(Ae=new g_,D[ge]=Ae),Ae.getHandSpace()};function re(ge){const Ae=C.indexOf(ge.inputSource);if(Ae===-1)return;const Ze=D[Ae];Ze!==void 0&&(Ze.update(ge.inputSource,ge.frame,h||s),Ze.dispatchEvent({type:ge.type,data:ge.inputSource}))}function W(){a.removeEventListener("select",re),a.removeEventListener("selectstart",re),a.removeEventListener("selectend",re),a.removeEventListener("squeeze",re),a.removeEventListener("squeezestart",re),a.removeEventListener("squeezeend",re),a.removeEventListener("end",W),a.removeEventListener("inputsourceschange",te);for(let ge=0;ge=0&&(C[ue]=null,D[ue].disconnect(Ze))}for(let Ae=0;Ae=C.length){C.push(Ze),ue=Mt;break}else if(C[Mt]===null){C[Mt]=Ze,ue=Mt;break}if(ue===-1)break}const it=D[ue];it&&it.connect(Ze)}}const K=new L,oe=new L;function ie(ge,Ae,Ze){K.setFromMatrixPosition(Ae.matrixWorld),oe.setFromMatrixPosition(Ze.matrixWorld);const ue=K.distanceTo(oe),it=Ae.projectionMatrix.elements,Mt=Ze.projectionMatrix.elements,ot=it[14]/(it[10]-1),Ke=it[14]/(it[10]+1),Te=(it[9]+1)/it[5],G=(it[9]-1)/it[5],be=(it[8]-1)/it[0],De=(Mt[8]+1)/Mt[0],Fe=ot*be,Be=ot*De,$e=ue/(-be+De),Je=$e*-be;if(Ae.matrixWorld.decompose(ge.position,ge.quaternion,ge.scale),ge.translateX(Je),ge.translateZ($e),ge.matrixWorld.compose(ge.position,ge.quaternion,ge.scale),ge.matrixWorldInverse.copy(ge.matrixWorld).invert(),it[10]===-1)ge.projectionMatrix.copy(Ae.projectionMatrix),ge.projectionMatrixInverse.copy(Ae.projectionMatrixInverse);else{const ct=ot+$e,k=Ke+$e,U=Fe-Je,ce=Be+(ue-Je),Ee=Te*Ke/k*ct,Le=G*Ke/k*ct;ge.projectionMatrix.makePerspective(U,ce,Ee,Le,ct,k),ge.projectionMatrixInverse.copy(ge.projectionMatrix).invert()}}function Ce(ge,Ae){Ae===null?ge.matrixWorld.copy(ge.matrix):ge.matrixWorld.multiplyMatrices(Ae.matrixWorld,ge.matrix),ge.matrixWorldInverse.copy(ge.matrixWorld).invert()}this.updateCamera=function(ge){if(a===null)return;let Ae=ge.near,Ze=ge.far;y.texture!==null&&(y.depthNear>0&&(Ae=y.depthNear),y.depthFar>0&&(Ze=y.depthFar)),j.near=w.near=O.near=Ae,j.far=w.far=O.far=Ze,(ee!==j.near||se!==j.far)&&(a.updateRenderState({depthNear:j.near,depthFar:j.far}),ee=j.near,se=j.far),j.layers.mask=ge.layers.mask|6,O.layers.mask=j.layers.mask&3,w.layers.mask=j.layers.mask&5;const ue=ge.parent,it=j.cameras;Ce(j,ue);for(let Mt=0;Mt0&&(y.alphaTest.value=v.alphaTest);const S=e.get(v),E=S.envMap,b=S.envMapRotation;E&&(y.envMap.value=E,ou.copy(b),ou.x*=-1,ou.y*=-1,ou.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(ou.y*=-1,ou.z*=-1),y.envMapRotation.value.setFromMatrix4(fj.makeRotationFromEuler(ou)),y.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=v.reflectivity,y.ior.value=v.ior,y.refractionRatio.value=v.refractionRatio),v.lightMap&&(y.lightMap.value=v.lightMap,y.lightMapIntensity.value=v.lightMapIntensity,t(v.lightMap,y.lightMapTransform)),v.aoMap&&(y.aoMap.value=v.aoMap,y.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,y.aoMapTransform))}function s(y,v){y.diffuse.value.copy(v.color),y.opacity.value=v.opacity,v.map&&(y.map.value=v.map,t(v.map,y.mapTransform))}function o(y,v){y.dashSize.value=v.dashSize,y.totalSize.value=v.dashSize+v.gapSize,y.scale.value=v.scale}function c(y,v,S,E){y.diffuse.value.copy(v.color),y.opacity.value=v.opacity,y.size.value=v.size*S,y.scale.value=E*.5,v.map&&(y.map.value=v.map,t(v.map,y.uvTransform)),v.alphaMap&&(y.alphaMap.value=v.alphaMap,t(v.alphaMap,y.alphaMapTransform)),v.alphaTest>0&&(y.alphaTest.value=v.alphaTest)}function h(y,v){y.diffuse.value.copy(v.color),y.opacity.value=v.opacity,y.rotation.value=v.rotation,v.map&&(y.map.value=v.map,t(v.map,y.mapTransform)),v.alphaMap&&(y.alphaMap.value=v.alphaMap,t(v.alphaMap,y.alphaMapTransform)),v.alphaTest>0&&(y.alphaTest.value=v.alphaTest)}function f(y,v){y.specular.value.copy(v.specular),y.shininess.value=Math.max(v.shininess,1e-4)}function d(y,v){v.gradientMap&&(y.gradientMap.value=v.gradientMap)}function m(y,v){y.metalness.value=v.metalness,v.metalnessMap&&(y.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,y.metalnessMapTransform)),y.roughness.value=v.roughness,v.roughnessMap&&(y.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,y.roughnessMapTransform)),v.envMap&&(y.envMapIntensity.value=v.envMapIntensity)}function g(y,v,S){y.ior.value=v.ior,v.sheen>0&&(y.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),y.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(y.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,y.sheenColorMapTransform)),v.sheenRoughnessMap&&(y.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,y.sheenRoughnessMapTransform))),v.clearcoat>0&&(y.clearcoat.value=v.clearcoat,y.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(y.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,y.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(y.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===Ui&&y.clearcoatNormalScale.value.negate())),v.dispersion>0&&(y.dispersion.value=v.dispersion),v.iridescence>0&&(y.iridescence.value=v.iridescence,y.iridescenceIOR.value=v.iridescenceIOR,y.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(y.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,y.iridescenceMapTransform)),v.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),v.transmission>0&&(y.transmission.value=v.transmission,y.transmissionSamplerMap.value=S.texture,y.transmissionSamplerSize.value.set(S.width,S.height),v.transmissionMap&&(y.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,y.transmissionMapTransform)),y.thickness.value=v.thickness,v.thicknessMap&&(y.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=v.attenuationDistance,y.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(y.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(y.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=v.specularIntensity,y.specularColor.value.copy(v.specularColor),v.specularColorMap&&(y.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,y.specularColorMapTransform)),v.specularIntensityMap&&(y.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,y.specularIntensityMapTransform))}function x(y,v){v.matcap&&(y.matcap.value=v.matcap)}function T(y,v){const S=e.get(v).light;y.referencePosition.value.setFromMatrixPosition(S.matrixWorld),y.nearDistance.value=S.shadow.camera.near,y.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:a}}function pj(n,e,t,i){let a={},r={},s=[];const o=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function c(S,E){const b=E.program;i.uniformBlockBinding(S,b)}function h(S,E){let b=a[S.id];b===void 0&&(x(S),b=f(S),a[S.id]=b,S.addEventListener("dispose",y));const D=E.program;i.updateUBOMapping(S,D);const C=e.render.frame;r[S.id]!==C&&(m(S),r[S.id]=C)}function f(S){const E=d();S.__bindingPointIndex=E;const b=n.createBuffer(),D=S.__size,C=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,b),n.bufferData(n.UNIFORM_BUFFER,D,C),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,E,b),b}function d(){for(let S=0;S0&&(b+=D-C),S.__size=b,S.__cache={},this}function T(S){const E={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(E.boundary=4,E.storage=4):S.isVector2?(E.boundary=8,E.storage=8):S.isVector3||S.isColor?(E.boundary=16,E.storage=12):S.isVector4?(E.boundary=16,E.storage=16):S.isMatrix3?(E.boundary=48,E.storage=48):S.isMatrix4?(E.boundary=64,E.storage=64):S.isTexture?ut("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ut("WebGLRenderer: Unsupported uniform value type.",S),E}function y(S){const E=S.target;E.removeEventListener("dispose",y);const b=s.indexOf(E.__bindingPointIndex);s.splice(b,1),n.deleteBuffer(a[E.id]),delete a[E.id],delete r[E.id]}function v(){for(const S in a)n.deleteBuffer(a[S]);s=[],a={},r={}}return{bind:c,update:h,dispose:v}}const mj=new Uint16Array([11481,15204,11534,15171,11808,15015,12385,14843,12894,14716,13396,14600,13693,14483,13976,14366,14237,14171,14405,13961,14511,13770,14605,13598,14687,13444,14760,13305,14822,13066,14876,12857,14923,12675,14963,12517,14997,12379,15025,12230,15049,12023,15070,11843,15086,11687,15100,11551,15111,11433,15120,11330,15127,11217,15132,11060,15135,10922,15138,10801,15139,10695,15139,10600,13012,14923,13020,14917,13064,14886,13176,14800,13349,14666,13513,14526,13724,14398,13960,14230,14200,14020,14383,13827,14488,13651,14583,13491,14667,13348,14740,13132,14803,12908,14856,12713,14901,12542,14938,12394,14968,12241,14992,12017,15010,11822,15024,11654,15034,11507,15041,11380,15044,11269,15044,11081,15042,10913,15037,10764,15031,10635,15023,10520,15014,10419,15003,10330,13657,14676,13658,14673,13670,14660,13698,14622,13750,14547,13834,14442,13956,14317,14112,14093,14291,13889,14407,13704,14499,13538,14586,13389,14664,13201,14733,12966,14792,12758,14842,12577,14882,12418,14915,12272,14940,12033,14959,11826,14972,11646,14980,11490,14983,11355,14983,11212,14979,11008,14971,10830,14961,10675,14950,10540,14936,10420,14923,10315,14909,10204,14894,10041,14089,14460,14090,14459,14096,14452,14112,14431,14141,14388,14186,14305,14252,14130,14341,13941,14399,13756,14467,13585,14539,13430,14610,13272,14677,13026,14737,12808,14790,12617,14833,12449,14869,12303,14896,12065,14916,11845,14929,11655,14937,11490,14939,11347,14936,11184,14930,10970,14921,10783,14912,10621,14900,10480,14885,10356,14867,10247,14848,10062,14827,9894,14805,9745,14400,14208,14400,14206,14402,14198,14406,14174,14415,14122,14427,14035,14444,13913,14469,13767,14504,13613,14548,13463,14598,13324,14651,13082,14704,12858,14752,12658,14795,12483,14831,12330,14860,12106,14881,11875,14895,11675,14903,11501,14905,11351,14903,11178,14900,10953,14892,10757,14880,10589,14865,10442,14847,10313,14827,10162,14805,9965,14782,9792,14757,9642,14731,9507,14562,13883,14562,13883,14563,13877,14566,13862,14570,13830,14576,13773,14584,13689,14595,13582,14613,13461,14637,13336,14668,13120,14704,12897,14741,12695,14776,12516,14808,12358,14835,12150,14856,11910,14870,11701,14878,11519,14882,11361,14884,11187,14880,10951,14871,10748,14858,10572,14842,10418,14823,10286,14801,10099,14777,9897,14751,9722,14725,9567,14696,9430,14666,9309,14702,13604,14702,13604,14702,13600,14703,13591,14705,13570,14707,13533,14709,13477,14712,13400,14718,13305,14727,13106,14743,12907,14762,12716,14784,12539,14807,12380,14827,12190,14844,11943,14855,11727,14863,11539,14870,11376,14871,11204,14868,10960,14858,10748,14845,10565,14829,10406,14809,10269,14786,10058,14761,9852,14734,9671,14705,9512,14674,9374,14641,9253,14608,9076,14821,13366,14821,13365,14821,13364,14821,13358,14821,13344,14821,13320,14819,13252,14817,13145,14815,13011,14814,12858,14817,12698,14823,12539,14832,12389,14841,12214,14850,11968,14856,11750,14861,11558,14866,11390,14867,11226,14862,10972,14853,10754,14840,10565,14823,10401,14803,10259,14780,10032,14754,9820,14725,9635,14694,9473,14661,9333,14627,9203,14593,8988,14557,8798,14923,13014,14922,13014,14922,13012,14922,13004,14920,12987,14919,12957,14915,12907,14909,12834,14902,12738,14894,12623,14888,12498,14883,12370,14880,12203,14878,11970,14875,11759,14873,11569,14874,11401,14872,11243,14865,10986,14855,10762,14842,10568,14825,10401,14804,10255,14781,10017,14754,9799,14725,9611,14692,9445,14658,9301,14623,9139,14587,8920,14548,8729,14509,8562,15008,12672,15008,12672,15008,12671,15007,12667,15005,12656,15001,12637,14997,12605,14989,12556,14978,12490,14966,12407,14953,12313,14940,12136,14927,11934,14914,11742,14903,11563,14896,11401,14889,11247,14879,10992,14866,10767,14851,10570,14833,10400,14812,10252,14789,10007,14761,9784,14731,9592,14698,9424,14663,9279,14627,9088,14588,8868,14548,8676,14508,8508,14467,8360,15080,12386,15080,12386,15079,12385,15078,12383,15076,12378,15072,12367,15066,12347,15057,12315,15045,12253,15030,12138,15012,11998,14993,11845,14972,11685,14951,11530,14935,11383,14920,11228,14904,10981,14887,10762,14870,10567,14850,10397,14827,10248,14803,9997,14774,9771,14743,9578,14710,9407,14674,9259,14637,9048,14596,8826,14555,8632,14514,8464,14471,8317,14427,8182,15139,12008,15139,12008,15138,12008,15137,12007,15135,12003,15130,11990,15124,11969,15115,11929,15102,11872,15086,11794,15064,11693,15041,11581,15013,11459,14987,11336,14966,11170,14944,10944,14921,10738,14898,10552,14875,10387,14850,10239,14824,9983,14794,9758,14762,9563,14728,9392,14692,9244,14653,9014,14611,8791,14569,8597,14526,8427,14481,8281,14436,8110,14391,7885,15188,11617,15188,11617,15187,11617,15186,11618,15183,11617,15179,11612,15173,11601,15163,11581,15150,11546,15133,11495,15110,11427,15083,11346,15051,11246,15024,11057,14996,10868,14967,10687,14938,10517,14911,10362,14882,10206,14853,9956,14821,9737,14787,9543,14752,9375,14715,9228,14675,8980,14632,8760,14589,8565,14544,8395,14498,8248,14451,8049,14404,7824,14357,7630,15228,11298,15228,11298,15227,11299,15226,11301,15223,11303,15219,11302,15213,11299,15204,11290,15191,11271,15174,11217,15150,11129,15119,11015,15087,10886,15057,10744,15024,10599,14990,10455,14957,10318,14924,10143,14891,9911,14856,9701,14820,9516,14782,9352,14744,9200,14703,8946,14659,8725,14615,8533,14568,8366,14521,8220,14472,7992,14423,7770,14374,7578,14315,7408,15260,10819,15260,10819,15259,10822,15258,10826,15256,10832,15251,10836,15246,10841,15237,10838,15225,10821,15207,10788,15183,10734,15151,10660,15120,10571,15087,10469,15049,10359,15012,10249,14974,10041,14937,9837,14900,9647,14860,9475,14820,9320,14779,9147,14736,8902,14691,8688,14646,8499,14598,8335,14549,8189,14499,7940,14448,7720,14397,7529,14347,7363,14256,7218,15285,10410,15285,10411,15285,10413,15284,10418,15282,10425,15278,10434,15272,10442,15264,10449,15252,10445,15235,10433,15210,10403,15179,10358,15149,10301,15113,10218,15073,10059,15033,9894,14991,9726,14951,9565,14909,9413,14865,9273,14822,9073,14777,8845,14730,8641,14682,8459,14633,8300,14583,8129,14531,7883,14479,7670,14426,7482,14373,7321,14305,7176,14201,6939,15305,9939,15305,9940,15305,9945,15304,9955,15302,9967,15298,9989,15293,10010,15286,10033,15274,10044,15258,10045,15233,10022,15205,9975,15174,9903,15136,9808,15095,9697,15053,9578,15009,9451,14965,9327,14918,9198,14871,8973,14825,8766,14775,8579,14725,8408,14675,8259,14622,8058,14569,7821,14515,7615,14460,7435,14405,7276,14350,7108,14256,6866,14149,6653,15321,9444,15321,9445,15321,9448,15320,9458,15317,9470,15314,9490,15310,9515,15302,9540,15292,9562,15276,9579,15251,9577,15226,9559,15195,9519,15156,9463,15116,9389,15071,9304,15025,9208,14978,9023,14927,8838,14878,8661,14827,8496,14774,8344,14722,8206,14667,7973,14612,7749,14556,7555,14499,7382,14443,7229,14385,7025,14322,6791,14210,6588,14100,6409,15333,8920,15333,8921,15332,8927,15332,8943,15329,8965,15326,9002,15322,9048,15316,9106,15307,9162,15291,9204,15267,9221,15244,9221,15212,9196,15175,9134,15133,9043,15088,8930,15040,8801,14990,8665,14938,8526,14886,8391,14830,8261,14775,8087,14719,7866,14661,7664,14603,7482,14544,7322,14485,7178,14426,6936,14367,6713,14281,6517,14166,6348,14054,6198,15341,8360,15341,8361,15341,8366,15341,8379,15339,8399,15336,8431,15332,8473,15326,8527,15318,8585,15302,8632,15281,8670,15258,8690,15227,8690,15191,8664,15149,8612,15104,8543,15055,8456,15001,8360,14948,8259,14892,8122,14834,7923,14776,7734,14716,7558,14656,7397,14595,7250,14534,7070,14472,6835,14410,6628,14350,6443,14243,6283,14125,6135,14010,5889,15348,7715,15348,7717,15348,7725,15347,7745,15345,7780,15343,7836,15339,7905,15334,8e3,15326,8103,15310,8193,15293,8239,15270,8270,15240,8287,15204,8283,15163,8260,15118,8223,15067,8143,15014,8014,14958,7873,14899,7723,14839,7573,14778,7430,14715,7293,14652,7164,14588,6931,14524,6720,14460,6531,14396,6362,14330,6210,14207,6015,14086,5781,13969,5576,15352,7114,15352,7116,15352,7128,15352,7159,15350,7195,15348,7237,15345,7299,15340,7374,15332,7457,15317,7544,15301,7633,15280,7703,15251,7754,15216,7775,15176,7767,15131,7733,15079,7670,15026,7588,14967,7492,14906,7387,14844,7278,14779,7171,14714,6965,14648,6770,14581,6587,14515,6420,14448,6269,14382,6123,14299,5881,14172,5665,14049,5477,13929,5310,15355,6329,15355,6330,15355,6339,15355,6362,15353,6410,15351,6472,15349,6572,15344,6688,15337,6835,15323,6985,15309,7142,15287,7220,15260,7277,15226,7310,15188,7326,15142,7318,15090,7285,15036,7239,14976,7177,14914,7045,14849,6892,14782,6736,14714,6581,14645,6433,14576,6293,14506,6164,14438,5946,14369,5733,14270,5540,14140,5369,14014,5216,13892,5043,15357,5483,15357,5484,15357,5496,15357,5528,15356,5597,15354,5692,15351,5835,15347,6011,15339,6195,15328,6317,15314,6446,15293,6566,15268,6668,15235,6746,15197,6796,15152,6811,15101,6790,15046,6748,14985,6673,14921,6583,14854,6479,14785,6371,14714,6259,14643,6149,14571,5946,14499,5750,14428,5567,14358,5401,14242,5250,14109,5111,13980,4870,13856,4657,15359,4555,15359,4557,15358,4573,15358,4633,15357,4715,15355,4841,15353,5061,15349,5216,15342,5391,15331,5577,15318,5770,15299,5967,15274,6150,15243,6223,15206,6280,15161,6310,15111,6317,15055,6300,14994,6262,14928,6208,14860,6141,14788,5994,14715,5838,14641,5684,14566,5529,14492,5384,14418,5247,14346,5121,14216,4892,14079,4682,13948,4496,13822,4330,15359,3498,15359,3501,15359,3520,15359,3598,15358,3719,15356,3860,15355,4137,15351,4305,15344,4563,15334,4809,15321,5116,15303,5273,15280,5418,15250,5547,15214,5653,15170,5722,15120,5761,15064,5763,15002,5733,14935,5673,14865,5597,14792,5504,14716,5400,14640,5294,14563,5185,14486,5041,14410,4841,14335,4655,14191,4482,14051,4325,13918,4183,13790,4012,15360,2282,15360,2285,15360,2306,15360,2401,15359,2547,15357,2748,15355,3103,15352,3349,15345,3675,15336,4020,15324,4272,15307,4496,15285,4716,15255,4908,15220,5086,15178,5170,15128,5214,15072,5234,15010,5231,14943,5206,14871,5166,14796,5102,14718,4971,14639,4833,14559,4687,14480,4541,14402,4401,14315,4268,14167,4142,14025,3958,13888,3747,13759,3556,15360,923,15360,925,15360,946,15360,1052,15359,1214,15357,1494,15356,1892,15352,2274,15346,2663,15338,3099,15326,3393,15309,3679,15288,3980,15260,4183,15226,4325,15185,4437,15136,4517,15080,4570,15018,4591,14950,4581,14877,4545,14800,4485,14720,4411,14638,4325,14556,4231,14475,4136,14395,3988,14297,3803,14145,3628,13999,3465,13861,3314,13729,3177,15360,263,15360,264,15360,272,15360,325,15359,407,15358,548,15356,780,15352,1144,15347,1580,15339,2099,15328,2425,15312,2795,15292,3133,15264,3329,15232,3517,15191,3689,15143,3819,15088,3923,15025,3978,14956,3999,14882,3979,14804,3931,14722,3855,14639,3756,14554,3645,14470,3529,14388,3409,14279,3289,14124,3173,13975,3055,13834,2848,13701,2658,15360,49,15360,49,15360,52,15360,75,15359,111,15358,201,15356,283,15353,519,15348,726,15340,1045,15329,1415,15314,1795,15295,2173,15269,2410,15237,2649,15197,2866,15150,3054,15095,3140,15032,3196,14963,3228,14888,3236,14808,3224,14725,3191,14639,3146,14553,3088,14466,2976,14382,2836,14262,2692,14103,2549,13952,2409,13808,2278,13674,2154,15360,4,15360,4,15360,4,15360,13,15359,33,15358,59,15357,112,15353,199,15348,302,15341,456,15331,628,15316,827,15297,1082,15272,1332,15241,1601,15202,1851,15156,2069,15101,2172,15039,2256,14970,2314,14894,2348,14813,2358,14728,2344,14640,2311,14551,2263,14463,2203,14376,2133,14247,2059,14084,1915,13930,1761,13784,1609,13648,1464,15360,0,15360,0,15360,0,15360,3,15359,18,15358,26,15357,53,15354,80,15348,97,15341,165,15332,238,15318,326,15299,427,15275,529,15245,654,15207,771,15161,885,15108,994,15046,1089,14976,1170,14900,1229,14817,1266,14731,1284,14641,1282,14550,1260,14460,1223,14370,1174,14232,1116,14066,1050,13909,981,13761,910,13623,839]);let Io=null;function gj(){return Io===null&&(Io=new $a(mj,32,32,ko,Xn),Io.minFilter=Ht,Io.magFilter=Ht,Io.wrapS=Pi,Io.wrapT=Pi,Io.generateMipmaps=!1,Io.needsUpdate=!0),Io}class $b{constructor(e={}){const{canvas:t=PU(),context:i=null,depth:a=!0,stencil:r=!1,alpha:s=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:h=!1,powerPreference:f="default",failIfMajorPerformanceCaveat:d=!1,reversedDepthBuffer:m=!1}=e;this.isWebGLRenderer=!0;let g;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=i.getContextAttributes().alpha}else g=s;const x=new Set([P1,U1,I0]),T=new Set([zi,Ds,Yu,qu,L1,I1]),y=new Uint32Array(4),v=new Int32Array(4);let S=null,E=null;const b=[],D=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=is,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const C=this;let I=!1;this._outputColorSpace=En;let P=0,O=0,w=null,B=-1,j=null;const ee=new zt,se=new zt;let re=null;const W=new je(0);let te=0,K=t.width,oe=t.height,ie=1,Ce=null,Xe=null;const nt=new zt(0,0,K,oe),tt=new zt(0,0,K,oe);let gt=!1;const ge=new Yd;let Ae=!1,Ze=!1;const ue=new ke,it=new L,Mt=new zt,ot={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ke=!1;function Te(){return w===null?ie:1}let G=i;function be(N,V){return t.getContext(N,V)}try{const N={alpha:!0,depth:a,stencil:r,antialias:o,premultipliedAlpha:c,preserveDrawingBuffer:h,powerPreference:f,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Cs}`),t.addEventListener("webglcontextlost",Ge,!1),t.addEventListener("webglcontextrestored",we,!1),t.addEventListener("webglcontextcreationerror",rt,!1),G===null){const V="webgl2";if(G=be(V,N),G===null)throw be(V)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(N){throw N("WebGLRenderer: "+N.message),N}let De,Fe,Be,$e,Je,ct,k,U,ce,Ee,Le,ye,vt,qe,_t,pt,Ie,He,ht,Q,pe,Oe,q,Ve;function me(){De=new AY(G),De.init(),Oe=new F6(G,De),Fe=new vY(G,De,e,Oe),Be=new sj(G,De),Fe.reversedDepthBuffer&&m&&Be.buffers.depth.setReversed(!0),$e=new CY(G),Je=new qq,ct=new oj(G,De,Be,Je,Fe,Oe,$e),k=new xY(C),U=new bY(C),ce=new Lk(G),q=new mY(G,ce),Ee=new wY(G,ce,$e,q),Le=new DY(G,Ee,ce,$e),ht=new NY(G,Fe,ct),pt=new _Y(Je),ye=new Yq(C,k,U,De,Fe,q,pt),vt=new dj(C,Je),qe=new Zq,_t=new tj(De),He=new pY(C,k,U,Be,Le,g,c),Ie=new aj(C,Le,Fe),Ve=new pj(G,$e,Fe,Be),Q=new gY(G,De,$e),pe=new RY(G,De,$e),$e.programs=ye.programs,C.capabilities=Fe,C.extensions=De,C.properties=Je,C.renderLists=qe,C.shadowMap=Ie,C.state=Be,C.info=$e}me();const We=new hj(C,G);this.xr=We,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const N=De.get("WEBGL_lose_context");N&&N.loseContext()},this.forceContextRestore=function(){const N=De.get("WEBGL_lose_context");N&&N.restoreContext()},this.getPixelRatio=function(){return ie},this.setPixelRatio=function(N){N!==void 0&&(ie=N,this.setSize(K,oe,!1))},this.getSize=function(N){return N.set(K,oe)},this.setSize=function(N,V,Z=!0){if(We.isPresenting){ut("WebGLRenderer: Can't change size while VR device is presenting.");return}K=N,oe=V,t.width=Math.floor(N*ie),t.height=Math.floor(V*ie),Z===!0&&(t.style.width=N+"px",t.style.height=V+"px"),this.setViewport(0,0,N,V)},this.getDrawingBufferSize=function(N){return N.set(K*ie,oe*ie).floor()},this.setDrawingBufferSize=function(N,V,Z){K=N,oe=V,ie=Z,t.width=Math.floor(N*Z),t.height=Math.floor(V*Z),this.setViewport(0,0,N,V)},this.getCurrentViewport=function(N){return N.copy(ee)},this.getViewport=function(N){return N.copy(nt)},this.setViewport=function(N,V,Z,H){N.isVector4?nt.set(N.x,N.y,N.z,N.w):nt.set(N,V,Z,H),Be.viewport(ee.copy(nt).multiplyScalar(ie).round())},this.getScissor=function(N){return N.copy(tt)},this.setScissor=function(N,V,Z,H){N.isVector4?tt.set(N.x,N.y,N.z,N.w):tt.set(N,V,Z,H),Be.scissor(se.copy(tt).multiplyScalar(ie).round())},this.getScissorTest=function(){return gt},this.setScissorTest=function(N){Be.setScissorTest(gt=N)},this.setOpaqueSort=function(N){Ce=N},this.setTransparentSort=function(N){Xe=N},this.getClearColor=function(N){return N.copy(He.getClearColor())},this.setClearColor=function(){He.setClearColor(...arguments)},this.getClearAlpha=function(){return He.getClearAlpha()},this.setClearAlpha=function(){He.setClearAlpha(...arguments)},this.clear=function(N=!0,V=!0,Z=!0){let H=0;if(N){let X=!1;if(w!==null){const ne=w.texture.format;X=x.has(ne)}if(X){const ne=w.texture.type,ae=T.has(ne),fe=He.getClearColor(),_e=He.getClearAlpha(),Se=fe.r,Re=fe.g,Pe=fe.b;ae?(y[0]=Se,y[1]=Re,y[2]=Pe,y[3]=_e,G.clearBufferuiv(G.COLOR,0,y)):(v[0]=Se,v[1]=Re,v[2]=Pe,v[3]=_e,G.clearBufferiv(G.COLOR,0,v))}else H|=G.COLOR_BUFFER_BIT}V&&(H|=G.DEPTH_BUFFER_BIT),Z&&(H|=G.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G.clear(H)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Ge,!1),t.removeEventListener("webglcontextrestored",we,!1),t.removeEventListener("webglcontextcreationerror",rt,!1),He.dispose(),qe.dispose(),_t.dispose(),Je.dispose(),k.dispose(),U.dispose(),Le.dispose(),q.dispose(),Ve.dispose(),ye.dispose(),We.dispose(),We.removeEventListener("sessionstart",Is),We.removeEventListener("sessionend",Us),bi.stop()};function Ge(N){N.preventDefault(),f0("WebGLRenderer: Context Lost."),I=!0}function we(){f0("WebGLRenderer: Context Restored."),I=!1;const N=$e.autoReset,V=Ie.enabled,Z=Ie.autoUpdate,H=Ie.needsUpdate,X=Ie.type;me(),$e.autoReset=N,Ie.enabled=V,Ie.autoUpdate=Z,Ie.needsUpdate=H,Ie.type=X}function rt(N){Bt("WebGLRenderer: A WebGL context could not be created. Reason: ",N.statusMessage)}function yt(N){const V=N.target;V.removeEventListener("dispose",yt),Gt(V)}function Gt(N){Vt(N),Je.remove(N)}function Vt(N){const V=Je.get(N).programs;V!==void 0&&(V.forEach(function(Z){ye.releaseProgram(Z)}),N.isShaderMaterial&&ye.releaseShaderCache(N))}this.renderBufferDirect=function(N,V,Z,H,X,ne){V===null&&(V=ot);const ae=X.isMesh&&X.matrixWorld.determinant()<0,fe=ho(N,V,Z,H,X);Be.setMaterial(H,ae);let _e=Z.index,Se=1;if(H.wireframe===!0){if(_e=Ee.getWireframeAttribute(Z),_e===void 0)return;Se=2}const Re=Z.drawRange,Pe=Z.attributes.position;let ze=Re.start*Se,Ye=(Re.start+Re.count)*Se;ne!==null&&(ze=Math.max(ze,ne.start*Se),Ye=Math.min(Ye,(ne.start+ne.count)*Se)),_e!==null?(ze=Math.max(ze,0),Ye=Math.min(Ye,_e.count)):Pe!=null&&(ze=Math.max(ze,0),Ye=Math.min(Ye,Pe.count));const lt=Ye-ze;if(lt<0||lt===1/0)return;q.setup(X,H,fe,Z,_e);let Tt,bt=Q;if(_e!==null&&(Tt=ce.get(_e),bt=pe,bt.setIndex(Tt)),X.isMesh)H.wireframe===!0?(Be.setLineWidth(H.wireframeLinewidth*Te()),bt.setMode(G.LINES)):bt.setMode(G.TRIANGLES);else if(X.isLine){let ft=H.linewidth;ft===void 0&&(ft=1),Be.setLineWidth(ft*Te()),X.isLineSegments?bt.setMode(G.LINES):X.isLineLoop?bt.setMode(G.LINE_LOOP):bt.setMode(G.LINE_STRIP)}else X.isPoints?bt.setMode(G.POINTS):X.isSprite&&bt.setMode(G.TRIANGLES);if(X.isBatchedMesh)if(X._multiDrawInstances!==null)Md("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),bt.renderMultiDrawInstances(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount,X._multiDrawInstances);else if(De.get("WEBGL_multi_draw"))bt.renderMultiDraw(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount);else{const ft=X._multiDrawStarts,At=X._multiDrawCounts,st=X._multiDrawCount,Kt=_e?ce.get(_e).bytesPerElement:1,On=Je.get(H).currentProgram.getUniforms();for(let Yt=0;Yt{function ne(){if(H.forEach(function(ae){Je.get(ae).currentProgram.isReady()&&H.delete(ae)}),H.size===0){X(N);return}setTimeout(ne,10)}De.get("KHR_parallel_shader_compile")!==null?ne():setTimeout(ne,10)})};let ci=null;function uo(N){ci&&ci(N)}function Is(){bi.stop()}function Us(){bi.start()}const bi=new U6;bi.setAnimationLoop(uo),typeof self<"u"&&bi.setContext(self),this.setAnimationLoop=function(N){ci=N,We.setAnimationLoop(N),N===null?bi.stop():bi.start()},We.addEventListener("sessionstart",Is),We.addEventListener("sessionend",Us),this.render=function(N,V){if(V!==void 0&&V.isCamera!==!0){Bt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;if(N.matrixWorldAutoUpdate===!0&&N.updateMatrixWorld(),V.parent===null&&V.matrixWorldAutoUpdate===!0&&V.updateMatrixWorld(),We.enabled===!0&&We.isPresenting===!0&&(We.cameraAutoUpdate===!0&&We.updateCamera(V),V=We.getCamera()),N.isScene===!0&&N.onBeforeRender(C,N,V,w),E=_t.get(N,D.length),E.init(V),D.push(E),ue.multiplyMatrices(V.projectionMatrix,V.matrixWorldInverse),ge.setFromProjectionMatrix(ue,br,V.reversedDepth),Ze=this.localClippingEnabled,Ae=pt.init(this.clippingPlanes,Ze),S=qe.get(N,b.length),S.init(),b.push(S),We.enabled===!0&&We.isPresenting===!0){const ne=C.xr.getDepthSensingMesh();ne!==null&&Ps(ne,V,-1/0,C.sortObjects)}Ps(N,V,0,C.sortObjects),S.finish(),C.sortObjects===!0&&S.sort(Ce,Xe),Ke=We.enabled===!1||We.isPresenting===!1||We.hasDepthSensing()===!1,Ke&&He.addToRenderList(S,N),this.info.render.frame++,Ae===!0&&pt.beginShadows();const Z=E.state.shadowsArray;Ie.render(Z,N,V),Ae===!0&&pt.endShadows(),this.info.autoReset===!0&&this.info.reset();const H=S.opaque,X=S.transmissive;if(E.setupLights(),V.isArrayCamera){const ne=V.cameras;if(X.length>0)for(let ae=0,fe=ne.length;ae0&&Xi(H,X,N,V),Ke&&He.render(N),fa(S,N,V);w!==null&&O===0&&(ct.updateMultisampleRenderTarget(w),ct.updateRenderTargetMipmap(w)),N.isScene===!0&&N.onAfterRender(C,N,V),q.resetDefaultState(),B=-1,j=null,D.pop(),D.length>0?(E=D[D.length-1],Ae===!0&&pt.setGlobalState(C.clippingPlanes,E.state.camera)):E=null,b.pop(),b.length>0?S=b[b.length-1]:S=null};function Ps(N,V,Z,H){if(N.visible===!1)return;if(N.layers.test(V.layers)){if(N.isGroup)Z=N.renderOrder;else if(N.isLOD)N.autoUpdate===!0&&N.update(V);else if(N.isLight)E.pushLight(N),N.castShadow&&E.pushShadow(N);else if(N.isSprite){if(!N.frustumCulled||ge.intersectsSprite(N)){H&&Mt.setFromMatrixPosition(N.matrixWorld).applyMatrix4(ue);const ae=Le.update(N),fe=N.material;fe.visible&&S.push(N,ae,fe,Z,Mt.z,null)}}else if((N.isMesh||N.isLine||N.isPoints)&&(!N.frustumCulled||ge.intersectsObject(N))){const ae=Le.update(N),fe=N.material;if(H&&(N.boundingSphere!==void 0?(N.boundingSphere===null&&N.computeBoundingSphere(),Mt.copy(N.boundingSphere.center)):(ae.boundingSphere===null&&ae.computeBoundingSphere(),Mt.copy(ae.boundingSphere.center)),Mt.applyMatrix4(N.matrixWorld).applyMatrix4(ue)),Array.isArray(fe)){const _e=ae.groups;for(let Se=0,Re=_e.length;Se0&&Fa(X,V,Z),ne.length>0&&Fa(ne,V,Z),ae.length>0&&Fa(ae,V,Z),Be.buffers.depth.setTest(!0),Be.buffers.depth.setMask(!0),Be.buffers.color.setMask(!0),Be.setPolygonOffset(!1)}function Xi(N,V,Z,H){if((Z.isScene===!0?Z.overrideMaterial:null)!==null)return;E.state.transmissionRenderTarget[H.id]===void 0&&(E.state.transmissionRenderTarget[H.id]=new xi(1,1,{generateMipmaps:!0,type:De.has("EXT_color_buffer_half_float")||De.has("EXT_color_buffer_float")?Xn:zi,minFilter:Mr,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:rn.workingColorSpace}));const ne=E.state.transmissionRenderTarget[H.id],ae=H.viewport||ee;ne.setSize(ae.z*C.transmissionResolutionScale,ae.w*C.transmissionResolutionScale);const fe=C.getRenderTarget(),_e=C.getActiveCubeFace(),Se=C.getActiveMipmapLevel();C.setRenderTarget(ne),C.getClearColor(W),te=C.getClearAlpha(),te<1&&C.setClearColor(16777215,.5),C.clear(),Ke&&He.render(Z);const Re=C.toneMapping;C.toneMapping=is;const Pe=H.viewport;if(H.viewport!==void 0&&(H.viewport=void 0),E.setupLightsView(H),Ae===!0&&pt.setGlobalState(C.clippingPlanes,H),Fa(N,Z,H),ct.updateMultisampleRenderTarget(ne),ct.updateRenderTargetMipmap(ne),De.has("WEBGL_multisampled_render_to_texture")===!1){let ze=!1;for(let Ye=0,lt=V.length;Ye0),Pe=!!Z.morphAttributes.position,ze=!!Z.morphAttributes.normal,Ye=!!Z.morphAttributes.color;let lt=is;H.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(lt=C.toneMapping);const Tt=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,bt=Tt!==void 0?Tt.length:0,ft=Je.get(H),At=E.state.lights;if(Ae===!0&&(Ze===!0||N!==j)){const Mn=N===j&&H.id===B;pt.setState(H,N,Mn)}let st=!1;H.version===ft.__version?(ft.needsLights&&ft.lightsStateVersion!==At.state.version||ft.outputColorSpace!==fe||X.isBatchedMesh&&ft.batching===!1||!X.isBatchedMesh&&ft.batching===!0||X.isBatchedMesh&&ft.batchingColor===!0&&X.colorTexture===null||X.isBatchedMesh&&ft.batchingColor===!1&&X.colorTexture!==null||X.isInstancedMesh&&ft.instancing===!1||!X.isInstancedMesh&&ft.instancing===!0||X.isSkinnedMesh&&ft.skinning===!1||!X.isSkinnedMesh&&ft.skinning===!0||X.isInstancedMesh&&ft.instancingColor===!0&&X.instanceColor===null||X.isInstancedMesh&&ft.instancingColor===!1&&X.instanceColor!==null||X.isInstancedMesh&&ft.instancingMorph===!0&&X.morphTexture===null||X.isInstancedMesh&&ft.instancingMorph===!1&&X.morphTexture!==null||ft.envMap!==_e||H.fog===!0&&ft.fog!==ne||ft.numClippingPlanes!==void 0&&(ft.numClippingPlanes!==pt.numPlanes||ft.numIntersection!==pt.numIntersection)||ft.vertexAlphas!==Se||ft.vertexTangents!==Re||ft.morphTargets!==Pe||ft.morphNormals!==ze||ft.morphColors!==Ye||ft.toneMapping!==lt||ft.morphTargetsCount!==bt)&&(st=!0):(st=!0,ft.__version=H.version);let Kt=ft.currentProgram;st===!0&&(Kt=Lr(H,V,X));let On=!1,Yt=!1,kt=!1;const Nt=Kt.getUniforms(),Bn=ft.uniforms;if(Be.useProgram(Kt.program)&&(On=!0,Yt=!0,kt=!0),H.id!==B&&(B=H.id,Yt=!0),On||j!==N){Be.buffers.depth.getReversed()&&N.reversedDepth!==!0&&(N._reversedDepth=!0,N.updateProjectionMatrix()),Nt.setValue(G,"projectionMatrix",N.projectionMatrix),Nt.setValue(G,"viewMatrix",N.matrixWorldInverse);const Gn=Nt.map.cameraPosition;Gn!==void 0&&Gn.setValue(G,it.setFromMatrixPosition(N.matrixWorld)),Fe.logarithmicDepthBuffer&&Nt.setValue(G,"logDepthBufFC",2/(Math.log(N.far+1)/Math.LN2)),(H.isMeshPhongMaterial||H.isMeshToonMaterial||H.isMeshLambertMaterial||H.isMeshBasicMaterial||H.isMeshStandardMaterial||H.isShaderMaterial)&&Nt.setValue(G,"isOrthographic",N.isOrthographicCamera===!0),j!==N&&(j=N,Yt=!0,kt=!0)}if(X.isSkinnedMesh){Nt.setOptional(G,X,"bindMatrix"),Nt.setOptional(G,X,"bindMatrixInverse");const Mn=X.skeleton;Mn&&(Mn.boneTexture===null&&Mn.computeBoneTexture(),Nt.setValue(G,"boneTexture",Mn.boneTexture,ct))}X.isBatchedMesh&&(Nt.setOptional(G,X,"batchingTexture"),Nt.setValue(G,"batchingTexture",X._matricesTexture,ct),Nt.setOptional(G,X,"batchingIdTexture"),Nt.setValue(G,"batchingIdTexture",X._indirectTexture,ct),Nt.setOptional(G,X,"batchingColorTexture"),X._colorsTexture!==null&&Nt.setValue(G,"batchingColorTexture",X._colorsTexture,ct));const Ai=Z.morphAttributes;if((Ai.position!==void 0||Ai.normal!==void 0||Ai.color!==void 0)&&ht.update(X,Z,Kt),(Yt||ft.receiveShadow!==X.receiveShadow)&&(ft.receiveShadow=X.receiveShadow,Nt.setValue(G,"receiveShadow",X.receiveShadow)),H.isMeshGouraudMaterial&&H.envMap!==null&&(Bn.envMap.value=_e,Bn.flipEnvMap.value=_e.isCubeTexture&&_e.isRenderTargetTexture===!1?-1:1),H.isMeshStandardMaterial&&H.envMap===null&&V.environment!==null&&(Bn.envMapIntensity.value=V.environmentIntensity),Bn.dfgLUT!==void 0&&(Bn.dfgLUT.value=gj()),Yt&&(Nt.setValue(G,"toneMappingExposure",C.toneMappingExposure),ft.needsLights&&sr(Bn,kt),ne&&H.fog===!0&&vt.refreshFogUniforms(Bn,ne),vt.refreshMaterialUniforms(Bn,H,ie,oe,E.state.transmissionRenderTarget[N.id]),v_.upload(G,zs(ft),Bn,ct)),H.isShaderMaterial&&H.uniformsNeedUpdate===!0&&(v_.upload(G,zs(ft),Bn,ct),H.uniformsNeedUpdate=!1),H.isSpriteMaterial&&Nt.setValue(G,"center",X.center),Nt.setValue(G,"modelViewMatrix",X.modelViewMatrix),Nt.setValue(G,"normalMatrix",X.normalMatrix),Nt.setValue(G,"modelMatrix",X.matrixWorld),H.isShaderMaterial||H.isRawShaderMaterial){const Mn=H.uniformsGroups;for(let Gn=0,_h=Mn.length;Gn<_h;Gn++){const Ir=Mn[Gn];Ve.update(Ir,Kt),Ve.bind(Ir,Kt)}}return Kt}function sr(N,V){N.ambientLightColor.needsUpdate=V,N.lightProbe.needsUpdate=V,N.directionalLights.needsUpdate=V,N.directionalLightShadows.needsUpdate=V,N.pointLights.needsUpdate=V,N.pointLightShadows.needsUpdate=V,N.spotLights.needsUpdate=V,N.spotLightShadows.needsUpdate=V,N.rectAreaLights.needsUpdate=V,N.hemisphereLights.needsUpdate=V}function da(N){return N.isMeshLambertMaterial||N.isMeshToonMaterial||N.isMeshPhongMaterial||N.isMeshStandardMaterial||N.isShadowMaterial||N.isShaderMaterial&&N.lights===!0}this.getActiveCubeFace=function(){return P},this.getActiveMipmapLevel=function(){return O},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(N,V,Z){const H=Je.get(N);H.__autoAllocateDepthBuffer=N.resolveDepthBuffer===!1,H.__autoAllocateDepthBuffer===!1&&(H.__useRenderToTexture=!1),Je.get(N.texture).__webglTexture=V,Je.get(N.depthTexture).__webglTexture=H.__autoAllocateDepthBuffer?void 0:Z,H.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(N,V){const Z=Je.get(N);Z.__webglFramebuffer=V,Z.__useDefaultFramebuffer=V===void 0};const R=G.createFramebuffer();this.setRenderTarget=function(N,V=0,Z=0){w=N,P=V,O=Z;let H=!0,X=null,ne=!1,ae=!1;if(N){const _e=Je.get(N);if(_e.__useDefaultFramebuffer!==void 0)Be.bindFramebuffer(G.FRAMEBUFFER,null),H=!1;else if(_e.__webglFramebuffer===void 0)ct.setupRenderTarget(N);else if(_e.__hasExternalTextures)ct.rebindTextures(N,Je.get(N.texture).__webglTexture,Je.get(N.depthTexture).__webglTexture);else if(N.depthBuffer){const Pe=N.depthTexture;if(_e.__boundDepthTexture!==Pe){if(Pe!==null&&Je.has(Pe)&&(N.width!==Pe.image.width||N.height!==Pe.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ct.setupDepthRenderbuffer(N)}}const Se=N.texture;(Se.isData3DTexture||Se.isDataArrayTexture||Se.isCompressedArrayTexture)&&(ae=!0);const Re=Je.get(N).__webglFramebuffer;N.isWebGLCubeRenderTarget?(Array.isArray(Re[V])?X=Re[V][Z]:X=Re[V],ne=!0):N.samples>0&&ct.useMultisampledRTT(N)===!1?X=Je.get(N).__webglMultisampledFramebuffer:Array.isArray(Re)?X=Re[Z]:X=Re,ee.copy(N.viewport),se.copy(N.scissor),re=N.scissorTest}else ee.copy(nt).multiplyScalar(ie).floor(),se.copy(tt).multiplyScalar(ie).floor(),re=gt;if(Z!==0&&(X=R),Be.bindFramebuffer(G.FRAMEBUFFER,X)&&H&&Be.drawBuffers(N,X),Be.viewport(ee),Be.scissor(se),Be.setScissorTest(re),ne){const _e=Je.get(N.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+V,_e.__webglTexture,Z)}else if(ae){const _e=V;for(let Se=0;Se=0&&V<=N.width-H&&Z>=0&&Z<=N.height-X&&(N.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+fe),G.readPixels(V,Z,H,X,Oe.convert(Re),Oe.convert(Pe),ne))}finally{const Se=w!==null?Je.get(w).__webglFramebuffer:null;Be.bindFramebuffer(G.FRAMEBUFFER,Se)}}},this.readRenderTargetPixelsAsync=async function(N,V,Z,H,X,ne,ae,fe=0){if(!(N&&N.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let _e=Je.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&ae!==void 0&&(_e=_e[ae]),_e)if(V>=0&&V<=N.width-H&&Z>=0&&Z<=N.height-X){Be.bindFramebuffer(G.FRAMEBUFFER,_e);const Se=N.textures[fe],Re=Se.format,Pe=Se.type;if(!Fe.textureFormatReadable(Re))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Fe.textureTypeReadable(Pe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const ze=G.createBuffer();G.bindBuffer(G.PIXEL_PACK_BUFFER,ze),G.bufferData(G.PIXEL_PACK_BUFFER,ne.byteLength,G.STREAM_READ),N.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+fe),G.readPixels(V,Z,H,X,Oe.convert(Re),Oe.convert(Pe),0);const Ye=w!==null?Je.get(w).__webglFramebuffer:null;Be.bindFramebuffer(G.FRAMEBUFFER,Ye);const lt=G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE,0);return G.flush(),await WF(G,lt,4),G.bindBuffer(G.PIXEL_PACK_BUFFER,ze),G.getBufferSubData(G.PIXEL_PACK_BUFFER,0,ne),G.deleteBuffer(ze),G.deleteSync(lt),ne}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(N,V=null,Z=0){const H=Math.pow(2,-Z),X=Math.floor(N.image.width*H),ne=Math.floor(N.image.height*H),ae=V!==null?V.x:0,fe=V!==null?V.y:0;ct.setTexture2D(N,0),G.copyTexSubImage2D(G.TEXTURE_2D,Z,0,0,ae,fe,X,ne),Be.unbindTexture()};const z=G.createFramebuffer(),Y=G.createFramebuffer();this.copyTextureToTexture=function(N,V,Z=null,H=null,X=0,ne=null){ne===null&&(X!==0?(Md("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ne=X,X=0):ne=0);let ae,fe,_e,Se,Re,Pe,ze,Ye,lt;const Tt=N.isCompressedTexture?N.mipmaps[ne]:N.image;if(Z!==null)ae=Z.max.x-Z.min.x,fe=Z.max.y-Z.min.y,_e=Z.isBox3?Z.max.z-Z.min.z:1,Se=Z.min.x,Re=Z.min.y,Pe=Z.isBox3?Z.min.z:0;else{const Ai=Math.pow(2,-X);ae=Math.floor(Tt.width*Ai),fe=Math.floor(Tt.height*Ai),N.isDataArrayTexture?_e=Tt.depth:N.isData3DTexture?_e=Math.floor(Tt.depth*Ai):_e=1,Se=0,Re=0,Pe=0}H!==null?(ze=H.x,Ye=H.y,lt=H.z):(ze=0,Ye=0,lt=0);const bt=Oe.convert(V.format),ft=Oe.convert(V.type);let At;V.isData3DTexture?(ct.setTexture3D(V,0),At=G.TEXTURE_3D):V.isDataArrayTexture||V.isCompressedArrayTexture?(ct.setTexture2DArray(V,0),At=G.TEXTURE_2D_ARRAY):(ct.setTexture2D(V,0),At=G.TEXTURE_2D),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,V.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,V.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,V.unpackAlignment);const st=G.getParameter(G.UNPACK_ROW_LENGTH),Kt=G.getParameter(G.UNPACK_IMAGE_HEIGHT),On=G.getParameter(G.UNPACK_SKIP_PIXELS),Yt=G.getParameter(G.UNPACK_SKIP_ROWS),kt=G.getParameter(G.UNPACK_SKIP_IMAGES);G.pixelStorei(G.UNPACK_ROW_LENGTH,Tt.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,Tt.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,Se),G.pixelStorei(G.UNPACK_SKIP_ROWS,Re),G.pixelStorei(G.UNPACK_SKIP_IMAGES,Pe);const Nt=N.isDataArrayTexture||N.isData3DTexture,Bn=V.isDataArrayTexture||V.isData3DTexture;if(N.isDepthTexture){const Ai=Je.get(N),Mn=Je.get(V),Gn=Je.get(Ai.__renderTarget),_h=Je.get(Mn.__renderTarget);Be.bindFramebuffer(G.READ_FRAMEBUFFER,Gn.__webglFramebuffer),Be.bindFramebuffer(G.DRAW_FRAMEBUFFER,_h.__webglFramebuffer);for(let Ir=0;Ir<_e;Ir++)Nt&&(G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Je.get(N).__webglTexture,X,Pe+Ir),G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Je.get(V).__webglTexture,ne,lt+Ir)),G.blitFramebuffer(Se,Re,ae,fe,ze,Ye,ae,fe,G.DEPTH_BUFFER_BIT,G.NEAREST);Be.bindFramebuffer(G.READ_FRAMEBUFFER,null),Be.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else if(X!==0||N.isRenderTargetTexture||Je.has(N)){const Ai=Je.get(N),Mn=Je.get(V);Be.bindFramebuffer(G.READ_FRAMEBUFFER,z),Be.bindFramebuffer(G.DRAW_FRAMEBUFFER,Y);for(let Gn=0;Gn<_e;Gn++)Nt?G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Ai.__webglTexture,X,Pe+Gn):G.framebufferTexture2D(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,Ai.__webglTexture,X),Bn?G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Mn.__webglTexture,ne,lt+Gn):G.framebufferTexture2D(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,Mn.__webglTexture,ne),X!==0?G.blitFramebuffer(Se,Re,ae,fe,ze,Ye,ae,fe,G.COLOR_BUFFER_BIT,G.NEAREST):Bn?G.copyTexSubImage3D(At,ne,ze,Ye,lt+Gn,Se,Re,ae,fe):G.copyTexSubImage2D(At,ne,ze,Ye,Se,Re,ae,fe);Be.bindFramebuffer(G.READ_FRAMEBUFFER,null),Be.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else Bn?N.isDataTexture||N.isData3DTexture?G.texSubImage3D(At,ne,ze,Ye,lt,ae,fe,_e,bt,ft,Tt.data):V.isCompressedArrayTexture?G.compressedTexSubImage3D(At,ne,ze,Ye,lt,ae,fe,_e,bt,Tt.data):G.texSubImage3D(At,ne,ze,Ye,lt,ae,fe,_e,bt,ft,Tt):N.isDataTexture?G.texSubImage2D(G.TEXTURE_2D,ne,ze,Ye,ae,fe,bt,ft,Tt.data):N.isCompressedTexture?G.compressedTexSubImage2D(G.TEXTURE_2D,ne,ze,Ye,Tt.width,Tt.height,bt,Tt.data):G.texSubImage2D(G.TEXTURE_2D,ne,ze,Ye,ae,fe,bt,ft,Tt);G.pixelStorei(G.UNPACK_ROW_LENGTH,st),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,Kt),G.pixelStorei(G.UNPACK_SKIP_PIXELS,On),G.pixelStorei(G.UNPACK_SKIP_ROWS,Yt),G.pixelStorei(G.UNPACK_SKIP_IMAGES,kt),ne===0&&V.generateMipmaps&&G.generateMipmap(At),Be.unbindTexture()},this.initRenderTarget=function(N){Je.get(N).__webglFramebuffer===void 0&&ct.setupRenderTarget(N)},this.initTexture=function(N){N.isCubeTexture?ct.setTextureCube(N,0):N.isData3DTexture?ct.setTexture3D(N,0):N.isDataArrayTexture||N.isCompressedArrayTexture?ct.setTexture2DArray(N,0):ct.setTexture2D(N,0),Be.unbindTexture()},this.resetState=function(){P=0,O=0,w=null,Be.reset(),q.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return br}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=rn._getDrawingBufferColorSpace(e),t.unpackColorSpace=rn._getUnpackColorSpace()}}const vj=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:hb,AddEquation:Js,AddOperation:dU,AdditiveAnimationBlendMode:vb,AdditiveBlending:nE,AgXToneMapping:_U,AlphaFormat:pb,AlwaysCompare:LU,AlwaysDepth:r0,AlwaysStencilFunc:sE,AmbientLight:y6,AnimationAction:N6,AnimationClip:Ju,AnimationLoader:NV,AnimationMixer:D6,AnimationObjectGroup:ek,AnimationUtils:AV,ArcCurve:KU,ArrayCamera:w6,ArrowHelper:bk,AttachedBindMode:rE,Audio:R6,AudioAnalyser:WV,AudioContext:jb,AudioListener:GV,AudioLoader:BV,AxesHelper:I6,BackSide:Ui,BasicDepthPacking:Mc,BasicShadowMap:ZI,BatchedMesh:qU,Bone:V1,BooleanKeyframeTrack:fh,Box2:ck,Box3:ta,Box3Helper:Ek,BoxGeometry:ch,BoxHelper:Tk,BufferAttribute:Ot,BufferGeometry:Ct,BufferGeometryLoader:b6,ByteType:D1,Cache:no,Camera:bc,CameraHelper:Sk,CanvasTexture:ZG,CapsuleGeometry:Y1,CatmullRomCurve3:QU,CineonToneMapping:gU,CircleGeometry:q1,ClampToEdgeWrapping:Pi,Clock:Zb,Color:je,ColorKeyframeTrack:Gb,ColorManagement:rn,CompressedArrayTexture:qG,CompressedCubeTexture:jG,CompressedTexture:X1,CompressedTextureLoader:DV,ConeGeometry:H0,ConstantAlphaFactor:uU,ConstantColorFactor:lU,Controls:wk,CubeCamera:VU,CubeReflectionMapping:rl,CubeRefractionMapping:gc,CubeTexture:U0,CubeTextureLoader:OV,CubeUVReflectionMapping:Xd,CubicBezierCurve:Db,CubicBezierCurve3:JU,CubicInterpolant:p6,CullFaceBack:tE,CullFaceFront:jI,CullFaceFrontBack:cF,CullFaceNone:qI,Curve:Ls,CurvePath:e6,CustomBlending:ub,CustomToneMapping:vU,CylinderGeometry:B0,Cylindrical:lk,Data3DTexture:as,DataArrayTexture:B1,DataTexture:$a,DataTextureLoader:_6,DataUtils:oE,DecrementStencilOp:xF,DecrementWrapStencilOp:SF,DefaultLoadingManager:v6,DepthFormat:yd,DepthStencilFormat:ju,DepthTexture:z0,DetachedBindMode:yU,DirectionalLight:qb,DirectionalLightHelper:yk,DiscreteInterpolant:m6,DodecahedronGeometry:j1,DoubleSide:ca,DstAlphaFactor:iU,DstColorFactor:rU,DynamicCopyUsage:UF,DynamicDrawUsage:IU,DynamicReadUsage:OF,EdgesGeometry:ZU,EllipseCurve:Z1,EqualCompare:CU,EqualDepth:ax,EqualStencilFunc:bF,EquirectangularReflectionMapping:s0,EquirectangularRefractionMapping:o0,Euler:Ei,EventDispatcher:nr,ExternalTexture:Cb,ExtrudeGeometry:K1,FileLoader:os,Float16BufferAttribute:bG,Float32BufferAttribute:xt,FloatType:si,Fog:F1,FogExp2:H1,FramebufferTexture:YG,FrontSide:Ns,Frustum:Yd,FrustumArray:k1,GLBufferAttribute:fE,GLSL1:zF,GLSL3:ro,GreaterCompare:NU,GreaterDepth:sx,GreaterEqualCompare:OU,GreaterEqualDepth:rx,GreaterEqualStencilFunc:CF,GreaterStencilFunc:wF,GridHelper:_k,Group:Ua,HalfFloatType:Xn,HemisphereLight:x6,HemisphereLightHelper:vk,IcosahedronGeometry:Q1,ImageBitmapLoader:A6,ImageLoader:Nd,ImageUtils:zU,IncrementStencilOp:_F,IncrementWrapStencilOp:yF,InstancedBufferAttribute:Zu,InstancedBufferGeometry:M6,InstancedInterleavedBuffer:rk,InstancedMesh:Ab,Int16BufferAttribute:EG,Int32BufferAttribute:MG,Int8BufferAttribute:yG,IntType:L0,InterleavedBuffer:P0,InterleavedBufferAttribute:_c,Interpolant:qd,InterpolateDiscrete:Sd,InterpolateLinear:Td,InterpolateSmooth:m_,InterpolationSamplingMode:FF,InterpolationSamplingType:HF,InvertStencilOp:TF,KeepStencilOp:xu,KeyframeTrack:cs,LOD:YU,LatheGeometry:J1,Layers:Ad,LessCompare:RU,LessDepth:ix,LessEqualCompare:xb,LessEqualDepth:Xu,LessEqualStencilFunc:AF,LessStencilFunc:MF,Light:Rc,LightProbe:E6,Line:so,Line3:fk,LineBasicMaterial:Bi,LineCurve:Ob,LineCurve3:$U,LineDashedMaterial:h6,LineLoop:wb,LineSegments:ir,LinearFilter:Ht,LinearInterpolant:Fb,LinearMipMapLinearFilter:SU,LinearMipMapNearestFilter:fF,LinearMipmapLinearFilter:Mr,LinearMipmapNearestFilter:id,LinearSRGBColorSpace:Wn,LinearToneMapping:pU,LinearTransfer:c0,Loader:Mi,LoaderUtils:uc,LoadingManager:Vb,LoopOnce:gb,LoopPingPong:EU,LoopRepeat:TU,MOUSE:vu,Material:qn,MaterialLoader:ry,MathUtils:$t,Matrix2:Jb,Matrix3:Et,Matrix4:ke,MaxEquation:$I,Mesh:oi,MeshBasicMaterial:Ia,MeshDepthMaterial:zb,MeshDistanceMaterial:Bb,MeshLambertMaterial:c6,MeshMatcapMaterial:u6,MeshNormalMaterial:Pb,MeshPhongMaterial:o6,MeshPhysicalMaterial:ls,MeshStandardMaterial:V0,MeshToonMaterial:l6,MinEquation:JI,MirroredRepeatWrapping:xd,MixOperation:fU,MultiplyBlending:aE,MultiplyOperation:O0,NearestFilter:Fn,NearestMipMapLinearFilter:hF,NearestMipMapNearestFilter:uF,NearestMipmapLinearFilter:Tu,NearestMipmapNearestFilter:N1,NeutralToneMapping:xU,NeverCompare:wU,NeverDepth:nx,NeverStencilFunc:EF,NoBlending:Ta,NoColorSpace:Da,NoToneMapping:is,NormalAnimationBlendMode:z1,NormalBlending:Iu,NotEqualCompare:DU,NotEqualDepth:ox,NotEqualStencilFunc:RF,NumberKeyframeTrack:xc,Object3D:Wt,ObjectLoader:PV,ObjectSpaceNormalMap:AU,OctahedronGeometry:F0,OneFactor:kf,OneMinusConstantAlphaFactor:hU,OneMinusConstantColorFactor:cU,OneMinusDstAlphaFactor:aU,OneMinusDstColorFactor:sU,OneMinusSrcAlphaFactor:tx,OneMinusSrcColorFactor:nU,OrthographicCamera:ao,PCFShadowMap:R1,PCFSoftShadowMap:Dm,PMREMGenerator:gE,Path:Fx,PerspectiveCamera:hi,Plane:Go,PlaneGeometry:uh,PlaneHelper:Mk,PointLight:Yb,PointLightHelper:mk,Points:Rb,PointsMaterial:W1,PolarGridHelper:xk,PolyhedronGeometry:wc,PositionalAudio:kV,PropertyBinding:fn,PropertyMixer:C6,QuadraticBezierCurve:Lb,QuadraticBezierCurve3:Ib,Quaternion:St,QuaternionKeyframeTrack:yc,QuaternionLinearInterpolant:g6,RED_GREEN_RGTC2_Format:Ix,RED_RGTC1_Format:Ox,REVISION:Cs,RGBADepthPacking:bU,RGBAFormat:$n,RGBAIntegerFormat:P1,RGBA_ASTC_10x10_Format:Ax,RGBA_ASTC_10x5_Format:Ex,RGBA_ASTC_10x6_Format:Mx,RGBA_ASTC_10x8_Format:bx,RGBA_ASTC_12x10_Format:wx,RGBA_ASTC_12x12_Format:Rx,RGBA_ASTC_4x4_Format:mx,RGBA_ASTC_5x4_Format:gx,RGBA_ASTC_5x5_Format:vx,RGBA_ASTC_6x5_Format:_x,RGBA_ASTC_6x6_Format:xx,RGBA_ASTC_8x5_Format:yx,RGBA_ASTC_8x6_Format:Sx,RGBA_ASTC_8x8_Format:Tx,RGBA_BPTC_Format:Cx,RGBA_ETC2_EAC_Format:px,RGBA_PVRTC_2BPPV1_Format:hx,RGBA_PVRTC_4BPPV1_Format:ux,RGBA_S3TC_DXT1_Format:Lm,RGBA_S3TC_DXT3_Format:Im,RGBA_S3TC_DXT5_Format:Um,RGBDepthPacking:pF,RGBFormat:mb,RGBIntegerFormat:dF,RGB_BPTC_SIGNED_Format:Nx,RGB_BPTC_UNSIGNED_Format:Dx,RGB_ETC1_Format:fx,RGB_ETC2_Format:dx,RGB_PVRTC_2BPPV1_Format:cx,RGB_PVRTC_4BPPV1_Format:lx,RGB_S3TC_DXT1_Format:Om,RGDepthPacking:mF,RGFormat:ko,RGIntegerFormat:U1,RawShaderMaterial:hh,Ray:lh,Raycaster:O6,RectAreaLight:S6,RedFormat:As,RedIntegerFormat:I0,ReinhardToneMapping:mU,RenderTarget:Sb,RenderTarget3D:nk,RepeatWrapping:Ea,ReplaceStencilOp:vF,ReverseSubtractEquation:QI,RingGeometry:$1,SIGNED_RED_GREEN_RGTC2_Format:Ux,SIGNED_RED_RGTC1_Format:Lx,SRGBColorSpace:En,SRGBTransfer:wn,Scene:Rd,ShaderChunk:Qt,ShaderLib:bs,ShaderMaterial:Vi,ShadowMaterial:s6,Shape:Pu,ShapeGeometry:ey,ShapePath:Ak,ShapeUtils:ws,ShortType:O1,Skeleton:Ac,SkeletonHelper:pk,SkinnedMesh:G1,Source:Jl,Sphere:na,SphereGeometry:G0,Spherical:pE,SphericalHarmonics3:T6,SplineCurve:Ub,SpotLight:Xb,SpotLightHelper:dk,Sprite:XU,SpriteMaterial:bb,SrcAlphaFactor:ex,SrcAlphaSaturateFactor:oU,SrcColorFactor:tU,StaticCopyUsage:IF,StaticDrawUsage:u0,StaticReadUsage:DF,StereoCamera:HV,StreamCopyUsage:PF,StreamDrawUsage:NF,StreamReadUsage:LF,StringKeyframeTrack:dh,SubtractEquation:KI,SubtractiveBlending:iE,TOUCH:_u,TangentSpaceNormalMap:ll,TetrahedronGeometry:ty,Texture:Nn,TextureLoader:kb,TextureUtils:Ok,Timer:sk,TimestampQuery:BF,TorusGeometry:ny,TorusKnotGeometry:iy,Triangle:Qa,TriangleFanDrawMode:Px,TriangleStripDrawMode:_b,TrianglesDrawMode:MU,TubeGeometry:ay,UVMapping:C1,Uint16BufferAttribute:Tb,Uint32BufferAttribute:Eb,Uint8BufferAttribute:SG,Uint8ClampedBufferAttribute:TG,Uniform:J,UniformsGroup:ak,UniformsLib:at,UniformsUtils:Mb,UnsignedByteType:zi,UnsignedInt101111Type:db,UnsignedInt248Type:qu,UnsignedInt5999Type:fb,UnsignedIntType:Ds,UnsignedShort4444Type:L1,UnsignedShort5551Type:I1,UnsignedShortType:Yu,VSMShadowMap:Ss,Vector2:de,Vector3:L,Vector4:zt,VectorKeyframeTrack:Qu,VideoFrameTexture:XG,VideoTexture:jU,WebGL3DRenderTarget:HU,WebGLArrayRenderTarget:BU,WebGLCoordinateSystem:br,WebGLCubeRenderTarget:kU,WebGLRenderTarget:xi,WebGLRenderer:$b,WebGLUtils:F6,WebGPUCoordinateSystem:Ed,WebXRController:g_,WireframeGeometry:r6,WrapAroundEnding:l0,ZeroCurvatureEnding:Eu,ZeroFactor:eU,ZeroSlopeEnding:Mu,ZeroStencilOp:gF,createCanvasElement:PU,error:Bt,getConsoleFunction:kF,log:f0,setConsoleFunction:VF,warn:ut,warnOnce:Md},Symbol.toStringTag,{value:"Module"}));var G6={exports:{}},V6={},k6={exports:{}},W6={};/** * @license React * use-sync-external-store-shim.production.js * @@ -4016,7 +4016,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Cd=be;function vj(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var _j=typeof Object.is=="function"?Object.is:vj,xj=Cd.useState,yj=Cd.useEffect,Sj=Cd.useLayoutEffect,Tj=Cd.useDebugValue;function Ej(n,e){var t=e(),i=xj({inst:{value:t,getSnapshot:e}}),a=i[0].inst,r=i[1];return Sj(function(){a.value=t,a.getSnapshot=e,d2(a)&&r({inst:a})},[n,t,e]),yj(function(){return d2(a)&&r({inst:a}),n(function(){d2(a)&&r({inst:a})})},[n]),Tj(t),t}function d2(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!_j(n,t)}catch{return!0}}function Mj(n,e){return e()}var bj=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Mj:Ej;V6.useSyncExternalStore=Cd.useSyncExternalStore!==void 0?Cd.useSyncExternalStore:bj;G6.exports=V6;var Aj=G6.exports;/** + */var Dd=Me;function _j(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var xj=typeof Object.is=="function"?Object.is:_j,yj=Dd.useState,Sj=Dd.useEffect,Tj=Dd.useLayoutEffect,Ej=Dd.useDebugValue;function Mj(n,e){var t=e(),i=yj({inst:{value:t,getSnapshot:e}}),a=i[0].inst,r=i[1];return Tj(function(){a.value=t,a.getSnapshot=e,g2(a)&&r({inst:a})},[n,t,e]),Sj(function(){return g2(a)&&r({inst:a}),n(function(){g2(a)&&r({inst:a})})},[n]),Ej(t),t}function g2(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!xj(n,t)}catch{return!0}}function bj(n,e){return e()}var Aj=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?bj:Mj;W6.useSyncExternalStore=Dd.useSyncExternalStore!==void 0?Dd.useSyncExternalStore:Aj;k6.exports=W6;var wj=k6.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -4024,7 +4024,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ry=be,Rj=Aj;function wj(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Cj=typeof Object.is=="function"?Object.is:wj,Nj=Rj.useSyncExternalStore,Dj=ry.useRef,Oj=ry.useEffect,Lj=ry.useMemo,Ij=ry.useDebugValue;F6.useSyncExternalStoreWithSelector=function(n,e,t,i,a){var r=Dj(null);if(r.current===null){var s={hasValue:!1,value:null};r.current=s}else s=r.current;r=Lj(function(){function c(g){if(!h){if(h=!0,f=g,g=i(g),a!==void 0&&s.hasValue){var x=s.value;if(a(x,g))return d=x}return d=g}if(x=d,Cj(f,g))return x;var T=i(g);return a!==void 0&&a(x,T)?(f=g,x):(f=g,d=T)}var h=!1,f,d,m=t===void 0?null:t;return[function(){return c(e())},m===null?void 0:function(){return c(m())}]},[e,t,i,a]);var o=Nj(n,r[0],r[1]);return Oj(function(){s.hasValue=!0,s.value=o},[o]),Ij(o),o};H6.exports=F6;var Uj=H6.exports;const Pj=r1(Uj),UN=n=>{let e;const t=new Set,i=(h,f)=>{const d=typeof h=="function"?h(e):h;if(!Object.is(d,e)){const m=e;e=f??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(g=>g(e,m))}},a=()=>e,o={setState:i,getState:a,getInitialState:()=>c,subscribe:h=>(t.add(h),()=>t.delete(h))},c=e=n(i,a,o);return o},zj=n=>n?UN(n):UN,{useSyncExternalStoreWithSelector:Bj}=Pj,Hj=n=>n;function Fj(n,e=Hj,t){const i=Bj(n.subscribe,n.getState,n.getInitialState,e,t);return hM.useDebugValue(i),i}const PN=(n,e)=>{const t=zj(n),i=(a,r=e)=>Fj(t,a,r);return Object.assign(i,t),i},Gj=(n,e)=>n?PN(n,e):PN,Vj=n=>typeof n=="object"&&typeof n.then=="function",Mu=[];function k6(n,e,t=(i,a)=>i===a){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let a=0;a0&&(r.timeout&&clearTimeout(r.timeout),r.timeout=setTimeout(r.remove,i.lifespan)),r.response;if(!t)throw r.promise}const a={keys:e,equal:i.equal,remove:()=>{const r=Mu.indexOf(a);r!==-1&&Mu.splice(r,1)},promise:(Vj(n)?n:n(...e)).then(r=>{a.response=r,i.lifespan&&i.lifespan>0&&(a.timeout=setTimeout(a.remove,i.lifespan))}).catch(r=>a.error=r)};if(Mu.push(a),!t)throw a.promise}const kj=(n,e,t)=>W6(n,e,!1,t),Wj=(n,e,t)=>void W6(n,e,!0,t),Xj=n=>{if(n===void 0||n.length===0)Mu.splice(0,Mu.length);else{const e=Mu.find(t=>k6(n,t.keys,t.equal));e&&e.remove()}};var X6={exports:{}},Y6={exports:{}},q6={exports:{}},j6={};/** + */var ly=Me,Rj=wj;function Cj(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Nj=typeof Object.is=="function"?Object.is:Cj,Dj=Rj.useSyncExternalStore,Oj=ly.useRef,Lj=ly.useEffect,Ij=ly.useMemo,Uj=ly.useDebugValue;V6.useSyncExternalStoreWithSelector=function(n,e,t,i,a){var r=Oj(null);if(r.current===null){var s={hasValue:!1,value:null};r.current=s}else s=r.current;r=Ij(function(){function c(g){if(!h){if(h=!0,f=g,g=i(g),a!==void 0&&s.hasValue){var x=s.value;if(a(x,g))return d=x}return d=g}if(x=d,Nj(f,g))return x;var T=i(g);return a!==void 0&&a(x,T)?(f=g,x):(f=g,d=T)}var h=!1,f,d,m=t===void 0?null:t;return[function(){return c(e())},m===null?void 0:function(){return c(m())}]},[e,t,i,a]);var o=Dj(n,r[0],r[1]);return Lj(function(){s.hasValue=!0,s.value=o},[o]),Uj(o),o};G6.exports=V6;var Pj=G6.exports;const zj=l1(Pj),BN=n=>{let e;const t=new Set,i=(h,f)=>{const d=typeof h=="function"?h(e):h;if(!Object.is(d,e)){const m=e;e=f??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(g=>g(e,m))}},a=()=>e,o={setState:i,getState:a,getInitialState:()=>c,subscribe:h=>(t.add(h),()=>t.delete(h))},c=e=n(i,a,o);return o},Bj=n=>n?BN(n):BN,{useSyncExternalStoreWithSelector:Hj}=zj,Fj=n=>n;function Gj(n,e=Fj,t){const i=Hj(n.subscribe,n.getState,n.getInitialState,e,t);return dM.useDebugValue(i),i}const HN=(n,e)=>{const t=Bj(n),i=(a,r=e)=>Gj(t,a,r);return Object.assign(i,t),i},Vj=(n,e)=>n?HN(n,e):HN,kj=n=>typeof n=="object"&&typeof n.then=="function",Au=[];function X6(n,e,t=(i,a)=>i===a){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let a=0;a0&&(r.timeout&&clearTimeout(r.timeout),r.timeout=setTimeout(r.remove,i.lifespan)),r.response;if(!t)throw r.promise}const a={keys:e,equal:i.equal,remove:()=>{const r=Au.indexOf(a);r!==-1&&Au.splice(r,1)},promise:(kj(n)?n:n(...e)).then(r=>{a.response=r,i.lifespan&&i.lifespan>0&&(a.timeout=setTimeout(a.remove,i.lifespan))}).catch(r=>a.error=r)};if(Au.push(a),!t)throw a.promise}const Wj=(n,e,t)=>Y6(n,e,!1,t),Xj=(n,e,t)=>void Y6(n,e,!0,t),Yj=n=>{if(n===void 0||n.length===0)Au.splice(0,Au.length);else{const e=Au.find(t=>X6(n,t.keys,t.equal));e&&e.remove()}};var q6={exports:{}},j6={exports:{}},Z6={exports:{}},K6={};/** * @license React * scheduler.production.js * @@ -4032,7 +4032,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(n){function e(W,te){var K=W.length;W.push(te);e:for(;0>>1,ie=W[oe];if(0>>1;oea(nt,K))tta(gt,nt)?(W[oe]=gt,W[tt]=K,oe=tt):(W[oe]=nt,W[Xe]=K,oe=Xe);else if(tta(gt,K))W[oe]=gt,W[tt]=K,oe=tt;else break e}}return te}function a(W,te){var K=W.sortIndex-te.sortIndex;return K!==0?K:W.id-te.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;n.unstable_now=function(){return r.now()}}else{var s=Date,o=s.now();n.unstable_now=function(){return s.now()-o}}var c=[],h=[],f=1,d=null,m=3,g=!1,x=!1,T=!1,S=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function E(W){for(var te=t(h);te!==null;){if(te.callback===null)i(h);else if(te.startTime<=W)i(h),te.sortIndex=te.expirationTime,e(c,te);else break;te=t(h)}}function b(W){if(T=!1,E(W),!x)if(t(c)!==null)x=!0,se();else{var te=t(h);te!==null&&re(b,te.startTime-W)}}var D=!1,C=-1,I=5,P=-1;function O(){return!(n.unstable_now()-PW&&O());){var oe=d.callback;if(typeof oe=="function"){d.callback=null,m=d.priorityLevel;var ie=oe(d.expirationTime<=W);if(W=n.unstable_now(),typeof ie=="function"){d.callback=ie,E(W),te=!0;break t}d===t(c)&&i(c),E(W)}else i(c);d=t(c)}if(d!==null)te=!0;else{var Ce=t(h);Ce!==null&&re(b,Ce.startTime-W),te=!1}}break e}finally{d=null,m=K,g=!1}te=void 0}}finally{te?B():D=!1}}}var B;if(typeof y=="function")B=function(){y(R)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,ee=j.port2;j.port1.onmessage=R,B=function(){ee.postMessage(null)}}else B=function(){S(R,0)};function se(){D||(D=!0,B())}function re(W,te){C=S(function(){W(n.unstable_now())},te)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(W){W.callback=null},n.unstable_continueExecution=function(){x||g||(x=!0,se())},n.unstable_forceFrameRate=function(W){0>W||125oe?(W.sortIndex=K,e(h,W),t(c)===null&&W===t(h)&&(T?(v(C),C=-1):T=!0,re(b,K-oe))):(W.sortIndex=ie,e(c,W),x||g||(x=!0,se())),W},n.unstable_shouldYield=O,n.unstable_wrapCallback=function(W){var te=m;return function(){var K=m;m=te;try{return W.apply(this,arguments)}finally{m=K}}}})(j6);q6.exports=j6;var mE=q6.exports;/** + */(function(n){function e(W,te){var K=W.length;W.push(te);e:for(;0>>1,ie=W[oe];if(0>>1;oea(nt,K))tta(gt,nt)?(W[oe]=gt,W[tt]=K,oe=tt):(W[oe]=nt,W[Xe]=K,oe=Xe);else if(tta(gt,K))W[oe]=gt,W[tt]=K,oe=tt;else break e}}return te}function a(W,te){var K=W.sortIndex-te.sortIndex;return K!==0?K:W.id-te.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;n.unstable_now=function(){return r.now()}}else{var s=Date,o=s.now();n.unstable_now=function(){return s.now()-o}}var c=[],h=[],f=1,d=null,m=3,g=!1,x=!1,T=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function E(W){for(var te=t(h);te!==null;){if(te.callback===null)i(h);else if(te.startTime<=W)i(h),te.sortIndex=te.expirationTime,e(c,te);else break;te=t(h)}}function b(W){if(T=!1,E(W),!x)if(t(c)!==null)x=!0,se();else{var te=t(h);te!==null&&re(b,te.startTime-W)}}var D=!1,C=-1,I=5,P=-1;function O(){return!(n.unstable_now()-PW&&O());){var oe=d.callback;if(typeof oe=="function"){d.callback=null,m=d.priorityLevel;var ie=oe(d.expirationTime<=W);if(W=n.unstable_now(),typeof ie=="function"){d.callback=ie,E(W),te=!0;break t}d===t(c)&&i(c),E(W)}else i(c);d=t(c)}if(d!==null)te=!0;else{var Ce=t(h);Ce!==null&&re(b,Ce.startTime-W),te=!1}}break e}finally{d=null,m=K,g=!1}te=void 0}}finally{te?B():D=!1}}}var B;if(typeof S=="function")B=function(){S(w)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,ee=j.port2;j.port1.onmessage=w,B=function(){ee.postMessage(null)}}else B=function(){y(w,0)};function se(){D||(D=!0,B())}function re(W,te){C=y(function(){W(n.unstable_now())},te)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(W){W.callback=null},n.unstable_continueExecution=function(){x||g||(x=!0,se())},n.unstable_forceFrameRate=function(W){0>W||125oe?(W.sortIndex=K,e(h,W),t(c)===null&&W===t(h)&&(T?(v(C),C=-1):T=!0,re(b,K-oe))):(W.sortIndex=ie,e(c,W),x||g||(x=!0,se())),W},n.unstable_shouldYield=O,n.unstable_wrapCallback=function(W){var te=m;return function(){var K=m;m=te;try{return W.apply(this,arguments)}finally{m=K}}}})(K6);Z6.exports=K6;var _E=Z6.exports;/** * @license React * react-reconciler.production.js * @@ -4040,25 +4040,25 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(n){n.exports=function(e){function t(l,u,p,_){return new R9(l,u,p,_)}function i(){}function a(l){var u="https://react.dev/errors/"+l;if(1)":-1M||he[_]!==Ne[M]){var et=` -`+he[_].replace(" at new "," at ");return l.displayName&&et.includes("")&&(et=et.replace("",l.displayName)),et}while(1<=_&&0<=M);break}}}finally{pS=!1,Error.prepareStackTrace=p}return(p=l?l.displayName||l.name:"")?o(p):""}function h(l){switch(l.tag){case 26:case 27:case 5:return o(l.type);case 16:return o("Lazy");case 13:return o("Suspense");case 19:return o("SuspenseList");case 0:case 15:return l=c(l.type,!1),l;case 11:return l=c(l.type.render,!1),l;case 1:return l=c(l.type,!0),l;default:return""}}function f(l){try{var u="";do u+=h(l),l=l.return;while(l);return u}catch(p){return` +`+he[_].replace(" at new "," at ");return l.displayName&&et.includes("")&&(et=et.replace("",l.displayName)),et}while(1<=_&&0<=M);break}}}finally{vS=!1,Error.prepareStackTrace=p}return(p=l?l.displayName||l.name:"")?o(p):""}function h(l){switch(l.tag){case 26:case 27:case 5:return o(l.type);case 16:return o("Lazy");case 13:return o("Suspense");case 19:return o("SuspenseList");case 0:case 15:return l=c(l.type,!1),l;case 11:return l=c(l.type.render,!1),l;case 1:return l=c(l.type,!0),l;default:return""}}function f(l){try{var u="";do u+=h(l),l=l.return;while(l);return u}catch(p){return` Error generating stack: `+p.message+` -`+p.stack}}function d(l){var u=l,p=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,u.flags&4098&&(p=u.return),l=u.return;while(l)}return u.tag===3?p:null}function m(l){if(d(l)!==l)throw Error(a(188))}function g(l){var u=l.alternate;if(!u){if(u=d(l),u===null)throw Error(a(188));return u!==l?null:l}for(var p=l,_=u;;){var M=p.return;if(M===null)break;var A=M.alternate;if(A===null){if(_=M.return,_!==null){p=_;continue}break}if(M.child===A.child){for(A=M.child;A;){if(A===p)return m(M),l;if(A===_)return m(M),u;A=A.sibling}throw Error(a(188))}if(p.return!==_.return)p=M,_=A;else{for(var F=!1,$=M.child;$;){if($===p){F=!0,p=M,_=A;break}if($===_){F=!0,_=M,p=A;break}$=$.sibling}if(!F){for($=A.child;$;){if($===p){F=!0,p=A,_=M;break}if($===_){F=!0,_=A,p=M;break}$=$.sibling}if(!F)throw Error(a(189))}}if(p.alternate!==_)throw Error(a(190))}if(p.tag!==3)throw Error(a(188));return p.stateNode.current===p?l:u}function x(l){var u=l.tag;if(u===5||u===26||u===27||u===6)return l;for(l=l.child;l!==null;){if(u=x(l),u!==null)return u;l=l.sibling}return null}function T(l){var u=l.tag;if(u===5||u===26||u===27||u===6)return l;for(l=l.child;l!==null;){if(l.tag!==4&&(u=T(l),u!==null))return u;l=l.sibling}return null}function S(l){return{current:l}}function v(l){0>Mh||(l.current=yS[Mh],yS[Mh]=null,Mh--)}function y(l,u){Mh++,yS[Mh]=l.current,l.current=u}function E(l){return l>>>=0,l===0?32:31-(j7(l)/Z7|0)|0}function b(l){var u=l&42;if(u!==0)return u;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function D(l,u){var p=l.pendingLanes;if(p===0)return 0;var _=0,M=l.suspendedLanes,A=l.pingedLanes,F=l.warmLanes;l=l.finishedLanes!==0;var $=p&134217727;return $!==0?(p=$&~M,p!==0?_=b(p):(A&=$,A!==0?_=b(A):l||(F=$&~F,F!==0&&(_=b(F))))):($=p&~M,$!==0?_=b($):A!==0?_=b(A):l||(F=p&~F,F!==0&&(_=b(F)))),_===0?0:u!==0&&u!==_&&!(u&M)&&(M=_&-_,F=u&-u,M>=F||M===32&&(F&4194176)!==0)?u:_}function C(l,u){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&u)===0}function I(l,u){switch(l){case 1:case 2:case 4:case 8:return u+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function P(){var l=lg;return lg<<=1,!(lg&4194176)&&(lg=128),l}function O(){var l=cg;return cg<<=1,!(cg&62914560)&&(cg=4194304),l}function R(l){for(var u=[],p=0;31>p;p++)u.push(l);return u}function B(l,u){l.pendingLanes|=u,u!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function j(l,u,p,_,M,A){var F=l.pendingLanes;l.pendingLanes=p,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=p,l.entangledLanes&=p,l.errorRecoveryDisabledLanes&=p,l.shellSuspendCounter=0;var $=l.entanglements,he=l.expirationTimes,Ne=l.hiddenUpdates;for(p=F&~p;0>=F,M-=F,vo=1<<32-hr(u)+M|p<mn?(Yi=Pt,Pt=null):Yi=Pt.sibling;var gn=mt(ve,Pt,xe[mn],Qe);if(gn===null){Pt===null&&(Pt=Yi);break}l&&Pt&&gn.alternate===null&&u(ve,Pt),le=A(gn,le,mn),Zn===null?Rt=gn:Zn.sibling=gn,Zn=gn,Pt=Yi}if(mn===xe.length)return p(ve,Pt),pn&&ie(ve,mn),Rt;if(Pt===null){for(;mnmn?(Yi=Pt,Pt=null):Yi=Pt.sibling;var El=mt(ve,Pt,gn.value,Qe);if(El===null){Pt===null&&(Pt=Yi);break}l&&Pt&&El.alternate===null&&u(ve,Pt),le=A(El,le,mn),Zn===null?Rt=El:Zn.sibling=El,Zn=El,Pt=Yi}if(gn.done)return p(ve,Pt),pn&&ie(ve,mn),Rt;if(Pt===null){for(;!gn.done;mn++,gn=xe.next())gn=dt(ve,gn.value,Qe),gn!==null&&(le=A(gn,le,mn),Zn===null?Rt=gn:Zn.sibling=gn,Zn=gn);return pn&&ie(ve,mn),Rt}for(Pt=_(Pt);!gn.done;mn++,gn=xe.next())gn=Yt(Pt,ve,mn,gn.value,Qe),gn!==null&&(l&&gn.alternate!==null&&Pt.delete(gn.key===null?mn:gn.key),le=A(gn,le,mn),Zn===null?Rt=gn:Zn.sibling=gn,Zn=gn);return l&&Pt.forEach(function(cz){return u(ve,cz)}),pn&&ie(ve,mn),Rt}function Wc(ve,le,xe,Qe){if(typeof xe=="object"&&xe!==null&&xe.type===Th&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case rg:e:{for(var Rt=xe.key;le!==null;){if(le.key===Rt){if(Rt=xe.type,Rt===Th){if(le.tag===7){p(ve,le.sibling),Qe=M(le,xe.props.children),Qe.return=ve,ve=Qe;break e}}else if(le.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===ml&&oi(Rt)===le.type){p(ve,le.sibling),Qe=M(le,xe.props),Gt(Qe,xe),Qe.return=ve,ve=Qe;break e}p(ve,le);break}else u(ve,le);le=le.sibling}xe.type===Th?(Qe=Oc(xe.props.children,ve.mode,Qe,xe.key),Qe.return=ve,ve=Qe):(Qe=ag(xe.type,xe.key,xe.props,null,ve.mode,Qe),Gt(Qe,xe),Qe.return=ve,ve=Qe)}return F(ve);case Sh:e:{for(Rt=xe.key;le!==null;){if(le.key===Rt)if(le.tag===4&&le.stateNode.containerInfo===xe.containerInfo&&le.stateNode.implementation===xe.implementation){p(ve,le.sibling),Qe=M(le,xe.children||[]),Qe.return=ve,ve=Qe;break e}else{p(ve,le);break}else u(ve,le);le=le.sibling}Qe=rS(xe,ve.mode,Qe),Qe.return=ve,ve=Qe}return F(ve);case ml:return Rt=xe._init,xe=Rt(xe._payload),Wc(ve,le,xe,Qe)}if(sg(xe))return Gr(ve,le,xe,Qe);if(r(xe)){if(Rt=r(xe),typeof Rt!="function")throw Error(a(150));return xe=Rt.call(xe),Ep(ve,le,xe,Qe)}if(typeof xe.then=="function")return Wc(ve,le,yt(xe),Qe);if(xe.$$typeof===pl)return Wc(ve,le,J0(ve,xe),Qe);Vt(ve,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint"?(xe=""+xe,le!==null&&le.tag===6?(p(ve,le.sibling),Qe=M(le,xe),Qe.return=ve,ve=Qe):(p(ve,le),Qe=aS(xe,ve.mode,Qe),Qe.return=ve,ve=Qe),F(ve)):p(ve,le)}return function(ve,le,xe,Qe){try{gp=0;var Rt=Wc(ve,le,xe,Qe);return Ih=null,Rt}catch(Pt){if(Pt===mp)throw Pt;var Zn=t(29,Pt,null,ve.mode);return Zn.lanes=Qe,Zn.return=ve,Zn}finally{}}}function co(l,u){l=To,y(vg,l),y(Uh,u),To=l|u.baseLanes}function Ls(){y(vg,To),y(Uh,Uh.current)}function Is(){To=vg.current,v(Uh),v(vg)}function Ei(l){var u=l.alternate;y(zi,zi.current&1),y(Hr,l),Hs===null&&(u===null||Uh.current!==null||u.memoizedState!==null)&&(Hs=l)}function Us(l){if(l.tag===22){if(y(zi,zi.current),y(Hr,l),Hs===null){var u=l.alternate;u!==null&&u.memoizedState!==null&&(Hs=l)}}else ha()}function ha(){y(zi,zi.current),y(Hr,Hr.current)}function ki(l){v(Hr),Hs===l&&(Hs=null),v(zi)}function Ha(l){for(var u=l;u!==null;){if(u.tag===13){var p=u.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||vS(p)||_S(p)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if(u.flags&128)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function Dn(){throw Error(a(321))}function Or(l,u){if(u===null)return!1;for(var p=0;pA?A:8);var F=Ft.T,$={};Ft.T=$,My(l,!1,u,p);try{var he=M(),Ne=Ft.S;if(Ne!==null&&Ne($,he),he!==null&&typeof he=="object"&&typeof he.then=="function"){var et=qe(he,_);tp(l,u,et,cr(l))}else tp(l,u,_,cr(l))}catch(dt){tp(l,u,{then:function(){},status:"rejected",reason:dt},cr())}finally{Ga(A),Ft.T=F}}function IA(l){var u=l.memoizedState;if(u!==null)return u;u={memoizedState:Eh,baseState:Eh,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:X,lastRenderedState:Eh},next:null};var p={};return u.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:X,lastRenderedState:p},next:null},l.memoizedState=u,l=l.alternate,l!==null&&(l.memoizedState=u),u}function Ey(){return da(Ic)}function UA(){return N().memoizedState}function PA(){return N().memoizedState}function u9(l){for(var u=l.return;u!==null;){switch(u.tag){case 24:case 3:var p=cr();l=Ie(p);var _=He(u,l,p);_!==null&&(Ea(_,u,p),ht(_,u,p)),u={cache:zy()},l.payload=u;return}u=u.return}}function h9(l,u,p){var _=cr();p={lane:_,revertLane:0,action:p,hasEagerState:!1,eagerState:null,next:null},Z0(l)?BA(u,p):(p=Me(l,u,p,_),p!==null&&(Ea(p,l,_),HA(p,u,_)))}function zA(l,u,p){var _=cr();tp(l,u,p,_)}function tp(l,u,p,_){var M={lane:_,revertLane:0,action:p,hasEagerState:!1,eagerState:null,next:null};if(Z0(l))BA(u,M);else{var A=l.alternate;if(l.lanes===0&&(A===null||A.lanes===0)&&(A=u.lastRenderedReducer,A!==null))try{var F=u.lastRenderedState,$=A(F,p);if(M.hasEagerState=!0,M.eagerState=$,dr($,F))return G(l,u,M,0),Vn===null&&Te(),!1}catch{}finally{}if(p=Me(l,u,M,_),p!==null)return Ea(p,l,_),HA(p,u,_),!0}return!1}function My(l,u,p,_){if(_={lane:2,revertLane:Le(),action:_,hasEagerState:!1,eagerState:null,next:null},Z0(l)){if(u)throw Error(a(479))}else u=Me(l,p,_,2),u!==null&&Ea(u,l,2)}function Z0(l){var u=l.alternate;return l===en||u!==null&&u===en}function BA(l,u){Ph=_g=!0;var p=l.pending;p===null?u.next=u:(u.next=p.next,p.next=u),l.pending=u}function HA(l,u,p){if(p&4194176){var _=u.lanes;_&=l.pendingLanes,p|=_,u.lanes=p,se(l,p)}}function by(l,u,p,_){u=l.memoizedState,p=p(_,u),p=p==null?u:oS({},u,p),l.memoizedState=p,l.lanes===0&&(l.updateQueue.baseState=p)}function FA(l,u,p,_,M,A,F){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(_,A,F):u.prototype&&u.prototype.isPureReactComponent?!me(p,_)||!me(M,A):!0}function GA(l,u,p,_){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(p,_),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(p,_),u.state!==l&&DS.enqueueReplaceState(u,u.state,null)}function Rc(l,u){var p=u;if("ref"in u){p={};for(var _ in u)_!=="ref"&&(p[_]=u[_])}if(l=l.defaultProps){p===u&&(p=oS({},p));for(var M in l)p[M]===void 0&&(p[M]=l[M])}return p}function K0(l,u){try{var p=l.onUncaughtError;p(u.value,{componentStack:u.stack})}catch(_){setTimeout(function(){throw _})}}function VA(l,u,p){try{var _=l.onCaughtError;_(p.value,{componentStack:p.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(M){setTimeout(function(){throw M})}}function Ay(l,u,p){return p=Ie(p),p.tag=3,p.payload={element:null},p.callback=function(){K0(l,u)},p}function kA(l){return l=Ie(l),l.tag=3,l}function WA(l,u,p,_){var M=p.type.getDerivedStateFromError;if(typeof M=="function"){var A=_.value;l.payload=function(){return M(A)},l.callback=function(){VA(u,p,_)}}var F=p.stateNode;F!==null&&typeof F.componentDidCatch=="function"&&(l.callback=function(){VA(u,p,_),typeof M!="function"&&(Tl===null?Tl=new Set([this]):Tl.add(this));var $=_.stack;this.componentDidCatch(_.value,{componentStack:$!==null?$:""})})}function f9(l,u,p,_,M){if(p.flags|=32768,_!==null&&typeof _=="object"&&typeof _.then=="function"){if(u=p.alternate,u!==null&&ip(u,p,M,!0),p=Hr.current,p!==null){switch(p.tag){case 13:return Hs===null?eS():p.alternate===null&&pi===0&&(pi=3),p.flags&=-257,p.flags|=65536,p.lanes=M,_===gg?p.flags|=16384:(u=p.updateQueue,u===null?p.updateQueue=new Set([_]):u.add(_),nS(l,_,M)),!1;case 22:return p.flags|=65536,_===gg?p.flags|=16384:(u=p.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([_])},p.updateQueue=u):(p=u.retryQueue,p===null?u.retryQueue=new Set([_]):p.add(_)),nS(l,_,M)),!1}throw Error(a(435,p.tag))}return nS(l,_,M),eS(),!1}if(pn)return u=Hr.current,u!==null?(!(u.flags&65536)&&(u.flags|=256),u.flags|=65536,u.lanes=M,_!==ES&&(l=Error(a(422),{cause:_}),Ke(oe(l,p)))):(_!==ES&&(u=Error(a(423),{cause:_}),Ke(oe(u,p))),l=l.current.alternate,l.flags|=65536,M&=-M,l.lanes|=M,_=oe(_,p),M=Ay(l.stateNode,_,M),Q(l,M),pi!==4&&(pi=2)),!1;var A=Error(a(520),{cause:_});if(A=oe(A,p),xp===null?xp=[A]:xp.push(A),pi!==4&&(pi=2),u===null)return!0;_=oe(_,p),p=u;do{switch(p.tag){case 3:return p.flags|=65536,l=M&-M,p.lanes|=l,l=Ay(p.stateNode,_,l),Q(p,l),!1;case 1:if(u=p.type,A=p.stateNode,(p.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(Tl===null||!Tl.has(A))))return p.flags|=65536,M&=-M,p.lanes|=M,M=kA(M),WA(M,l,p,_),Q(p,M),!1}p=p.return}while(p!==null);return!1}function ia(l,u,p,_){u.child=l===null?Aw(u,null,p,_):Pc(u,l.child,p,_)}function XA(l,u,p,_,M){p=p.render;var A=u.ref;if("ref"in _){var F={};for(var $ in _)$!=="ref"&&(F[$]=_[$])}else F=_;return wc(u),_=Ps(l,u,p,F,A,M),$=fa(),l!==null&&!Wi?(w(l,u,M),ho(l,u,M)):(pn&&$&&Xe(u),u.flags|=1,ia(l,u,_,M),u.child)}function YA(l,u,p,_,M){if(l===null){var A=p.type;return typeof A=="function"&&!iS(A)&&A.defaultProps===void 0&&p.compare===null?(u.tag=15,u.type=A,qA(l,u,A,_,M)):(l=ag(p.type,null,_,u,u.mode,M),l.ref=u.ref,l.return=u,u.child=l)}if(A=l.child,!Iy(l,M)){var F=A.memoizedProps;if(p=p.compare,p=p!==null?p:me,p(F,_)&&l.ref===u.ref)return ho(l,u,M)}return u.flags|=1,l=dl(A,_),l.ref=u.ref,l.return=u,u.child=l}function qA(l,u,p,_,M){if(l!==null){var A=l.memoizedProps;if(me(A,_)&&l.ref===u.ref)if(Wi=!1,u.pendingProps=_=A,Iy(l,M))l.flags&131072&&(Wi=!0);else return u.lanes=l.lanes,ho(l,u,M)}return Ry(l,u,p,_,M)}function jA(l,u,p){var _=u.pendingProps,M=_.children,A=(u.stateNode._pendingVisibility&2)!==0,F=l!==null?l.memoizedState:null;if(np(l,u),_.mode==="hidden"||A){if(u.flags&128){if(_=F!==null?F.baseLanes|p:p,l!==null){for(M=u.child=l.child,A=0;M!==null;)A=A|M.lanes|M.childLanes,M=M.sibling;u.childLanes=A&~_}else u.childLanes=0,u.child=null;return ZA(l,u,_,p)}if(p&536870912)u.memoizedState={baseLanes:0,cachePool:null},l!==null&&$0(u,F!==null?F.cachePool:null),F!==null?co(u,F):Ls(),Us(u);else return u.lanes=u.childLanes=536870912,ZA(l,u,F!==null?F.baseLanes|p:p,p)}else F!==null?($0(u,F.cachePool),co(u,F),ha(),u.memoizedState=null):(l!==null&&$0(u,null),Ls(),ha());return ia(l,u,M,p),u.child}function ZA(l,u,p,_){var M=By();return M=M===null?null:{parent:go?fi._currentValue:fi._currentValue2,pool:M},u.memoizedState={baseLanes:p,cachePool:M},l!==null&&$0(u,null),Ls(),Us(u),l!==null&&ip(l,u,_,!0),null}function np(l,u){var p=u.ref;if(p===null)l!==null&&l.ref!==null&&(u.flags|=2097664);else{if(typeof p!="function"&&typeof p!="object")throw Error(a(284));(l===null||l.ref!==p)&&(u.flags|=2097664)}}function Ry(l,u,p,_,M){return wc(u),p=Ps(l,u,p,_,void 0,M),_=fa(),l!==null&&!Wi?(w(l,u,M),ho(l,u,M)):(pn&&_&&Xe(u),u.flags|=1,ia(l,u,p,M),u.child)}function KA(l,u,p,_,M,A){return wc(u),u.updateQueue=null,p=uo(u,_,p,M),zs(l),_=fa(),l!==null&&!Wi?(w(l,u,A),ho(l,u,A)):(pn&&_&&Xe(u),u.flags|=1,ia(l,u,p,A),u.child)}function QA(l,u,p,_,M){if(wc(u),u.stateNode===null){var A=bh,F=p.contextType;typeof F=="object"&&F!==null&&(A=da(F)),A=new p(_,A),u.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=DS,u.stateNode=A,A._reactInternals=u,A=u.stateNode,A.props=_,A.state=u.memoizedState,A.refs={},_t(u),F=p.contextType,A.context=typeof F=="object"&&F!==null?da(F):bh,A.state=u.memoizedState,F=p.getDerivedStateFromProps,typeof F=="function"&&(by(u,p,F,_),A.state=u.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(F=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),F!==A.state&&DS.enqueueReplaceState(A,A.state,null),Oe(u,_,A,M),pe(),A.state=u.memoizedState),typeof A.componentDidMount=="function"&&(u.flags|=4194308),_=!0}else if(l===null){A=u.stateNode;var $=u.memoizedProps,he=Rc(p,$);A.props=he;var Ne=A.context,et=p.contextType;F=bh,typeof et=="object"&&et!==null&&(F=da(et));var dt=p.getDerivedStateFromProps;et=typeof dt=="function"||typeof A.getSnapshotBeforeUpdate=="function",$=u.pendingProps!==$,et||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||($||Ne!==F)&&GA(u,A,_,F),_l=!1;var mt=u.memoizedState;A.state=mt,Oe(u,_,A,M),pe(),Ne=u.memoizedState,$||mt!==Ne||_l?(typeof dt=="function"&&(by(u,p,dt,_),Ne=u.memoizedState),(he=_l||FA(u,p,he,_,mt,Ne,F))?(et||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(u.flags|=4194308)):(typeof A.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=_,u.memoizedState=Ne),A.props=_,A.state=Ne,A.context=F,_=he):(typeof A.componentDidMount=="function"&&(u.flags|=4194308),_=!1)}else{A=u.stateNode,pt(l,u),F=u.memoizedProps,et=Rc(p,F),A.props=et,dt=u.pendingProps,mt=A.context,Ne=p.contextType,he=bh,typeof Ne=="object"&&Ne!==null&&(he=da(Ne)),$=p.getDerivedStateFromProps,(Ne=typeof $=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(F!==dt||mt!==he)&&GA(u,A,_,he),_l=!1,mt=u.memoizedState,A.state=mt,Oe(u,_,A,M),pe();var Yt=u.memoizedState;F!==dt||mt!==Yt||_l||l!==null&&l.dependencies!==null&&Q0(l.dependencies)?(typeof $=="function"&&(by(u,p,$,_),Yt=u.memoizedState),(et=_l||FA(u,p,et,_,mt,Yt,he)||l!==null&&l.dependencies!==null&&Q0(l.dependencies))?(Ne||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(_,Yt,he),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(_,Yt,he)),typeof A.componentDidUpdate=="function"&&(u.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof A.componentDidUpdate!="function"||F===l.memoizedProps&&mt===l.memoizedState||(u.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||F===l.memoizedProps&&mt===l.memoizedState||(u.flags|=1024),u.memoizedProps=_,u.memoizedState=Yt),A.props=_,A.state=Yt,A.context=he,_=et):(typeof A.componentDidUpdate!="function"||F===l.memoizedProps&&mt===l.memoizedState||(u.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||F===l.memoizedProps&&mt===l.memoizedState||(u.flags|=1024),_=!1)}return A=_,np(l,u),_=(u.flags&128)!==0,A||_?(A=u.stateNode,p=_&&typeof p.getDerivedStateFromError!="function"?null:A.render(),u.flags|=1,l!==null&&_?(u.child=Pc(u,l.child,null,M),u.child=Pc(u,null,p,M)):ia(l,u,p,M),u.memoizedState=A.state,l=u.child):l=ho(l,u,M),l}function JA(l,u,p,_){return ot(),u.flags|=256,ia(l,u,p,_),u.child}function wy(l){return{baseLanes:l,cachePool:aR()}}function Cy(l,u,p){return l=l!==null?l.childLanes&~p:0,u&&(l|=Fr),l}function $A(l,u,p){var _=u.pendingProps,M=!1,A=(u.flags&128)!==0,F;if((F=A)||(F=l!==null&&l.memoizedState===null?!1:(zi.current&2)!==0),F&&(M=!0,u.flags&=-129),F=(u.flags&32)!==0,u.flags&=-33,l===null){if(pn){if(M?Ei(u):ha(),pn){var $=ga,he;(he=$)&&($=C7($,Bs),$!==null?(u.memoizedState={dehydrated:$,treeContext:Uc!==null?{id:vo,overflow:_o}:null,retryLane:536870912},he=t(18,null,null,0),he.stateNode=$,he.return=u,u.child=he,Ma=u,ga=null,he=!0):he=!1),he||Ze(u)}if($=u.memoizedState,$!==null&&($=$.dehydrated,$!==null))return _S($)?u.lanes=16:u.lanes=536870912,null;ki(u)}return $=_.children,_=_.fallback,M?(ha(),M=u.mode,$=Dy({mode:"hidden",children:$},M),_=Oc(_,M,p,null),$.return=u,_.return=u,$.sibling=_,u.child=$,M=u.child,M.memoizedState=wy(p),M.childLanes=Cy(l,F,p),u.memoizedState=OS,_):(Ei(u),Ny(u,$))}if(he=l.memoizedState,he!==null&&($=he.dehydrated,$!==null)){if(A)u.flags&256?(Ei(u),u.flags&=-257,u=Oy(l,u,p)):u.memoizedState!==null?(ha(),u.child=l.child,u.flags|=128,u=null):(ha(),M=_.fallback,$=u.mode,_=Dy({mode:"visible",children:_.children},$),M=Oc(M,$,p,null),M.flags|=2,_.return=u,M.return=u,_.sibling=M,u.child=_,Pc(u,l.child,null,p),_=u.child,_.memoizedState=wy(p),_.childLanes=Cy(l,F,p),u.memoizedState=OS,u=M);else if(Ei(u),_S($))F=S7($).digest,_=Error(a(419)),_.stack="",_.digest=F,Ke({value:_,source:null,stack:null}),u=Oy(l,u,p);else if(Wi||ip(l,u,p,!1),F=(p&l.childLanes)!==0,Wi||F){if(F=Vn,F!==null){if(_=p&-p,_&42)_=1;else switch(_){case 2:_=1;break;case 8:_=4;break;case 32:_=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:_=64;break;case 268435456:_=134217728;break;default:_=0}if(_=_&(F.suspendedLanes|p)?0:_,_!==0&&_!==he.retryLane)throw he.retryLane=_,De(l,_),Ea(F,l,_),ww}vS($)||eS(),u=Oy(l,u,p)}else vS($)?(u.flags|=128,u.child=l.child,u=M9.bind(null,l),T7($,u),u=null):(l=he.treeContext,Ir&&(ga=A7($),Ma=u,pn=!0,hs=null,Bs=!1,l!==null&&(Pr[zr++]=vo,Pr[zr++]=_o,Pr[zr++]=Uc,vo=l.id,_o=l.overflow,Uc=u)),u=Ny(u,_.children),u.flags|=4096);return u}return M?(ha(),M=_.fallback,$=u.mode,he=l.child,A=he.sibling,_=dl(he,{mode:"hidden",children:_.children}),_.subtreeFlags=he.subtreeFlags&31457280,A!==null?M=dl(A,M):(M=Oc(M,$,p,null),M.flags|=2),M.return=u,_.return=u,_.sibling=M,u.child=_,_=M,M=u.child,$=l.child.memoizedState,$===null?$=wy(p):(he=$.cachePool,he!==null?(A=go?fi._currentValue:fi._currentValue2,he=he.parent!==A?{parent:A,pool:A}:he):he=aR(),$={baseLanes:$.baseLanes|p,cachePool:he}),M.memoizedState=$,M.childLanes=Cy(l,F,p),u.memoizedState=OS,_):(Ei(u),p=l.child,l=p.sibling,p=dl(p,{mode:"visible",children:_.children}),p.return=u,p.sibling=null,l!==null&&(F=u.deletions,F===null?(u.deletions=[l],u.flags|=16):F.push(l)),u.child=p,u.memoizedState=null,p)}function Ny(l,u){return u=Dy({mode:"visible",children:u},l.mode),u.return=l,l.child=u}function Dy(l,u){return kR(l,u,0,null)}function Oy(l,u,p){return Pc(u,l.child,null,p),l=Ny(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function eR(l,u,p){l.lanes|=u;var _=l.alternate;_!==null&&(_.lanes|=u),Uy(l.return,u,p)}function Ly(l,u,p,_,M){var A=l.memoizedState;A===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:_,tail:p,tailMode:M}:(A.isBackwards=u,A.rendering=null,A.renderingStartTime=0,A.last=_,A.tail=p,A.tailMode=M)}function tR(l,u,p){var _=u.pendingProps,M=_.revealOrder,A=_.tail;if(ia(l,u,_.children,p),_=zi.current,_&2)_=_&1|2,u.flags|=128;else{if(l!==null&&l.flags&128)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&eR(l,p,u);else if(l.tag===19)eR(l,p,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}_&=1}switch(y(zi,_),M){case"forwards":for(p=u.child,M=null;p!==null;)l=p.alternate,l!==null&&Ha(l)===null&&(M=p),p=p.sibling;p=M,p===null?(M=u.child,u.child=null):(M=p.sibling,p.sibling=null),Ly(u,!1,M,p,A);break;case"backwards":for(p=null,M=u.child,u.child=null;M!==null;){if(l=M.alternate,l!==null&&Ha(l)===null){u.child=M;break}l=M.sibling,M.sibling=p,p=M,M=l}Ly(u,!0,p,null,A);break;case"together":Ly(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function ho(l,u,p){if(l!==null&&(u.dependencies=l.dependencies),Sl|=u.lanes,!(p&u.childLanes))if(l!==null){if(ip(l,u,p,!1),(p&u.childLanes)===0)return null}else return null;if(l!==null&&u.child!==l.child)throw Error(a(153));if(u.child!==null){for(l=u.child,p=dl(l,l.pendingProps),u.child=p,p.return=u;l.sibling!==null;)l=l.sibling,p=p.sibling=dl(l,l.pendingProps),p.return=u;p.sibling=null}return u.child}function Iy(l,u){return l.lanes&u?!0:(l=l.dependencies,!!(l!==null&&Q0(l)))}function d9(l,u,p){switch(u.tag){case 3:tt(u,u.stateNode.containerInfo),cl(u,fi,l.memoizedState.cache),ot();break;case 27:case 5:ge(u);break;case 4:tt(u,u.stateNode.containerInfo);break;case 10:cl(u,u.type,u.memoizedProps.value);break;case 13:var _=u.memoizedState;if(_!==null)return _.dehydrated!==null?(Ei(u),u.flags|=128,null):p&u.child.childLanes?$A(l,u,p):(Ei(u),l=ho(l,u,p),l!==null?l.sibling:null);Ei(u);break;case 19:var M=(l.flags&128)!==0;if(_=(p&u.childLanes)!==0,_||(ip(l,u,p,!1),_=(p&u.childLanes)!==0),M){if(_)return tR(l,u,p);u.flags|=128}if(M=u.memoizedState,M!==null&&(M.rendering=null,M.tail=null,M.lastEffect=null),y(zi,zi.current),_)break;return null;case 22:case 23:return u.lanes=0,jA(l,u,p);case 24:cl(u,fi,l.memoizedState.cache)}return ho(l,u,p)}function nR(l,u,p){if(l!==null)if(l.memoizedProps!==u.pendingProps)Wi=!0;else{if(!Iy(l,p)&&!(u.flags&128))return Wi=!1,d9(l,u,p);Wi=!!(l.flags&131072)}else Wi=!1,pn&&u.flags&1048576&&Ce(u,fg,u.index);switch(u.lanes=0,u.tag){case 16:e:{l=u.pendingProps;var _=u.elementType,M=_._init;if(_=M(_._payload),u.type=_,typeof _=="function")iS(_)?(l=Rc(_,l),u.tag=1,u=QA(null,u,_,l,p)):(u.tag=0,u=Ry(null,u,_,l,p));else{if(_!=null){if(M=_.$$typeof,M===cS){u.tag=11,u=XA(null,u,_,l,p);break e}else if(M===fS){u.tag=14,u=YA(null,u,_,l,p);break e}}throw u=s(_)||_,Error(a(306,u,""))}}return u;case 0:return Ry(l,u,u.type,u.pendingProps,p);case 1:return _=u.type,M=Rc(_,u.pendingProps),QA(l,u,_,M,p);case 3:e:{if(tt(u,u.stateNode.containerInfo),l===null)throw Error(a(387));var A=u.pendingProps;M=u.memoizedState,_=M.element,pt(l,u),Oe(u,A,null,p);var F=u.memoizedState;if(A=F.cache,cl(u,fi,A),A!==M.cache&&Py(u,[fi],p,!0),pe(),A=F.element,Ir&&M.isDehydrated)if(M={element:A,isDehydrated:!1,cache:F.cache},u.updateQueue.baseState=M,u.memoizedState=M,u.flags&256){u=JA(l,u,A,p);break e}else if(A!==_){_=oe(Error(a(424)),u),Ke(_),u=JA(l,u,A,p);break e}else for(Ir&&(ga=b7(u.stateNode.containerInfo),Ma=u,pn=!0,hs=null,Bs=!0),p=Aw(u,null,A,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(ot(),A===_){u=ho(l,u,p);break e}ia(l,u,A,p)}u=u.child}return u;case 26:if(Ur)return np(l,u),l===null?(p=gw(u.type,null,u.pendingProps,null))?u.memoizedState=p:pn||(u.stateNode=G7(u.type,u.pendingProps,vl.current,u)):u.memoizedState=gw(u.type,l.memoizedProps,u.pendingProps,l.memoizedState),null;case 27:if(ma)return ge(u),l===null&&ma&&pn&&(_=u.stateNode=Tw(u.type,u.pendingProps,vl.current,aa.current,!1),Ma=u,Bs=!0,ga=dw(_)),_=u.pendingProps.children,l!==null||pn?ia(l,u,_,p):u.child=Pc(u,null,_,p),np(l,u),u.child;case 5:return l===null&&pn&&(B7(u.type,u.pendingProps,aa.current),(M=_=ga)&&(_=R7(_,u.type,u.pendingProps,Bs),_!==null?(u.stateNode=_,Ma=u,ga=dw(_),Bs=!1,M=!0):M=!1),M||Ze(u)),ge(u),M=u.type,A=u.pendingProps,F=l!==null?l.memoizedProps:null,_=A.children,og(M,A)?_=null:F!==null&&og(M,F)&&(u.flags|=32),u.memoizedState!==null&&(M=Ps(l,u,rr,null,null,p),go?Ic._currentValue=M:Ic._currentValue2=M),np(l,u),ia(l,u,_,p),u.child;case 6:return l===null&&pn&&(H7(u.pendingProps,aa.current),(l=p=ga)&&(p=w7(p,u.pendingProps,Bs),p!==null?(u.stateNode=p,Ma=u,ga=null,l=!0):l=!1),l||Ze(u)),null;case 13:return $A(l,u,p);case 4:return tt(u,u.stateNode.containerInfo),_=u.pendingProps,l===null?u.child=Pc(u,null,_,p):ia(l,u,_,p),u.child;case 11:return XA(l,u,u.type,u.pendingProps,p);case 7:return ia(l,u,u.pendingProps,p),u.child;case 8:return ia(l,u,u.pendingProps.children,p),u.child;case 12:return ia(l,u,u.pendingProps.children,p),u.child;case 10:return _=u.pendingProps,cl(u,u.type,_.value),ia(l,u,_.children,p),u.child;case 9:return M=u.type._context,_=u.pendingProps.children,wc(u),M=da(M),_=_(M),u.flags|=1,ia(l,u,_,p),u.child;case 14:return YA(l,u,u.type,u.pendingProps,p);case 15:return qA(l,u,u.type,u.pendingProps,p);case 19:return tR(l,u,p);case 22:return jA(l,u,p);case 24:return wc(u),_=da(fi),l===null?(M=By(),M===null&&(M=Vn,A=zy(),M.pooledCache=A,A.refCount++,A!==null&&(M.pooledCacheLanes|=p),M=A),u.memoizedState={parent:_,cache:M},_t(u),cl(u,fi,M)):(l.lanes&p&&(pt(l,u),Oe(u,null,null,p),pe()),M=l.memoizedState,A=u.memoizedState,M.parent!==_?(M={parent:_,cache:_},u.memoizedState=M,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=M),cl(u,fi,_)):(_=A.cache,cl(u,fi,_),_!==M.cache&&Py(u,[fi],p,!0))),ia(l,u,u.pendingProps.children,p),u.child;case 29:throw u.pendingProps}throw Error(a(156,u.tag))}function cl(l,u,p){go?(y(yg,u._currentValue),u._currentValue=p):(y(yg,u._currentValue2),u._currentValue2=p)}function fo(l){var u=yg.current;go?l._currentValue=u:l._currentValue2=u,v(yg)}function Uy(l,u,p){for(;l!==null;){var _=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,_!==null&&(_.childLanes|=u)):_!==null&&(_.childLanes&u)!==u&&(_.childLanes|=u),l===p)break;l=l.return}}function Py(l,u,p,_){var M=l.child;for(M!==null&&(M.return=l);M!==null;){var A=M.dependencies;if(A!==null){var F=M.child;A=A.firstContext;e:for(;A!==null;){var $=A;A=M;for(var he=0;heyp&&(u.flags|=128,_=!0,rp(M,!1),u.lanes=4194304)}else{if(!_)if(l=Ha(A),l!==null){if(u.flags|=128,_=!0,l=l.updateQueue,u.updateQueue=l,eg(u,l),rp(M,!0),M.tail===null&&M.tailMode==="hidden"&&!A.alternate&&!pn)return ci(u),null}else 2*us()-M.renderingStartTime>yp&&p!==536870912&&(u.flags|=128,_=!0,rp(M,!1),u.lanes=4194304);M.isBackwards?(A.sibling=u.child,u.child=A):(l=M.last,l!==null?l.sibling=A:u.child=A,M.last=A)}return M.tail!==null?(u=M.tail,M.rendering=u,M.tail=u.sibling,M.renderingStartTime=us(),u.sibling=null,l=zi.current,y(zi,_?l&1|2:l&1),u):(ci(u),null);case 22:case 23:return ki(u),Is(),_=u.memoizedState!==null,l!==null?l.memoizedState!==null!==_&&(u.flags|=8192):_&&(u.flags|=8192),_?p&536870912&&!(u.flags&128)&&(ci(u),u.subtreeFlags&6&&(u.flags|=8192)):ci(u),p=u.updateQueue,p!==null&&eg(u,p.retryQueue),p=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),_=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(_=u.memoizedState.cachePool.pool),_!==p&&(u.flags|=2048),l!==null&&v(Gc),null;case 24:return p=null,l!==null&&(p=l.memoizedState.cache),u.memoizedState.cache!==p&&(u.flags|=2048),fo(fi),ci(u),null;case 25:return null}throw Error(a(156,u.tag))}function m9(l,u){switch(nt(u),u.tag){case 1:return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return fo(fi),gt(),l=u.flags,l&65536&&!(l&128)?(u.flags=l&-65537|128,u):null;case 26:case 27:case 5:return Ae(u),null;case 13:if(ki(u),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(a(340));ot()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return v(zi),null;case 4:return gt(),null;case 10:return fo(u.type),null;case 22:case 23:return ki(u),Is(),l!==null&&v(Gc),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 24:return fo(fi),null;case 25:return null;default:return null}}function cR(l,u){switch(nt(u),u.tag){case 3:fo(fi),gt();break;case 26:case 27:case 5:Ae(u);break;case 4:gt();break;case 13:ki(u);break;case 19:v(zi);break;case 10:fo(u.type);break;case 22:case 23:ki(u),Is(),l!==null&&v(Gc);break;case 24:fo(fi)}}function sp(l,u){try{var p=u.updateQueue,_=p!==null?p.lastEffect:null;if(_!==null){var M=_.next;p=M;do{if((p.tag&l)===l){_=void 0;var A=p.create,F=p.inst;_=A(),F.destroy=_}p=p.next}while(p!==M)}}catch($){bn(u,u.return,$)}}function ul(l,u,p){try{var _=u.updateQueue,M=_!==null?_.lastEffect:null;if(M!==null){var A=M.next;_=A;do{if((_.tag&l)===l){var F=_.inst,$=F.destroy;if($!==void 0){F.destroy=void 0,M=u;var he=p;try{$()}catch(Ne){bn(M,he,Ne)}}}_=_.next}while(_!==A)}}catch(Ne){bn(u,u.return,Ne)}}function uR(l){var u=l.updateQueue;if(u!==null){var p=l.stateNode;try{Ve(u,p)}catch(_){bn(l,l.return,_)}}}function hR(l,u,p){p.props=Rc(l.type,l.memoizedProps),p.state=l.memoizedState;try{p.componentWillUnmount()}catch(_){bn(l,u,_)}}function Cc(l,u){try{var p=l.ref;if(p!==null){var _=l.stateNode;switch(l.tag){case 26:case 27:case 5:var M=cp(_);break;default:M=_}typeof p=="function"?l.refCleanup=p(M):p.current=M}}catch(A){bn(l,u,A)}}function or(l,u){var p=l.ref,_=l.refCleanup;if(p!==null)if(typeof _=="function")try{_()}catch(M){bn(l,u,M)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(M){bn(l,u,M)}else p.current=null}function fR(l){var u=l.type,p=l.memoizedProps,_=l.stateNode;try{l7(_,u,p,l)}catch(M){bn(l,l.return,M)}}function dR(l,u,p){try{c7(l.stateNode,l.type,p,u,l)}catch(_){bn(l,l.return,_)}}function pR(l){return l.tag===5||l.tag===3||(Ur?l.tag===26:!1)||(ma?l.tag===27:!1)||l.tag===4}function Vy(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||pR(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&(!ma||l.tag!==27)&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function ky(l,u,p){var _=l.tag;if(_===5||_===6)l=l.stateNode,u?h7(p,l,u):s7(p,l);else if(!(_===4||ma&&_===27)&&(l=l.child,l!==null))for(ky(l,u,p),l=l.sibling;l!==null;)ky(l,u,p),l=l.sibling}function tg(l,u,p){var _=l.tag;if(_===5||_===6)l=l.stateNode,u?u7(p,l,u):r7(p,l);else if(!(_===4||ma&&_===27)&&(l=l.child,l!==null))for(tg(l,u,p),l=l.sibling;l!==null;)tg(l,u,p),l=l.sibling}function mR(l,u,p){l=l.containerInfo;try{cw(l,p)}catch(_){bn(u,u.return,_)}}function g9(l,u){for(B9(l.containerInfo),Xi=u;Xi!==null;)if(l=Xi,u=l.child,(l.subtreeFlags&1028)!==0&&u!==null)u.return=l,Xi=u;else for(;Xi!==null;){l=Xi;var p=l.alternate;switch(u=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if(u&1024&&p!==null){u=void 0;var _=l,M=p.memoizedProps;p=p.memoizedState;var A=_.stateNode;try{var F=Rc(_.type,M,_.elementType===_.type);u=A.getSnapshotBeforeUpdate(F,p),A.__reactInternalSnapshotBeforeUpdate=u}catch($){bn(_,_.return,$)}}break;case 3:u&1024&&pa&&_7(l.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(u&1024)throw Error(a(163))}if(u=l.sibling,u!==null){u.return=l.return,Xi=u;break}Xi=l.return}return F=Dw,Dw=!1,F}function gR(l,u,p){var _=p.flags;switch(p.tag){case 0:case 11:case 15:po(l,p),_&4&&sp(5,p);break;case 1:if(po(l,p),_&4)if(l=p.stateNode,u===null)try{l.componentDidMount()}catch($){bn(p,p.return,$)}else{var M=Rc(p.type,u.memoizedProps);u=u.memoizedState;try{l.componentDidUpdate(M,u,l.__reactInternalSnapshotBeforeUpdate)}catch($){bn(p,p.return,$)}}_&64&&uR(p),_&512&&Cc(p,p.return);break;case 3:if(po(l,p),_&64&&(_=p.updateQueue,_!==null)){if(l=null,p.child!==null)switch(p.child.tag){case 27:case 5:l=cp(p.child.stateNode);break;case 1:l=p.child.stateNode}try{Ve(_,l)}catch($){bn(p,p.return,$)}}break;case 26:if(Ur){po(l,p),_&512&&Cc(p,p.return);break}case 27:case 5:po(l,p),u===null&&_&4&&fR(p),_&512&&Cc(p,p.return);break;case 12:po(l,p);break;case 13:po(l,p),_&4&&_R(l,p);break;case 22:if(M=p.memoizedState!==null||yo,!M){u=u!==null&&u.memoizedState!==null||di;var A=yo,F=di;yo=M,(di=u)&&!F?hl(l,p,(p.subtreeFlags&8772)!==0):po(l,p),yo=A,di=F}_&512&&(p.memoizedProps.mode==="manual"?Cc(p,p.return):or(p,p.return));break;default:po(l,p)}}function vR(l){var u=l.alternate;u!==null&&(l.alternate=null,vR(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&Y9(u)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function cs(l,u,p){for(p=p.child;p!==null;)Wy(l,u,p),p=p.sibling}function Wy(l,u,p){if(fr&&typeof fr.onCommitFiberUnmount=="function")try{fr.onCommitFiberUnmount(fp,p)}catch{}switch(p.tag){case 26:if(Ur){di||or(p,u),cs(l,u,p),p.memoizedState?_w(p.memoizedState):p.stateNode&&yw(p.stateNode);break}case 27:if(ma){di||or(p,u);var _=Ai,M=pr;Ai=p.stateNode,cs(l,u,p),q7(p.stateNode),Ai=_,pr=M;break}case 5:di||or(p,u);case 6:if(pa){if(_=Ai,M=pr,Ai=null,cs(l,u,p),Ai=_,pr=M,Ai!==null)if(pr)try{d7(Ai,p.stateNode)}catch(A){bn(p,u,A)}else try{f7(Ai,p.stateNode)}catch(A){bn(p,u,A)}}else cs(l,u,p);break;case 18:pa&&Ai!==null&&(pr?z7(Ai,p.stateNode):P7(Ai,p.stateNode));break;case 4:pa?(_=Ai,M=pr,Ai=p.stateNode.containerInfo,pr=!0,cs(l,u,p),Ai=_,pr=M):(gl&&mR(p.stateNode,p,ow()),cs(l,u,p));break;case 0:case 11:case 14:case 15:di||ul(2,p,u),di||ul(4,p,u),cs(l,u,p);break;case 1:di||(or(p,u),_=p.stateNode,typeof _.componentWillUnmount=="function"&&hR(p,u,_)),cs(l,u,p);break;case 21:cs(l,u,p);break;case 22:di||or(p,u),di=(_=di)||p.memoizedState!==null,cs(l,u,p),di=_;break;default:cs(l,u,p)}}function _R(l,u){if(Ir&&u.memoizedState===null&&(l=u.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{U7(l)}catch(p){bn(u,u.return,p)}}function v9(l){switch(l.tag){case 13:case 19:var u=l.stateNode;return u===null&&(u=l.stateNode=new Nw),u;case 22:return l=l.stateNode,u=l._retryCache,u===null&&(u=l._retryCache=new Nw),u;default:throw Error(a(435,l.tag))}}function Xy(l,u){var p=v9(l);u.forEach(function(_){var M=b9.bind(null,l,_);p.has(_)||(p.add(_),_.then(M,M))})}function Fa(l,u){var p=u.deletions;if(p!==null)for(var _=0;_";case Tg:return":has("+(Ky(l)||"")+")";case Eg:return'[role="'+l.value+'"]';case bg:return'"'+l.value+'"';case Mg:return'[data-testname="'+l.value+'"]';default:throw Error(a(365))}}function AR(l,u){var p=[];l=[l,0];for(var _=0;_p?32:p;p=Ft.T;var M=Lc();try{if(Ga(_),Ft.T=null,kc===null)var A=!1;else{_=HS,HS=null;var F=kc,$=Sp;if(kc=null,Sp=0,In&6)throw Error(a(331));var he=In;if(In|=4,MR(F.current),SR(F,F.current,$,_),In=he,Je(0,!1),fr&&typeof fr.onPostCommitFiberRoot=="function")try{fr.onPostCommitFiberRoot(fp,F)}catch{}A=!0}return A}finally{Ga(M),Ft.T=p,HR(l,u)}}return!1}function FR(l,u,p){u=oe(p,u),u=Ay(l.stateNode,u,2),l=He(l,u,2),l!==null&&(B(l,2),$e(l))}function bn(l,u,p){if(l.tag===3)FR(l,l,p);else for(;u!==null;){if(u.tag===3){FR(u,l,p);break}else if(u.tag===1){var _=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof _.componentDidCatch=="function"&&(Tl===null||!Tl.has(_))){l=oe(p,l),p=kA(2),_=He(u,p,2),_!==null&&(WA(p,_,u,l),B(_,2),$e(_));break}}u=u.return}}function nS(l,u,p){var _=l.pingCache;if(_===null){_=l.pingCache=new lz;var M=new Set;_.set(u,M)}else M=_.get(u),M===void 0&&(M=new Set,_.set(u,M));M.has(p)||(IS=!0,M.add(p),l=E9.bind(null,l,u,p),u.then(l,l))}function E9(l,u,p){var _=l.pingCache;_!==null&&_.delete(u),l.pingedLanes|=l.suspendedLanes&p,l.warmLanes&=~p,Vn===l&&(hn&p)===p&&(pi===4||pi===3&&(hn&62914560)===hn&&300>us()-zS?!(In&2)&&xh(l,0):US|=p,Fh===hn&&(Fh=0)),$e(l)}function GR(l,u){u===0&&(u=O()),l=De(l,u),l!==null&&(B(l,u),$e(l))}function M9(l){var u=l.memoizedState,p=0;u!==null&&(p=u.retryLane),GR(l,p)}function b9(l,u){var p=0;switch(l.tag){case 13:var _=l.stateNode,M=l.memoizedState;M!==null&&(p=M.retryLane);break;case 19:_=l.stateNode;break;case 22:_=l.stateNode._retryCache;break;default:throw Error(a(314))}_!==null&&_.delete(u),GR(l,p)}function A9(l,u){return ug(l,u)}function R9(l,u,p,_){this.tag=l,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function iS(l){return l=l.prototype,!(!l||!l.isReactComponent)}function dl(l,u){var p=l.alternate;return p===null?(p=t(l.tag,u,l.key,l.mode),p.elementType=l.elementType,p.type=l.type,p.stateNode=l.stateNode,p.alternate=l,l.alternate=p):(p.pendingProps=u,p.type=l.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=l.flags&31457280,p.childLanes=l.childLanes,p.lanes=l.lanes,p.child=l.child,p.memoizedProps=l.memoizedProps,p.memoizedState=l.memoizedState,p.updateQueue=l.updateQueue,u=l.dependencies,p.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},p.sibling=l.sibling,p.index=l.index,p.ref=l.ref,p.refCleanup=l.refCleanup,p}function VR(l,u){l.flags&=31457282;var p=l.alternate;return p===null?(l.childLanes=0,l.lanes=u,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=p.childLanes,l.lanes=p.lanes,l.child=p.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=p.memoizedProps,l.memoizedState=p.memoizedState,l.updateQueue=p.updateQueue,l.type=p.type,u=p.dependencies,l.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),l}function ag(l,u,p,_,M,A){var F=0;if(_=l,typeof l=="function")iS(l)&&(F=1);else if(typeof l=="string")F=Ur&&ma?mw(l,p,aa.current)?26:Ew(l)?27:5:Ur?mw(l,p,aa.current)?26:5:ma&&Ew(l)?27:5;else e:switch(l){case Th:return Oc(p.children,M,A,u);case ZR:F=8,M|=24;break;case lS:return l=t(12,p,u,M|2),l.elementType=lS,l.lanes=A,l;case uS:return l=t(13,p,u,M),l.elementType=uS,l.lanes=A,l;case hS:return l=t(19,p,u,M),l.elementType=hS,l.lanes=A,l;case QR:return kR(p,M,A,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case D9:case pl:F=10;break e;case KR:F=9;break e;case cS:F=11;break e;case fS:F=14;break e;case ml:F=16,_=null;break e}F=29,p=Error(a(130,l===null?"null":typeof l,"")),_=null}return u=t(F,p,u,M),u.elementType=l,u.type=_,u.lanes=A,u}function Oc(l,u,p,_){return l=t(7,l,_,u),l.lanes=p,l}function kR(l,u,p,_){l=t(22,l,_,u),l.elementType=QR,l.lanes=p;var M={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var A=M._current;if(A===null)throw Error(a(456));if(!(M._pendingVisibility&2)){var F=De(A,2);F!==null&&(M._pendingVisibility|=2,Ea(F,A,2))}},attach:function(){var A=M._current;if(A===null)throw Error(a(456));if(M._pendingVisibility&2){var F=De(A,2);F!==null&&(M._pendingVisibility&=-3,Ea(F,A,2))}}};return l.stateNode=M,l}function aS(l,u,p){return l=t(6,l,null,u),l.lanes=p,l}function rS(l,u,p){return u=t(4,l.children!==null?l.children:[],l.key,u),u.lanes=p,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function w9(l,u,p,_,M,A,F,$){this.tag=1,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=gS,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=R(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R(0),this.hiddenUpdates=R(null),this.identifierPrefix=_,this.onUncaughtError=M,this.onCaughtError=A,this.onRecoverableError=F,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function WR(l,u,p,_,M,A,F,$,he,Ne,et,dt){return l=new w9(l,u,p,F,$,he,Ne,dt),u=1,A===!0&&(u|=24),A=t(3,null,null,u),l.current=A,A.stateNode=l,u=zy(),u.refCount++,l.pooledCache=u,u.refCount++,A.memoizedState={element:_,isDehydrated:p,cache:u},_t(A),l}function XR(l){return l?(l=bh,l):bh}function YR(l){var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(a(188)):(l=Object.keys(l).join(","),Error(a(268,l)));return l=g(u),l=l!==null?x(l):null,l===null?null:cp(l.stateNode)}function qR(l,u,p,_,M,A){M=XR(M),_.context===null?_.context=M:_.pendingContext=M,_=Ie(u),_.payload={element:p},A=A===void 0?null:A,A!==null&&(_.callback=A),p=He(l,_,u),p!==null&&(Ea(p,l,u),ht(p,l,u))}function jR(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var p=l.retryLane;l.retryLane=p!==0&&p=Ne&&A>=dt&&M<=et&&F<=mt){l.splice(u,1);break}else if(_!==Ne||p.width!==he.width||mtF){if(!(A!==dt||p.height!==he.height||et<_||Ne>M)){Ne>_&&(he.width+=Ne-_,he.x=_),etA&&(he.height+=dt-A,he.y=A),mtp&&(p=$)),$Ah||(l.current=ES[Ah],ES[Ah]=null,Ah--)}function S(l,u){Ah++,ES[Ah]=l.current,l.current=u}function E(l){return l>>>=0,l===0?32:31-(Z7(l)/K7|0)|0}function b(l){var u=l&42;if(u!==0)return u;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function D(l,u){var p=l.pendingLanes;if(p===0)return 0;var _=0,M=l.suspendedLanes,A=l.pingedLanes,F=l.warmLanes;l=l.finishedLanes!==0;var $=p&134217727;return $!==0?(p=$&~M,p!==0?_=b(p):(A&=$,A!==0?_=b(A):l||(F=$&~F,F!==0&&(_=b(F))))):($=p&~M,$!==0?_=b($):A!==0?_=b(A):l||(F=p&~F,F!==0&&(_=b(F)))),_===0?0:u!==0&&u!==_&&!(u&M)&&(M=_&-_,F=u&-u,M>=F||M===32&&(F&4194176)!==0)?u:_}function C(l,u){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&u)===0}function I(l,u){switch(l){case 1:case 2:case 4:case 8:return u+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function P(){var l=ug;return ug<<=1,!(ug&4194176)&&(ug=128),l}function O(){var l=hg;return hg<<=1,!(hg&62914560)&&(hg=4194304),l}function w(l){for(var u=[],p=0;31>p;p++)u.push(l);return u}function B(l,u){l.pendingLanes|=u,u!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function j(l,u,p,_,M,A){var F=l.pendingLanes;l.pendingLanes=p,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=p,l.entangledLanes&=p,l.errorRecoveryDisabledLanes&=p,l.shellSuspendCounter=0;var $=l.entanglements,he=l.expirationTimes,Ne=l.hiddenUpdates;for(p=F&~p;0>=F,M-=F,_o=1<<32-fr(u)+M|p<mn?(ji=Pt,Pt=null):ji=Pt.sibling;var gn=mt(ve,Pt,xe[mn],Qe);if(gn===null){Pt===null&&(Pt=ji);break}l&&Pt&&gn.alternate===null&&u(ve,Pt),le=A(gn,le,mn),Zn===null?wt=gn:Zn.sibling=gn,Zn=gn,Pt=ji}if(mn===xe.length)return p(ve,Pt),pn&&ie(ve,mn),wt;if(Pt===null){for(;mnmn?(ji=Pt,Pt=null):ji=Pt.sibling;var bl=mt(ve,Pt,gn.value,Qe);if(bl===null){Pt===null&&(Pt=ji);break}l&&Pt&&bl.alternate===null&&u(ve,Pt),le=A(bl,le,mn),Zn===null?wt=bl:Zn.sibling=bl,Zn=bl,Pt=ji}if(gn.done)return p(ve,Pt),pn&&ie(ve,mn),wt;if(Pt===null){for(;!gn.done;mn++,gn=xe.next())gn=dt(ve,gn.value,Qe),gn!==null&&(le=A(gn,le,mn),Zn===null?wt=gn:Zn.sibling=gn,Zn=gn);return pn&&ie(ve,mn),wt}for(Pt=_(Pt);!gn.done;mn++,gn=xe.next())gn=qt(Pt,ve,mn,gn.value,Qe),gn!==null&&(l&&gn.alternate!==null&&Pt.delete(gn.key===null?mn:gn.key),le=A(gn,le,mn),Zn===null?wt=gn:Zn.sibling=gn,Zn=gn);return l&&Pt.forEach(function(uz){return u(ve,uz)}),pn&&ie(ve,mn),wt}function Yc(ve,le,xe,Qe){if(typeof xe=="object"&&xe!==null&&xe.type===Mh&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case og:e:{for(var wt=xe.key;le!==null;){if(le.key===wt){if(wt=xe.type,wt===Mh){if(le.tag===7){p(ve,le.sibling),Qe=M(le,xe.props.children),Qe.return=ve,ve=Qe;break e}}else if(le.elementType===wt||typeof wt=="object"&&wt!==null&&wt.$$typeof===vl&&li(wt)===le.type){p(ve,le.sibling),Qe=M(le,xe.props),Gt(Qe,xe),Qe.return=ve,ve=Qe;break e}p(ve,le);break}else u(ve,le);le=le.sibling}xe.type===Mh?(Qe=Ic(xe.props.children,ve.mode,Qe,xe.key),Qe.return=ve,ve=Qe):(Qe=sg(xe.type,xe.key,xe.props,null,ve.mode,Qe),Gt(Qe,xe),Qe.return=ve,ve=Qe)}return F(ve);case Eh:e:{for(wt=xe.key;le!==null;){if(le.key===wt)if(le.tag===4&&le.stateNode.containerInfo===xe.containerInfo&&le.stateNode.implementation===xe.implementation){p(ve,le.sibling),Qe=M(le,xe.children||[]),Qe.return=ve,ve=Qe;break e}else{p(ve,le);break}else u(ve,le);le=le.sibling}Qe=lS(xe,ve.mode,Qe),Qe.return=ve,ve=Qe}return F(ve);case vl:return wt=xe._init,xe=wt(xe._payload),Yc(ve,le,xe,Qe)}if(lg(xe))return Vr(ve,le,xe,Qe);if(r(xe)){if(wt=r(xe),typeof wt!="function")throw Error(a(150));return xe=wt.call(xe),bp(ve,le,xe,Qe)}if(typeof xe.then=="function")return Yc(ve,le,yt(xe),Qe);if(xe.$$typeof===gl)return Yc(ve,le,eg(ve,xe),Qe);Vt(ve,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint"?(xe=""+xe,le!==null&&le.tag===6?(p(ve,le.sibling),Qe=M(le,xe),Qe.return=ve,ve=Qe):(p(ve,le),Qe=oS(xe,ve.mode,Qe),Qe.return=ve,ve=Qe),F(ve)):p(ve,le)}return function(ve,le,xe,Qe){try{_p=0;var wt=Yc(ve,le,xe,Qe);return Ph=null,wt}catch(Pt){if(Pt===vp)throw Pt;var Zn=t(29,Pt,null,ve.mode);return Zn.lanes=Qe,Zn.return=ve,Zn}finally{}}}function uo(l,u){l=Eo,S(xg,l),S(zh,u),Eo=l|u.baseLanes}function Is(){S(xg,Eo),S(zh,zh.current)}function Us(){Eo=xg.current,v(zh),v(xg)}function bi(l){var u=l.alternate;S(Hi,Hi.current&1),S(Fr,l),Fs===null&&(u===null||zh.current!==null||u.memoizedState!==null)&&(Fs=l)}function Ps(l){if(l.tag===22){if(S(Hi,Hi.current),S(Fr,l),Fs===null){var u=l.alternate;u!==null&&u.memoizedState!==null&&(Fs=l)}}else fa()}function fa(){S(Hi,Hi.current),S(Fr,Fr.current)}function Xi(l){v(Fr),Fs===l&&(Fs=null),v(Hi)}function Fa(l){for(var u=l;u!==null;){if(u.tag===13){var p=u.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||yS(p)||SS(p)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if(u.flags&128)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function Dn(){throw Error(a(321))}function Lr(l,u){if(u===null)return!1;for(var p=0;pA?A:8);var F=Ft.T,$={};Ft.T=$,wy(l,!1,u,p);try{var he=M(),Ne=Ft.S;if(Ne!==null&&Ne($,he),he!==null&&typeof he=="object"&&typeof he.then=="function"){var et=qe(he,_);ip(l,u,et,ur(l))}else ip(l,u,_,ur(l))}catch(dt){ip(l,u,{then:function(){},status:"rejected",reason:dt},ur())}finally{Va(A),Ft.T=F}}function zA(l){var u=l.memoizedState;if(u!==null)return u;u={memoizedState:bh,baseState:bh,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:X,lastRenderedState:bh},next:null};var p={};return u.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:X,lastRenderedState:p},next:null},l.memoizedState=u,l=l.alternate,l!==null&&(l.memoizedState=u),u}function Ay(){return pa(Pc)}function BA(){return N().memoizedState}function HA(){return N().memoizedState}function h9(l){for(var u=l.return;u!==null;){switch(u.tag){case 24:case 3:var p=ur();l=Ie(p);var _=He(u,l,p);_!==null&&(Ma(_,u,p),ht(_,u,p)),u={cache:Fy()},l.payload=u;return}u=u.return}}function f9(l,u,p){var _=ur();p={lane:_,revertLane:0,action:p,hasEagerState:!1,eagerState:null,next:null},Q0(l)?GA(u,p):(p=be(l,u,p,_),p!==null&&(Ma(p,l,_),VA(p,u,_)))}function FA(l,u,p){var _=ur();ip(l,u,p,_)}function ip(l,u,p,_){var M={lane:_,revertLane:0,action:p,hasEagerState:!1,eagerState:null,next:null};if(Q0(l))GA(u,M);else{var A=l.alternate;if(l.lanes===0&&(A===null||A.lanes===0)&&(A=u.lastRenderedReducer,A!==null))try{var F=u.lastRenderedState,$=A(F,p);if(M.hasEagerState=!0,M.eagerState=$,pr($,F))return G(l,u,M,0),Vn===null&&Te(),!1}catch{}finally{}if(p=be(l,u,M,_),p!==null)return Ma(p,l,_),VA(p,u,_),!0}return!1}function wy(l,u,p,_){if(_={lane:2,revertLane:Le(),action:_,hasEagerState:!1,eagerState:null,next:null},Q0(l)){if(u)throw Error(a(479))}else u=be(l,p,_,2),u!==null&&Ma(u,l,2)}function Q0(l){var u=l.alternate;return l===en||u!==null&&u===en}function GA(l,u){Bh=yg=!0;var p=l.pending;p===null?u.next=u:(u.next=p.next,p.next=u),l.pending=u}function VA(l,u,p){if(p&4194176){var _=u.lanes;_&=l.pendingLanes,p|=_,u.lanes=p,se(l,p)}}function Ry(l,u,p,_){u=l.memoizedState,p=p(_,u),p=p==null?u:uS({},u,p),l.memoizedState=p,l.lanes===0&&(l.updateQueue.baseState=p)}function kA(l,u,p,_,M,A,F){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(_,A,F):u.prototype&&u.prototype.isPureReactComponent?!me(p,_)||!me(M,A):!0}function WA(l,u,p,_){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(p,_),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(p,_),u.state!==l&&IS.enqueueReplaceState(u,u.state,null)}function Cc(l,u){var p=u;if("ref"in u){p={};for(var _ in u)_!=="ref"&&(p[_]=u[_])}if(l=l.defaultProps){p===u&&(p=uS({},p));for(var M in l)p[M]===void 0&&(p[M]=l[M])}return p}function J0(l,u){try{var p=l.onUncaughtError;p(u.value,{componentStack:u.stack})}catch(_){setTimeout(function(){throw _})}}function XA(l,u,p){try{var _=l.onCaughtError;_(p.value,{componentStack:p.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(M){setTimeout(function(){throw M})}}function Cy(l,u,p){return p=Ie(p),p.tag=3,p.payload={element:null},p.callback=function(){J0(l,u)},p}function YA(l){return l=Ie(l),l.tag=3,l}function qA(l,u,p,_){var M=p.type.getDerivedStateFromError;if(typeof M=="function"){var A=_.value;l.payload=function(){return M(A)},l.callback=function(){XA(u,p,_)}}var F=p.stateNode;F!==null&&typeof F.componentDidCatch=="function"&&(l.callback=function(){XA(u,p,_),typeof M!="function"&&(Ml===null?Ml=new Set([this]):Ml.add(this));var $=_.stack;this.componentDidCatch(_.value,{componentStack:$!==null?$:""})})}function d9(l,u,p,_,M){if(p.flags|=32768,_!==null&&typeof _=="object"&&typeof _.then=="function"){if(u=p.alternate,u!==null&&rp(u,p,M,!0),p=Fr.current,p!==null){switch(p.tag){case 13:return Fs===null?iS():p.alternate===null&&mi===0&&(mi=3),p.flags&=-257,p.flags|=65536,p.lanes=M,_===_g?p.flags|=16384:(u=p.updateQueue,u===null?p.updateQueue=new Set([_]):u.add(_),rS(l,_,M)),!1;case 22:return p.flags|=65536,_===_g?p.flags|=16384:(u=p.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([_])},p.updateQueue=u):(p=u.retryQueue,p===null?u.retryQueue=new Set([_]):p.add(_)),rS(l,_,M)),!1}throw Error(a(435,p.tag))}return rS(l,_,M),iS(),!1}if(pn)return u=Fr.current,u!==null?(!(u.flags&65536)&&(u.flags|=256),u.flags|=65536,u.lanes=M,_!==AS&&(l=Error(a(422),{cause:_}),Ke(oe(l,p)))):(_!==AS&&(u=Error(a(423),{cause:_}),Ke(oe(u,p))),l=l.current.alternate,l.flags|=65536,M&=-M,l.lanes|=M,_=oe(_,p),M=Cy(l.stateNode,_,M),Q(l,M),mi!==4&&(mi=2)),!1;var A=Error(a(520),{cause:_});if(A=oe(A,p),Sp===null?Sp=[A]:Sp.push(A),mi!==4&&(mi=2),u===null)return!0;_=oe(_,p),p=u;do{switch(p.tag){case 3:return p.flags|=65536,l=M&-M,p.lanes|=l,l=Cy(p.stateNode,_,l),Q(p,l),!1;case 1:if(u=p.type,A=p.stateNode,(p.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(Ml===null||!Ml.has(A))))return p.flags|=65536,M&=-M,p.lanes|=M,M=YA(M),qA(M,l,p,_),Q(p,M),!1}p=p.return}while(p!==null);return!1}function aa(l,u,p,_){u.child=l===null?CR(u,null,p,_):Bc(u,l.child,p,_)}function jA(l,u,p,_,M){p=p.render;var A=u.ref;if("ref"in _){var F={};for(var $ in _)$!=="ref"&&(F[$]=_[$])}else F=_;return Nc(u),_=zs(l,u,p,F,A,M),$=da(),l!==null&&!Yi?(R(l,u,M),fo(l,u,M)):(pn&&$&&Xe(u),u.flags|=1,aa(l,u,_,M),u.child)}function ZA(l,u,p,_,M){if(l===null){var A=p.type;return typeof A=="function"&&!sS(A)&&A.defaultProps===void 0&&p.compare===null?(u.tag=15,u.type=A,KA(l,u,A,_,M)):(l=sg(p.type,null,_,u,u.mode,M),l.ref=u.ref,l.return=u,u.child=l)}if(A=l.child,!zy(l,M)){var F=A.memoizedProps;if(p=p.compare,p=p!==null?p:me,p(F,_)&&l.ref===u.ref)return fo(l,u,M)}return u.flags|=1,l=ml(A,_),l.ref=u.ref,l.return=u,u.child=l}function KA(l,u,p,_,M){if(l!==null){var A=l.memoizedProps;if(me(A,_)&&l.ref===u.ref)if(Yi=!1,u.pendingProps=_=A,zy(l,M))l.flags&131072&&(Yi=!0);else return u.lanes=l.lanes,fo(l,u,M)}return Ny(l,u,p,_,M)}function QA(l,u,p){var _=u.pendingProps,M=_.children,A=(u.stateNode._pendingVisibility&2)!==0,F=l!==null?l.memoizedState:null;if(ap(l,u),_.mode==="hidden"||A){if(u.flags&128){if(_=F!==null?F.baseLanes|p:p,l!==null){for(M=u.child=l.child,A=0;M!==null;)A=A|M.lanes|M.childLanes,M=M.sibling;u.childLanes=A&~_}else u.childLanes=0,u.child=null;return JA(l,u,_,p)}if(p&536870912)u.memoizedState={baseLanes:0,cachePool:null},l!==null&&tg(u,F!==null?F.cachePool:null),F!==null?uo(u,F):Is(),Ps(u);else return u.lanes=u.childLanes=536870912,JA(l,u,F!==null?F.baseLanes|p:p,p)}else F!==null?(tg(u,F.cachePool),uo(u,F),fa(),u.memoizedState=null):(l!==null&&tg(u,null),Is(),fa());return aa(l,u,M,p),u.child}function JA(l,u,p,_){var M=Gy();return M=M===null?null:{parent:vo?di._currentValue:di._currentValue2,pool:M},u.memoizedState={baseLanes:p,cachePool:M},l!==null&&tg(u,null),Is(),Ps(u),l!==null&&rp(l,u,_,!0),null}function ap(l,u){var p=u.ref;if(p===null)l!==null&&l.ref!==null&&(u.flags|=2097664);else{if(typeof p!="function"&&typeof p!="object")throw Error(a(284));(l===null||l.ref!==p)&&(u.flags|=2097664)}}function Ny(l,u,p,_,M){return Nc(u),p=zs(l,u,p,_,void 0,M),_=da(),l!==null&&!Yi?(R(l,u,M),fo(l,u,M)):(pn&&_&&Xe(u),u.flags|=1,aa(l,u,p,M),u.child)}function $A(l,u,p,_,M,A){return Nc(u),u.updateQueue=null,p=ho(u,_,p,M),Bs(l),_=da(),l!==null&&!Yi?(R(l,u,A),fo(l,u,A)):(pn&&_&&Xe(u),u.flags|=1,aa(l,u,p,A),u.child)}function ew(l,u,p,_,M){if(Nc(u),u.stateNode===null){var A=wh,F=p.contextType;typeof F=="object"&&F!==null&&(A=pa(F)),A=new p(_,A),u.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=IS,u.stateNode=A,A._reactInternals=u,A=u.stateNode,A.props=_,A.state=u.memoizedState,A.refs={},_t(u),F=p.contextType,A.context=typeof F=="object"&&F!==null?pa(F):wh,A.state=u.memoizedState,F=p.getDerivedStateFromProps,typeof F=="function"&&(Ry(u,p,F,_),A.state=u.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(F=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),F!==A.state&&IS.enqueueReplaceState(A,A.state,null),Oe(u,_,A,M),pe(),A.state=u.memoizedState),typeof A.componentDidMount=="function"&&(u.flags|=4194308),_=!0}else if(l===null){A=u.stateNode;var $=u.memoizedProps,he=Cc(p,$);A.props=he;var Ne=A.context,et=p.contextType;F=wh,typeof et=="object"&&et!==null&&(F=pa(et));var dt=p.getDerivedStateFromProps;et=typeof dt=="function"||typeof A.getSnapshotBeforeUpdate=="function",$=u.pendingProps!==$,et||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||($||Ne!==F)&&WA(u,A,_,F),yl=!1;var mt=u.memoizedState;A.state=mt,Oe(u,_,A,M),pe(),Ne=u.memoizedState,$||mt!==Ne||yl?(typeof dt=="function"&&(Ry(u,p,dt,_),Ne=u.memoizedState),(he=yl||kA(u,p,he,_,mt,Ne,F))?(et||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(u.flags|=4194308)):(typeof A.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=_,u.memoizedState=Ne),A.props=_,A.state=Ne,A.context=F,_=he):(typeof A.componentDidMount=="function"&&(u.flags|=4194308),_=!1)}else{A=u.stateNode,pt(l,u),F=u.memoizedProps,et=Cc(p,F),A.props=et,dt=u.pendingProps,mt=A.context,Ne=p.contextType,he=wh,typeof Ne=="object"&&Ne!==null&&(he=pa(Ne)),$=p.getDerivedStateFromProps,(Ne=typeof $=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(F!==dt||mt!==he)&&WA(u,A,_,he),yl=!1,mt=u.memoizedState,A.state=mt,Oe(u,_,A,M),pe();var qt=u.memoizedState;F!==dt||mt!==qt||yl||l!==null&&l.dependencies!==null&&$0(l.dependencies)?(typeof $=="function"&&(Ry(u,p,$,_),qt=u.memoizedState),(et=yl||kA(u,p,et,_,mt,qt,he)||l!==null&&l.dependencies!==null&&$0(l.dependencies))?(Ne||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(_,qt,he),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(_,qt,he)),typeof A.componentDidUpdate=="function"&&(u.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof A.componentDidUpdate!="function"||F===l.memoizedProps&&mt===l.memoizedState||(u.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||F===l.memoizedProps&&mt===l.memoizedState||(u.flags|=1024),u.memoizedProps=_,u.memoizedState=qt),A.props=_,A.state=qt,A.context=he,_=et):(typeof A.componentDidUpdate!="function"||F===l.memoizedProps&&mt===l.memoizedState||(u.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||F===l.memoizedProps&&mt===l.memoizedState||(u.flags|=1024),_=!1)}return A=_,ap(l,u),_=(u.flags&128)!==0,A||_?(A=u.stateNode,p=_&&typeof p.getDerivedStateFromError!="function"?null:A.render(),u.flags|=1,l!==null&&_?(u.child=Bc(u,l.child,null,M),u.child=Bc(u,null,p,M)):aa(l,u,p,M),u.memoizedState=A.state,l=u.child):l=fo(l,u,M),l}function tw(l,u,p,_){return ot(),u.flags|=256,aa(l,u,p,_),u.child}function Dy(l){return{baseLanes:l,cachePool:ow()}}function Oy(l,u,p){return l=l!==null?l.childLanes&~p:0,u&&(l|=Gr),l}function nw(l,u,p){var _=u.pendingProps,M=!1,A=(u.flags&128)!==0,F;if((F=A)||(F=l!==null&&l.memoizedState===null?!1:(Hi.current&2)!==0),F&&(M=!0,u.flags&=-129),F=(u.flags&32)!==0,u.flags&=-33,l===null){if(pn){if(M?bi(u):fa(),pn){var $=va,he;(he=$)&&($=N7($,Hs),$!==null?(u.memoizedState={dehydrated:$,treeContext:zc!==null?{id:_o,overflow:xo}:null,retryLane:536870912},he=t(18,null,null,0),he.stateNode=$,he.return=u,u.child=he,ba=u,va=null,he=!0):he=!1),he||Ze(u)}if($=u.memoizedState,$!==null&&($=$.dehydrated,$!==null))return SS($)?u.lanes=16:u.lanes=536870912,null;Xi(u)}return $=_.children,_=_.fallback,M?(fa(),M=u.mode,$=Iy({mode:"hidden",children:$},M),_=Ic(_,M,p,null),$.return=u,_.return=u,$.sibling=_,u.child=$,M=u.child,M.memoizedState=Dy(p),M.childLanes=Oy(l,F,p),u.memoizedState=US,_):(bi(u),Ly(u,$))}if(he=l.memoizedState,he!==null&&($=he.dehydrated,$!==null)){if(A)u.flags&256?(bi(u),u.flags&=-257,u=Uy(l,u,p)):u.memoizedState!==null?(fa(),u.child=l.child,u.flags|=128,u=null):(fa(),M=_.fallback,$=u.mode,_=Iy({mode:"visible",children:_.children},$),M=Ic(M,$,p,null),M.flags|=2,_.return=u,M.return=u,_.sibling=M,u.child=_,Bc(u,l.child,null,p),_=u.child,_.memoizedState=Dy(p),_.childLanes=Oy(l,F,p),u.memoizedState=US,u=M);else if(bi(u),SS($))F=T7($).digest,_=Error(a(419)),_.stack="",_.digest=F,Ke({value:_,source:null,stack:null}),u=Uy(l,u,p);else if(Yi||rp(l,u,p,!1),F=(p&l.childLanes)!==0,Yi||F){if(F=Vn,F!==null){if(_=p&-p,_&42)_=1;else switch(_){case 2:_=1;break;case 8:_=4;break;case 32:_=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:_=64;break;case 268435456:_=134217728;break;default:_=0}if(_=_&(F.suspendedLanes|p)?0:_,_!==0&&_!==he.retryLane)throw he.retryLane=_,De(l,_),Ma(F,l,_),DR}yS($)||iS(),u=Uy(l,u,p)}else yS($)?(u.flags|=128,u.child=l.child,u=b9.bind(null,l),E7($,u),u=null):(l=he.treeContext,Ur&&(va=w7($),ba=u,pn=!0,fs=null,Hs=!1,l!==null&&(zr[Br++]=_o,zr[Br++]=xo,zr[Br++]=zc,_o=l.id,xo=l.overflow,zc=u)),u=Ly(u,_.children),u.flags|=4096);return u}return M?(fa(),M=_.fallback,$=u.mode,he=l.child,A=he.sibling,_=ml(he,{mode:"hidden",children:_.children}),_.subtreeFlags=he.subtreeFlags&31457280,A!==null?M=ml(A,M):(M=Ic(M,$,p,null),M.flags|=2),M.return=u,_.return=u,_.sibling=M,u.child=_,_=M,M=u.child,$=l.child.memoizedState,$===null?$=Dy(p):(he=$.cachePool,he!==null?(A=vo?di._currentValue:di._currentValue2,he=he.parent!==A?{parent:A,pool:A}:he):he=ow(),$={baseLanes:$.baseLanes|p,cachePool:he}),M.memoizedState=$,M.childLanes=Oy(l,F,p),u.memoizedState=US,_):(bi(u),p=l.child,l=p.sibling,p=ml(p,{mode:"visible",children:_.children}),p.return=u,p.sibling=null,l!==null&&(F=u.deletions,F===null?(u.deletions=[l],u.flags|=16):F.push(l)),u.child=p,u.memoizedState=null,p)}function Ly(l,u){return u=Iy({mode:"visible",children:u},l.mode),u.return=l,l.child=u}function Iy(l,u){return Yw(l,u,0,null)}function Uy(l,u,p){return Bc(u,l.child,null,p),l=Ly(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function iw(l,u,p){l.lanes|=u;var _=l.alternate;_!==null&&(_.lanes|=u),By(l.return,u,p)}function Py(l,u,p,_,M){var A=l.memoizedState;A===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:_,tail:p,tailMode:M}:(A.isBackwards=u,A.rendering=null,A.renderingStartTime=0,A.last=_,A.tail=p,A.tailMode=M)}function aw(l,u,p){var _=u.pendingProps,M=_.revealOrder,A=_.tail;if(aa(l,u,_.children,p),_=Hi.current,_&2)_=_&1|2,u.flags|=128;else{if(l!==null&&l.flags&128)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&iw(l,p,u);else if(l.tag===19)iw(l,p,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}_&=1}switch(S(Hi,_),M){case"forwards":for(p=u.child,M=null;p!==null;)l=p.alternate,l!==null&&Fa(l)===null&&(M=p),p=p.sibling;p=M,p===null?(M=u.child,u.child=null):(M=p.sibling,p.sibling=null),Py(u,!1,M,p,A);break;case"backwards":for(p=null,M=u.child,u.child=null;M!==null;){if(l=M.alternate,l!==null&&Fa(l)===null){u.child=M;break}l=M.sibling,M.sibling=p,p=M,M=l}Py(u,!0,p,null,A);break;case"together":Py(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function fo(l,u,p){if(l!==null&&(u.dependencies=l.dependencies),El|=u.lanes,!(p&u.childLanes))if(l!==null){if(rp(l,u,p,!1),(p&u.childLanes)===0)return null}else return null;if(l!==null&&u.child!==l.child)throw Error(a(153));if(u.child!==null){for(l=u.child,p=ml(l,l.pendingProps),u.child=p,p.return=u;l.sibling!==null;)l=l.sibling,p=p.sibling=ml(l,l.pendingProps),p.return=u;p.sibling=null}return u.child}function zy(l,u){return l.lanes&u?!0:(l=l.dependencies,!!(l!==null&&$0(l)))}function p9(l,u,p){switch(u.tag){case 3:tt(u,u.stateNode.containerInfo),hl(u,di,l.memoizedState.cache),ot();break;case 27:case 5:ge(u);break;case 4:tt(u,u.stateNode.containerInfo);break;case 10:hl(u,u.type,u.memoizedProps.value);break;case 13:var _=u.memoizedState;if(_!==null)return _.dehydrated!==null?(bi(u),u.flags|=128,null):p&u.child.childLanes?nw(l,u,p):(bi(u),l=fo(l,u,p),l!==null?l.sibling:null);bi(u);break;case 19:var M=(l.flags&128)!==0;if(_=(p&u.childLanes)!==0,_||(rp(l,u,p,!1),_=(p&u.childLanes)!==0),M){if(_)return aw(l,u,p);u.flags|=128}if(M=u.memoizedState,M!==null&&(M.rendering=null,M.tail=null,M.lastEffect=null),S(Hi,Hi.current),_)break;return null;case 22:case 23:return u.lanes=0,QA(l,u,p);case 24:hl(u,di,l.memoizedState.cache)}return fo(l,u,p)}function rw(l,u,p){if(l!==null)if(l.memoizedProps!==u.pendingProps)Yi=!0;else{if(!zy(l,p)&&!(u.flags&128))return Yi=!1,p9(l,u,p);Yi=!!(l.flags&131072)}else Yi=!1,pn&&u.flags&1048576&&Ce(u,pg,u.index);switch(u.lanes=0,u.tag){case 16:e:{l=u.pendingProps;var _=u.elementType,M=_._init;if(_=M(_._payload),u.type=_,typeof _=="function")sS(_)?(l=Cc(_,l),u.tag=1,u=ew(null,u,_,l,p)):(u.tag=0,u=Ny(null,u,_,l,p));else{if(_!=null){if(M=_.$$typeof,M===fS){u.tag=11,u=jA(null,u,_,l,p);break e}else if(M===mS){u.tag=14,u=ZA(null,u,_,l,p);break e}}throw u=s(_)||_,Error(a(306,u,""))}}return u;case 0:return Ny(l,u,u.type,u.pendingProps,p);case 1:return _=u.type,M=Cc(_,u.pendingProps),ew(l,u,_,M,p);case 3:e:{if(tt(u,u.stateNode.containerInfo),l===null)throw Error(a(387));var A=u.pendingProps;M=u.memoizedState,_=M.element,pt(l,u),Oe(u,A,null,p);var F=u.memoizedState;if(A=F.cache,hl(u,di,A),A!==M.cache&&Hy(u,[di],p,!0),pe(),A=F.element,Ur&&M.isDehydrated)if(M={element:A,isDehydrated:!1,cache:F.cache},u.updateQueue.baseState=M,u.memoizedState=M,u.flags&256){u=tw(l,u,A,p);break e}else if(A!==_){_=oe(Error(a(424)),u),Ke(_),u=tw(l,u,A,p);break e}else for(Ur&&(va=A7(u.stateNode.containerInfo),ba=u,pn=!0,fs=null,Hs=!0),p=CR(u,null,A,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(ot(),A===_){u=fo(l,u,p);break e}aa(l,u,A,p)}u=u.child}return u;case 26:if(Pr)return ap(l,u),l===null?(p=xR(u.type,null,u.pendingProps,null))?u.memoizedState=p:pn||(u.stateNode=V7(u.type,u.pendingProps,xl.current,u)):u.memoizedState=xR(u.type,l.memoizedProps,u.pendingProps,l.memoizedState),null;case 27:if(ga)return ge(u),l===null&&ga&&pn&&(_=u.stateNode=bR(u.type,u.pendingProps,xl.current,ra.current,!1),ba=u,Hs=!0,va=gR(_)),_=u.pendingProps.children,l!==null||pn?aa(l,u,_,p):u.child=Bc(u,null,_,p),ap(l,u),u.child;case 5:return l===null&&pn&&(H7(u.type,u.pendingProps,ra.current),(M=_=va)&&(_=R7(_,u.type,u.pendingProps,Hs),_!==null?(u.stateNode=_,ba=u,va=gR(_),Hs=!1,M=!0):M=!1),M||Ze(u)),ge(u),M=u.type,A=u.pendingProps,F=l!==null?l.memoizedProps:null,_=A.children,cg(M,A)?_=null:F!==null&&cg(M,F)&&(u.flags|=32),u.memoizedState!==null&&(M=zs(l,u,sr,null,null,p),vo?Pc._currentValue=M:Pc._currentValue2=M),ap(l,u),aa(l,u,_,p),u.child;case 6:return l===null&&pn&&(F7(u.pendingProps,ra.current),(l=p=va)&&(p=C7(p,u.pendingProps,Hs),p!==null?(u.stateNode=p,ba=u,va=null,l=!0):l=!1),l||Ze(u)),null;case 13:return nw(l,u,p);case 4:return tt(u,u.stateNode.containerInfo),_=u.pendingProps,l===null?u.child=Bc(u,null,_,p):aa(l,u,_,p),u.child;case 11:return jA(l,u,u.type,u.pendingProps,p);case 7:return aa(l,u,u.pendingProps,p),u.child;case 8:return aa(l,u,u.pendingProps.children,p),u.child;case 12:return aa(l,u,u.pendingProps.children,p),u.child;case 10:return _=u.pendingProps,hl(u,u.type,_.value),aa(l,u,_.children,p),u.child;case 9:return M=u.type._context,_=u.pendingProps.children,Nc(u),M=pa(M),_=_(M),u.flags|=1,aa(l,u,_,p),u.child;case 14:return ZA(l,u,u.type,u.pendingProps,p);case 15:return KA(l,u,u.type,u.pendingProps,p);case 19:return aw(l,u,p);case 22:return QA(l,u,p);case 24:return Nc(u),_=pa(di),l===null?(M=Gy(),M===null&&(M=Vn,A=Fy(),M.pooledCache=A,A.refCount++,A!==null&&(M.pooledCacheLanes|=p),M=A),u.memoizedState={parent:_,cache:M},_t(u),hl(u,di,M)):(l.lanes&p&&(pt(l,u),Oe(u,null,null,p),pe()),M=l.memoizedState,A=u.memoizedState,M.parent!==_?(M={parent:_,cache:_},u.memoizedState=M,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=M),hl(u,di,_)):(_=A.cache,hl(u,di,_),_!==M.cache&&Hy(u,[di],p,!0))),aa(l,u,u.pendingProps.children,p),u.child;case 29:throw u.pendingProps}throw Error(a(156,u.tag))}function hl(l,u,p){vo?(S(Tg,u._currentValue),u._currentValue=p):(S(Tg,u._currentValue2),u._currentValue2=p)}function po(l){var u=Tg.current;vo?l._currentValue=u:l._currentValue2=u,v(Tg)}function By(l,u,p){for(;l!==null;){var _=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,_!==null&&(_.childLanes|=u)):_!==null&&(_.childLanes&u)!==u&&(_.childLanes|=u),l===p)break;l=l.return}}function Hy(l,u,p,_){var M=l.child;for(M!==null&&(M.return=l);M!==null;){var A=M.dependencies;if(A!==null){var F=M.child;A=A.firstContext;e:for(;A!==null;){var $=A;A=M;for(var he=0;heTp&&(u.flags|=128,_=!0,op(M,!1),u.lanes=4194304)}else{if(!_)if(l=Fa(A),l!==null){if(u.flags|=128,_=!0,l=l.updateQueue,u.updateQueue=l,ng(u,l),op(M,!0),M.tail===null&&M.tailMode==="hidden"&&!A.alternate&&!pn)return ui(u),null}else 2*hs()-M.renderingStartTime>Tp&&p!==536870912&&(u.flags|=128,_=!0,op(M,!1),u.lanes=4194304);M.isBackwards?(A.sibling=u.child,u.child=A):(l=M.last,l!==null?l.sibling=A:u.child=A,M.last=A)}return M.tail!==null?(u=M.tail,M.rendering=u,M.tail=u.sibling,M.renderingStartTime=hs(),u.sibling=null,l=Hi.current,S(Hi,_?l&1|2:l&1),u):(ui(u),null);case 22:case 23:return Xi(u),Us(),_=u.memoizedState!==null,l!==null?l.memoizedState!==null!==_&&(u.flags|=8192):_&&(u.flags|=8192),_?p&536870912&&!(u.flags&128)&&(ui(u),u.subtreeFlags&6&&(u.flags|=8192)):ui(u),p=u.updateQueue,p!==null&&ng(u,p.retryQueue),p=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),_=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(_=u.memoizedState.cachePool.pool),_!==p&&(u.flags|=2048),l!==null&&v(kc),null;case 24:return p=null,l!==null&&(p=l.memoizedState.cache),u.memoizedState.cache!==p&&(u.flags|=2048),po(di),ui(u),null;case 25:return null}throw Error(a(156,u.tag))}function g9(l,u){switch(nt(u),u.tag){case 1:return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return po(di),gt(),l=u.flags,l&65536&&!(l&128)?(u.flags=l&-65537|128,u):null;case 26:case 27:case 5:return Ae(u),null;case 13:if(Xi(u),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(a(340));ot()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return v(Hi),null;case 4:return gt(),null;case 10:return po(u.type),null;case 22:case 23:return Xi(u),Us(),l!==null&&v(kc),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 24:return po(di),null;case 25:return null;default:return null}}function fw(l,u){switch(nt(u),u.tag){case 3:po(di),gt();break;case 26:case 27:case 5:Ae(u);break;case 4:gt();break;case 13:Xi(u);break;case 19:v(Hi);break;case 10:po(u.type);break;case 22:case 23:Xi(u),Us(),l!==null&&v(kc);break;case 24:po(di)}}function lp(l,u){try{var p=u.updateQueue,_=p!==null?p.lastEffect:null;if(_!==null){var M=_.next;p=M;do{if((p.tag&l)===l){_=void 0;var A=p.create,F=p.inst;_=A(),F.destroy=_}p=p.next}while(p!==M)}}catch($){bn(u,u.return,$)}}function fl(l,u,p){try{var _=u.updateQueue,M=_!==null?_.lastEffect:null;if(M!==null){var A=M.next;_=A;do{if((_.tag&l)===l){var F=_.inst,$=F.destroy;if($!==void 0){F.destroy=void 0,M=u;var he=p;try{$()}catch(Ne){bn(M,he,Ne)}}}_=_.next}while(_!==A)}}catch(Ne){bn(u,u.return,Ne)}}function dw(l){var u=l.updateQueue;if(u!==null){var p=l.stateNode;try{Ve(u,p)}catch(_){bn(l,l.return,_)}}}function pw(l,u,p){p.props=Cc(l.type,l.memoizedProps),p.state=l.memoizedState;try{p.componentWillUnmount()}catch(_){bn(l,u,_)}}function Dc(l,u){try{var p=l.ref;if(p!==null){var _=l.stateNode;switch(l.tag){case 26:case 27:case 5:var M=hp(_);break;default:M=_}typeof p=="function"?l.refCleanup=p(M):p.current=M}}catch(A){bn(l,u,A)}}function lr(l,u){var p=l.ref,_=l.refCleanup;if(p!==null)if(typeof _=="function")try{_()}catch(M){bn(l,u,M)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(M){bn(l,u,M)}else p.current=null}function mw(l){var u=l.type,p=l.memoizedProps,_=l.stateNode;try{c7(_,u,p,l)}catch(M){bn(l,l.return,M)}}function gw(l,u,p){try{u7(l.stateNode,l.type,p,u,l)}catch(_){bn(l,l.return,_)}}function vw(l){return l.tag===5||l.tag===3||(Pr?l.tag===26:!1)||(ga?l.tag===27:!1)||l.tag===4}function Xy(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||vw(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&(!ga||l.tag!==27)&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Yy(l,u,p){var _=l.tag;if(_===5||_===6)l=l.stateNode,u?f7(p,l,u):o7(p,l);else if(!(_===4||ga&&_===27)&&(l=l.child,l!==null))for(Yy(l,u,p),l=l.sibling;l!==null;)Yy(l,u,p),l=l.sibling}function ig(l,u,p){var _=l.tag;if(_===5||_===6)l=l.stateNode,u?h7(p,l,u):s7(p,l);else if(!(_===4||ga&&_===27)&&(l=l.child,l!==null))for(ig(l,u,p),l=l.sibling;l!==null;)ig(l,u,p),l=l.sibling}function _w(l,u,p){l=l.containerInfo;try{fR(l,p)}catch(_){bn(u,u.return,_)}}function v9(l,u){for(H9(l.containerInfo),qi=u;qi!==null;)if(l=qi,u=l.child,(l.subtreeFlags&1028)!==0&&u!==null)u.return=l,qi=u;else for(;qi!==null;){l=qi;var p=l.alternate;switch(u=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if(u&1024&&p!==null){u=void 0;var _=l,M=p.memoizedProps;p=p.memoizedState;var A=_.stateNode;try{var F=Cc(_.type,M,_.elementType===_.type);u=A.getSnapshotBeforeUpdate(F,p),A.__reactInternalSnapshotBeforeUpdate=u}catch($){bn(_,_.return,$)}}break;case 3:u&1024&&ma&&x7(l.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(u&1024)throw Error(a(163))}if(u=l.sibling,u!==null){u.return=l.return,qi=u;break}qi=l.return}return F=IR,IR=!1,F}function xw(l,u,p){var _=p.flags;switch(p.tag){case 0:case 11:case 15:mo(l,p),_&4&&lp(5,p);break;case 1:if(mo(l,p),_&4)if(l=p.stateNode,u===null)try{l.componentDidMount()}catch($){bn(p,p.return,$)}else{var M=Cc(p.type,u.memoizedProps);u=u.memoizedState;try{l.componentDidUpdate(M,u,l.__reactInternalSnapshotBeforeUpdate)}catch($){bn(p,p.return,$)}}_&64&&dw(p),_&512&&Dc(p,p.return);break;case 3:if(mo(l,p),_&64&&(_=p.updateQueue,_!==null)){if(l=null,p.child!==null)switch(p.child.tag){case 27:case 5:l=hp(p.child.stateNode);break;case 1:l=p.child.stateNode}try{Ve(_,l)}catch($){bn(p,p.return,$)}}break;case 26:if(Pr){mo(l,p),_&512&&Dc(p,p.return);break}case 27:case 5:mo(l,p),u===null&&_&4&&mw(p),_&512&&Dc(p,p.return);break;case 12:mo(l,p);break;case 13:mo(l,p),_&4&&Sw(l,p);break;case 22:if(M=p.memoizedState!==null||So,!M){u=u!==null&&u.memoizedState!==null||pi;var A=So,F=pi;So=M,(pi=u)&&!F?dl(l,p,(p.subtreeFlags&8772)!==0):mo(l,p),So=A,pi=F}_&512&&(p.memoizedProps.mode==="manual"?Dc(p,p.return):lr(p,p.return));break;default:mo(l,p)}}function yw(l){var u=l.alternate;u!==null&&(l.alternate=null,yw(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&q9(u)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function us(l,u,p){for(p=p.child;p!==null;)qy(l,u,p),p=p.sibling}function qy(l,u,p){if(dr&&typeof dr.onCommitFiberUnmount=="function")try{dr.onCommitFiberUnmount(pp,p)}catch{}switch(p.tag){case 26:if(Pr){pi||lr(p,u),us(l,u,p),p.memoizedState?SR(p.memoizedState):p.stateNode&&ER(p.stateNode);break}case 27:if(ga){pi||lr(p,u);var _=Ri,M=mr;Ri=p.stateNode,us(l,u,p),j7(p.stateNode),Ri=_,mr=M;break}case 5:pi||lr(p,u);case 6:if(ma){if(_=Ri,M=mr,Ri=null,us(l,u,p),Ri=_,mr=M,Ri!==null)if(mr)try{p7(Ri,p.stateNode)}catch(A){bn(p,u,A)}else try{d7(Ri,p.stateNode)}catch(A){bn(p,u,A)}}else us(l,u,p);break;case 18:ma&&Ri!==null&&(mr?B7(Ri,p.stateNode):z7(Ri,p.stateNode));break;case 4:ma?(_=Ri,M=mr,Ri=p.stateNode.containerInfo,mr=!0,us(l,u,p),Ri=_,mr=M):(_l&&_w(p.stateNode,p,uR()),us(l,u,p));break;case 0:case 11:case 14:case 15:pi||fl(2,p,u),pi||fl(4,p,u),us(l,u,p);break;case 1:pi||(lr(p,u),_=p.stateNode,typeof _.componentWillUnmount=="function"&&pw(p,u,_)),us(l,u,p);break;case 21:us(l,u,p);break;case 22:pi||lr(p,u),pi=(_=pi)||p.memoizedState!==null,us(l,u,p),pi=_;break;default:us(l,u,p)}}function Sw(l,u){if(Ur&&u.memoizedState===null&&(l=u.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{P7(l)}catch(p){bn(u,u.return,p)}}function _9(l){switch(l.tag){case 13:case 19:var u=l.stateNode;return u===null&&(u=l.stateNode=new LR),u;case 22:return l=l.stateNode,u=l._retryCache,u===null&&(u=l._retryCache=new LR),u;default:throw Error(a(435,l.tag))}}function jy(l,u){var p=_9(l);u.forEach(function(_){var M=A9.bind(null,l,_);p.has(_)||(p.add(_),_.then(M,M))})}function Ga(l,u){var p=u.deletions;if(p!==null)for(var _=0;_";case Mg:return":has("+($y(l)||"")+")";case bg:return'[role="'+l.value+'"]';case wg:return'"'+l.value+'"';case Ag:return'[data-testname="'+l.value+'"]';default:throw Error(a(365))}}function Cw(l,u){var p=[];l=[l,0];for(var _=0;_p?32:p;p=Ft.T;var M=Uc();try{if(Va(_),Ft.T=null,Xc===null)var A=!1;else{_=VS,VS=null;var F=Xc,$=Ep;if(Xc=null,Ep=0,In&6)throw Error(a(331));var he=In;if(In|=4,ww(F.current),Mw(F,F.current,$,_),In=he,Je(0,!1),dr&&typeof dr.onPostCommitFiberRoot=="function")try{dr.onPostCommitFiberRoot(pp,F)}catch{}A=!0}return A}finally{Va(M),Ft.T=p,Vw(l,u)}}return!1}function kw(l,u,p){u=oe(p,u),u=Cy(l.stateNode,u,2),l=He(l,u,2),l!==null&&(B(l,2),$e(l))}function bn(l,u,p){if(l.tag===3)kw(l,l,p);else for(;u!==null;){if(u.tag===3){kw(u,l,p);break}else if(u.tag===1){var _=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof _.componentDidCatch=="function"&&(Ml===null||!Ml.has(_))){l=oe(p,l),p=YA(2),_=He(u,p,2),_!==null&&(qA(p,_,u,l),B(_,2),$e(_));break}}u=u.return}}function rS(l,u,p){var _=l.pingCache;if(_===null){_=l.pingCache=new cz;var M=new Set;_.set(u,M)}else M=_.get(u),M===void 0&&(M=new Set,_.set(u,M));M.has(p)||(zS=!0,M.add(p),l=M9.bind(null,l,u,p),u.then(l,l))}function M9(l,u,p){var _=l.pingCache;_!==null&&_.delete(u),l.pingedLanes|=l.suspendedLanes&p,l.warmLanes&=~p,Vn===l&&(hn&p)===p&&(mi===4||mi===3&&(hn&62914560)===hn&&300>hs()-FS?!(In&2)&&Sh(l,0):BS|=p,Vh===hn&&(Vh=0)),$e(l)}function Ww(l,u){u===0&&(u=O()),l=De(l,u),l!==null&&(B(l,u),$e(l))}function b9(l){var u=l.memoizedState,p=0;u!==null&&(p=u.retryLane),Ww(l,p)}function A9(l,u){var p=0;switch(l.tag){case 13:var _=l.stateNode,M=l.memoizedState;M!==null&&(p=M.retryLane);break;case 19:_=l.stateNode;break;case 22:_=l.stateNode._retryCache;break;default:throw Error(a(314))}_!==null&&_.delete(u),Ww(l,p)}function w9(l,u){return fg(l,u)}function R9(l,u,p,_){this.tag=l,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sS(l){return l=l.prototype,!(!l||!l.isReactComponent)}function ml(l,u){var p=l.alternate;return p===null?(p=t(l.tag,u,l.key,l.mode),p.elementType=l.elementType,p.type=l.type,p.stateNode=l.stateNode,p.alternate=l,l.alternate=p):(p.pendingProps=u,p.type=l.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=l.flags&31457280,p.childLanes=l.childLanes,p.lanes=l.lanes,p.child=l.child,p.memoizedProps=l.memoizedProps,p.memoizedState=l.memoizedState,p.updateQueue=l.updateQueue,u=l.dependencies,p.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},p.sibling=l.sibling,p.index=l.index,p.ref=l.ref,p.refCleanup=l.refCleanup,p}function Xw(l,u){l.flags&=31457282;var p=l.alternate;return p===null?(l.childLanes=0,l.lanes=u,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=p.childLanes,l.lanes=p.lanes,l.child=p.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=p.memoizedProps,l.memoizedState=p.memoizedState,l.updateQueue=p.updateQueue,l.type=p.type,u=p.dependencies,l.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),l}function sg(l,u,p,_,M,A){var F=0;if(_=l,typeof l=="function")sS(l)&&(F=1);else if(typeof l=="string")F=Pr&&ga?_R(l,p,ra.current)?26:AR(l)?27:5:Pr?_R(l,p,ra.current)?26:5:ga&&AR(l)?27:5;else e:switch(l){case Mh:return Ic(p.children,M,A,u);case Jw:F=8,M|=24;break;case hS:return l=t(12,p,u,M|2),l.elementType=hS,l.lanes=A,l;case dS:return l=t(13,p,u,M),l.elementType=dS,l.lanes=A,l;case pS:return l=t(19,p,u,M),l.elementType=pS,l.lanes=A,l;case eR:return Yw(p,M,A,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case O9:case gl:F=10;break e;case $w:F=9;break e;case fS:F=11;break e;case mS:F=14;break e;case vl:F=16,_=null;break e}F=29,p=Error(a(130,l===null?"null":typeof l,"")),_=null}return u=t(F,p,u,M),u.elementType=l,u.type=_,u.lanes=A,u}function Ic(l,u,p,_){return l=t(7,l,_,u),l.lanes=p,l}function Yw(l,u,p,_){l=t(22,l,_,u),l.elementType=eR,l.lanes=p;var M={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var A=M._current;if(A===null)throw Error(a(456));if(!(M._pendingVisibility&2)){var F=De(A,2);F!==null&&(M._pendingVisibility|=2,Ma(F,A,2))}},attach:function(){var A=M._current;if(A===null)throw Error(a(456));if(M._pendingVisibility&2){var F=De(A,2);F!==null&&(M._pendingVisibility&=-3,Ma(F,A,2))}}};return l.stateNode=M,l}function oS(l,u,p){return l=t(6,l,null,u),l.lanes=p,l}function lS(l,u,p){return u=t(4,l.children!==null?l.children:[],l.key,u),u.lanes=p,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function C9(l,u,p,_,M,A,F,$){this.tag=1,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=xS,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=w(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=w(0),this.hiddenUpdates=w(null),this.identifierPrefix=_,this.onUncaughtError=M,this.onCaughtError=A,this.onRecoverableError=F,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function qw(l,u,p,_,M,A,F,$,he,Ne,et,dt){return l=new C9(l,u,p,F,$,he,Ne,dt),u=1,A===!0&&(u|=24),A=t(3,null,null,u),l.current=A,A.stateNode=l,u=Fy(),u.refCount++,l.pooledCache=u,u.refCount++,A.memoizedState={element:_,isDehydrated:p,cache:u},_t(A),l}function jw(l){return l?(l=wh,l):wh}function Zw(l){var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(a(188)):(l=Object.keys(l).join(","),Error(a(268,l)));return l=g(u),l=l!==null?x(l):null,l===null?null:hp(l.stateNode)}function Kw(l,u,p,_,M,A){M=jw(M),_.context===null?_.context=M:_.pendingContext=M,_=Ie(u),_.payload={element:p},A=A===void 0?null:A,A!==null&&(_.callback=A),p=He(l,_,u),p!==null&&(Ma(p,l,u),ht(p,l,u))}function Qw(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var p=l.retryLane;l.retryLane=p!==0&&p=Ne&&A>=dt&&M<=et&&F<=mt){l.splice(u,1);break}else if(_!==Ne||p.width!==he.width||mtF){if(!(A!==dt||p.height!==he.height||et<_||Ne>M)){Ne>_&&(he.width+=Ne-_,he.x=_),etA&&(he.height+=dt-A,he.y=A),mtp&&(p=$)),$ ")+` No matching component was found for: - `)+l.join(" > ")}return null},tn.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 27:case 5:return cp(l.child.stateNode);default:return l.child.stateNode}},tn.injectIntoDevTools=function(){var l={bundleType:0,version:I9,rendererPackageName:U9,currentDispatcherRef:Ft,findFiberByHostInstance:iw,reconcilerVersion:"19.0.0"};if(ew!==null&&(l.rendererConfig=ew),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)l=!0;else{try{fp=u.inject(l),fr=u}catch{}l=!!u.checkDCE}}return l},tn.isAlreadyRendering=function(){return!1},tn.observeVisibleRects=function(l,u,p,_){if(!up)throw Error(a(363));l=Qy(l,u);var M=a7(l,p,_).disconnect;return{disconnect:function(){M()}}},tn.shouldError=function(){return null},tn.shouldSuspend=function(){return!1},tn.startHostTransition=function(l,u,p,_){if(l.tag!==5)throw Error(a(476));var M=IA(l).queue;LA(l,M,u,Eh,p===null?i:function(){var A=IA(l).next.queue;return tp(l,A,{},cr()),p(_)})},tn.updateContainer=function(l,u,p,_){var M=u.current,A=cr();return qR(M,A,l,u,p,_),A},tn.updateContainerSync=function(l,u,p,_){return u.tag===0&&Dc(),qR(u.current,2,l,u,p,_),2},tn},n.exports.default=n.exports,Object.defineProperty(n.exports,"__esModule",{value:!0})})(Y6);var Yj=Y6.exports;X6.exports=Yj;var qj=X6.exports;const jj=r1(qj);function Qb(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const a=Qb(i,e,t);if(a)return a;i=e?null:i.sibling}}function Z6(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const Jb=Z6(be.createContext(null));let K6=class extends be.Component{render(){return be.createElement(Jb.Provider,{value:this._reactInternals},this.props.children)}};function Q6(){const n=be.useContext(Jb);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=be.useId();return be.useMemo(()=>{for(const t of[n,n==null?void 0:n.alternate]){if(!t)continue;const i=Qb(t,!1,a=>{let r=a.memoizedState;for(;r;){if(r.memoizedState===e)return!0;r=r.next}});if(i)return i}},[n,e])}const Zj=Symbol.for("react.context"),Kj=n=>n!==null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===Zj;function Qj(){const n=Q6(),[e]=be.useState(()=>new Map);e.clear();let t=n;for(;t;){const i=t.type;Kj(i)&&i!==Jb&&!e.has(i)&&e.set(i,be.use(Z6(i))),t=t.return}return e}function Jj(){const n=Qj();return be.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>be.createElement(e,null,be.createElement(t.Provider,{...i,value:n.get(t)})),e=>be.createElement(K6,{...e})),[n])}function J6(n){let e=n.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const $6=n=>n&&n.isOrthographicCamera,$j=n=>n&&n.hasOwnProperty("current"),eZ=n=>n!=null&&(typeof n=="string"||typeof n=="number"||n.isColor),G0=((n,e)=>typeof window<"u"&&(((n=window.document)==null?void 0:n.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?be.useLayoutEffect:be.useEffect;function e8(n){const e=be.useRef(n);return G0(()=>void(e.current=n),[n]),e}function tZ(){const n=Q6(),e=Jj();return be.useMemo(()=>({children:t})=>{const a=!!Qb(n,!0,r=>r.type===be.StrictMode)?be.StrictMode:be.Fragment;return Nt.jsx(a,{children:Nt.jsx(e,{children:t})})},[n,e])}function nZ({set:n}){return G0(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}const iZ=(n=>(n=class extends be.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}},n.getDerivedStateFromError=()=>({error:!0}),n))();function t8(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}function hf(n){var e;return(e=n.__r3f)==null?void 0:e.root.getState()}const ai={obj:n=>n===Object(n)&&!ai.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,nul:n=>n===null,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:a=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(ai.str(n)||ai.num(n)||ai.boo(n))return n===e;const r=ai.obj(n);if(r&&i==="reference")return n===e;const s=ai.arr(n);if(s&&t==="reference")return n===e;if((s||r)&&n===e)return!0;let o;for(o in n)if(!(o in e))return!1;if(r&&t==="shallow"&&i==="shallow"){for(o in a?e:n)if(!ai.equ(n[o],e[o],{strict:a,objects:"reference"}))return!1}else for(o in a?e:n)if(n[o]!==e[o])return!1;if(ai.und(o)){if(s&&n.length===0&&e.length===0||r&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function aZ(n){const e={nodes:{},materials:{},meshes:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material),t.isMesh&&!e.meshes[t.name]&&(e.meshes[t.name]=t)}),e}function rZ(n){n.type!=="Scene"&&(n.dispose==null||n.dispose());for(const e in n){const t=n[e];(t==null?void 0:t.type)!=="Scene"&&(t==null||t.dispose==null||t.dispose())}}const n8=["children","key","ref"];function sZ(n){const e={};for(const t in n)n8.includes(t)||(e[t]=n[t]);return e}function Bx(n,e,t,i){const a=n;let r=a==null?void 0:a.__r3f;return r||(r={root:e,type:t,parent:null,children:[],props:sZ(i),object:a,eventCount:0,handlers:{},isHidden:!1},a&&(a.__r3f=r)),r}function p0(n,e){if(!e.includes("-"))return{root:n,key:e,target:n[e]};if(e in n)return{root:n,key:e,target:n[e]};let t=n;const i=e.split("-");for(const a of i){if(typeof t!="object"||t===null){if(t!==void 0){const r=i.slice(i.indexOf(a)).join("-");return{root:t,key:r,target:void 0}}return{root:n,key:e,target:void 0}}e=a,n=t,t=t[e]}return{root:n,key:e,target:t}}const zN=/-\d+$/;function Hx(n,e){if(ai.str(e.props.attach)){if(zN.test(e.props.attach)){const a=e.props.attach.replace(zN,""),{root:r,key:s}=p0(n.object,a);Array.isArray(r[s])||(r[s]=[])}const{root:t,key:i}=p0(n.object,e.props.attach);e.previousAttach=t[i],t[i]=e.object}else ai.fun(e.props.attach)&&(e.previousAttach=e.props.attach(n.object,e.object))}function Fx(n,e){if(ai.str(e.props.attach)){const{root:t,key:i}=p0(n.object,e.props.attach),a=e.previousAttach;a===void 0?delete t[i]:t[i]=a}else e.previousAttach==null||e.previousAttach(n.object,e.object);delete e.previousAttach}const gE=[...n8,"args","dispose","attach","object","onUpdate","dispose"],BN=new Map;function oZ(n){let e=BN.get(n.constructor);try{e||(e=new n.constructor,BN.set(n.constructor,e))}catch{}return e}function lZ(n,e){const t={};for(const i in e)if(!gE.includes(i)&&!ai.equ(e[i],n.props[i])){t[i]=e[i];for(const a in e)a.startsWith(`${i}-`)&&(t[a]=e[a])}for(const i in n.props){if(gE.includes(i)||e.hasOwnProperty(i))continue;const{root:a,key:r}=p0(n.object,i);if(a.constructor&&a.constructor.length===0){const s=oZ(a);ai.und(s)||(t[r]=s[r])}else t[r]=0}return t}const cZ=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],uZ=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function kl(n,e){var t;const i=n.__r3f,a=i&&J6(i).getState(),r=i==null?void 0:i.eventCount;for(const o in e){let c=e[o];if(gE.includes(o))continue;if(i&&uZ.test(o)){typeof c=="function"?i.handlers[o]=c:delete i.handlers[o],i.eventCount=Object.keys(i.handlers).length;continue}if(c===void 0)continue;let{root:h,key:f,target:d}=p0(n,o);if(d===void 0&&(typeof h!="object"||h===null))throw Error(`R3F: Cannot set "${o}". Ensure it is an object before setting "${f}".`);if(d instanceof Md&&c instanceof Md)d.mask=c.mask;else if(d instanceof je&&eZ(c))d.set(c);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof d.copy=="function"&&c!=null&&c.constructor&&d.constructor===c.constructor)d.copy(c);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&Array.isArray(c))typeof d.fromArray=="function"?d.fromArray(c):d.set(...c);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof c=="number")typeof d.setScalar=="function"?d.setScalar(c):d.set(c);else{var s;h[f]=c,a&&!a.linear&&cZ.includes(f)&&(s=h[f])!=null&&s.isTexture&&h[f].format===Jn&&h[f].type===Ii&&(h[f].colorSpace=En)}}if(i!=null&&i.parent&&a!=null&&a.internal&&(t=i.object)!=null&&t.isObject3D&&r!==i.eventCount){const o=i.object,c=a.internal.interaction.indexOf(o);c>-1&&a.internal.interaction.splice(c,1),i.eventCount&&o.raycast!==null&&a.internal.interaction.push(o)}return i&&i.props.attach===void 0&&(i.object.isBufferGeometry?i.props.attach="geometry":i.object.isMaterial&&(i.props.attach="material")),i&&qd(i),n}function qd(n){var e;if(!n.parent)return;n.props.onUpdate==null||n.props.onUpdate(n.object);const t=(e=n.root)==null||e.getState==null?void 0:e.getState();t&&t.internal.frames===0&&t.invalidate()}function hZ(n,e){n.manual||($6(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix())}const wa=n=>n==null?void 0:n.isObject3D;function Iv(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function i8(n,e,t,i){const a=t.get(e);a&&(t.delete(e),t.size===0&&(n.delete(i),a.target.releasePointerCapture(i)))}function fZ(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,a)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(a)}),t.capturedMap.forEach((i,a)=>{i8(t.capturedMap,e,i,a)})}function dZ(n){function e(c){const{internal:h}=n.getState(),f=c.offsetX-h.initialClick[0],d=c.offsetY-h.initialClick[1];return Math.round(Math.sqrt(f*f+d*d))}function t(c){return c.filter(h=>["Move","Over","Enter","Out","Leave"].some(f=>{var d;return(d=h.__r3f)==null?void 0:d.handlers["onPointer"+f]}))}function i(c,h){const f=n.getState(),d=new Set,m=[],g=h?h(f.internal.interaction):f.internal.interaction;for(let v=0;v{const E=hf(v.object),b=hf(y.object);return!E||!b?v.distance-y.distance:b.events.priority-E.events.priority||v.distance-y.distance}).filter(v=>{const y=Iv(v);return d.has(y)?!1:(d.add(y),!0)});f.events.filter&&(T=f.events.filter(T,f));for(const v of T){let y=v.object;for(;y;){var S;(S=y.__r3f)!=null&&S.eventCount&&m.push({...v,eventObject:y}),y=y.parent}}if("pointerId"in c&&f.internal.capturedMap.has(c.pointerId))for(let v of f.internal.capturedMap.get(c.pointerId).values())d.has(Iv(v.intersection))||m.push(v.intersection);return m}function a(c,h,f,d){if(c.length){const m={stopped:!1};for(const g of c){let x=hf(g.object);if(x||g.object.traverseAncestors(T=>{const S=hf(T);if(S)return x=S,!1}),x){const{raycaster:T,pointer:S,camera:v,internal:y}=x,E=new L(S.x,S.y,0).unproject(v),b=O=>{var R,B;return(R=(B=y.capturedMap.get(O))==null?void 0:B.has(g.eventObject))!=null?R:!1},D=O=>{const R={intersection:g,target:h.target};y.capturedMap.has(O)?y.capturedMap.get(O).set(g.eventObject,R):y.capturedMap.set(O,new Map([[g.eventObject,R]])),h.target.setPointerCapture(O)},C=O=>{const R=y.capturedMap.get(O);R&&i8(y.capturedMap,g.eventObject,R,O)};let I={};for(let O in h){let R=h[O];typeof R!="function"&&(I[O]=R)}let P={...g,...I,pointer:S,intersections:c,stopped:m.stopped,delta:f,unprojectedPoint:E,ray:T.ray,camera:v,stopPropagation(){const O="pointerId"in h&&y.capturedMap.get(h.pointerId);if((!O||O.has(g.eventObject))&&(P.stopped=m.stopped=!0,y.hovered.size&&Array.from(y.hovered.values()).find(R=>R.eventObject===g.eventObject))){const R=c.slice(0,c.indexOf(g));r([...R,g])}},target:{hasPointerCapture:b,setPointerCapture:D,releasePointerCapture:C},currentTarget:{hasPointerCapture:b,setPointerCapture:D,releasePointerCapture:C},nativeEvent:h};if(d(P),m.stopped===!0)break}}}return c}function r(c){const{internal:h}=n.getState();for(const f of h.hovered.values())if(!c.length||!c.find(d=>d.object===f.object&&d.index===f.index&&d.instanceId===f.instanceId)){const m=f.eventObject.__r3f;if(h.hovered.delete(Iv(f)),m!=null&&m.eventCount){const g=m.handlers,x={...f,intersections:c};g.onPointerOut==null||g.onPointerOut(x),g.onPointerLeave==null||g.onPointerLeave(x)}}}function s(c,h){for(let f=0;fr([]);case"onLostPointerCapture":return h=>{const{internal:f}=n.getState();"pointerId"in h&&f.capturedMap.has(h.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(h.pointerId)&&(f.capturedMap.delete(h.pointerId),r([]))})}}return function(f){const{onPointerMissed:d,internal:m}=n.getState();m.lastEvent.current=f;const g=c==="onPointerMove",x=c==="onClick"||c==="onContextMenu"||c==="onDoubleClick",S=i(f,g?t:void 0),v=x?e(f):0;c==="onPointerDown"&&(m.initialClick=[f.offsetX,f.offsetY],m.initialHits=S.map(E=>E.eventObject)),x&&!S.length&&v<=2&&(s(f,m.interaction),d&&d(f)),g&&r(S);function y(E){const b=E.eventObject,D=b.__r3f;if(!(D!=null&&D.eventCount))return;const C=D.handlers;if(g){if(C.onPointerOver||C.onPointerEnter||C.onPointerOut||C.onPointerLeave){const I=Iv(E),P=m.hovered.get(I);P?P.stopped&&E.stopPropagation():(m.hovered.set(I,E),C.onPointerOver==null||C.onPointerOver(E),C.onPointerEnter==null||C.onPointerEnter(E))}C.onPointerMove==null||C.onPointerMove(E)}else{const I=C[c];I?(!x||m.initialHits.includes(b))&&(s(f,m.interaction.filter(P=>!m.initialHits.includes(P))),I(E)):x&&m.initialHits.includes(b)&&s(f,m.interaction.filter(P=>!m.initialHits.includes(P)))}}a(S,f,v,y)}}return{handlePointer:o}}const HN=n=>!!(n!=null&&n.render),a8=be.createContext(null),pZ=(n,e)=>{const t=Gj((o,c)=>{const h=new L,f=new L,d=new L;function m(v=c().camera,y=f,E=c().size){const{width:b,height:D,top:C,left:I}=E,P=b/D;y.isVector3?d.copy(y):d.set(...y);const O=v.getWorldPosition(h).distanceTo(d);if($6(v))return{width:b/v.zoom,height:D/v.zoom,top:C,left:I,factor:1,distance:O,aspect:P};{const R=v.fov*Math.PI/180,B=2*Math.tan(R/2)*O,j=B*(b/D);return{width:j,height:B,top:C,left:I,factor:b/j,distance:O,aspect:P}}}let g;const x=v=>o(y=>({performance:{...y.performance,current:v}})),T=new de;return{set:o,get:c,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(v=1)=>n(c(),v),advance:(v,y)=>e(v,y,c()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Yb,pointer:T,mouse:T,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const v=c();g&&clearTimeout(g),v.performance.current!==v.performance.min&&x(v.performance.min),g=setTimeout(()=>x(c().performance.max),v.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:m},setEvents:v=>o(y=>({...y,events:{...y.events,...v}})),setSize:(v,y,E=0,b=0)=>{const D=c().camera,C={width:v,height:y,top:E,left:b};o(I=>({size:C,viewport:{...I.viewport,...m(D,f,C)}}))},setDpr:v=>o(y=>{const E=t8(v);return{viewport:{...y.viewport,dpr:E,initialDpr:y.viewport.initialDpr||E}}}),setFrameloop:(v="always")=>{const y=c().clock;y.stop(),y.elapsedTime=0,v!=="never"&&(y.start(),y.elapsedTime=0),o(()=>({frameloop:v}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:be.createRef(),active:!1,frames:0,priority:0,subscribe:(v,y,E)=>{const b=c().internal;return b.priority=b.priority+(y>0?1:0),b.subscribers.push({ref:v,priority:y,store:E}),b.subscribers=b.subscribers.sort((D,C)=>D.priority-C.priority),()=>{const D=c().internal;D!=null&&D.subscribers&&(D.priority=D.priority-(y>0?1:0),D.subscribers=D.subscribers.filter(C=>C.ref!==v))}}}}}),i=t.getState();let a=i.size,r=i.viewport.dpr,s=i.camera;return t.subscribe(()=>{const{camera:o,size:c,viewport:h,gl:f,set:d}=t.getState();if(c.width!==a.width||c.height!==a.height||h.dpr!==r){a=c,r=h.dpr,hZ(o,c),h.dpr>0&&f.setPixelRatio(h.dpr);const m=typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(c.width,c.height,m)}o!==s&&(s=o,d(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(o)}})))}),t.subscribe(o=>n(o)),t};function r8(){const n=be.useContext(a8);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Qi(n=t=>t,e){return r8()(n,e)}function Ac(n,e=0){const t=r8(),i=t.getState().internal.subscribe,a=e8(n);return G0(()=>i(a,e,t),[e,i,t]),null}const FN=new WeakMap,mZ=n=>{var e;return typeof n=="function"&&(n==null||(e=n.prototype)==null?void 0:e.constructor)===n};function s8(n,e){return function(t,...i){let a;return mZ(t)?(a=FN.get(t),a||(a=new t,FN.set(t,a))):a=t,n&&n(a),Promise.all(i.map(r=>new Promise((s,o)=>a.load(r,c=>{wa(c==null?void 0:c.scene)&&Object.assign(c,aZ(c.scene)),s(c)},e,c=>o(new Error(`Could not load ${r}: ${c==null?void 0:c.message}`))))))}}function Gx(n,e,t,i){const a=Array.isArray(e)?e:[e],r=kj(s8(t,i),[n,...a],{equal:ai.equ});return Array.isArray(e)?r:r[0]}Gx.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return Wj(s8(t),[n,...i])};Gx.clear=function(n,e){const t=Array.isArray(e)?e:[e];return Xj([n,...t])};function gZ(n){const e=jj(n);return e.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:be.version}),e}const o8=0,Nd={},vZ=/^three(?=[A-Z])/,sy=n=>`${n[0].toUpperCase()}${n.slice(1)}`;let _Z=0;const xZ=n=>typeof n=="function";function l8(n){if(xZ(n)){const e=`${_Z++}`;return Nd[e]=n,e}else Object.assign(Nd,n)}function c8(n,e){const t=sy(n),i=Nd[t];if(n!=="primitive"&&!i)throw new Error(`R3F: ${t} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(n==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function yZ(n,e,t){var i;return n=sy(n)in Nd?n:n.replace(vZ,""),c8(n,e),n==="primitive"&&(i=e.object)!=null&&i.__r3f&&delete e.object.__r3f,Bx(e.object,t,n,e)}function SZ(n){if(!n.isHidden){var e;n.props.attach&&(e=n.parent)!=null&&e.object?Fx(n.parent,n):wa(n.object)&&(n.object.visible=!1),n.isHidden=!0,qd(n)}}function u8(n){if(n.isHidden){var e;n.props.attach&&(e=n.parent)!=null&&e.object?Hx(n.parent,n):wa(n.object)&&n.props.visible!==!1&&(n.object.visible=!0),n.isHidden=!1,qd(n)}}function $b(n,e,t){const i=e.root.getState();if(!(!n.parent&&n.object!==i.scene)){if(!e.object){var a,r;const s=Nd[sy(e.type)];e.object=(a=e.props.object)!=null?a:new s(...(r=e.props.args)!=null?r:[]),e.object.__r3f=e}if(kl(e.object,e.props),e.props.attach)Hx(n,e);else if(wa(e.object)&&wa(n.object)){const s=n.object.children.indexOf(t==null?void 0:t.object);if(t&&s!==-1){const o=n.object.children.indexOf(e.object);if(o!==-1){n.object.children.splice(o,1);const c=o{try{n.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():mE.unstable_scheduleCallback(mE.unstable_IdlePriority,e)}}function vE(n,e,t){if(!e)return;e.parent=null;const i=n.children.indexOf(e);i!==-1&&n.children.splice(i,1),e.props.attach?Fx(n,e):wa(e.object)&&wa(n.object)&&(n.object.remove(e.object),fZ(J6(e),e.object));const a=e.props.dispose!==null&&t!==!1;for(let r=e.children.length-1;r>=0;r--){const s=e.children[r];vE(e,s,a)}e.children.length=0,delete e.object.__r3f,a&&e.type!=="primitive"&&e.object.type!=="Scene"&&h8(e.object),t===void 0&&qd(e)}function TZ(n,e){for(const t of[n,n.alternate])if(t!==null)if(typeof t.ref=="function"){t.refCleanup==null||t.refCleanup();const i=t.ref(e);typeof i=="function"&&(t.refCleanup=i)}else t.ref&&(t.ref.current=e)}const g_=[];function EZ(){for(const[t]of g_){const i=t.parent;if(i){t.props.attach?Fx(i,t):wa(t.object)&&wa(i.object)&&i.object.remove(t.object);for(const a of t.children)a.props.attach?Fx(t,a):wa(a.object)&&wa(t.object)&&t.object.remove(a.object)}t.isHidden&&u8(t),t.object.__r3f&&delete t.object.__r3f,t.type!=="primitive"&&h8(t.object)}for(const[t,i,a]of g_){t.props=i;const r=t.parent;if(r){var n,e;const s=Nd[sy(t.type)];t.object=(n=t.props.object)!=null?n:new s(...(e=t.props.args)!=null?e:[]),t.object.__r3f=t,TZ(a,t.object),kl(t.object,t.props),t.props.attach?Hx(r,t):wa(t.object)&&wa(r.object)&&r.object.add(t.object);for(const o of t.children)o.props.attach?Hx(t,o):wa(o.object)&&wa(t.object)&&t.object.add(o.object);qd(t)}}g_.length=0}const m2=()=>{},VN={};let Uv=o8;const MZ=0,bZ=4,_E=gZ({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:yZ,removeChild:vE,appendChild:p2,appendInitialChild:p2,insertBefore:GN,appendChildToContainer(n,e){const t=n.getState().scene.__r3f;!e||!t||p2(t,e)},removeChildFromContainer(n,e){const t=n.getState().scene.__r3f;!e||!t||vE(t,e)},insertInContainerBefore(n,e,t){const i=n.getState().scene.__r3f;!e||!t||!i||GN(i,e,t)},getRootHostContext:()=>VN,getChildHostContext:()=>VN,commitUpdate(n,e,t,i,a){var r,s,o;c8(e,i);let c=!1;if((n.type==="primitive"&&t.object!==i.object||((r=i.args)==null?void 0:r.length)!==((s=t.args)==null?void 0:s.length)||(o=i.args)!=null&&o.some((f,d)=>{var m;return f!==((m=t.args)==null?void 0:m[d])}))&&(c=!0),c)g_.push([n,{...i},a]);else{const f=lZ(n,i);Object.keys(f).length&&(Object.assign(n.props,f),kl(n.object,f))}(a.sibling===null||(a.flags&bZ)===MZ)&&EZ()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:n=>n==null?void 0:n.object,prepareForCommit:()=>null,preparePortalMount:n=>Bx(n.getState().scene,n,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:SZ,unhideInstance:u8,createTextInstance:m2,hideTextInstance:m2,unhideTextInstance:m2,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:be.createContext(null),setCurrentUpdatePriority(n){Uv=n},getCurrentUpdatePriority(){return Uv},resolveUpdatePriority(){var n;if(Uv!==o8)return Uv;switch(typeof window<"u"&&((n=window.event)==null?void 0:n.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return f_.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return f_.ContinuousEventPriority;default:return f_.DefaultEventPriority}},resetFormInstance(){}}),Qu=new Map,ff={objects:"shallow",strict:!1};function AZ(n,e){if(!e&&typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:t,height:i,top:a,left:r}=n.parentElement.getBoundingClientRect();return{width:t,height:i,top:a,left:r}}else if(!e&&typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function RZ(n){const e=Qu.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const a=typeof reportError=="function"?reportError:console.error,r=i||pZ(SE,WN),s=t||_E.createContainer(r,f_.ConcurrentRoot,null,!1,null,"",a,a,a,null);e||Qu.set(n,{fiber:s,store:r});let o,c,h=!1,f=null;return{async configure(d={}){let m;f=new Promise(Ce=>m=Ce);let{gl:g,size:x,scene:T,events:S,onCreated:v,shadows:y=!1,linear:E=!1,flat:b=!1,legacy:D=!1,orthographic:C=!1,frameloop:I="always",dpr:P=[1,2],performance:O,raycaster:R,camera:B,onPointerMissed:j}=d,ee=r.getState(),se=ee.gl;if(!ee.gl){const Ce={canvas:n,powerPreference:"high-performance",antialias:!0,alpha:!0},Xe=typeof g=="function"?await g(Ce):g;HN(Xe)?se=Xe:se=new Kb({...Ce,...g}),ee.set({gl:se})}let re=ee.raycaster;re||ee.set({raycaster:re=new N6});const{params:W,...te}=R||{};if(ai.equ(te,re,ff)||kl(re,{...te}),ai.equ(W,re.params,ff)||kl(re,{params:{...re.params,...W}}),!ee.camera||ee.camera===c&&!ai.equ(c,B,ff)){c=B;const Ce=B==null?void 0:B.isCamera,Xe=Ce?B:C?new io(0,0,0,0,.1,1e3):new ui(75,0,.1,1e3);Ce||(Xe.position.z=5,B&&(kl(Xe,B),Xe.manual||("aspect"in B||"left"in B||"right"in B||"bottom"in B||"top"in B)&&(Xe.manual=!0,Xe.updateProjectionMatrix())),!ee.camera&&!(B!=null&&B.rotation)&&Xe.lookAt(0,0,0)),ee.set({camera:Xe}),re.camera=Xe}if(!ee.scene){let Ce;T!=null&&T.isScene?(Ce=T,Bx(Ce,r,"",{})):(Ce=new Ad,Bx(Ce,r,"",{}),T&&kl(Ce,T)),ee.set({scene:Ce})}S&&!ee.events.handlers&&ee.set({events:S(r)});const K=AZ(n,x);if(ai.equ(K,ee.size,ff)||ee.setSize(K.width,K.height,K.top,K.left),P&&ee.viewport.dpr!==t8(P)&&ee.setDpr(P),ee.frameloop!==I&&ee.setFrameloop(I),ee.onPointerMissed||ee.set({onPointerMissed:j}),O&&!ai.equ(O,ee.performance,ff)&&ee.set(Ce=>({performance:{...Ce.performance,...O}})),!ee.xr){var oe;const Ce=(tt,gt)=>{const ge=r.getState();ge.frameloop!=="never"&&WN(tt,!0,ge,gt)},Xe=()=>{const tt=r.getState();tt.gl.xr.enabled=tt.gl.xr.isPresenting,tt.gl.xr.setAnimationLoop(tt.gl.xr.isPresenting?Ce:null),tt.gl.xr.isPresenting||SE(tt)},nt={connect(){const tt=r.getState().gl;tt.xr.addEventListener("sessionstart",Xe),tt.xr.addEventListener("sessionend",Xe)},disconnect(){const tt=r.getState().gl;tt.xr.removeEventListener("sessionstart",Xe),tt.xr.removeEventListener("sessionend",Xe)}};typeof((oe=se.xr)==null?void 0:oe.addEventListener)=="function"&&nt.connect(),ee.set({xr:nt})}if(se.shadowMap){const Ce=se.shadowMap.enabled,Xe=se.shadowMap.type;if(se.shadowMap.enabled=!!y,ai.boo(y))se.shadowMap.type=Cm;else if(ai.str(y)){var ie;const nt={basic:YI,percentage:b1,soft:Cm,variance:ys};se.shadowMap.type=(ie=nt[y])!=null?ie:Cm}else ai.obj(y)&&Object.assign(se.shadowMap,y);(Ce!==se.shadowMap.enabled||Xe!==se.shadowMap.type)&&(se.shadowMap.needsUpdate=!0)}return rn.enabled=!D,h||(se.outputColorSpace=E?Wn:En,se.toneMapping=b?ns:cb),ee.legacy!==D&&ee.set(()=>({legacy:D})),ee.linear!==E&&ee.set(()=>({linear:E})),ee.flat!==b&&ee.set(()=>({flat:b})),g&&!ai.fun(g)&&!HN(g)&&!ai.equ(g,se,ff)&&kl(se,g),o=v,h=!0,m(),this},render(d){return!h&&!f&&this.configure(),f.then(()=>{_E.updateContainer(Nt.jsx(wZ,{store:r,children:d,onCreated:o,rootElement:n}),s,null,()=>{})}),r},unmount(){f8(n)}}}function wZ({store:n,children:e,onCreated:t,rootElement:i}){return G0(()=>{const a=n.getState();a.set(r=>({internal:{...r.internal,active:!0}})),t&&t(a),n.getState().events.connected||a.events.connect==null||a.events.connect(i)},[]),Nt.jsx(a8.Provider,{value:n,children:e})}function f8(n,e){const t=Qu.get(n),i=t==null?void 0:t.fiber;if(i){const a=t==null?void 0:t.store.getState();a&&(a.internal.active=!1),_E.updateContainer(null,i,null,()=>{a&&setTimeout(()=>{try{var r,s,o,c;a.events.disconnect==null||a.events.disconnect(),(r=a.gl)==null||(s=r.renderLists)==null||s.dispose==null||s.dispose(),(o=a.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(c=a.gl)!=null&&c.xr&&a.xr.disconnect(),rZ(a.scene),Qu.delete(n)}catch{}},500)})}}const CZ=new Set,NZ=new Set,DZ=new Set;function g2(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function zm(n,e){switch(n){case"before":return g2(CZ,e);case"after":return g2(NZ,e);case"tail":return g2(DZ,e)}}let v2,_2;function xE(n,e,t){let i=e.clock.getDelta();e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),v2=e.internal.subscribers;for(let a=0;a0)&&!((e=df.gl.xr)!=null&&e.isPresenting)&&(x2+=xE(n,df))}if(yE=!1,zm("after",n),x2===0)return zm("tail",n),Vx=!1,cancelAnimationFrame(kN)}function SE(n,e=1){var t;if(!n)return Qu.forEach(i=>SE(i.store.getState(),e));(t=n.gl.xr)!=null&&t.isPresenting||!n.internal.active||n.frameloop==="never"||(e>1?n.internal.frames=Math.min(60,n.internal.frames+e):yE?n.internal.frames=2:n.internal.frames=1,Vx||(Vx=!0,requestAnimationFrame(d8)))}function WN(n,e=!0,t,i){if(e&&zm("before",n),t)xE(n,t,i);else for(const a of Qu.values())xE(n,a.store.getState());e&&zm("after",n)}const y2={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function OZ(n){const{handlePointer:e}=dZ(n);return{priority:1,enabled:!0,compute(t,i,a){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(y2).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:a}=n.getState();(t=a.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(a.lastEvent.current)},connect:t=>{const{set:i,events:a}=n.getState();if(a.disconnect==null||a.disconnect(),i(r=>({events:{...r.events,connected:t}})),a.handlers)for(const r in a.handlers){const s=a.handlers[r],[o,c]=y2[r];t.addEventListener(o,s,{passive:c})}},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){if(i.handlers)for(const a in i.handlers){const r=i.handlers[a],[s]=y2[a];i.connected.removeEventListener(s,r)}t(a=>({events:{...a.events,connected:void 0}}))}}}}function XN(n,e){let t;return(...i)=>{window.clearTimeout(t),t=window.setTimeout(()=>n(...i),e)}}function LZ({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const a=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!a)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[r,s]=be.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),o=be.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:r,orientationHandler:null}),c=n?typeof n=="number"?n:n.scroll:null,h=n?typeof n=="number"?n:n.resize:null,f=be.useRef(!1);be.useEffect(()=>(f.current=!0,()=>void(f.current=!1)));const[d,m,g]=be.useMemo(()=>{const v=()=>{if(!o.current.element)return;const{left:y,top:E,width:b,height:D,bottom:C,right:I,x:P,y:O}=o.current.element.getBoundingClientRect(),R={left:y,top:E,width:b,height:D,bottom:C,right:I,x:P,y:O};o.current.element instanceof HTMLElement&&i&&(R.height=o.current.element.offsetHeight,R.width=o.current.element.offsetWidth),Object.freeze(R),f.current&&!zZ(o.current.lastBounds,R)&&s(o.current.lastBounds=R)};return[v,h?XN(v,h):v,c?XN(v,c):v]},[s,i,c,h]);function x(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(v=>v.removeEventListener("scroll",g,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function T(){o.current.element&&(o.current.resizeObserver=new a(g),o.current.resizeObserver.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(v=>v.addEventListener("scroll",g,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{g()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const S=v=>{!v||v===o.current.element||(x(),o.current.element=v,o.current.scrollContainers=p8(v),T())};return UZ(g,!!e),IZ(m),be.useEffect(()=>{x(),T()},[e,g,m]),be.useEffect(()=>x,[]),[S,r,d]}function IZ(n){be.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function UZ(n,e){be.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function p8(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:a}=window.getComputedStyle(n);return[t,i,a].some(r=>r==="auto"||r==="scroll")&&e.push(n),[...e,...p8(n.parentElement)]}const PZ=["x","y","top","bottom","left","right","width","height"],zZ=(n,e)=>PZ.every(t=>n[t]===e[t]);function BZ({ref:n,children:e,fallback:t,resize:i,style:a,gl:r,events:s=OZ,eventSource:o,eventPrefix:c,shadows:h,linear:f,flat:d,legacy:m,orthographic:g,frameloop:x,dpr:T,performance:S,raycaster:v,camera:y,scene:E,onPointerMissed:b,onCreated:D,...C}){be.useMemo(()=>l8(gj),[]);const I=tZ(),[P,O]=LZ({scroll:!0,debounce:{scroll:50,resize:0},...i}),R=be.useRef(null),B=be.useRef(null);be.useImperativeHandle(n,()=>R.current);const j=e8(b),[ee,se]=be.useState(!1),[re,W]=be.useState(!1);if(ee)throw ee;if(re)throw re;const te=be.useRef(null);G0(()=>{const oe=R.current;if(O.width>0&&O.height>0&&oe){te.current||(te.current=RZ(oe));async function ie(){await te.current.configure({gl:r,scene:E,events:s,shadows:h,linear:f,flat:d,legacy:m,orthographic:g,frameloop:x,dpr:T,performance:S,raycaster:v,camera:y,size:O,onPointerMissed:(...Ce)=>j.current==null?void 0:j.current(...Ce),onCreated:Ce=>{Ce.events.connect==null||Ce.events.connect(o?$j(o)?o.current:o:B.current),c&&Ce.setEvents({compute:(Xe,nt)=>{const tt=Xe[c+"X"],gt=Xe[c+"Y"];nt.pointer.set(tt/nt.size.width*2-1,-(gt/nt.size.height)*2+1),nt.raycaster.setFromCamera(nt.pointer,nt.camera)}}),D==null||D(Ce)}}),te.current.render(Nt.jsx(I,{children:Nt.jsx(iZ,{set:W,children:Nt.jsx(be.Suspense,{fallback:Nt.jsx(nZ,{set:se}),children:e??null})})}))}ie()}}),be.useEffect(()=>{const oe=R.current;if(oe)return()=>f8(oe)},[]);const K=o?"none":"auto";return Nt.jsx("div",{ref:B,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:K,...a},...C,children:Nt.jsx("div",{ref:P,style:{width:"100%",height:"100%"},children:Nt.jsx("canvas",{ref:R,style:{display:"block"},children:t})})})}function m8(n){return Nt.jsx(K6,{children:Nt.jsx(BZ,{...n})})}function YN(n,e){if(e===TU)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===Lx||e===mb){let t=n.getIndex();if(t===null){const s=[],o=n.getAttribute("position");if(o!==void 0){for(let c=0;c=2.0 are supported."));return}const h=new vK(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let f=0;f=0&&o[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}h.setExtensions(s),h.setPlugins(o),h.parse(i,a)}parseAsync(e,t){const i=this;return new Promise(function(a,r){i.parse(e,t,a,r)})}}function HZ(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const on={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class FZ{constructor(e){this.parser=e,this.name=on.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,a=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,s)}}class eK{constructor(e){this.parser=e,this.name=on.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,i=this.parser,a=i.json,r=a.textures[e];if(!r.extensions||!r.extensions[t])return null;const s=r.extensions[t],o=a.images[s.source];let c=i.textureLoader;if(o.uri){const h=i.options.manager.getHandler(o.uri);h!==null&&(c=h)}return i.loadTextureImage(e,s.source,c)}}class tK{constructor(e){this.parser=e,this.name=on.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,i=this.parser,a=i.json,r=a.textures[e];if(!r.extensions||!r.extensions[t])return null;const s=r.extensions[t],o=a.images[s.source];let c=i.textureLoader;if(o.uri){const h=i.options.manager.getHandler(o.uri);h!==null&&(c=h)}return i.loadTextureImage(e,s.source,c)}}class nK{constructor(e){this.name=on.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const a=i.extensions[this.name],r=this.parser.getDependency("buffer",a.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(o){const c=a.byteOffset||0,h=a.byteLength||0,f=a.count,d=a.byteStride,m=new Uint8Array(o,c,h);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(f,d,m,a.mode,a.filter).then(function(g){return g.buffer}):s.ready.then(function(){const g=new ArrayBuffer(f*d);return s.decodeGltfBuffer(new Uint8Array(g),f,d,m,a.mode,a.filter),g})})}else return null}}class iK{constructor(e){this.name=on.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const a=t.meshes[i.mesh];for(const h of a.primitives)if(h.mode!==Xr.TRIANGLES&&h.mode!==Xr.TRIANGLE_STRIP&&h.mode!==Xr.TRIANGLE_FAN&&h.mode!==void 0)return null;const s=i.extensions[this.name].attributes,o=[],c={};for(const h in s)o.push(this.parser.getDependency("accessor",s[h]).then(f=>(c[h]=f,c[h])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(h=>{const f=h.pop(),d=f.isGroup?f.children:[f],m=h[0].count,g=[];for(const x of d){const T=new ke,S=new L,v=new Tt,y=new L(1,1,1),E=new Eb(x.geometry,x.material,m);for(let b=0;b0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":n.search(/\.ktx2($|\?)/i)>0||n.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const gK=new ke;class vK{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new HZ,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,a=-1,r=!1,s=-1;if(typeof navigator<"u"){const o=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(o)===!0;const c=o.match(/Version\/(\d+)/);a=i&&c?parseInt(c[1],10):-1,r=o.indexOf("Firefox")>-1,s=r?o.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&a<17||r&&s<98?this.textureLoader=new Fb(this.options.manager):this.textureLoader=new M6(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new ss(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,a=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(s){const o={scene:s[0][a.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:a.asset,parser:i,userData:{}};return su(r,o,a),qs(o,a),Promise.all(i._invokeAll(function(c){return c.afterRoot&&c.afterRoot(o)})).then(function(){for(const c of o.scenes)c.updateMatrixWorld();e(o)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let a=0,r=t.length;a{const c=this.associations.get(s);c!=null&&this.associations.set(o,c);for(const[h,f]of s.children.entries())r(f,o.children[h])};return r(i,a),a.name+="_instance_"+e.uses[t]++,a}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&S.setY(O,C[I*c+1]),c>=3&&S.setZ(O,C[I*c+2]),c>=4&&S.setW(O,C[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}S.normalized=x}return S})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e].source,s=t.images[r];let o=this.textureLoader;if(s.uri){const c=i.manager.getHandler(s.uri);c!==null&&(o=c)}return this.loadTextureImage(e,r,o)}loadTextureImage(e,t,i){const a=this,r=this.json,s=r.textures[e],o=r.images[t],c=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[c])return this.textureCache[c];const h=this.loadImageSource(t,i).then(function(f){f.flipY=!1,f.name=s.name||o.name||"",f.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(f.name=o.uri);const m=(r.samplers||{})[s.sampler]||{};return f.magFilter=ZN[m.magFilter]||Ht,f.minFilter=ZN[m.minFilter]||Er,f.wrapS=KN[m.wrapS]||Ta,f.wrapT=KN[m.wrapT]||Ta,f.generateMipmaps=!f.isCompressedTexture&&f.minFilter!==Fn&&f.minFilter!==Ht,a.associations.set(f,{textures:e}),f}).catch(function(){return null});return this.textureCache[c]=h,h}loadImageSource(e,t){const i=this,a=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const s=a.images[e],o=self.URL||self.webkitURL;let c=s.uri||"",h=!1;if(s.bufferView!==void 0)c=i.getDependency("bufferView",s.bufferView).then(function(d){h=!0;const m=new Blob([d],{type:s.mimeType});return c=o.createObjectURL(m),c});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const f=Promise.resolve(c).then(function(d){return new Promise(function(m,g){let x=m;t.isImageBitmapLoader===!0&&(x=function(T){const S=new Nn(T);S.needsUpdate=!0,m(S)}),t.load(oc.resolveURL(d,r.path),x,void 0,g)})}).then(function(d){return h===!0&&o.revokeObjectURL(c),qs(d,s),d.userData.mimeType=s.mimeType||mK(s.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),d});return this.sourceCache[e]=f,f}assignTexture(e,t,i,a){const r=this;return this.getDependency("texture",i.index).then(function(s){if(!s)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(s=s.clone(),s.channel=i.texCoord),r.extensions[on.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[on.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const c=r.associations.get(s);s=r.extensions[on.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,c)}}return a!==void 0&&(s.colorSpace=a),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const a=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,s=t.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+i.uuid;let c=this.cache.get(o);c||(c=new G1,qn.prototype.copy.call(c,i),c.color.copy(i.color),c.map=i.map,c.sizeAttenuation=!1,this.cache.add(o,c)),i=c}else if(e.isLine){const o="LineBasicMaterial:"+i.uuid;let c=this.cache.get(o);c||(c=new Pi,qn.prototype.copy.call(c,i),c.color.copy(i.color),c.map=i.map,this.cache.add(o,c)),i=c}if(a||r||s){let o="ClonedMaterial:"+i.uuid+":";a&&(o+="derivative-tangents:"),r&&(o+="vertex-colors:"),s&&(o+="flat-shading:");let c=this.cache.get(o);c||(c=i.clone(),r&&(c.vertexColors=!0),s&&(c.flatShading=!0),a&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(o,c),this.associations.set(c,this.associations.get(i))),i=c}e.material=i}getMaterialType(){return F0}loadMaterial(e){const t=this,i=this.json,a=this.extensions,r=i.materials[e];let s;const o={},c=r.extensions||{},h=[];if(c[on.KHR_MATERIALS_UNLIT]){const d=a[on.KHR_MATERIALS_UNLIT];s=d.getMaterialType(),h.push(d.extendParams(o,r,t))}else{const d=r.pbrMetallicRoughness||{};if(o.color=new je(1,1,1),o.opacity=1,Array.isArray(d.baseColorFactor)){const m=d.baseColorFactor;o.color.setRGB(m[0],m[1],m[2],Wn),o.opacity=m[3]}d.baseColorTexture!==void 0&&h.push(t.assignTexture(o,"map",d.baseColorTexture,En)),o.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,o.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(h.push(t.assignTexture(o,"metalnessMap",d.metallicRoughnessTexture)),h.push(t.assignTexture(o,"roughnessMap",d.metallicRoughnessTexture))),s=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(e)}),h.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,o)})))}r.doubleSided===!0&&(o.side=la);const f=r.alphaMode||T2.OPAQUE;if(f===T2.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,f===T2.MASK&&(o.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&s!==La&&(h.push(t.assignTexture(o,"normalMap",r.normalTexture)),o.normalScale=new de(1,1),r.normalTexture.scale!==void 0)){const d=r.normalTexture.scale;o.normalScale.set(d,d)}if(r.occlusionTexture!==void 0&&s!==La&&(h.push(t.assignTexture(o,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&s!==La){const d=r.emissiveFactor;o.emissive=new je().setRGB(d[0],d[1],d[2],Wn)}return r.emissiveTexture!==void 0&&s!==La&&h.push(t.assignTexture(o,"emissiveMap",r.emissiveTexture,En)),Promise.all(h).then(function(){const d=new s(o);return r.name&&(d.name=r.name),qs(d,r),t.associations.set(d,{materials:e}),r.extensions&&su(a,d,r),d})}createUniqueName(e){const t=fn.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,a=this.primitiveCache;function r(o){return i[on.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,t).then(function(c){return QN(c,o,t)})}const s=[];for(let o=0,c=e.length;o0&&dK(v,r),v.name=t.createUniqueName(r.name||"mesh_"+e),qs(v,r),S.extensions&&su(a,v,S),t.assignFinalMaterial(v),d.push(v)}for(let g=0,x=d.length;g1?f=new Ia:h.length===1?f=h[0]:f=new Zt,f!==h[0])for(let d=0,m=h.length;d1){const d=a.associations.get(f);a.associations.set(f,{...d})}return a.associations.get(f).nodes=e,f}),this.nodeCache[e]}loadScene(e){const t=this.extensions,i=this.json.scenes[e],a=this,r=new Ia;i.name&&(r.name=a.createUniqueName(i.name)),qs(r,i),i.extensions&&su(t,r,i);const s=i.nodes||[],o=[];for(let c=0,h=s.length;c{const d=new Map;for(const[m,g]of a.associations)(m instanceof qn||m instanceof Nn)&&d.set(m,g);return f.traverse(m=>{const g=a.associations.get(m);g!=null&&d.set(m,g)}),d};return a.associations=h(r),r})}_createAnimationTracks(e,t,i,a,r){const s=[],o=e.name?e.name:e.uuid,c=[];Ol[r.path]===Ol.weights?e.traverse(function(m){m.morphTargetInfluences&&c.push(m.name?m.name:m.uuid)}):c.push(o);let h;switch(Ol[r.path]){case Ol.weights:h=gc;break;case Ol.rotation:h=vc;break;case Ol.translation:case Ol.scale:h=Zu;break;default:switch(i.itemSize){case 1:h=gc;break;case 2:case 3:default:h=Zu;break}break}const f=a.interpolation!==void 0?uK[a.interpolation]:yd,d=this._getArrayFromAccessor(i);for(let m=0,g=c.length;m ")}return null},tn.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 27:case 5:return hp(l.child.stateNode);default:return l.child.stateNode}},tn.injectIntoDevTools=function(){var l={bundleType:0,version:U9,rendererPackageName:P9,currentDispatcherRef:Ft,findFiberByHostInstance:sR,reconcilerVersion:"19.0.0"};if(iR!==null&&(l.rendererConfig=iR),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)l=!0;else{try{pp=u.inject(l),dr=u}catch{}l=!!u.checkDCE}}return l},tn.isAlreadyRendering=function(){return!1},tn.observeVisibleRects=function(l,u,p,_){if(!fp)throw Error(a(363));l=eS(l,u);var M=r7(l,p,_).disconnect;return{disconnect:function(){M()}}},tn.shouldError=function(){return null},tn.shouldSuspend=function(){return!1},tn.startHostTransition=function(l,u,p,_){if(l.tag!==5)throw Error(a(476));var M=zA(l).queue;PA(l,M,u,bh,p===null?i:function(){var A=zA(l).next.queue;return ip(l,A,{},ur()),p(_)})},tn.updateContainer=function(l,u,p,_){var M=u.current,A=ur();return Kw(M,A,l,u,p,_),A},tn.updateContainerSync=function(l,u,p,_){return u.tag===0&&Lc(),Kw(u.current,2,l,u,p,_),2},tn},n.exports.default=n.exports,Object.defineProperty(n.exports,"__esModule",{value:!0})})(j6);var qj=j6.exports;q6.exports=qj;var jj=q6.exports;const Zj=l1(jj);function eA(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const a=eA(i,e,t);if(a)return a;i=e?null:i.sibling}}function Q6(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const tA=Q6(Me.createContext(null));let J6=class extends Me.Component{render(){return Me.createElement(tA.Provider,{value:this._reactInternals},this.props.children)}};function $6(){const n=Me.useContext(tA);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=Me.useId();return Me.useMemo(()=>{for(const t of[n,n==null?void 0:n.alternate]){if(!t)continue;const i=eA(t,!1,a=>{let r=a.memoizedState;for(;r;){if(r.memoizedState===e)return!0;r=r.next}});if(i)return i}},[n,e])}const Kj=Symbol.for("react.context"),Qj=n=>n!==null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===Kj;function Jj(){const n=$6(),[e]=Me.useState(()=>new Map);e.clear();let t=n;for(;t;){const i=t.type;Qj(i)&&i!==tA&&!e.has(i)&&e.set(i,Me.use(Q6(i))),t=t.return}return e}function $j(){const n=Jj();return Me.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>Me.createElement(e,null,Me.createElement(t.Provider,{...i,value:n.get(t)})),e=>Me.createElement(J6,{...e})),[n])}function e8(n){let e=n.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const t8=n=>n&&n.isOrthographicCamera,eZ=n=>n&&n.hasOwnProperty("current"),tZ=n=>n!=null&&(typeof n=="string"||typeof n=="number"||n.isColor),k0=((n,e)=>typeof window<"u"&&(((n=window.document)==null?void 0:n.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?Me.useLayoutEffect:Me.useEffect;function n8(n){const e=Me.useRef(n);return k0(()=>void(e.current=n),[n]),e}function nZ(){const n=$6(),e=$j();return Me.useMemo(()=>({children:t})=>{const a=!!eA(n,!0,r=>r.type===Me.StrictMode)?Me.StrictMode:Me.Fragment;return Rt.jsx(a,{children:Rt.jsx(e,{children:t})})},[n,e])}function iZ({set:n}){return k0(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}const aZ=(n=>(n=class extends Me.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}},n.getDerivedStateFromError=()=>({error:!0}),n))();function i8(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}function df(n){var e;return(e=n.__r3f)==null?void 0:e.root.getState()}const ri={obj:n=>n===Object(n)&&!ri.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,nul:n=>n===null,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:a=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(ri.str(n)||ri.num(n)||ri.boo(n))return n===e;const r=ri.obj(n);if(r&&i==="reference")return n===e;const s=ri.arr(n);if(s&&t==="reference")return n===e;if((s||r)&&n===e)return!0;let o;for(o in n)if(!(o in e))return!1;if(r&&t==="shallow"&&i==="shallow"){for(o in a?e:n)if(!ri.equ(n[o],e[o],{strict:a,objects:"reference"}))return!1}else for(o in a?e:n)if(n[o]!==e[o])return!1;if(ri.und(o)){if(s&&n.length===0&&e.length===0||r&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function rZ(n){const e={nodes:{},materials:{},meshes:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material),t.isMesh&&!e.meshes[t.name]&&(e.meshes[t.name]=t)}),e}function sZ(n){n.type!=="Scene"&&(n.dispose==null||n.dispose());for(const e in n){const t=n[e];(t==null?void 0:t.type)!=="Scene"&&(t==null||t.dispose==null||t.dispose())}}const a8=["children","key","ref"];function oZ(n){const e={};for(const t in n)a8.includes(t)||(e[t]=n[t]);return e}function Gx(n,e,t,i){const a=n;let r=a==null?void 0:a.__r3f;return r||(r={root:e,type:t,parent:null,children:[],props:oZ(i),object:a,eventCount:0,handlers:{},isHidden:!1},a&&(a.__r3f=r)),r}function g0(n,e){if(!e.includes("-"))return{root:n,key:e,target:n[e]};if(e in n)return{root:n,key:e,target:n[e]};let t=n;const i=e.split("-");for(const a of i){if(typeof t!="object"||t===null){if(t!==void 0){const r=i.slice(i.indexOf(a)).join("-");return{root:t,key:r,target:void 0}}return{root:n,key:e,target:void 0}}e=a,n=t,t=t[e]}return{root:n,key:e,target:t}}const FN=/-\d+$/;function Vx(n,e){if(ri.str(e.props.attach)){if(FN.test(e.props.attach)){const a=e.props.attach.replace(FN,""),{root:r,key:s}=g0(n.object,a);Array.isArray(r[s])||(r[s]=[])}const{root:t,key:i}=g0(n.object,e.props.attach);e.previousAttach=t[i],t[i]=e.object}else ri.fun(e.props.attach)&&(e.previousAttach=e.props.attach(n.object,e.object))}function kx(n,e){if(ri.str(e.props.attach)){const{root:t,key:i}=g0(n.object,e.props.attach),a=e.previousAttach;a===void 0?delete t[i]:t[i]=a}else e.previousAttach==null||e.previousAttach(n.object,e.object);delete e.previousAttach}const xE=[...a8,"args","dispose","attach","object","onUpdate","dispose"],GN=new Map;function lZ(n){let e=GN.get(n.constructor);try{e||(e=new n.constructor,GN.set(n.constructor,e))}catch{}return e}function cZ(n,e){const t={};for(const i in e)if(!xE.includes(i)&&!ri.equ(e[i],n.props[i])){t[i]=e[i];for(const a in e)a.startsWith(`${i}-`)&&(t[a]=e[a])}for(const i in n.props){if(xE.includes(i)||e.hasOwnProperty(i))continue;const{root:a,key:r}=g0(n.object,i);if(a.constructor&&a.constructor.length===0){const s=lZ(a);ri.und(s)||(t[r]=s[r])}else t[r]=0}return t}const uZ=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],hZ=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function Yl(n,e){var t;const i=n.__r3f,a=i&&e8(i).getState(),r=i==null?void 0:i.eventCount;for(const o in e){let c=e[o];if(xE.includes(o))continue;if(i&&hZ.test(o)){typeof c=="function"?i.handlers[o]=c:delete i.handlers[o],i.eventCount=Object.keys(i.handlers).length;continue}if(c===void 0)continue;let{root:h,key:f,target:d}=g0(n,o);if(d===void 0&&(typeof h!="object"||h===null))throw Error(`R3F: Cannot set "${o}". Ensure it is an object before setting "${f}".`);if(d instanceof Ad&&c instanceof Ad)d.mask=c.mask;else if(d instanceof je&&tZ(c))d.set(c);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof d.copy=="function"&&c!=null&&c.constructor&&d.constructor===c.constructor)d.copy(c);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&Array.isArray(c))typeof d.fromArray=="function"?d.fromArray(c):d.set(...c);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof c=="number")typeof d.setScalar=="function"?d.setScalar(c):d.set(c);else{var s;h[f]=c,a&&!a.linear&&uZ.includes(f)&&(s=h[f])!=null&&s.isTexture&&h[f].format===$n&&h[f].type===zi&&(h[f].colorSpace=En)}}if(i!=null&&i.parent&&a!=null&&a.internal&&(t=i.object)!=null&&t.isObject3D&&r!==i.eventCount){const o=i.object,c=a.internal.interaction.indexOf(o);c>-1&&a.internal.interaction.splice(c,1),i.eventCount&&o.raycast!==null&&a.internal.interaction.push(o)}return i&&i.props.attach===void 0&&(i.object.isBufferGeometry?i.props.attach="geometry":i.object.isMaterial&&(i.props.attach="material")),i&&Zd(i),n}function Zd(n){var e;if(!n.parent)return;n.props.onUpdate==null||n.props.onUpdate(n.object);const t=(e=n.root)==null||e.getState==null?void 0:e.getState();t&&t.internal.frames===0&&t.invalidate()}function fZ(n,e){n.manual||(t8(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix())}const Ca=n=>n==null?void 0:n.isObject3D;function Pv(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function r8(n,e,t,i){const a=t.get(e);a&&(t.delete(e),t.size===0&&(n.delete(i),a.target.releasePointerCapture(i)))}function dZ(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,a)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(a)}),t.capturedMap.forEach((i,a)=>{r8(t.capturedMap,e,i,a)})}function pZ(n){function e(c){const{internal:h}=n.getState(),f=c.offsetX-h.initialClick[0],d=c.offsetY-h.initialClick[1];return Math.round(Math.sqrt(f*f+d*d))}function t(c){return c.filter(h=>["Move","Over","Enter","Out","Leave"].some(f=>{var d;return(d=h.__r3f)==null?void 0:d.handlers["onPointer"+f]}))}function i(c,h){const f=n.getState(),d=new Set,m=[],g=h?h(f.internal.interaction):f.internal.interaction;for(let v=0;v{const E=df(v.object),b=df(S.object);return!E||!b?v.distance-S.distance:b.events.priority-E.events.priority||v.distance-S.distance}).filter(v=>{const S=Pv(v);return d.has(S)?!1:(d.add(S),!0)});f.events.filter&&(T=f.events.filter(T,f));for(const v of T){let S=v.object;for(;S;){var y;(y=S.__r3f)!=null&&y.eventCount&&m.push({...v,eventObject:S}),S=S.parent}}if("pointerId"in c&&f.internal.capturedMap.has(c.pointerId))for(let v of f.internal.capturedMap.get(c.pointerId).values())d.has(Pv(v.intersection))||m.push(v.intersection);return m}function a(c,h,f,d){if(c.length){const m={stopped:!1};for(const g of c){let x=df(g.object);if(x||g.object.traverseAncestors(T=>{const y=df(T);if(y)return x=y,!1}),x){const{raycaster:T,pointer:y,camera:v,internal:S}=x,E=new L(y.x,y.y,0).unproject(v),b=O=>{var w,B;return(w=(B=S.capturedMap.get(O))==null?void 0:B.has(g.eventObject))!=null?w:!1},D=O=>{const w={intersection:g,target:h.target};S.capturedMap.has(O)?S.capturedMap.get(O).set(g.eventObject,w):S.capturedMap.set(O,new Map([[g.eventObject,w]])),h.target.setPointerCapture(O)},C=O=>{const w=S.capturedMap.get(O);w&&r8(S.capturedMap,g.eventObject,w,O)};let I={};for(let O in h){let w=h[O];typeof w!="function"&&(I[O]=w)}let P={...g,...I,pointer:y,intersections:c,stopped:m.stopped,delta:f,unprojectedPoint:E,ray:T.ray,camera:v,stopPropagation(){const O="pointerId"in h&&S.capturedMap.get(h.pointerId);if((!O||O.has(g.eventObject))&&(P.stopped=m.stopped=!0,S.hovered.size&&Array.from(S.hovered.values()).find(w=>w.eventObject===g.eventObject))){const w=c.slice(0,c.indexOf(g));r([...w,g])}},target:{hasPointerCapture:b,setPointerCapture:D,releasePointerCapture:C},currentTarget:{hasPointerCapture:b,setPointerCapture:D,releasePointerCapture:C},nativeEvent:h};if(d(P),m.stopped===!0)break}}}return c}function r(c){const{internal:h}=n.getState();for(const f of h.hovered.values())if(!c.length||!c.find(d=>d.object===f.object&&d.index===f.index&&d.instanceId===f.instanceId)){const m=f.eventObject.__r3f;if(h.hovered.delete(Pv(f)),m!=null&&m.eventCount){const g=m.handlers,x={...f,intersections:c};g.onPointerOut==null||g.onPointerOut(x),g.onPointerLeave==null||g.onPointerLeave(x)}}}function s(c,h){for(let f=0;fr([]);case"onLostPointerCapture":return h=>{const{internal:f}=n.getState();"pointerId"in h&&f.capturedMap.has(h.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(h.pointerId)&&(f.capturedMap.delete(h.pointerId),r([]))})}}return function(f){const{onPointerMissed:d,internal:m}=n.getState();m.lastEvent.current=f;const g=c==="onPointerMove",x=c==="onClick"||c==="onContextMenu"||c==="onDoubleClick",y=i(f,g?t:void 0),v=x?e(f):0;c==="onPointerDown"&&(m.initialClick=[f.offsetX,f.offsetY],m.initialHits=y.map(E=>E.eventObject)),x&&!y.length&&v<=2&&(s(f,m.interaction),d&&d(f)),g&&r(y);function S(E){const b=E.eventObject,D=b.__r3f;if(!(D!=null&&D.eventCount))return;const C=D.handlers;if(g){if(C.onPointerOver||C.onPointerEnter||C.onPointerOut||C.onPointerLeave){const I=Pv(E),P=m.hovered.get(I);P?P.stopped&&E.stopPropagation():(m.hovered.set(I,E),C.onPointerOver==null||C.onPointerOver(E),C.onPointerEnter==null||C.onPointerEnter(E))}C.onPointerMove==null||C.onPointerMove(E)}else{const I=C[c];I?(!x||m.initialHits.includes(b))&&(s(f,m.interaction.filter(P=>!m.initialHits.includes(P))),I(E)):x&&m.initialHits.includes(b)&&s(f,m.interaction.filter(P=>!m.initialHits.includes(P)))}}a(y,f,v,S)}}return{handlePointer:o}}const VN=n=>!!(n!=null&&n.render),s8=Me.createContext(null),mZ=(n,e)=>{const t=Vj((o,c)=>{const h=new L,f=new L,d=new L;function m(v=c().camera,S=f,E=c().size){const{width:b,height:D,top:C,left:I}=E,P=b/D;S.isVector3?d.copy(S):d.set(...S);const O=v.getWorldPosition(h).distanceTo(d);if(t8(v))return{width:b/v.zoom,height:D/v.zoom,top:C,left:I,factor:1,distance:O,aspect:P};{const w=v.fov*Math.PI/180,B=2*Math.tan(w/2)*O,j=B*(b/D);return{width:j,height:B,top:C,left:I,factor:b/j,distance:O,aspect:P}}}let g;const x=v=>o(S=>({performance:{...S.performance,current:v}})),T=new de;return{set:o,get:c,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(v=1)=>n(c(),v),advance:(v,S)=>e(v,S,c()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Zb,pointer:T,mouse:T,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const v=c();g&&clearTimeout(g),v.performance.current!==v.performance.min&&x(v.performance.min),g=setTimeout(()=>x(c().performance.max),v.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:m},setEvents:v=>o(S=>({...S,events:{...S.events,...v}})),setSize:(v,S,E=0,b=0)=>{const D=c().camera,C={width:v,height:S,top:E,left:b};o(I=>({size:C,viewport:{...I.viewport,...m(D,f,C)}}))},setDpr:v=>o(S=>{const E=i8(v);return{viewport:{...S.viewport,dpr:E,initialDpr:S.viewport.initialDpr||E}}}),setFrameloop:(v="always")=>{const S=c().clock;S.stop(),S.elapsedTime=0,v!=="never"&&(S.start(),S.elapsedTime=0),o(()=>({frameloop:v}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:Me.createRef(),active:!1,frames:0,priority:0,subscribe:(v,S,E)=>{const b=c().internal;return b.priority=b.priority+(S>0?1:0),b.subscribers.push({ref:v,priority:S,store:E}),b.subscribers=b.subscribers.sort((D,C)=>D.priority-C.priority),()=>{const D=c().internal;D!=null&&D.subscribers&&(D.priority=D.priority-(S>0?1:0),D.subscribers=D.subscribers.filter(C=>C.ref!==v))}}}}}),i=t.getState();let a=i.size,r=i.viewport.dpr,s=i.camera;return t.subscribe(()=>{const{camera:o,size:c,viewport:h,gl:f,set:d}=t.getState();if(c.width!==a.width||c.height!==a.height||h.dpr!==r){a=c,r=h.dpr,fZ(o,c),h.dpr>0&&f.setPixelRatio(h.dpr);const m=typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(c.width,c.height,m)}o!==s&&(s=o,d(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(o)}})))}),t.subscribe(o=>n(o)),t};function o8(){const n=Me.useContext(s8);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Oi(n=t=>t,e){return o8()(n,e)}function cl(n,e=0){const t=o8(),i=t.getState().internal.subscribe,a=n8(n);return k0(()=>i(a,e,t),[e,i,t]),null}const kN=new WeakMap,gZ=n=>{var e;return typeof n=="function"&&(n==null||(e=n.prototype)==null?void 0:e.constructor)===n};function l8(n,e){return function(t,...i){let a;return gZ(t)?(a=kN.get(t),a||(a=new t,kN.set(t,a))):a=t,n&&n(a),Promise.all(i.map(r=>new Promise((s,o)=>a.load(r,c=>{Ca(c==null?void 0:c.scene)&&Object.assign(c,rZ(c.scene)),s(c)},e,c=>o(new Error(`Could not load ${r}: ${c==null?void 0:c.message}`))))))}}function Wx(n,e,t,i){const a=Array.isArray(e)?e:[e],r=Wj(l8(t,i),[n,...a],{equal:ri.equ});return Array.isArray(e)?r:r[0]}Wx.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return Xj(l8(t),[n,...i])};Wx.clear=function(n,e){const t=Array.isArray(e)?e:[e];return Yj([n,...t])};function vZ(n){const e=Zj(n);return e.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:Me.version}),e}const c8=0,Od={},_Z=/^three(?=[A-Z])/,cy=n=>`${n[0].toUpperCase()}${n.slice(1)}`;let xZ=0;const yZ=n=>typeof n=="function";function u8(n){if(yZ(n)){const e=`${xZ++}`;return Od[e]=n,e}else Object.assign(Od,n)}function h8(n,e){const t=cy(n),i=Od[t];if(n!=="primitive"&&!i)throw new Error(`R3F: ${t} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(n==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function SZ(n,e,t){var i;return n=cy(n)in Od?n:n.replace(_Z,""),h8(n,e),n==="primitive"&&(i=e.object)!=null&&i.__r3f&&delete e.object.__r3f,Gx(e.object,t,n,e)}function TZ(n){if(!n.isHidden){var e;n.props.attach&&(e=n.parent)!=null&&e.object?kx(n.parent,n):Ca(n.object)&&(n.object.visible=!1),n.isHidden=!0,Zd(n)}}function f8(n){if(n.isHidden){var e;n.props.attach&&(e=n.parent)!=null&&e.object?Vx(n.parent,n):Ca(n.object)&&n.props.visible!==!1&&(n.object.visible=!0),n.isHidden=!1,Zd(n)}}function nA(n,e,t){const i=e.root.getState();if(!(!n.parent&&n.object!==i.scene)){if(!e.object){var a,r;const s=Od[cy(e.type)];e.object=(a=e.props.object)!=null?a:new s(...(r=e.props.args)!=null?r:[]),e.object.__r3f=e}if(Yl(e.object,e.props),e.props.attach)Vx(n,e);else if(Ca(e.object)&&Ca(n.object)){const s=n.object.children.indexOf(t==null?void 0:t.object);if(t&&s!==-1){const o=n.object.children.indexOf(e.object);if(o!==-1){n.object.children.splice(o,1);const c=o{try{n.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():_E.unstable_scheduleCallback(_E.unstable_IdlePriority,e)}}function yE(n,e,t){if(!e)return;e.parent=null;const i=n.children.indexOf(e);i!==-1&&n.children.splice(i,1),e.props.attach?kx(n,e):Ca(e.object)&&Ca(n.object)&&(n.object.remove(e.object),dZ(e8(e),e.object));const a=e.props.dispose!==null&&t!==!1;for(let r=e.children.length-1;r>=0;r--){const s=e.children[r];yE(e,s,a)}e.children.length=0,delete e.object.__r3f,a&&e.type!=="primitive"&&e.object.type!=="Scene"&&d8(e.object),t===void 0&&Zd(e)}function EZ(n,e){for(const t of[n,n.alternate])if(t!==null)if(typeof t.ref=="function"){t.refCleanup==null||t.refCleanup();const i=t.ref(e);typeof i=="function"&&(t.refCleanup=i)}else t.ref&&(t.ref.current=e)}const __=[];function MZ(){for(const[t]of __){const i=t.parent;if(i){t.props.attach?kx(i,t):Ca(t.object)&&Ca(i.object)&&i.object.remove(t.object);for(const a of t.children)a.props.attach?kx(t,a):Ca(a.object)&&Ca(t.object)&&t.object.remove(a.object)}t.isHidden&&f8(t),t.object.__r3f&&delete t.object.__r3f,t.type!=="primitive"&&d8(t.object)}for(const[t,i,a]of __){t.props=i;const r=t.parent;if(r){var n,e;const s=Od[cy(t.type)];t.object=(n=t.props.object)!=null?n:new s(...(e=t.props.args)!=null?e:[]),t.object.__r3f=t,EZ(a,t.object),Yl(t.object,t.props),t.props.attach?Vx(r,t):Ca(t.object)&&Ca(r.object)&&r.object.add(t.object);for(const o of t.children)o.props.attach?Vx(t,o):Ca(o.object)&&Ca(t.object)&&t.object.add(o.object);Zd(t)}}__.length=0}const _2=()=>{},XN={};let zv=c8;const bZ=0,AZ=4,SE=vZ({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:SZ,removeChild:yE,appendChild:v2,appendInitialChild:v2,insertBefore:WN,appendChildToContainer(n,e){const t=n.getState().scene.__r3f;!e||!t||v2(t,e)},removeChildFromContainer(n,e){const t=n.getState().scene.__r3f;!e||!t||yE(t,e)},insertInContainerBefore(n,e,t){const i=n.getState().scene.__r3f;!e||!t||!i||WN(i,e,t)},getRootHostContext:()=>XN,getChildHostContext:()=>XN,commitUpdate(n,e,t,i,a){var r,s,o;h8(e,i);let c=!1;if((n.type==="primitive"&&t.object!==i.object||((r=i.args)==null?void 0:r.length)!==((s=t.args)==null?void 0:s.length)||(o=i.args)!=null&&o.some((f,d)=>{var m;return f!==((m=t.args)==null?void 0:m[d])}))&&(c=!0),c)__.push([n,{...i},a]);else{const f=cZ(n,i);Object.keys(f).length&&(Object.assign(n.props,f),Yl(n.object,f))}(a.sibling===null||(a.flags&AZ)===bZ)&&MZ()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:n=>n==null?void 0:n.object,prepareForCommit:()=>null,preparePortalMount:n=>Gx(n.getState().scene,n,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:TZ,unhideInstance:f8,createTextInstance:_2,hideTextInstance:_2,unhideTextInstance:_2,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:Me.createContext(null),setCurrentUpdatePriority(n){zv=n},getCurrentUpdatePriority(){return zv},resolveUpdatePriority(){var n;if(zv!==c8)return zv;switch(typeof window<"u"&&((n=window.event)==null?void 0:n.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return p_.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return p_.ContinuousEventPriority;default:return p_.DefaultEventPriority}},resetFormInstance(){}}),$u=new Map,pf={objects:"shallow",strict:!1};function wZ(n,e){if(!e&&typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:t,height:i,top:a,left:r}=n.parentElement.getBoundingClientRect();return{width:t,height:i,top:a,left:r}}else if(!e&&typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function RZ(n){const e=$u.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const a=typeof reportError=="function"?reportError:console.error,r=i||mZ(ME,qN),s=t||SE.createContainer(r,p_.ConcurrentRoot,null,!1,null,"",a,a,a,null);e||$u.set(n,{fiber:s,store:r});let o,c,h=!1,f=null;return{async configure(d={}){let m;f=new Promise(Ce=>m=Ce);let{gl:g,size:x,scene:T,events:y,onCreated:v,shadows:S=!1,linear:E=!1,flat:b=!1,legacy:D=!1,orthographic:C=!1,frameloop:I="always",dpr:P=[1,2],performance:O,raycaster:w,camera:B,onPointerMissed:j}=d,ee=r.getState(),se=ee.gl;if(!ee.gl){const Ce={canvas:n,powerPreference:"high-performance",antialias:!0,alpha:!0},Xe=typeof g=="function"?await g(Ce):g;VN(Xe)?se=Xe:se=new $b({...Ce,...g}),ee.set({gl:se})}let re=ee.raycaster;re||ee.set({raycaster:re=new O6});const{params:W,...te}=w||{};if(ri.equ(te,re,pf)||Yl(re,{...te}),ri.equ(W,re.params,pf)||Yl(re,{params:{...re.params,...W}}),!ee.camera||ee.camera===c&&!ri.equ(c,B,pf)){c=B;const Ce=B==null?void 0:B.isCamera,Xe=Ce?B:C?new ao(0,0,0,0,.1,1e3):new hi(75,0,.1,1e3);Ce||(Xe.position.z=5,B&&(Yl(Xe,B),Xe.manual||("aspect"in B||"left"in B||"right"in B||"bottom"in B||"top"in B)&&(Xe.manual=!0,Xe.updateProjectionMatrix())),!ee.camera&&!(B!=null&&B.rotation)&&Xe.lookAt(0,0,0)),ee.set({camera:Xe}),re.camera=Xe}if(!ee.scene){let Ce;T!=null&&T.isScene?(Ce=T,Gx(Ce,r,"",{})):(Ce=new Rd,Gx(Ce,r,"",{}),T&&Yl(Ce,T)),ee.set({scene:Ce})}y&&!ee.events.handlers&&ee.set({events:y(r)});const K=wZ(n,x);if(ri.equ(K,ee.size,pf)||ee.setSize(K.width,K.height,K.top,K.left),P&&ee.viewport.dpr!==i8(P)&&ee.setDpr(P),ee.frameloop!==I&&ee.setFrameloop(I),ee.onPointerMissed||ee.set({onPointerMissed:j}),O&&!ri.equ(O,ee.performance,pf)&&ee.set(Ce=>({performance:{...Ce.performance,...O}})),!ee.xr){var oe;const Ce=(tt,gt)=>{const ge=r.getState();ge.frameloop!=="never"&&qN(tt,!0,ge,gt)},Xe=()=>{const tt=r.getState();tt.gl.xr.enabled=tt.gl.xr.isPresenting,tt.gl.xr.setAnimationLoop(tt.gl.xr.isPresenting?Ce:null),tt.gl.xr.isPresenting||ME(tt)},nt={connect(){const tt=r.getState().gl;tt.xr.addEventListener("sessionstart",Xe),tt.xr.addEventListener("sessionend",Xe)},disconnect(){const tt=r.getState().gl;tt.xr.removeEventListener("sessionstart",Xe),tt.xr.removeEventListener("sessionend",Xe)}};typeof((oe=se.xr)==null?void 0:oe.addEventListener)=="function"&&nt.connect(),ee.set({xr:nt})}if(se.shadowMap){const Ce=se.shadowMap.enabled,Xe=se.shadowMap.type;if(se.shadowMap.enabled=!!S,ri.boo(S))se.shadowMap.type=Dm;else if(ri.str(S)){var ie;const nt={basic:ZI,percentage:R1,soft:Dm,variance:Ss};se.shadowMap.type=(ie=nt[S])!=null?ie:Dm}else ri.obj(S)&&Object.assign(se.shadowMap,S);(Ce!==se.shadowMap.enabled||Xe!==se.shadowMap.type)&&(se.shadowMap.needsUpdate=!0)}return rn.enabled=!D,h||(se.outputColorSpace=E?Wn:En,se.toneMapping=b?is:hb),ee.legacy!==D&&ee.set(()=>({legacy:D})),ee.linear!==E&&ee.set(()=>({linear:E})),ee.flat!==b&&ee.set(()=>({flat:b})),g&&!ri.fun(g)&&!VN(g)&&!ri.equ(g,se,pf)&&Yl(se,g),o=v,h=!0,m(),this},render(d){return!h&&!f&&this.configure(),f.then(()=>{SE.updateContainer(Rt.jsx(CZ,{store:r,children:d,onCreated:o,rootElement:n}),s,null,()=>{})}),r},unmount(){p8(n)}}}function CZ({store:n,children:e,onCreated:t,rootElement:i}){return k0(()=>{const a=n.getState();a.set(r=>({internal:{...r.internal,active:!0}})),t&&t(a),n.getState().events.connected||a.events.connect==null||a.events.connect(i)},[]),Rt.jsx(s8.Provider,{value:n,children:e})}function p8(n,e){const t=$u.get(n),i=t==null?void 0:t.fiber;if(i){const a=t==null?void 0:t.store.getState();a&&(a.internal.active=!1),SE.updateContainer(null,i,null,()=>{a&&setTimeout(()=>{try{var r,s,o,c;a.events.disconnect==null||a.events.disconnect(),(r=a.gl)==null||(s=r.renderLists)==null||s.dispose==null||s.dispose(),(o=a.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(c=a.gl)!=null&&c.xr&&a.xr.disconnect(),sZ(a.scene),$u.delete(n)}catch{}},500)})}}const NZ=new Set,DZ=new Set,OZ=new Set;function x2(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Hm(n,e){switch(n){case"before":return x2(NZ,e);case"after":return x2(DZ,e);case"tail":return x2(OZ,e)}}let y2,S2;function TE(n,e,t){let i=e.clock.getDelta();e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),y2=e.internal.subscribers;for(let a=0;a0)&&!((e=mf.gl.xr)!=null&&e.isPresenting)&&(T2+=TE(n,mf))}if(EE=!1,Hm("after",n),T2===0)return Hm("tail",n),Xx=!1,cancelAnimationFrame(YN)}function ME(n,e=1){var t;if(!n)return $u.forEach(i=>ME(i.store.getState(),e));(t=n.gl.xr)!=null&&t.isPresenting||!n.internal.active||n.frameloop==="never"||(e>1?n.internal.frames=Math.min(60,n.internal.frames+e):EE?n.internal.frames=2:n.internal.frames=1,Xx||(Xx=!0,requestAnimationFrame(m8)))}function qN(n,e=!0,t,i){if(e&&Hm("before",n),t)TE(n,t,i);else for(const a of $u.values())TE(n,a.store.getState());e&&Hm("after",n)}const E2={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function LZ(n){const{handlePointer:e}=pZ(n);return{priority:1,enabled:!0,compute(t,i,a){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(E2).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:a}=n.getState();(t=a.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(a.lastEvent.current)},connect:t=>{const{set:i,events:a}=n.getState();if(a.disconnect==null||a.disconnect(),i(r=>({events:{...r.events,connected:t}})),a.handlers)for(const r in a.handlers){const s=a.handlers[r],[o,c]=E2[r];t.addEventListener(o,s,{passive:c})}},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){if(i.handlers)for(const a in i.handlers){const r=i.handlers[a],[s]=E2[a];i.connected.removeEventListener(s,r)}t(a=>({events:{...a.events,connected:void 0}}))}}}}function jN(n,e){let t;return(...i)=>{window.clearTimeout(t),t=window.setTimeout(()=>n(...i),e)}}function IZ({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const a=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!a)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[r,s]=Me.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),o=Me.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:r,orientationHandler:null}),c=n?typeof n=="number"?n:n.scroll:null,h=n?typeof n=="number"?n:n.resize:null,f=Me.useRef(!1);Me.useEffect(()=>(f.current=!0,()=>void(f.current=!1)));const[d,m,g]=Me.useMemo(()=>{const v=()=>{if(!o.current.element)return;const{left:S,top:E,width:b,height:D,bottom:C,right:I,x:P,y:O}=o.current.element.getBoundingClientRect(),w={left:S,top:E,width:b,height:D,bottom:C,right:I,x:P,y:O};o.current.element instanceof HTMLElement&&i&&(w.height=o.current.element.offsetHeight,w.width=o.current.element.offsetWidth),Object.freeze(w),f.current&&!BZ(o.current.lastBounds,w)&&s(o.current.lastBounds=w)};return[v,h?jN(v,h):v,c?jN(v,c):v]},[s,i,c,h]);function x(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(v=>v.removeEventListener("scroll",g,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function T(){o.current.element&&(o.current.resizeObserver=new a(g),o.current.resizeObserver.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(v=>v.addEventListener("scroll",g,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{g()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const y=v=>{!v||v===o.current.element||(x(),o.current.element=v,o.current.scrollContainers=g8(v),T())};return PZ(g,!!e),UZ(m),Me.useEffect(()=>{x(),T()},[e,g,m]),Me.useEffect(()=>x,[]),[y,r,d]}function UZ(n){Me.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function PZ(n,e){Me.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function g8(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:a}=window.getComputedStyle(n);return[t,i,a].some(r=>r==="auto"||r==="scroll")&&e.push(n),[...e,...g8(n.parentElement)]}const zZ=["x","y","top","bottom","left","right","width","height"],BZ=(n,e)=>zZ.every(t=>n[t]===e[t]);function HZ({ref:n,children:e,fallback:t,resize:i,style:a,gl:r,events:s=LZ,eventSource:o,eventPrefix:c,shadows:h,linear:f,flat:d,legacy:m,orthographic:g,frameloop:x,dpr:T,performance:y,raycaster:v,camera:S,scene:E,onPointerMissed:b,onCreated:D,...C}){Me.useMemo(()=>u8(vj),[]);const I=nZ(),[P,O]=IZ({scroll:!0,debounce:{scroll:50,resize:0},...i}),w=Me.useRef(null),B=Me.useRef(null);Me.useImperativeHandle(n,()=>w.current);const j=n8(b),[ee,se]=Me.useState(!1),[re,W]=Me.useState(!1);if(ee)throw ee;if(re)throw re;const te=Me.useRef(null);k0(()=>{const oe=w.current;if(O.width>0&&O.height>0&&oe){te.current||(te.current=RZ(oe));async function ie(){await te.current.configure({gl:r,scene:E,events:s,shadows:h,linear:f,flat:d,legacy:m,orthographic:g,frameloop:x,dpr:T,performance:y,raycaster:v,camera:S,size:O,onPointerMissed:(...Ce)=>j.current==null?void 0:j.current(...Ce),onCreated:Ce=>{Ce.events.connect==null||Ce.events.connect(o?eZ(o)?o.current:o:B.current),c&&Ce.setEvents({compute:(Xe,nt)=>{const tt=Xe[c+"X"],gt=Xe[c+"Y"];nt.pointer.set(tt/nt.size.width*2-1,-(gt/nt.size.height)*2+1),nt.raycaster.setFromCamera(nt.pointer,nt.camera)}}),D==null||D(Ce)}}),te.current.render(Rt.jsx(I,{children:Rt.jsx(aZ,{set:W,children:Rt.jsx(Me.Suspense,{fallback:Rt.jsx(iZ,{set:se}),children:e??null})})}))}ie()}}),Me.useEffect(()=>{const oe=w.current;if(oe)return()=>p8(oe)},[]);const K=o?"none":"auto";return Rt.jsx("div",{ref:B,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:K,...a},...C,children:Rt.jsx("div",{ref:P,style:{width:"100%",height:"100%"},children:Rt.jsx("canvas",{ref:w,style:{display:"block"},children:t})})})}function v8(n){return Rt.jsx(J6,{children:Rt.jsx(HZ,{...n})})}function ZN(n,e){if(e===MU)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===Px||e===_b){let t=n.getIndex();if(t===null){const s=[],o=n.getAttribute("position");if(o!==void 0){for(let c=0;c=2.0 are supported."));return}const h=new _K(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let f=0;f=0&&o[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}h.setExtensions(s),h.setPlugins(o),h.parse(i,a)}parseAsync(e,t){const i=this;return new Promise(function(a,r){i.parse(e,t,a,r)})}}function FZ(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const on={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class GZ{constructor(e){this.parser=e,this.name=on.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,a=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,s)}}class tK{constructor(e){this.parser=e,this.name=on.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,i=this.parser,a=i.json,r=a.textures[e];if(!r.extensions||!r.extensions[t])return null;const s=r.extensions[t],o=a.images[s.source];let c=i.textureLoader;if(o.uri){const h=i.options.manager.getHandler(o.uri);h!==null&&(c=h)}return i.loadTextureImage(e,s.source,c)}}class nK{constructor(e){this.parser=e,this.name=on.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,i=this.parser,a=i.json,r=a.textures[e];if(!r.extensions||!r.extensions[t])return null;const s=r.extensions[t],o=a.images[s.source];let c=i.textureLoader;if(o.uri){const h=i.options.manager.getHandler(o.uri);h!==null&&(c=h)}return i.loadTextureImage(e,s.source,c)}}class iK{constructor(e){this.name=on.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const a=i.extensions[this.name],r=this.parser.getDependency("buffer",a.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(o){const c=a.byteOffset||0,h=a.byteLength||0,f=a.count,d=a.byteStride,m=new Uint8Array(o,c,h);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(f,d,m,a.mode,a.filter).then(function(g){return g.buffer}):s.ready.then(function(){const g=new ArrayBuffer(f*d);return s.decodeGltfBuffer(new Uint8Array(g),f,d,m,a.mode,a.filter),g})})}else return null}}class aK{constructor(e){this.name=on.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const a=t.meshes[i.mesh];for(const h of a.primitives)if(h.mode!==Yr.TRIANGLES&&h.mode!==Yr.TRIANGLE_STRIP&&h.mode!==Yr.TRIANGLE_FAN&&h.mode!==void 0)return null;const s=i.extensions[this.name].attributes,o=[],c={};for(const h in s)o.push(this.parser.getDependency("accessor",s[h]).then(f=>(c[h]=f,c[h])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(h=>{const f=h.pop(),d=f.isGroup?f.children:[f],m=h[0].count,g=[];for(const x of d){const T=new ke,y=new L,v=new St,S=new L(1,1,1),E=new Ab(x.geometry,x.material,m);for(let b=0;b0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":n.search(/\.ktx2($|\?)/i)>0||n.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const vK=new ke;class _K{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new FZ,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,a=-1,r=!1,s=-1;if(typeof navigator<"u"){const o=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(o)===!0;const c=o.match(/Version\/(\d+)/);a=i&&c?parseInt(c[1],10):-1,r=o.indexOf("Firefox")>-1,s=r?o.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&a<17||r&&s<98?this.textureLoader=new kb(this.options.manager):this.textureLoader=new A6(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new os(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,a=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(s){const o={scene:s[0][a.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:a.asset,parser:i,userData:{}};return lu(r,o,a),js(o,a),Promise.all(i._invokeAll(function(c){return c.afterRoot&&c.afterRoot(o)})).then(function(){for(const c of o.scenes)c.updateMatrixWorld();e(o)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let a=0,r=t.length;a{const c=this.associations.get(s);c!=null&&this.associations.set(o,c);for(const[h,f]of s.children.entries())r(f,o.children[h])};return r(i,a),a.name+="_instance_"+e.uses[t]++,a}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&y.setY(O,C[I*c+1]),c>=3&&y.setZ(O,C[I*c+2]),c>=4&&y.setW(O,C[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}y.normalized=x}return y})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e].source,s=t.images[r];let o=this.textureLoader;if(s.uri){const c=i.manager.getHandler(s.uri);c!==null&&(o=c)}return this.loadTextureImage(e,r,o)}loadTextureImage(e,t,i){const a=this,r=this.json,s=r.textures[e],o=r.images[t],c=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[c])return this.textureCache[c];const h=this.loadImageSource(t,i).then(function(f){f.flipY=!1,f.name=s.name||o.name||"",f.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(f.name=o.uri);const m=(r.samplers||{})[s.sampler]||{};return f.magFilter=JN[m.magFilter]||Ht,f.minFilter=JN[m.minFilter]||Mr,f.wrapS=$N[m.wrapS]||Ea,f.wrapT=$N[m.wrapT]||Ea,f.generateMipmaps=!f.isCompressedTexture&&f.minFilter!==Fn&&f.minFilter!==Ht,a.associations.set(f,{textures:e}),f}).catch(function(){return null});return this.textureCache[c]=h,h}loadImageSource(e,t){const i=this,a=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const s=a.images[e],o=self.URL||self.webkitURL;let c=s.uri||"",h=!1;if(s.bufferView!==void 0)c=i.getDependency("bufferView",s.bufferView).then(function(d){h=!0;const m=new Blob([d],{type:s.mimeType});return c=o.createObjectURL(m),c});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const f=Promise.resolve(c).then(function(d){return new Promise(function(m,g){let x=m;t.isImageBitmapLoader===!0&&(x=function(T){const y=new Nn(T);y.needsUpdate=!0,m(y)}),t.load(uc.resolveURL(d,r.path),x,void 0,g)})}).then(function(d){return h===!0&&o.revokeObjectURL(c),js(d,s),d.userData.mimeType=s.mimeType||gK(s.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),d});return this.sourceCache[e]=f,f}assignTexture(e,t,i,a){const r=this;return this.getDependency("texture",i.index).then(function(s){if(!s)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(s=s.clone(),s.channel=i.texCoord),r.extensions[on.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[on.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const c=r.associations.get(s);s=r.extensions[on.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,c)}}return a!==void 0&&(s.colorSpace=a),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const a=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,s=t.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+i.uuid;let c=this.cache.get(o);c||(c=new W1,qn.prototype.copy.call(c,i),c.color.copy(i.color),c.map=i.map,c.sizeAttenuation=!1,this.cache.add(o,c)),i=c}else if(e.isLine){const o="LineBasicMaterial:"+i.uuid;let c=this.cache.get(o);c||(c=new Bi,qn.prototype.copy.call(c,i),c.color.copy(i.color),c.map=i.map,this.cache.add(o,c)),i=c}if(a||r||s){let o="ClonedMaterial:"+i.uuid+":";a&&(o+="derivative-tangents:"),r&&(o+="vertex-colors:"),s&&(o+="flat-shading:");let c=this.cache.get(o);c||(c=i.clone(),r&&(c.vertexColors=!0),s&&(c.flatShading=!0),a&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(o,c),this.associations.set(c,this.associations.get(i))),i=c}e.material=i}getMaterialType(){return V0}loadMaterial(e){const t=this,i=this.json,a=this.extensions,r=i.materials[e];let s;const o={},c=r.extensions||{},h=[];if(c[on.KHR_MATERIALS_UNLIT]){const d=a[on.KHR_MATERIALS_UNLIT];s=d.getMaterialType(),h.push(d.extendParams(o,r,t))}else{const d=r.pbrMetallicRoughness||{};if(o.color=new je(1,1,1),o.opacity=1,Array.isArray(d.baseColorFactor)){const m=d.baseColorFactor;o.color.setRGB(m[0],m[1],m[2],Wn),o.opacity=m[3]}d.baseColorTexture!==void 0&&h.push(t.assignTexture(o,"map",d.baseColorTexture,En)),o.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,o.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(h.push(t.assignTexture(o,"metalnessMap",d.metallicRoughnessTexture)),h.push(t.assignTexture(o,"roughnessMap",d.metallicRoughnessTexture))),s=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(e)}),h.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,o)})))}r.doubleSided===!0&&(o.side=ca);const f=r.alphaMode||b2.OPAQUE;if(f===b2.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,f===b2.MASK&&(o.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&s!==Ia&&(h.push(t.assignTexture(o,"normalMap",r.normalTexture)),o.normalScale=new de(1,1),r.normalTexture.scale!==void 0)){const d=r.normalTexture.scale;o.normalScale.set(d,d)}if(r.occlusionTexture!==void 0&&s!==Ia&&(h.push(t.assignTexture(o,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&s!==Ia){const d=r.emissiveFactor;o.emissive=new je().setRGB(d[0],d[1],d[2],Wn)}return r.emissiveTexture!==void 0&&s!==Ia&&h.push(t.assignTexture(o,"emissiveMap",r.emissiveTexture,En)),Promise.all(h).then(function(){const d=new s(o);return r.name&&(d.name=r.name),js(d,r),t.associations.set(d,{materials:e}),r.extensions&&lu(a,d,r),d})}createUniqueName(e){const t=fn.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,a=this.primitiveCache;function r(o){return i[on.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,t).then(function(c){return eD(c,o,t)})}const s=[];for(let o=0,c=e.length;o0&&pK(v,r),v.name=t.createUniqueName(r.name||"mesh_"+e),js(v,r),y.extensions&&lu(a,v,y),t.assignFinalMaterial(v),d.push(v)}for(let g=0,x=d.length;g1?f=new Ua:h.length===1?f=h[0]:f=new Wt,f!==h[0])for(let d=0,m=h.length;d1){const d=a.associations.get(f);a.associations.set(f,{...d})}return a.associations.get(f).nodes=e,f}),this.nodeCache[e]}loadScene(e){const t=this.extensions,i=this.json.scenes[e],a=this,r=new Ua;i.name&&(r.name=a.createUniqueName(i.name)),js(r,i),i.extensions&&lu(t,r,i);const s=i.nodes||[],o=[];for(let c=0,h=s.length;c{const d=new Map;for(const[m,g]of a.associations)(m instanceof qn||m instanceof Nn)&&d.set(m,g);return f.traverse(m=>{const g=a.associations.get(m);g!=null&&d.set(m,g)}),d};return a.associations=h(r),r})}_createAnimationTracks(e,t,i,a,r){const s=[],o=e.name?e.name:e.uuid,c=[];Il[r.path]===Il.weights?e.traverse(function(m){m.morphTargetInfluences&&c.push(m.name?m.name:m.uuid)}):c.push(o);let h;switch(Il[r.path]){case Il.weights:h=xc;break;case Il.rotation:h=yc;break;case Il.translation:case Il.scale:h=Qu;break;default:switch(i.itemSize){case 1:h=xc;break;case 2:case 3:default:h=Qu;break}break}const f=a.interpolation!==void 0?hK[a.interpolation]:Td,d=this._getArrayFromAccessor(i);for(let m=0,g=c.length;mnew Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),vn=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),JN=class extends Zt{constructor(n){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${n}`,this.expressionName=n,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(n){this._binds.push(n)}deleteBind(n){const e=this._binds.indexOf(n);e>=0&&this._binds.splice(e,1)}applyWeight(n){var e;let t=this.outputWeight;t*=(e=n==null?void 0:n.multiplier)!=null?e:1,this.isBinary&&t<1&&(t=0),this._binds.forEach(i=>i.applyWeight(t))}clearAppliedWeight(){this._binds.forEach(n=>n.clearAppliedWeight())}};function _8(n,e,t){var i,a;const r=n.parser.json,s=(i=r.nodes)==null?void 0:i[e];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;const o=s.mesh;if(o==null)return null;const c=(a=r.meshes)==null?void 0:a[o];if(c==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${o}] of glTF but the mesh doesn't exist`),null;const h=c.primitives.length,f=[];return t.traverse(d=>{f.length{const r=_8(n,a,i);r!=null&&t.set(a,r)}),t})}var ME={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function x8(n){return Math.max(Math.min(n,1),0)}var tD=class y8{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"],this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"],this.mouthExpressionNames=["aa","ee","ih","oh","ou"],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){const e={},t=new Set(Object.values(ME));return Object.entries(this._expressionMap).forEach(([i,a])=>{t.has(i)&&(e[i]=a)}),e}get customExpressionMap(){const e={},t=new Set(Object.values(ME));return Object.entries(this._expressionMap).forEach(([i,a])=>{t.has(i)||(e[i]=a)}),e}copy(e){return this._expressions.concat().forEach(i=>{this.unregisterExpression(i)}),e._expressions.forEach(i=>{this.registerExpression(i)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new y8().copy(this)}getExpression(e){var t;return(t=this._expressionMap[e])!=null?t:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){const t=this._expressions.indexOf(e);t===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){var t;const i=this.getExpression(e);return(t=i==null?void 0:i.weight)!=null?t:null}setValue(e,t){const i=this.getExpression(e);i&&(i.weight=x8(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){const t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){const e=this._calculateWeightMultipliers();this._expressions.forEach(t=>{t.clearAppliedWeight()}),this._expressions.forEach(t=>{let i=1;const a=t.expressionName;this.blinkExpressionNames.indexOf(a)!==-1&&(i*=e.blink),this.lookAtExpressionNames.indexOf(a)!==-1&&(i*=e.lookAt),this.mouthExpressionNames.indexOf(a)!==-1&&(i*=e.mouth),t.applyWeight({multiplier:i})})}_calculateWeightMultipliers(){let e=1,t=1,i=1;return this._expressions.forEach(a=>{e-=a.overrideBlinkAmount,t-=a.overrideLookAtAmount,i-=a.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),i=Math.max(0,i),{blink:e,lookAt:t,mouth:i}}},Xp={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",RimColor:"rimColor",OutlineColor:"outlineColor"},xK={_Color:Xp.Color,_EmissionColor:Xp.EmissionColor,_ShadeColor:Xp.ShadeColor,_RimColor:Xp.RimColor,_OutlineColor:Xp.OutlineColor},yK=new je,S8=class T8{constructor({material:e,type:t,targetValue:i,targetAlpha:a}){this.material=e,this.type=t,this.targetValue=i,this.targetAlpha=a??1;const r=this._initColorBindState(),s=this._initAlphaBindState();this._state={color:r,alpha:s}}applyWeight(e){const{color:t,alpha:i}=this._state;if(t!=null){const{propertyName:a,deltaValue:r}=t,s=this.material[a];s!=null&&s.add(yK.copy(r).multiplyScalar(e))}if(i!=null){const{propertyName:a,deltaValue:r}=i;this.material[a]!=null&&(this.material[a]+=r*e)}}clearAppliedWeight(){const{color:e,alpha:t}=this._state;if(e!=null){const{propertyName:i,initialValue:a}=e,r=this.material[i];r!=null&&r.copy(a)}if(t!=null){const{propertyName:i,initialValue:a}=t;this.material[i]!=null&&(this.material[i]=a)}}_initColorBindState(){var e,t,i;const{material:a,type:r,targetValue:s}=this,o=this._getPropertyNameMap(),c=(t=(e=o==null?void 0:o[r])==null?void 0:e[0])!=null?t:null;if(c==null)return console.warn(`Tried to add a material color bind to the material ${(i=a.name)!=null?i:"(no name)"}, the type ${r} but the material or the type is not supported.`),null;const f=a[c].clone(),d=new je(s.r-f.r,s.g-f.g,s.b-f.b);return{propertyName:c,initialValue:f,deltaValue:d}}_initAlphaBindState(){var e,t,i;const{material:a,type:r,targetAlpha:s}=this,o=this._getPropertyNameMap(),c=(t=(e=o==null?void 0:o[r])==null?void 0:e[1])!=null?t:null;if(c==null&&s!==1)return console.warn(`Tried to add a material alpha bind to the material ${(i=a.name)!=null?i:"(no name)"}, the type ${r} but the material or the type does not support alpha.`),null;if(c==null)return null;const h=a[c],f=s-h;return{propertyName:c,initialValue:h,deltaValue:f}}_getPropertyNameMap(){var e,t;return(t=(e=Object.entries(T8._propertyNameMapMap).find(([i])=>this.material[i]===!0))==null?void 0:e[1])!=null?t:null}};S8._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var nD=S8,kx=class{constructor({primitives:n,index:e,weight:t}){this.primitives=n,this.index=e,this.weight=t}applyWeight(n){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]+=this.weight*n)})}clearAppliedWeight(){this.primitives.forEach(n=>{var e;((e=n.morphTargetInfluences)==null?void 0:e[this.index])!=null&&(n.morphTargetInfluences[this.index]=0)})}},iD=new de,E8=class M8{constructor({material:e,scale:t,offset:i}){var a,r;this.material=e,this.scale=t,this.offset=i;const s=(a=Object.entries(M8._propertyNamesMap).find(([o])=>e[o]===!0))==null?void 0:a[1];s==null?(console.warn(`Tried to add a texture transform bind to the material ${(r=e.name)!=null?r:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],s.forEach(o=>{var c;const h=(c=e[o])==null?void 0:c.clone();if(!h)return null;e[o]=h;const f=h.offset.clone(),d=h.repeat.clone(),m=i.clone().sub(f),g=t.clone().sub(d);this._properties.push({name:o,initialOffset:f,deltaOffset:m,initialScale:d,deltaScale:g})}))}applyWeight(e){this._properties.forEach(t=>{const i=this.material[t.name];i!==void 0&&(i.offset.add(iD.copy(t.deltaOffset).multiplyScalar(e)),i.repeat.add(iD.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{const t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};E8._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var aD=E8,SK=new Set(["1.0","1.0-beta"]),b8=class A8{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return vn(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return vn(this,null,function*(){const t=yield this._v1Import(e);if(t)return t;const i=yield this._v0Import(e);return i||null})}_v1Import(e){return vn(this,null,function*(){var t,i;const a=this.parser.json;if(!(((t=a.extensionsUsed)==null?void 0:t.indexOf("VRMC_vrm"))!==-1))return null;const s=(i=a.extensions)==null?void 0:i.VRMC_vrm;if(!s)return null;const o=s.specVersion;if(!SK.has(o))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${o}"`),null;const c=s.expressions;if(!c)return null;const h=new Set(Object.values(ME)),f=new Map;c.preset!=null&&Object.entries(c.preset).forEach(([m,g])=>{if(g!=null){if(!h.has(m)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${m}" detected. Ignoring the expression`);return}f.set(m,g)}}),c.custom!=null&&Object.entries(c.custom).forEach(([m,g])=>{if(h.has(m)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${m}". Ignoring the expression`);return}f.set(m,g)});const d=new tD;return yield Promise.all(Array.from(f.entries()).map(m=>vn(this,[m],function*([g,x]){var T,S,v,y,E,b,D;const C=new JN(g);if(e.scene.add(C),C.isBinary=(T=x.isBinary)!=null?T:!1,C.overrideBlink=(S=x.overrideBlink)!=null?S:"none",C.overrideLookAt=(v=x.overrideLookAt)!=null?v:"none",C.overrideMouth=(y=x.overrideMouth)!=null?y:"none",(E=x.morphTargetBinds)==null||E.forEach(I=>vn(this,null,function*(){var P;if(I.node===void 0||I.index===void 0)return;const O=yield $N(e,I.node),R=I.index;if(!O.every(B=>Array.isArray(B.morphTargetInfluences)&&R{const O=P.material;O&&(Array.isArray(O)?I.push(...O):I.push(O))}),(b=x.materialColorBinds)==null||b.forEach(P=>vn(this,null,function*(){I.filter(R=>{var B;const j=(B=this.parser.associations.get(R))==null?void 0:B.materials;return P.material===j}).forEach(R=>{C.addBind(new nD({material:R,type:P.type,targetValue:new je().fromArray(P.targetValue),targetAlpha:P.targetValue[3]}))})})),(D=x.textureTransformBinds)==null||D.forEach(P=>vn(this,null,function*(){I.filter(R=>{var B;const j=(B=this.parser.associations.get(R))==null?void 0:B.materials;return P.material===j}).forEach(R=>{var B,j;C.addBind(new aD({material:R,offset:new de().fromArray((B=P.offset)!=null?B:[0,0]),scale:new de().fromArray((j=P.scale)!=null?j:[1,1])}))})}))}d.registerExpression(C)}))),d})}_v0Import(e){return vn(this,null,function*(){var t;const i=this.parser.json,a=(t=i.extensions)==null?void 0:t.VRM;if(!a)return null;const r=a.blendShapeMaster;if(!r)return null;const s=new tD,o=r.blendShapeGroups;if(!o)return s;const c=new Set;return yield Promise.all(o.map(h=>vn(this,null,function*(){var f;const d=h.presetName,m=d!=null&&A8.v0v1PresetNameMap[d]||null,g=m??h.name;if(g==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(c.has(g)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${d} has duplicated entries. Ignoring the expression`);return}c.add(g);const x=new JN(g);e.scene.add(x),x.isBinary=(f=h.isBinary)!=null?f:!1,h.binds&&h.binds.forEach(S=>vn(this,null,function*(){var v;if(S.mesh===void 0||S.index===void 0)return;const y=[];(v=i.nodes)==null||v.forEach((b,D)=>{b.mesh===S.mesh&&y.push(D)});const E=S.index;yield Promise.all(y.map(b=>vn(this,null,function*(){var D;const C=yield $N(e,b);if(!C.every(I=>Array.isArray(I.morphTargetInfluences)&&E{if(S.materialName===void 0||S.propertyName===void 0||S.targetValue===void 0)return;const v=[];e.scene.traverse(E=>{if(E.material){const b=E.material;Array.isArray(b)?v.push(...b.filter(D=>(D.name===S.materialName||D.name===S.materialName+" (Outline)")&&v.indexOf(D)===-1)):b.name===S.materialName&&v.indexOf(b)===-1&&v.push(b)}});const y=S.propertyName;v.forEach(E=>{if(y==="_MainTex_ST"){const D=new de(S.targetValue[0],S.targetValue[1]),C=new de(S.targetValue[2],S.targetValue[3]);C.y=1-C.y-D.y,x.addBind(new aD({material:E,scale:D,offset:C}));return}const b=xK[y];if(b){x.addBind(new nD({material:E,type:b,targetValue:new je().fromArray(S.targetValue),targetAlpha:S.targetValue[3]}));return}console.warn(y+" is not supported")})}),s.registerExpression(x)}))),s})}};b8.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var TK=b8,eA=class Rf{constructor(e,t){this._firstPersonOnlyLayer=Rf.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=Rf.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=e,this.meshAnnotations=t}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(t=>({meshes:t.meshes.concat(),type:t.type})),this}clone(){return new Rf(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=Rf.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:t=Rf.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=t,this.meshAnnotations.forEach(i=>{i.meshes.forEach(a=>{i.type==="firstPersonOnly"?(a.layers.set(this._firstPersonOnlyLayer),a.traverse(r=>r.layers.set(this._firstPersonOnlyLayer))):i.type==="thirdPersonOnly"?(a.layers.set(this._thirdPersonOnlyLayer),a.traverse(r=>r.layers.set(this._thirdPersonOnlyLayer))):i.type==="auto"&&this._createHeadlessModel(a)})}),this._initializedLayers=!0)}_excludeTriangles(e,t,i,a){let r=0;if(t!=null&&t.length>0)for(let s=0;s0&&a.includes(d[0])||f[1]>0&&a.includes(d[1])||f[2]>0&&a.includes(d[2])||f[3]>0&&a.includes(d[3]))continue;const m=t[c],g=i[c];if(m[0]>0&&a.includes(g[0])||m[1]>0&&a.includes(g[1])||m[2]>0&&a.includes(g[2])||m[3]>0&&a.includes(g[3]))continue;const x=t[h],T=i[h];x[0]>0&&a.includes(T[0])||x[1]>0&&a.includes(T[1])||x[2]>0&&a.includes(T[2])||x[3]>0&&a.includes(T[3])||(e[r++]=o,e[r++]=c,e[r++]=h)}return r}_createErasedMesh(e,t){const i=new B1(e.geometry.clone(),e.material);i.name=`${e.name}(erase)`,i.frustumCulled=e.frustumCulled,i.layers.set(this._firstPersonOnlyLayer);const a=i.geometry,r=a.getAttribute("skinIndex"),s=r instanceof cE?[]:r.array,o=[];for(let T=0;T{this._isEraseTarget(r)&&i.push(s)}),!i.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);const a=this._createErasedMesh(t,i);e.add(a)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer));else{const t=new Ia;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(i=>i.type==="SkinnedMesh").forEach(i=>{const a=i;this._createHeadlessModelForSkinnedMesh(t,a)})}else if(e.type==="SkinnedMesh"){const t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};eA.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;eA.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var rD=eA,EK=new Set(["1.0","1.0-beta"]),MK=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(n){this.parser=n}afterRoot(n){return vn(this,null,function*(){const e=n.userData.vrmHumanoid;if(e!==null){if(e===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");n.userData.vrmFirstPerson=yield this._import(n,e)}})}_import(n,e){return vn(this,null,function*(){if(e==null)return null;const t=yield this._v1Import(n,e);if(t)return t;const i=yield this._v0Import(n,e);return i||null})}_v1Import(n,e){return vn(this,null,function*(){var t,i;const a=this.parser.json;if(!(((t=a.extensionsUsed)==null?void 0:t.indexOf("VRMC_vrm"))!==-1))return null;const s=(i=a.extensions)==null?void 0:i.VRMC_vrm;if(!s)return null;const o=s.specVersion;if(!EK.has(o))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${o}"`),null;const c=s.firstPerson,h=[],f=yield eD(n);return Array.from(f.entries()).forEach(([d,m])=>{var g,x;const T=(g=c==null?void 0:c.meshAnnotations)==null?void 0:g.find(S=>S.node===d);h.push({meshes:m,type:(x=T==null?void 0:T.type)!=null?x:"auto"})}),new rD(e,h)})}_v0Import(n,e){return vn(this,null,function*(){var t;const i=this.parser.json,a=(t=i.extensions)==null?void 0:t.VRM;if(!a)return null;const r=a.firstPerson;if(!r)return null;const s=[],o=yield eD(n);return Array.from(o.entries()).forEach(([c,h])=>{const f=i.nodes[c],d=r.meshAnnotations?r.meshAnnotations.find(m=>m.mesh===f.mesh):void 0;s.push({meshes:h,type:this._convertV0FlagToV1Type(d==null?void 0:d.firstPersonFlag)})}),new rD(e,s)})}_convertV0FlagToV1Type(n){return n==="FirstPersonOnly"?"firstPersonOnly":n==="ThirdPersonOnly"?"thirdPersonOnly":n==="Both"?"both":"auto"}},sD=new L,oD=new L,bK=new Tt,lD=class extends Ia{constructor(n){super(),this.vrmHumanoid=n,this._boneAxesMap=new Map,Object.values(n.humanBones).forEach(e=>{const t=new O6(1);t.matrixAutoUpdate=!1,t.material.depthTest=!1,t.material.depthWrite=!1,this.add(t),this._boneAxesMap.set(e,t)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(n=>{n.geometry.dispose(),n.material.dispose()})}updateMatrixWorld(n){Array.from(this._boneAxesMap.entries()).forEach(([e,t])=>{e.node.updateWorldMatrix(!0,!1),e.node.matrixWorld.decompose(sD,bK,oD);const i=sD.set(.1,.1,.1).divide(oD);t.matrix.copy(e.node.matrixWorld).scale(i)}),super.updateMatrixWorld(n)}},M2=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"],AK={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function R8(n){return n.invert?n.invert():n.inverse(),n}var ou=new L,lu=new Tt,bE=class{constructor(n){this.humanBones=n,this.restPose=this.getAbsolutePose()}getAbsolutePose(){const n={};return Object.keys(this.humanBones).forEach(e=>{const t=e,i=this.getBoneNode(t);i&&(ou.copy(i.position),lu.copy(i.quaternion),n[t]={position:ou.toArray(),rotation:lu.toArray()})}),n}getPose(){const n={};return Object.keys(this.humanBones).forEach(e=>{const t=e,i=this.getBoneNode(t);if(!i)return;ou.set(0,0,0),lu.identity();const a=this.restPose[t];a!=null&&a.position&&ou.fromArray(a.position).negate(),a!=null&&a.rotation&&R8(lu.fromArray(a.rotation)),ou.add(i.position),lu.premultiply(i.quaternion),n[t]={position:ou.toArray(),rotation:lu.toArray()}}),n}setPose(n){Object.entries(n).forEach(([e,t])=>{const i=e,a=this.getBoneNode(i);if(!a)return;const r=this.restPose[i];r&&(t!=null&&t.position&&(a.position.fromArray(t.position),r.position&&a.position.add(ou.fromArray(r.position))),t!=null&&t.rotation&&(a.quaternion.fromArray(t.rotation),r.rotation&&a.quaternion.multiply(lu.fromArray(r.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([n,e])=>{const t=this.getBoneNode(n);t&&(e!=null&&e.position&&t.position.fromArray(e.position),e!=null&&e.rotation&&t.quaternion.fromArray(e.rotation))})}getBone(n){var e;return(e=this.humanBones[n])!=null?e:void 0}getBoneNode(n){var e,t;return(t=(e=this.humanBones[n])==null?void 0:e.node)!=null?t:null}},b2=new L,RK=new Tt,wK=new L,cD=class w8 extends bE{static _setupTransforms(e){const t=new Zt;t.name="VRMHumanoidRig";const i={},a={},r={};M2.forEach(o=>{var c;const h=e.getBoneNode(o);if(h){const f=new L,d=new Tt;h.updateWorldMatrix(!0,!1),h.matrixWorld.decompose(f,d,b2),i[o]=f,a[o]=h.quaternion.clone();const m=new Tt;(c=h.parent)==null||c.matrixWorld.decompose(b2,m,b2),r[o]=m}});const s={};return M2.forEach(o=>{var c;const h=e.getBoneNode(o);if(h){const f=i[o];let d=o,m;for(;m==null&&(d=AK[d],d!=null);)m=i[d];const g=new Zt;g.name="Normalized_"+h.name,(d?(c=s[d])==null?void 0:c.node:t).add(g),g.position.copy(f),m&&g.position.sub(m),s[o]={node:g}}}),{rigBones:s,root:t,parentWorldRotations:r,boneRotations:a}}constructor(e){const{rigBones:t,root:i,parentWorldRotations:a,boneRotations:r}=w8._setupTransforms(e);super(t),this.original=e,this.root=i,this._parentWorldRotations=a,this._boneRotations=r}update(){M2.forEach(e=>{const t=this.original.getBoneNode(e);if(t!=null){const i=this.getBoneNode(e),a=this._parentWorldRotations[e],r=RK.copy(a).invert(),s=this._boneRotations[e];if(t.quaternion.copy(i.quaternion).multiply(a).premultiply(r).multiply(s),e==="hips"){const o=i.getWorldPosition(wK);t.parent.updateWorldMatrix(!0,!1);const c=t.parent.matrixWorld,h=o.applyMatrix4(c.invert());t.position.copy(h)}}})}},uD=class C8{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,t){var i;this.autoUpdateHumanBones=(i=t==null?void 0:t.autoUpdateHumanBones)!=null?i:!0,this._rawHumanBones=new bE(e),this._normalizedHumanBones=new cD(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new bE(e.humanBones),this._normalizedHumanBones=new cD(this._rawHumanBones),this}clone(){return new C8(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},CK={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"},NK=new Set(["1.0","1.0-beta"]),hD={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},DK=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(n,e){this.parser=n,this.helperRoot=e==null?void 0:e.helperRoot,this.autoUpdateHumanBones=e==null?void 0:e.autoUpdateHumanBones}afterRoot(n){return vn(this,null,function*(){n.userData.vrmHumanoid=yield this._import(n)})}_import(n){return vn(this,null,function*(){const e=yield this._v1Import(n);if(e)return e;const t=yield this._v0Import(n);return t||null})}_v1Import(n){return vn(this,null,function*(){var e,t;const i=this.parser.json;if(!(((e=i.extensionsUsed)==null?void 0:e.indexOf("VRMC_vrm"))!==-1))return null;const r=(t=i.extensions)==null?void 0:t.VRMC_vrm;if(!r)return null;const s=r.specVersion;if(!NK.has(s))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${s}"`),null;const o=r.humanoid;if(!o)return null;const c=o.humanBones.leftThumbIntermediate!=null||o.humanBones.rightThumbIntermediate!=null,h={};o.humanBones!=null&&(yield Promise.all(Object.entries(o.humanBones).map(d=>vn(this,[d],function*([m,g]){let x=m;const T=g.node;if(c){const v=hD[x];v!=null&&(x=v)}const S=yield this.parser.getDependency("node",T);if(S==null){console.warn(`A glTF node bound to the humanoid bone ${x} (index = ${T}) does not exist`);return}h[x]={node:S}}))));const f=new uD(this._ensureRequiredBonesExist(h),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(n.scene.add(f.normalizedHumanBonesRoot),this.helperRoot){const d=new lD(f);this.helperRoot.add(d),d.renderOrder=this.helperRoot.renderOrder}return f})}_v0Import(n){return vn(this,null,function*(){var e;const i=(e=this.parser.json.extensions)==null?void 0:e.VRM;if(!i)return null;const a=i.humanoid;if(!a)return null;const r={};a.humanBones!=null&&(yield Promise.all(a.humanBones.map(o=>vn(this,null,function*(){const c=o.bone,h=o.node;if(c==null||h==null)return;const f=yield this.parser.getDependency("node",h);if(f==null){console.warn(`A glTF node bound to the humanoid bone ${c} (index = ${h}) does not exist`);return}const d=hD[c],m=d??c;if(r[m]!=null){console.warn(`Multiple bone entries for ${m} detected (index = ${h}), ignoring duplicated entries.`);return}r[m]={node:f}}))));const s=new uD(this._ensureRequiredBonesExist(r),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(n.scene.add(s.normalizedHumanBonesRoot),this.helperRoot){const o=new lD(s);this.helperRoot.add(o),o.renderOrder=this.helperRoot.renderOrder}return s})}_ensureRequiredBonesExist(n){const e=Object.values(CK).filter(t=>n[t]==null);if(e.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${e.join(", ")}`);return n}},fD=class extends wt{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new Ot(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,n=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,n=!0),n&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let n=0;n<64;n++){const e=n/63*this._currentTheta;this._attrPos.setXYZ(n+1,this._currentRadius*Math.sin(e),0,this._currentRadius*Math.cos(e))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let n=0;n<63;n++)this._attrIndex.setXYZ(n*3,0,n+1,n+2);this._attrIndex.needsUpdate=!0}},OK=class extends wt{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new L,this._currentTail=new L,this._attrPos=new Ot(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,n=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),n=!0),n&&this._buildPosition()}_buildPosition(){for(let n=0;n<32;n++){const e=n/16*Math.PI;this._attrPos.setXYZ(n,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+n,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+n,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let n=0;n<32;n++){const e=(n+1)%32;this._attrIndex.setXY(n*2,n,e),this._attrIndex.setXY(64+n*2,32+n,32+e),this._attrIndex.setXY(128+n*2,64+n,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},zv=new Tt,dD=new Tt,Yp=new L,pD=new L,mD=Math.sqrt(2)/2,LK=new Tt(0,0,-mD,mD),IK=new L(0,1,0),UK=class extends Ia{constructor(n){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=n;{const e=new fD;e.radius=.5;const t=new La({color:65280,transparent:!0,opacity:.5,side:la,depthTest:!1,depthWrite:!1});this._meshPitch=new si(e,t),this.add(this._meshPitch)}{const e=new fD;e.radius=.5;const t=new La({color:16711680,transparent:!0,opacity:.5,side:la,depthTest:!1,depthWrite:!1});this._meshYaw=new si(e,t),this.add(this._meshYaw)}{const e=new OK;e.radius=.1;const t=new Pi({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new nr(e,t),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(n){const e=$t.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=e,this._meshYaw.geometry.update();const t=$t.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=t,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(Yp),this.vrmLookAt.getLookAtWorldQuaternion(zv),zv.multiply(this.vrmLookAt.getFaceFrontQuaternion(dD)),this._meshYaw.position.copy(Yp),this._meshYaw.quaternion.copy(zv),this._meshPitch.position.copy(Yp),this._meshPitch.quaternion.copy(zv),this._meshPitch.quaternion.multiply(dD.setFromAxisAngle(IK,e)),this._meshPitch.quaternion.multiply(LK);const{target:i,autoUpdate:a}=this.vrmLookAt;i!=null&&a&&(i.getWorldPosition(pD).sub(Yp),this._lineTarget.geometry.tail.copy(pD),this._lineTarget.geometry.update(),this._lineTarget.position.copy(Yp)),super.updateMatrixWorld(n)}},PK=new L,zK=new L;function AE(n,e){return n.matrixWorld.decompose(PK,e,zK),e}function v_(n){return[Math.atan2(-n.z,n.x),Math.atan2(n.y,Math.sqrt(n.x*n.x+n.z*n.z))]}function gD(n){const e=Math.round(n/2/Math.PI);return n-2*Math.PI*e}var vD=new L(0,0,1),BK=new L,HK=new L,FK=new L,GK=new Tt,A2=new Tt,_D=new Tt,VK=new Tt,R2=new Ui,N8=class D8{constructor(e,t){this.offsetFromHeadBone=new L,this.autoUpdate=!0,this.faceFront=new L(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new Tt)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new Ui)}getEuler(e){return e.set($t.DEG2RAD*this._pitch,$t.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new D8(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){const t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){const t=this.humanoid.getRawBoneNode("head");return AE(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(vD)<.01)return e.copy(this._restHeadWorldQuaternion).invert();const[t,i]=v_(this.faceFront);return R2.set(0,.5*Math.PI+t,i,"YZX"),e.setFromEuler(R2).premultiply(VK.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(A2),this.getFaceFrontQuaternion(_D),e.copy(vD).applyQuaternion(A2).applyQuaternion(_D).applyEuler(this.getEuler(R2))}lookAt(e){const t=GK.copy(this._restHeadWorldQuaternion).multiply(R8(this.getLookAtWorldQuaternion(A2))),i=this.getLookAtWorldPosition(HK),a=FK.copy(e).sub(i).applyQuaternion(t).normalize(),[r,s]=v_(this.faceFront),[o,c]=v_(a),h=gD(o-r),f=gD(s-c);this._yaw=$t.RAD2DEG*h,this._pitch=$t.RAD2DEG*f,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(BK)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};N8.EULER_ORDER="YXZ";var kK=N8,WK=new L(0,0,1),Ws=new Tt,pf=new Tt,kr=new Ui(0,0,0,"YXZ"),__=class{constructor(n,e,t,i,a){this.humanoid=n,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=a,this.faceFront=new L(0,0,1),this._restQuatLeftEye=new Tt,this._restQuatRightEye=new Tt,this._restLeftEyeParentWorldQuat=new Tt,this._restRightEyeParentWorldQuat=new Tt;const r=this.humanoid.getRawBoneNode("leftEye"),s=this.humanoid.getRawBoneNode("rightEye");r&&(this._restQuatLeftEye.copy(r.quaternion),AE(r.parent,this._restLeftEyeParentWorldQuat)),s&&(this._restQuatRightEye.copy(s.quaternion),AE(s.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(n,e){const t=this.humanoid.getRawBoneNode("leftEye"),i=this.humanoid.getRawBoneNode("rightEye"),a=this.humanoid.getNormalizedBoneNode("leftEye"),r=this.humanoid.getNormalizedBoneNode("rightEye");t&&(e<0?kr.x=-$t.DEG2RAD*this.rangeMapVerticalDown.map(-e):kr.x=$t.DEG2RAD*this.rangeMapVerticalUp.map(e),n<0?kr.y=-$t.DEG2RAD*this.rangeMapHorizontalInner.map(-n):kr.y=$t.DEG2RAD*this.rangeMapHorizontalOuter.map(n),Ws.setFromEuler(kr),this._getWorldFaceFrontQuat(pf),a.quaternion.copy(pf).multiply(Ws).multiply(pf.invert()),Ws.copy(this._restLeftEyeParentWorldQuat),t.quaternion.copy(a.quaternion).multiply(Ws).premultiply(Ws.invert()).multiply(this._restQuatLeftEye)),i&&(e<0?kr.x=-$t.DEG2RAD*this.rangeMapVerticalDown.map(-e):kr.x=$t.DEG2RAD*this.rangeMapVerticalUp.map(e),n<0?kr.y=-$t.DEG2RAD*this.rangeMapHorizontalOuter.map(-n):kr.y=$t.DEG2RAD*this.rangeMapHorizontalInner.map(n),Ws.setFromEuler(kr),this._getWorldFaceFrontQuat(pf),r.quaternion.copy(pf).multiply(Ws).multiply(pf.invert()),Ws.copy(this._restRightEyeParentWorldQuat),i.quaternion.copy(r.quaternion).multiply(Ws).premultiply(Ws.invert()).multiply(this._restQuatRightEye))}lookAt(n){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const e=$t.RAD2DEG*n.y,t=$t.RAD2DEG*n.x;this.applyYawPitch(e,t)}_getWorldFaceFrontQuat(n){if(this.faceFront.distanceToSquared(WK)<.01)return n.identity();const[e,t]=v_(this.faceFront);return kr.set(0,.5*Math.PI+e,t,"YZX"),n.setFromEuler(kr)}};__.type="bone";var RE=class{constructor(n,e,t,i,a){this.expressions=n,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=a}applyYawPitch(n,e){e<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-e))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(e))),n<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-n))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(n)))}lookAt(n){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const e=$t.RAD2DEG*n.y,t=$t.RAD2DEG*n.x;this.applyYawPitch(e,t)}};RE.type="expression";var xD=class{constructor(n,e){this.inputMaxValue=n,this.outputScale=e}map(n){return this.outputScale*x8(n/this.inputMaxValue)}},XK=new Set(["1.0","1.0-beta"]),Bv=.01,YK=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(n,e){this.parser=n,this.helperRoot=e==null?void 0:e.helperRoot}afterRoot(n){return vn(this,null,function*(){const e=n.userData.vrmHumanoid;if(e===null)return;if(e===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");const t=n.userData.vrmExpressionManager;if(t!==null){if(t===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");n.userData.vrmLookAt=yield this._import(n,e,t)}})}_import(n,e,t){return vn(this,null,function*(){if(e==null||t==null)return null;const i=yield this._v1Import(n,e,t);if(i)return i;const a=yield this._v0Import(n,e,t);return a||null})}_v1Import(n,e,t){return vn(this,null,function*(){var i,a,r;const s=this.parser.json;if(!(((i=s.extensionsUsed)==null?void 0:i.indexOf("VRMC_vrm"))!==-1))return null;const c=(a=s.extensions)==null?void 0:a.VRMC_vrm;if(!c)return null;const h=c.specVersion;if(!XK.has(h))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${h}"`),null;const f=c.lookAt;if(!f)return null;const d=f.type==="expression"?1:10,m=this._v1ImportRangeMap(f.rangeMapHorizontalInner,d),g=this._v1ImportRangeMap(f.rangeMapHorizontalOuter,d),x=this._v1ImportRangeMap(f.rangeMapVerticalDown,d),T=this._v1ImportRangeMap(f.rangeMapVerticalUp,d);let S;f.type==="expression"?S=new RE(t,m,g,x,T):S=new __(e,m,g,x,T);const v=this._importLookAt(e,S);return v.offsetFromHeadBone.fromArray((r=f.offsetFromHeadBone)!=null?r:[0,.06,0]),v})}_v1ImportRangeMap(n,e){var t,i;let a=(t=n==null?void 0:n.inputMaxValue)!=null?t:90;const r=(i=n==null?void 0:n.outputScale)!=null?i:e;return a(console.error(s),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}},KK=class{constructor(n){this.scene=n.scene,this.meta=n.meta,this.humanoid=n.humanoid,this.expressionManager=n.expressionManager,this.firstPerson=n.firstPerson,this.lookAt=n.lookAt}update(n){this.humanoid.update(),this.lookAt&&this.lookAt.update(n),this.expressionManager&&this.expressionManager.update()}},QK=class extends KK{constructor(n){super(n),this.materials=n.materials,this.springBoneManager=n.springBoneManager,this.nodeConstraintManager=n.nodeConstraintManager}update(n){super.update(n),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(n),this.materials&&this.materials.forEach(e=>{e.update&&e.update(n)})}},JK=Object.defineProperty,yD=Object.getOwnPropertySymbols,$K=Object.prototype.hasOwnProperty,eQ=Object.prototype.propertyIsEnumerable,SD=(n,e,t)=>e in n?JK(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,TD=(n,e)=>{for(var t in e||(e={}))$K.call(e,t)&&SD(n,t,e[t]);if(yD)for(var t of yD(e))eQ.call(e,t)&&SD(n,t,e[t]);return n},bu=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),tQ={"":3e3,srgb:3001};function nQ(n,e){parseInt(ws,10)>=152?n.colorSpace=e:n.encoding=tQ[e]}var iQ=class{get pending(){return Promise.all(this._pendings)}constructor(n,e){this._parser=n,this._materialParams=e,this._pendings=[]}assignPrimitive(n,e){e!=null&&(this._materialParams[n]=e)}assignColor(n,e,t){if(e!=null){const i=new je().fromArray(e);t&&i.convertSRGBToLinear(),this._materialParams[n]=i}}assignTexture(n,e,t){return bu(this,null,function*(){const i=bu(this,null,function*(){e!=null&&(yield this._parser.assignTexture(this._materialParams,n,e),t&&nQ(this._materialParams[n],"srgb"))});return this._pendings.push(i),i})}assignTextureByIndex(n,e,t){return bu(this,null,function*(){return this.assignTexture(n,e!=null?{index:e}:void 0,t)})}},aQ=`// #define PHONG + */var Bv=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),vn=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),tD=class extends Wt{constructor(n){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${n}`,this.expressionName=n,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(n){this._binds.push(n)}deleteBind(n){const e=this._binds.indexOf(n);e>=0&&this._binds.splice(e,1)}applyWeight(n){var e;let t=this.outputWeight;t*=(e=n==null?void 0:n.multiplier)!=null?e:1,this.isBinary&&t<1&&(t=0),this._binds.forEach(i=>i.applyWeight(t))}clearAppliedWeight(){this._binds.forEach(n=>n.clearAppliedWeight())}};function y8(n,e,t){var i,a;const r=n.parser.json,s=(i=r.nodes)==null?void 0:i[e];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;const o=s.mesh;if(o==null)return null;const c=(a=r.meshes)==null?void 0:a[o];if(c==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${o}] of glTF but the mesh doesn't exist`),null;const h=c.primitives.length,f=[];return t.traverse(d=>{f.length{const r=y8(n,a,i);r!=null&&t.set(a,r)}),t})}var wE={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function S8(n){return Math.max(Math.min(n,1),0)}var aD=class T8{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"],this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"],this.mouthExpressionNames=["aa","ee","ih","oh","ou"],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){const e={},t=new Set(Object.values(wE));return Object.entries(this._expressionMap).forEach(([i,a])=>{t.has(i)&&(e[i]=a)}),e}get customExpressionMap(){const e={},t=new Set(Object.values(wE));return Object.entries(this._expressionMap).forEach(([i,a])=>{t.has(i)||(e[i]=a)}),e}copy(e){return this._expressions.concat().forEach(i=>{this.unregisterExpression(i)}),e._expressions.forEach(i=>{this.registerExpression(i)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new T8().copy(this)}getExpression(e){var t;return(t=this._expressionMap[e])!=null?t:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){const t=this._expressions.indexOf(e);t===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){var t;const i=this.getExpression(e);return(t=i==null?void 0:i.weight)!=null?t:null}setValue(e,t){const i=this.getExpression(e);i&&(i.weight=S8(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){const t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){const e=this._calculateWeightMultipliers();this._expressions.forEach(t=>{t.clearAppliedWeight()}),this._expressions.forEach(t=>{let i=1;const a=t.expressionName;this.blinkExpressionNames.indexOf(a)!==-1&&(i*=e.blink),this.lookAtExpressionNames.indexOf(a)!==-1&&(i*=e.lookAt),this.mouthExpressionNames.indexOf(a)!==-1&&(i*=e.mouth),t.applyWeight({multiplier:i})})}_calculateWeightMultipliers(){let e=1,t=1,i=1;return this._expressions.forEach(a=>{e-=a.overrideBlinkAmount,t-=a.overrideLookAtAmount,i-=a.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),i=Math.max(0,i),{blink:e,lookAt:t,mouth:i}}},qp={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",RimColor:"rimColor",OutlineColor:"outlineColor"},yK={_Color:qp.Color,_EmissionColor:qp.EmissionColor,_ShadeColor:qp.ShadeColor,_RimColor:qp.RimColor,_OutlineColor:qp.OutlineColor},SK=new je,E8=class M8{constructor({material:e,type:t,targetValue:i,targetAlpha:a}){this.material=e,this.type=t,this.targetValue=i,this.targetAlpha=a??1;const r=this._initColorBindState(),s=this._initAlphaBindState();this._state={color:r,alpha:s}}applyWeight(e){const{color:t,alpha:i}=this._state;if(t!=null){const{propertyName:a,deltaValue:r}=t,s=this.material[a];s!=null&&s.add(SK.copy(r).multiplyScalar(e))}if(i!=null){const{propertyName:a,deltaValue:r}=i;this.material[a]!=null&&(this.material[a]+=r*e)}}clearAppliedWeight(){const{color:e,alpha:t}=this._state;if(e!=null){const{propertyName:i,initialValue:a}=e,r=this.material[i];r!=null&&r.copy(a)}if(t!=null){const{propertyName:i,initialValue:a}=t;this.material[i]!=null&&(this.material[i]=a)}}_initColorBindState(){var e,t,i;const{material:a,type:r,targetValue:s}=this,o=this._getPropertyNameMap(),c=(t=(e=o==null?void 0:o[r])==null?void 0:e[0])!=null?t:null;if(c==null)return console.warn(`Tried to add a material color bind to the material ${(i=a.name)!=null?i:"(no name)"}, the type ${r} but the material or the type is not supported.`),null;const f=a[c].clone(),d=new je(s.r-f.r,s.g-f.g,s.b-f.b);return{propertyName:c,initialValue:f,deltaValue:d}}_initAlphaBindState(){var e,t,i;const{material:a,type:r,targetAlpha:s}=this,o=this._getPropertyNameMap(),c=(t=(e=o==null?void 0:o[r])==null?void 0:e[1])!=null?t:null;if(c==null&&s!==1)return console.warn(`Tried to add a material alpha bind to the material ${(i=a.name)!=null?i:"(no name)"}, the type ${r} but the material or the type does not support alpha.`),null;if(c==null)return null;const h=a[c],f=s-h;return{propertyName:c,initialValue:h,deltaValue:f}}_getPropertyNameMap(){var e,t;return(t=(e=Object.entries(M8._propertyNameMapMap).find(([i])=>this.material[i]===!0))==null?void 0:e[1])!=null?t:null}};E8._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var rD=E8,Yx=class{constructor({primitives:n,index:e,weight:t}){this.primitives=n,this.index=e,this.weight=t}applyWeight(n){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]+=this.weight*n)})}clearAppliedWeight(){this.primitives.forEach(n=>{var e;((e=n.morphTargetInfluences)==null?void 0:e[this.index])!=null&&(n.morphTargetInfluences[this.index]=0)})}},sD=new de,b8=class A8{constructor({material:e,scale:t,offset:i}){var a,r;this.material=e,this.scale=t,this.offset=i;const s=(a=Object.entries(A8._propertyNamesMap).find(([o])=>e[o]===!0))==null?void 0:a[1];s==null?(console.warn(`Tried to add a texture transform bind to the material ${(r=e.name)!=null?r:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],s.forEach(o=>{var c;const h=(c=e[o])==null?void 0:c.clone();if(!h)return null;e[o]=h;const f=h.offset.clone(),d=h.repeat.clone(),m=i.clone().sub(f),g=t.clone().sub(d);this._properties.push({name:o,initialOffset:f,deltaOffset:m,initialScale:d,deltaScale:g})}))}applyWeight(e){this._properties.forEach(t=>{const i=this.material[t.name];i!==void 0&&(i.offset.add(sD.copy(t.deltaOffset).multiplyScalar(e)),i.repeat.add(sD.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{const t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};b8._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var oD=b8,TK=new Set(["1.0","1.0-beta"]),w8=class R8{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return vn(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return vn(this,null,function*(){const t=yield this._v1Import(e);if(t)return t;const i=yield this._v0Import(e);return i||null})}_v1Import(e){return vn(this,null,function*(){var t,i;const a=this.parser.json;if(!(((t=a.extensionsUsed)==null?void 0:t.indexOf("VRMC_vrm"))!==-1))return null;const s=(i=a.extensions)==null?void 0:i.VRMC_vrm;if(!s)return null;const o=s.specVersion;if(!TK.has(o))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${o}"`),null;const c=s.expressions;if(!c)return null;const h=new Set(Object.values(wE)),f=new Map;c.preset!=null&&Object.entries(c.preset).forEach(([m,g])=>{if(g!=null){if(!h.has(m)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${m}" detected. Ignoring the expression`);return}f.set(m,g)}}),c.custom!=null&&Object.entries(c.custom).forEach(([m,g])=>{if(h.has(m)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${m}". Ignoring the expression`);return}f.set(m,g)});const d=new aD;return yield Promise.all(Array.from(f.entries()).map(m=>vn(this,[m],function*([g,x]){var T,y,v,S,E,b,D;const C=new tD(g);if(e.scene.add(C),C.isBinary=(T=x.isBinary)!=null?T:!1,C.overrideBlink=(y=x.overrideBlink)!=null?y:"none",C.overrideLookAt=(v=x.overrideLookAt)!=null?v:"none",C.overrideMouth=(S=x.overrideMouth)!=null?S:"none",(E=x.morphTargetBinds)==null||E.forEach(I=>vn(this,null,function*(){var P;if(I.node===void 0||I.index===void 0)return;const O=yield nD(e,I.node),w=I.index;if(!O.every(B=>Array.isArray(B.morphTargetInfluences)&&w{const O=P.material;O&&(Array.isArray(O)?I.push(...O):I.push(O))}),(b=x.materialColorBinds)==null||b.forEach(P=>vn(this,null,function*(){I.filter(w=>{var B;const j=(B=this.parser.associations.get(w))==null?void 0:B.materials;return P.material===j}).forEach(w=>{C.addBind(new rD({material:w,type:P.type,targetValue:new je().fromArray(P.targetValue),targetAlpha:P.targetValue[3]}))})})),(D=x.textureTransformBinds)==null||D.forEach(P=>vn(this,null,function*(){I.filter(w=>{var B;const j=(B=this.parser.associations.get(w))==null?void 0:B.materials;return P.material===j}).forEach(w=>{var B,j;C.addBind(new oD({material:w,offset:new de().fromArray((B=P.offset)!=null?B:[0,0]),scale:new de().fromArray((j=P.scale)!=null?j:[1,1])}))})}))}d.registerExpression(C)}))),d})}_v0Import(e){return vn(this,null,function*(){var t;const i=this.parser.json,a=(t=i.extensions)==null?void 0:t.VRM;if(!a)return null;const r=a.blendShapeMaster;if(!r)return null;const s=new aD,o=r.blendShapeGroups;if(!o)return s;const c=new Set;return yield Promise.all(o.map(h=>vn(this,null,function*(){var f;const d=h.presetName,m=d!=null&&R8.v0v1PresetNameMap[d]||null,g=m??h.name;if(g==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(c.has(g)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${d} has duplicated entries. Ignoring the expression`);return}c.add(g);const x=new tD(g);e.scene.add(x),x.isBinary=(f=h.isBinary)!=null?f:!1,h.binds&&h.binds.forEach(y=>vn(this,null,function*(){var v;if(y.mesh===void 0||y.index===void 0)return;const S=[];(v=i.nodes)==null||v.forEach((b,D)=>{b.mesh===y.mesh&&S.push(D)});const E=y.index;yield Promise.all(S.map(b=>vn(this,null,function*(){var D;const C=yield nD(e,b);if(!C.every(I=>Array.isArray(I.morphTargetInfluences)&&E{if(y.materialName===void 0||y.propertyName===void 0||y.targetValue===void 0)return;const v=[];e.scene.traverse(E=>{if(E.material){const b=E.material;Array.isArray(b)?v.push(...b.filter(D=>(D.name===y.materialName||D.name===y.materialName+" (Outline)")&&v.indexOf(D)===-1)):b.name===y.materialName&&v.indexOf(b)===-1&&v.push(b)}});const S=y.propertyName;v.forEach(E=>{if(S==="_MainTex_ST"){const D=new de(y.targetValue[0],y.targetValue[1]),C=new de(y.targetValue[2],y.targetValue[3]);C.y=1-C.y-D.y,x.addBind(new oD({material:E,scale:D,offset:C}));return}const b=yK[S];if(b){x.addBind(new rD({material:E,type:b,targetValue:new je().fromArray(y.targetValue),targetAlpha:y.targetValue[3]}));return}console.warn(S+" is not supported")})}),s.registerExpression(x)}))),s})}};w8.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var EK=w8,iA=class Cf{constructor(e,t){this._firstPersonOnlyLayer=Cf.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=Cf.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=e,this.meshAnnotations=t}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(t=>({meshes:t.meshes.concat(),type:t.type})),this}clone(){return new Cf(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=Cf.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:t=Cf.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=t,this.meshAnnotations.forEach(i=>{i.meshes.forEach(a=>{i.type==="firstPersonOnly"?(a.layers.set(this._firstPersonOnlyLayer),a.traverse(r=>r.layers.set(this._firstPersonOnlyLayer))):i.type==="thirdPersonOnly"?(a.layers.set(this._thirdPersonOnlyLayer),a.traverse(r=>r.layers.set(this._thirdPersonOnlyLayer))):i.type==="auto"&&this._createHeadlessModel(a)})}),this._initializedLayers=!0)}_excludeTriangles(e,t,i,a){let r=0;if(t!=null&&t.length>0)for(let s=0;s0&&a.includes(d[0])||f[1]>0&&a.includes(d[1])||f[2]>0&&a.includes(d[2])||f[3]>0&&a.includes(d[3]))continue;const m=t[c],g=i[c];if(m[0]>0&&a.includes(g[0])||m[1]>0&&a.includes(g[1])||m[2]>0&&a.includes(g[2])||m[3]>0&&a.includes(g[3]))continue;const x=t[h],T=i[h];x[0]>0&&a.includes(T[0])||x[1]>0&&a.includes(T[1])||x[2]>0&&a.includes(T[2])||x[3]>0&&a.includes(T[3])||(e[r++]=o,e[r++]=c,e[r++]=h)}return r}_createErasedMesh(e,t){const i=new G1(e.geometry.clone(),e.material);i.name=`${e.name}(erase)`,i.frustumCulled=e.frustumCulled,i.layers.set(this._firstPersonOnlyLayer);const a=i.geometry,r=a.getAttribute("skinIndex"),s=r instanceof fE?[]:r.array,o=[];for(let T=0;T{this._isEraseTarget(r)&&i.push(s)}),!i.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);const a=this._createErasedMesh(t,i);e.add(a)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer));else{const t=new Ua;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(i=>i.type==="SkinnedMesh").forEach(i=>{const a=i;this._createHeadlessModelForSkinnedMesh(t,a)})}else if(e.type==="SkinnedMesh"){const t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};iA.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;iA.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var lD=iA,MK=new Set(["1.0","1.0-beta"]),bK=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(n){this.parser=n}afterRoot(n){return vn(this,null,function*(){const e=n.userData.vrmHumanoid;if(e!==null){if(e===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");n.userData.vrmFirstPerson=yield this._import(n,e)}})}_import(n,e){return vn(this,null,function*(){if(e==null)return null;const t=yield this._v1Import(n,e);if(t)return t;const i=yield this._v0Import(n,e);return i||null})}_v1Import(n,e){return vn(this,null,function*(){var t,i;const a=this.parser.json;if(!(((t=a.extensionsUsed)==null?void 0:t.indexOf("VRMC_vrm"))!==-1))return null;const s=(i=a.extensions)==null?void 0:i.VRMC_vrm;if(!s)return null;const o=s.specVersion;if(!MK.has(o))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${o}"`),null;const c=s.firstPerson,h=[],f=yield iD(n);return Array.from(f.entries()).forEach(([d,m])=>{var g,x;const T=(g=c==null?void 0:c.meshAnnotations)==null?void 0:g.find(y=>y.node===d);h.push({meshes:m,type:(x=T==null?void 0:T.type)!=null?x:"auto"})}),new lD(e,h)})}_v0Import(n,e){return vn(this,null,function*(){var t;const i=this.parser.json,a=(t=i.extensions)==null?void 0:t.VRM;if(!a)return null;const r=a.firstPerson;if(!r)return null;const s=[],o=yield iD(n);return Array.from(o.entries()).forEach(([c,h])=>{const f=i.nodes[c],d=r.meshAnnotations?r.meshAnnotations.find(m=>m.mesh===f.mesh):void 0;s.push({meshes:h,type:this._convertV0FlagToV1Type(d==null?void 0:d.firstPersonFlag)})}),new lD(e,s)})}_convertV0FlagToV1Type(n){return n==="FirstPersonOnly"?"firstPersonOnly":n==="ThirdPersonOnly"?"thirdPersonOnly":n==="Both"?"both":"auto"}},cD=new L,uD=new L,AK=new St,hD=class extends Ua{constructor(n){super(),this.vrmHumanoid=n,this._boneAxesMap=new Map,Object.values(n.humanBones).forEach(e=>{const t=new I6(1);t.matrixAutoUpdate=!1,t.material.depthTest=!1,t.material.depthWrite=!1,this.add(t),this._boneAxesMap.set(e,t)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(n=>{n.geometry.dispose(),n.material.dispose()})}updateMatrixWorld(n){Array.from(this._boneAxesMap.entries()).forEach(([e,t])=>{e.node.updateWorldMatrix(!0,!1),e.node.matrixWorld.decompose(cD,AK,uD);const i=cD.set(.1,.1,.1).divide(uD);t.matrix.copy(e.node.matrixWorld).scale(i)}),super.updateMatrixWorld(n)}},w2=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"],wK={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function C8(n){return n.invert?n.invert():n.inverse(),n}var cu=new L,uu=new St,RE=class{constructor(n){this.humanBones=n,this.restPose=this.getAbsolutePose()}getAbsolutePose(){const n={};return Object.keys(this.humanBones).forEach(e=>{const t=e,i=this.getBoneNode(t);i&&(cu.copy(i.position),uu.copy(i.quaternion),n[t]={position:cu.toArray(),rotation:uu.toArray()})}),n}getPose(){const n={};return Object.keys(this.humanBones).forEach(e=>{const t=e,i=this.getBoneNode(t);if(!i)return;cu.set(0,0,0),uu.identity();const a=this.restPose[t];a!=null&&a.position&&cu.fromArray(a.position).negate(),a!=null&&a.rotation&&C8(uu.fromArray(a.rotation)),cu.add(i.position),uu.premultiply(i.quaternion),n[t]={position:cu.toArray(),rotation:uu.toArray()}}),n}setPose(n){Object.entries(n).forEach(([e,t])=>{const i=e,a=this.getBoneNode(i);if(!a)return;const r=this.restPose[i];r&&(t!=null&&t.position&&(a.position.fromArray(t.position),r.position&&a.position.add(cu.fromArray(r.position))),t!=null&&t.rotation&&(a.quaternion.fromArray(t.rotation),r.rotation&&a.quaternion.multiply(uu.fromArray(r.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([n,e])=>{const t=this.getBoneNode(n);t&&(e!=null&&e.position&&t.position.fromArray(e.position),e!=null&&e.rotation&&t.quaternion.fromArray(e.rotation))})}getBone(n){var e;return(e=this.humanBones[n])!=null?e:void 0}getBoneNode(n){var e,t;return(t=(e=this.humanBones[n])==null?void 0:e.node)!=null?t:null}},R2=new L,RK=new St,CK=new L,fD=class N8 extends RE{static _setupTransforms(e){const t=new Wt;t.name="VRMHumanoidRig";const i={},a={},r={};w2.forEach(o=>{var c;const h=e.getBoneNode(o);if(h){const f=new L,d=new St;h.updateWorldMatrix(!0,!1),h.matrixWorld.decompose(f,d,R2),i[o]=f,a[o]=h.quaternion.clone();const m=new St;(c=h.parent)==null||c.matrixWorld.decompose(R2,m,R2),r[o]=m}});const s={};return w2.forEach(o=>{var c;const h=e.getBoneNode(o);if(h){const f=i[o];let d=o,m;for(;m==null&&(d=wK[d],d!=null);)m=i[d];const g=new Wt;g.name="Normalized_"+h.name,(d?(c=s[d])==null?void 0:c.node:t).add(g),g.position.copy(f),m&&g.position.sub(m),s[o]={node:g}}}),{rigBones:s,root:t,parentWorldRotations:r,boneRotations:a}}constructor(e){const{rigBones:t,root:i,parentWorldRotations:a,boneRotations:r}=N8._setupTransforms(e);super(t),this.original=e,this.root=i,this._parentWorldRotations=a,this._boneRotations=r}update(){w2.forEach(e=>{const t=this.original.getBoneNode(e);if(t!=null){const i=this.getBoneNode(e),a=this._parentWorldRotations[e],r=RK.copy(a).invert(),s=this._boneRotations[e];if(t.quaternion.copy(i.quaternion).multiply(a).premultiply(r).multiply(s),e==="hips"){const o=i.getWorldPosition(CK);t.parent.updateWorldMatrix(!0,!1);const c=t.parent.matrixWorld,h=o.applyMatrix4(c.invert());t.position.copy(h)}}})}},dD=class D8{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,t){var i;this.autoUpdateHumanBones=(i=t==null?void 0:t.autoUpdateHumanBones)!=null?i:!0,this._rawHumanBones=new RE(e),this._normalizedHumanBones=new fD(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new RE(e.humanBones),this._normalizedHumanBones=new fD(this._rawHumanBones),this}clone(){return new D8(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},NK={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"},DK=new Set(["1.0","1.0-beta"]),pD={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},OK=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(n,e){this.parser=n,this.helperRoot=e==null?void 0:e.helperRoot,this.autoUpdateHumanBones=e==null?void 0:e.autoUpdateHumanBones}afterRoot(n){return vn(this,null,function*(){n.userData.vrmHumanoid=yield this._import(n)})}_import(n){return vn(this,null,function*(){const e=yield this._v1Import(n);if(e)return e;const t=yield this._v0Import(n);return t||null})}_v1Import(n){return vn(this,null,function*(){var e,t;const i=this.parser.json;if(!(((e=i.extensionsUsed)==null?void 0:e.indexOf("VRMC_vrm"))!==-1))return null;const r=(t=i.extensions)==null?void 0:t.VRMC_vrm;if(!r)return null;const s=r.specVersion;if(!DK.has(s))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${s}"`),null;const o=r.humanoid;if(!o)return null;const c=o.humanBones.leftThumbIntermediate!=null||o.humanBones.rightThumbIntermediate!=null,h={};o.humanBones!=null&&(yield Promise.all(Object.entries(o.humanBones).map(d=>vn(this,[d],function*([m,g]){let x=m;const T=g.node;if(c){const v=pD[x];v!=null&&(x=v)}const y=yield this.parser.getDependency("node",T);if(y==null){console.warn(`A glTF node bound to the humanoid bone ${x} (index = ${T}) does not exist`);return}h[x]={node:y}}))));const f=new dD(this._ensureRequiredBonesExist(h),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(n.scene.add(f.normalizedHumanBonesRoot),this.helperRoot){const d=new hD(f);this.helperRoot.add(d),d.renderOrder=this.helperRoot.renderOrder}return f})}_v0Import(n){return vn(this,null,function*(){var e;const i=(e=this.parser.json.extensions)==null?void 0:e.VRM;if(!i)return null;const a=i.humanoid;if(!a)return null;const r={};a.humanBones!=null&&(yield Promise.all(a.humanBones.map(o=>vn(this,null,function*(){const c=o.bone,h=o.node;if(c==null||h==null)return;const f=yield this.parser.getDependency("node",h);if(f==null){console.warn(`A glTF node bound to the humanoid bone ${c} (index = ${h}) does not exist`);return}const d=pD[c],m=d??c;if(r[m]!=null){console.warn(`Multiple bone entries for ${m} detected (index = ${h}), ignoring duplicated entries.`);return}r[m]={node:f}}))));const s=new dD(this._ensureRequiredBonesExist(r),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(n.scene.add(s.normalizedHumanBonesRoot),this.helperRoot){const o=new hD(s);this.helperRoot.add(o),o.renderOrder=this.helperRoot.renderOrder}return s})}_ensureRequiredBonesExist(n){const e=Object.values(NK).filter(t=>n[t]==null);if(e.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${e.join(", ")}`);return n}},mD=class extends Ct{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new Ot(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,n=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,n=!0),n&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let n=0;n<64;n++){const e=n/63*this._currentTheta;this._attrPos.setXYZ(n+1,this._currentRadius*Math.sin(e),0,this._currentRadius*Math.cos(e))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let n=0;n<63;n++)this._attrIndex.setXYZ(n*3,0,n+1,n+2);this._attrIndex.needsUpdate=!0}},LK=class extends Ct{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new L,this._currentTail=new L,this._attrPos=new Ot(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,n=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),n=!0),n&&this._buildPosition()}_buildPosition(){for(let n=0;n<32;n++){const e=n/16*Math.PI;this._attrPos.setXYZ(n,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+n,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+n,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let n=0;n<32;n++){const e=(n+1)%32;this._attrIndex.setXY(n*2,n,e),this._attrIndex.setXY(64+n*2,32+n,32+e),this._attrIndex.setXY(128+n*2,64+n,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},Hv=new St,gD=new St,jp=new L,vD=new L,_D=Math.sqrt(2)/2,IK=new St(0,0,-_D,_D),UK=new L(0,1,0),PK=class extends Ua{constructor(n){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=n;{const e=new mD;e.radius=.5;const t=new Ia({color:65280,transparent:!0,opacity:.5,side:ca,depthTest:!1,depthWrite:!1});this._meshPitch=new oi(e,t),this.add(this._meshPitch)}{const e=new mD;e.radius=.5;const t=new Ia({color:16711680,transparent:!0,opacity:.5,side:ca,depthTest:!1,depthWrite:!1});this._meshYaw=new oi(e,t),this.add(this._meshYaw)}{const e=new LK;e.radius=.1;const t=new Bi({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new ir(e,t),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(n){const e=$t.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=e,this._meshYaw.geometry.update();const t=$t.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=t,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(jp),this.vrmLookAt.getLookAtWorldQuaternion(Hv),Hv.multiply(this.vrmLookAt.getFaceFrontQuaternion(gD)),this._meshYaw.position.copy(jp),this._meshYaw.quaternion.copy(Hv),this._meshPitch.position.copy(jp),this._meshPitch.quaternion.copy(Hv),this._meshPitch.quaternion.multiply(gD.setFromAxisAngle(UK,e)),this._meshPitch.quaternion.multiply(IK);const{target:i,autoUpdate:a}=this.vrmLookAt;i!=null&&a&&(i.getWorldPosition(vD).sub(jp),this._lineTarget.geometry.tail.copy(vD),this._lineTarget.geometry.update(),this._lineTarget.position.copy(jp)),super.updateMatrixWorld(n)}},zK=new L,BK=new L;function CE(n,e){return n.matrixWorld.decompose(zK,e,BK),e}function x_(n){return[Math.atan2(-n.z,n.x),Math.atan2(n.y,Math.sqrt(n.x*n.x+n.z*n.z))]}function xD(n){const e=Math.round(n/2/Math.PI);return n-2*Math.PI*e}var yD=new L(0,0,1),HK=new L,FK=new L,GK=new L,VK=new St,C2=new St,SD=new St,kK=new St,N2=new Ei,O8=class L8{constructor(e,t){this.offsetFromHeadBone=new L,this.autoUpdate=!0,this.faceFront=new L(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new St)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new Ei)}getEuler(e){return e.set($t.DEG2RAD*this._pitch,$t.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new L8(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){const t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){const t=this.humanoid.getRawBoneNode("head");return CE(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(yD)<.01)return e.copy(this._restHeadWorldQuaternion).invert();const[t,i]=x_(this.faceFront);return N2.set(0,.5*Math.PI+t,i,"YZX"),e.setFromEuler(N2).premultiply(kK.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(C2),this.getFaceFrontQuaternion(SD),e.copy(yD).applyQuaternion(C2).applyQuaternion(SD).applyEuler(this.getEuler(N2))}lookAt(e){const t=VK.copy(this._restHeadWorldQuaternion).multiply(C8(this.getLookAtWorldQuaternion(C2))),i=this.getLookAtWorldPosition(FK),a=GK.copy(e).sub(i).applyQuaternion(t).normalize(),[r,s]=x_(this.faceFront),[o,c]=x_(a),h=xD(o-r),f=xD(s-c);this._yaw=$t.RAD2DEG*h,this._pitch=$t.RAD2DEG*f,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(HK)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};O8.EULER_ORDER="YXZ";var WK=O8,XK=new L(0,0,1),Xs=new St,gf=new St,Wr=new Ei(0,0,0,"YXZ"),y_=class{constructor(n,e,t,i,a){this.humanoid=n,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=a,this.faceFront=new L(0,0,1),this._restQuatLeftEye=new St,this._restQuatRightEye=new St,this._restLeftEyeParentWorldQuat=new St,this._restRightEyeParentWorldQuat=new St;const r=this.humanoid.getRawBoneNode("leftEye"),s=this.humanoid.getRawBoneNode("rightEye");r&&(this._restQuatLeftEye.copy(r.quaternion),CE(r.parent,this._restLeftEyeParentWorldQuat)),s&&(this._restQuatRightEye.copy(s.quaternion),CE(s.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(n,e){const t=this.humanoid.getRawBoneNode("leftEye"),i=this.humanoid.getRawBoneNode("rightEye"),a=this.humanoid.getNormalizedBoneNode("leftEye"),r=this.humanoid.getNormalizedBoneNode("rightEye");t&&(e<0?Wr.x=-$t.DEG2RAD*this.rangeMapVerticalDown.map(-e):Wr.x=$t.DEG2RAD*this.rangeMapVerticalUp.map(e),n<0?Wr.y=-$t.DEG2RAD*this.rangeMapHorizontalInner.map(-n):Wr.y=$t.DEG2RAD*this.rangeMapHorizontalOuter.map(n),Xs.setFromEuler(Wr),this._getWorldFaceFrontQuat(gf),a.quaternion.copy(gf).multiply(Xs).multiply(gf.invert()),Xs.copy(this._restLeftEyeParentWorldQuat),t.quaternion.copy(a.quaternion).multiply(Xs).premultiply(Xs.invert()).multiply(this._restQuatLeftEye)),i&&(e<0?Wr.x=-$t.DEG2RAD*this.rangeMapVerticalDown.map(-e):Wr.x=$t.DEG2RAD*this.rangeMapVerticalUp.map(e),n<0?Wr.y=-$t.DEG2RAD*this.rangeMapHorizontalOuter.map(-n):Wr.y=$t.DEG2RAD*this.rangeMapHorizontalInner.map(n),Xs.setFromEuler(Wr),this._getWorldFaceFrontQuat(gf),r.quaternion.copy(gf).multiply(Xs).multiply(gf.invert()),Xs.copy(this._restRightEyeParentWorldQuat),i.quaternion.copy(r.quaternion).multiply(Xs).premultiply(Xs.invert()).multiply(this._restQuatRightEye))}lookAt(n){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const e=$t.RAD2DEG*n.y,t=$t.RAD2DEG*n.x;this.applyYawPitch(e,t)}_getWorldFaceFrontQuat(n){if(this.faceFront.distanceToSquared(XK)<.01)return n.identity();const[e,t]=x_(this.faceFront);return Wr.set(0,.5*Math.PI+e,t,"YZX"),n.setFromEuler(Wr)}};y_.type="bone";var NE=class{constructor(n,e,t,i,a){this.expressions=n,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=a}applyYawPitch(n,e){e<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-e))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(e))),n<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-n))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(n)))}lookAt(n){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const e=$t.RAD2DEG*n.y,t=$t.RAD2DEG*n.x;this.applyYawPitch(e,t)}};NE.type="expression";var TD=class{constructor(n,e){this.inputMaxValue=n,this.outputScale=e}map(n){return this.outputScale*S8(n/this.inputMaxValue)}},YK=new Set(["1.0","1.0-beta"]),Fv=.01,qK=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(n,e){this.parser=n,this.helperRoot=e==null?void 0:e.helperRoot}afterRoot(n){return vn(this,null,function*(){const e=n.userData.vrmHumanoid;if(e===null)return;if(e===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");const t=n.userData.vrmExpressionManager;if(t!==null){if(t===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");n.userData.vrmLookAt=yield this._import(n,e,t)}})}_import(n,e,t){return vn(this,null,function*(){if(e==null||t==null)return null;const i=yield this._v1Import(n,e,t);if(i)return i;const a=yield this._v0Import(n,e,t);return a||null})}_v1Import(n,e,t){return vn(this,null,function*(){var i,a,r;const s=this.parser.json;if(!(((i=s.extensionsUsed)==null?void 0:i.indexOf("VRMC_vrm"))!==-1))return null;const c=(a=s.extensions)==null?void 0:a.VRMC_vrm;if(!c)return null;const h=c.specVersion;if(!YK.has(h))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${h}"`),null;const f=c.lookAt;if(!f)return null;const d=f.type==="expression"?1:10,m=this._v1ImportRangeMap(f.rangeMapHorizontalInner,d),g=this._v1ImportRangeMap(f.rangeMapHorizontalOuter,d),x=this._v1ImportRangeMap(f.rangeMapVerticalDown,d),T=this._v1ImportRangeMap(f.rangeMapVerticalUp,d);let y;f.type==="expression"?y=new NE(t,m,g,x,T):y=new y_(e,m,g,x,T);const v=this._importLookAt(e,y);return v.offsetFromHeadBone.fromArray((r=f.offsetFromHeadBone)!=null?r:[0,.06,0]),v})}_v1ImportRangeMap(n,e){var t,i;let a=(t=n==null?void 0:n.inputMaxValue)!=null?t:90;const r=(i=n==null?void 0:n.outputScale)!=null?i:e;return a(console.error(s),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}},QK=class{constructor(n){this.scene=n.scene,this.meta=n.meta,this.humanoid=n.humanoid,this.expressionManager=n.expressionManager,this.firstPerson=n.firstPerson,this.lookAt=n.lookAt}update(n){this.humanoid.update(),this.lookAt&&this.lookAt.update(n),this.expressionManager&&this.expressionManager.update()}},JK=class extends QK{constructor(n){super(n),this.materials=n.materials,this.springBoneManager=n.springBoneManager,this.nodeConstraintManager=n.nodeConstraintManager}update(n){super.update(n),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(n),this.materials&&this.materials.forEach(e=>{e.update&&e.update(n)})}},$K=Object.defineProperty,ED=Object.getOwnPropertySymbols,eQ=Object.prototype.hasOwnProperty,tQ=Object.prototype.propertyIsEnumerable,MD=(n,e,t)=>e in n?$K(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,bD=(n,e)=>{for(var t in e||(e={}))eQ.call(e,t)&&MD(n,t,e[t]);if(ED)for(var t of ED(e))tQ.call(e,t)&&MD(n,t,e[t]);return n},wu=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),nQ={"":3e3,srgb:3001};function iQ(n,e){parseInt(Cs,10)>=152?n.colorSpace=e:n.encoding=nQ[e]}var aQ=class{get pending(){return Promise.all(this._pendings)}constructor(n,e){this._parser=n,this._materialParams=e,this._pendings=[]}assignPrimitive(n,e){e!=null&&(this._materialParams[n]=e)}assignColor(n,e,t){if(e!=null){const i=new je().fromArray(e);t&&i.convertSRGBToLinear(),this._materialParams[n]=i}}assignTexture(n,e,t){return wu(this,null,function*(){const i=wu(this,null,function*(){e!=null&&(yield this._parser.assignTexture(this._materialParams,n,e),t&&iQ(this._materialParams[n],"srgb"))});return this._pendings.push(i),i})}assignTextureByIndex(n,e,t){return wu(this,null,function*(){return this.assignTexture(n,e!=null?{index:e}:void 0,t)})}},rQ=`// #define PHONG varying vec3 vViewPosition; @@ -4176,7 +4176,7 @@ void main() { #include #include -}`,rQ=`// #define PHONG +}`,sQ=`// #define PHONG uniform vec3 litFactor; @@ -4978,9 +4978,9 @@ void main() { gl_FragColor = vec4( col, diffuseColor.a ); postCorrection(); } -`,sQ={None:"none"},ED={None:"none",ScreenCoordinates:"screenCoordinates"},oQ={3e3:"",3001:"srgb"};function w2(n){return parseInt(ws,10)>=152?n.colorSpace:oQ[n.encoding]}var lQ=class extends Fi{constructor(n={}){var e;super({vertexShader:aQ,fragmentShader:rQ}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=ol,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=sQ.None,this._outlineWidthMode=ED.None,this._isOutline=!1,n.transparentWithZWrite&&(n.depthWrite=!0),delete n.transparentWithZWrite,n.fog=!0,n.lights=!0,n.clipping=!0,this.uniforms=Sb.merge([at.common,at.normalmap,at.emissivemap,at.fog,at.lights,{litFactor:{value:new je(1,1,1)},mapUvTransform:{value:new Et},colorAlpha:{value:1},normalMapUvTransform:{value:new Et},shadeColorFactor:{value:new je(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new Et},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new Et},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new je(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new Et},parametricRimColorFactor:{value:new je(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new Et},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new je(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new Et},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new Et},outlineWidthFactor:{value:0},outlineColorFactor:{value:new je(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new Et},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(e=n.uniforms)!=null?e:{}]),this.setValues(n),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([t,i])=>`${t}:${i}`),this.matcapTexture?`matcapTextureColorSpace:${w2(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${w2(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${w2(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=t=>{const i=parseInt(ws,10),a=Object.entries(TD(TD({},this._generateDefines()),this.defines)).filter(([r,s])=>!!s).map(([r,s])=>`#define ${r} ${s}`).join(` +`,oQ={None:"none"},AD={None:"none",ScreenCoordinates:"screenCoordinates"},lQ={3e3:"",3001:"srgb"};function D2(n){return parseInt(Cs,10)>=152?n.colorSpace:lQ[n.encoding]}var cQ=class extends Vi{constructor(n={}){var e;super({vertexShader:rQ,fragmentShader:sQ}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=ll,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=oQ.None,this._outlineWidthMode=AD.None,this._isOutline=!1,n.transparentWithZWrite&&(n.depthWrite=!0),delete n.transparentWithZWrite,n.fog=!0,n.lights=!0,n.clipping=!0,this.uniforms=Mb.merge([at.common,at.normalmap,at.emissivemap,at.fog,at.lights,{litFactor:{value:new je(1,1,1)},mapUvTransform:{value:new Et},colorAlpha:{value:1},normalMapUvTransform:{value:new Et},shadeColorFactor:{value:new je(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new Et},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new Et},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new je(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new Et},parametricRimColorFactor:{value:new je(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new Et},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new je(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new Et},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new Et},outlineWidthFactor:{value:0},outlineColorFactor:{value:new je(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new Et},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(e=n.uniforms)!=null?e:{}]),this.setValues(n),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([t,i])=>`${t}:${i}`),this.matcapTexture?`matcapTextureColorSpace:${D2(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${D2(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${D2(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=t=>{const i=parseInt(Cs,10),a=Object.entries(bD(bD({},this._generateDefines()),this.defines)).filter(([r,s])=>!!s).map(([r,s])=>`#define ${r} ${s}`).join(` `)+` -`;t.vertexShader=a+t.vertexShader,t.fragmentShader=a+t.fragmentShader,i<154&&(t.fragmentShader=t.fragmentShader.replace("#include ","#include "))}}get color(){return this.uniforms.litFactor.value}set color(n){this.uniforms.litFactor.value=n}get map(){return this.uniforms.map.value}set map(n){this.uniforms.map.value=n}get normalMap(){return this.uniforms.normalMap.value}set normalMap(n){this.uniforms.normalMap.value=n}get normalScale(){return this.uniforms.normalScale.value}set normalScale(n){this.uniforms.normalScale.value=n}get emissive(){return this.uniforms.emissive.value}set emissive(n){this.uniforms.emissive.value=n}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(n){this.uniforms.emissiveIntensity.value=n}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(n){this.uniforms.emissiveMap.value=n}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(n){this.uniforms.shadeColorFactor.value=n}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(n){this.uniforms.shadeMultiplyTexture.value=n}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(n){this.uniforms.shadingShiftFactor.value=n}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(n){this.uniforms.shadingShiftTexture.value=n}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(n){this.uniforms.shadingShiftTextureScale.value=n}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(n){this.uniforms.shadingToonyFactor.value=n}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(n){this.uniforms.giEqualizationFactor.value=n}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(n){this.uniforms.matcapFactor.value=n}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(n){this.uniforms.matcapTexture.value=n}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(n){this.uniforms.parametricRimColorFactor.value=n}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(n){this.uniforms.rimMultiplyTexture.value=n}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(n){this.uniforms.rimLightingMixFactor.value=n}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(n){this.uniforms.parametricRimFresnelPowerFactor.value=n}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(n){this.uniforms.parametricRimLiftFactor.value=n}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(n){this.uniforms.outlineWidthMultiplyTexture.value=n}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(n){this.uniforms.outlineWidthFactor.value=n}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(n){this.uniforms.outlineColorFactor.value=n}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(n){this.uniforms.outlineLightingMixFactor.value=n}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(n){this.uniforms.uvAnimationMaskTexture.value=n}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(n){this.uniforms.uvAnimationScrollXOffset.value=n}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(n){this.uniforms.uvAnimationScrollYOffset.value=n}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(n){this.uniforms.uvAnimationRotationPhase.value=n}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(n){this._ignoreVertexColor=n,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(n){this._v0CompatShade=n,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(n){this._debugMode=n,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(n){this._outlineWidthMode=n,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(n){this._isOutline=n,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(n){this._uploadUniformsWorkaround(),this._updateUVAnimation(n)}copy(n){return super.copy(n),this.map=n.map,this.normalMap=n.normalMap,this.emissiveMap=n.emissiveMap,this.shadeMultiplyTexture=n.shadeMultiplyTexture,this.shadingShiftTexture=n.shadingShiftTexture,this.matcapTexture=n.matcapTexture,this.rimMultiplyTexture=n.rimMultiplyTexture,this.outlineWidthMultiplyTexture=n.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=n.uvAnimationMaskTexture,this.normalMapType=n.normalMapType,this.uvAnimationScrollXSpeedFactor=n.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=n.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=n.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=n.ignoreVertexColor,this.v0CompatShade=n.v0CompatShade,this.debugMode=n.debugMode,this.outlineWidthMode=n.outlineWidthMode,this.isOutline=n.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(n){this.uniforms.uvAnimationScrollXOffset.value+=n*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=n*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=n*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){const n=parseInt(ws,10),e=this.outlineWidthMultiplyTexture!==null,t=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:n,OUTLINE:this._isOutline,MTOON_USE_UV:e||t,MTOON_UVS_VERTEX_ONLY:e&&!t,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode==="normal",DEBUG_LITSHADERATE:this._debugMode==="litShadeRate",DEBUG_UV:this._debugMode==="uv",OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===ED.ScreenCoordinates}}_updateTextureMatrix(n,e){n.value&&(n.value.matrixAutoUpdate&&n.value.updateMatrix(),e.value.copy(n.value.matrix))}},cQ=new Set(["1.0","1.0-beta"]),O8=class x_{get name(){return x_.EXTENSION_NAME}constructor(e,t={}){var i,a,r,s;this.parser=e,this.materialType=(i=t.materialType)!=null?i:lQ,this.renderOrderOffset=(a=t.renderOrderOffset)!=null?a:0,this.v0CompatShade=(r=t.v0CompatShade)!=null?r:!1,this.debugMode=(s=t.debugMode)!=null?s:"none",this._mToonMaterialSet=new Set}beforeRoot(){return bu(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(e){return bu(this,null,function*(){e.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(e){return this._getMToonExtension(e)?this.materialType:null}extendMaterialParams(e,t){const i=this._getMToonExtension(e);return i?this._extendMaterialParams(i,t):null}loadMesh(e){return bu(this,null,function*(){var t;const i=this.parser,r=(t=i.json.meshes)==null?void 0:t[e];if(r==null)throw new Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${e}] of glTF but the mesh doesn't exist`);const s=r.primitives,o=yield i.loadMesh(e);if(s.length===1){const c=o,h=s[0].material;h!=null&&this._setupPrimitive(c,h)}else{const c=o;for(let h=0;h{var s;this._getMToonExtension(r)&&((s=a.extensions)!=null&&s.KHR_materials_unlit)&&delete a.extensions.KHR_materials_unlit})}_getMToonExtension(e){var t,i;const s=(t=this.parser.json.materials)==null?void 0:t[e];if(s==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}const o=(i=s.extensions)==null?void 0:i[x_.EXTENSION_NAME];if(o==null)return;const c=o.specVersion;if(!cQ.has(c)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${x_.EXTENSION_NAME} specVersion "${c}"`);return}return o}_extendMaterialParams(e,t){return bu(this,null,function*(){var i;delete t.metalness,delete t.roughness;const a=new iQ(this.parser,t);a.assignPrimitive("transparentWithZWrite",e.transparentWithZWrite),a.assignColor("shadeColorFactor",e.shadeColorFactor),a.assignTexture("shadeMultiplyTexture",e.shadeMultiplyTexture,!0),a.assignPrimitive("shadingShiftFactor",e.shadingShiftFactor),a.assignTexture("shadingShiftTexture",e.shadingShiftTexture,!0),a.assignPrimitive("shadingShiftTextureScale",(i=e.shadingShiftTexture)==null?void 0:i.scale),a.assignPrimitive("shadingToonyFactor",e.shadingToonyFactor),a.assignPrimitive("giEqualizationFactor",e.giEqualizationFactor),a.assignColor("matcapFactor",e.matcapFactor),a.assignTexture("matcapTexture",e.matcapTexture,!0),a.assignColor("parametricRimColorFactor",e.parametricRimColorFactor),a.assignTexture("rimMultiplyTexture",e.rimMultiplyTexture,!0),a.assignPrimitive("rimLightingMixFactor",e.rimLightingMixFactor),a.assignPrimitive("parametricRimFresnelPowerFactor",e.parametricRimFresnelPowerFactor),a.assignPrimitive("parametricRimLiftFactor",e.parametricRimLiftFactor),a.assignPrimitive("outlineWidthMode",e.outlineWidthMode),a.assignPrimitive("outlineWidthFactor",e.outlineWidthFactor),a.assignTexture("outlineWidthMultiplyTexture",e.outlineWidthMultiplyTexture,!1),a.assignColor("outlineColorFactor",e.outlineColorFactor),a.assignPrimitive("outlineLightingMixFactor",e.outlineLightingMixFactor),a.assignTexture("uvAnimationMaskTexture",e.uvAnimationMaskTexture,!1),a.assignPrimitive("uvAnimationScrollXSpeedFactor",e.uvAnimationScrollXSpeedFactor),a.assignPrimitive("uvAnimationScrollYSpeedFactor",e.uvAnimationScrollYSpeedFactor),a.assignPrimitive("uvAnimationRotationSpeedFactor",e.uvAnimationRotationSpeedFactor),a.assignPrimitive("v0CompatShade",this.v0CompatShade),a.assignPrimitive("debugMode",this.debugMode),yield a.pending})}_setupPrimitive(e,t){const i=this._getMToonExtension(t);if(i){const a=this._parseRenderOrder(i);e.renderOrder=a+this.renderOrderOffset,this._generateOutline(e),this._addToMaterialSet(e);return}}_shouldGenerateOutline(e){return typeof e.outlineWidthMode=="string"&&e.outlineWidthMode!=="none"&&typeof e.outlineWidthFactor=="number"&&e.outlineWidthFactor>0}_generateOutline(e){const t=e.material;if(!(t instanceof qn)||!this._shouldGenerateOutline(t))return;e.material=[t];const i=t.clone();i.name+=" (Outline)",i.isOutline=!0,i.side=Oi,e.material.push(i);const a=e.geometry,r=a.index?a.index.count:a.attributes.position.count/3;a.addGroup(0,r,0),a.addGroup(0,r,1)}_addToMaterialSet(e){const t=e.material,i=new Set;Array.isArray(t)?t.forEach(a=>i.add(a)):i.add(t);for(const a of i)this._mToonMaterialSet.add(a)}_parseRenderOrder(e){var t;return(e.transparentWithZWrite?0:19)+((t=e.renderQueueOffsetNumber)!=null?t:0)}};O8.EXTENSION_NAME="VRMC_materials_mtoon";var uQ=O8,hQ=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),L8=class wE{get name(){return wE.EXTENSION_NAME}constructor(e){this.parser=e}extendMaterialParams(e,t){return hQ(this,null,function*(){const i=this._getHDREmissiveMultiplierExtension(e);if(i==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");const a=i.emissiveMultiplier;t.emissiveIntensity=a})}_getHDREmissiveMultiplierExtension(e){var t,i;const s=(t=this.parser.json.materials)==null?void 0:t[e];if(s==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}const o=(i=s.extensions)==null?void 0:i[wE.EXTENSION_NAME];if(o!=null)return o}};L8.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var fQ=L8,dQ=Object.defineProperty,pQ=Object.defineProperties,mQ=Object.getOwnPropertyDescriptors,MD=Object.getOwnPropertySymbols,gQ=Object.prototype.hasOwnProperty,vQ=Object.prototype.propertyIsEnumerable,bD=(n,e,t)=>e in n?dQ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Xs=(n,e)=>{for(var t in e||(e={}))gQ.call(e,t)&&bD(n,t,e[t]);if(MD)for(var t of MD(e))vQ.call(e,t)&&bD(n,t,e[t]);return n},AD=(n,e)=>pQ(n,mQ(e)),_Q=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())});function mf(n){return Math.pow(n,2.2)}var xQ=class{get name(){return"VRMMaterialsV0CompatPlugin"}constructor(n){var e;this.parser=n,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;const t=this.parser.json;t.extensionsUsed=(e=t.extensionsUsed)!=null?e:[],t.extensionsUsed.indexOf("KHR_texture_transform")===-1&&t.extensionsUsed.push("KHR_texture_transform")}beforeRoot(){return _Q(this,null,function*(){var n;const e=this.parser.json,t=(n=e.extensions)==null?void 0:n.VRM,i=t==null?void 0:t.materialProperties;i&&(this._populateRenderQueueMap(i),i.forEach((a,r)=>{var s,o;const c=(s=e.materials)==null?void 0:s[r];if(c==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${r}] of glTF but the material doesn't exist`);return}if(a.shader==="VRM/MToon"){const h=this._parseV0MToonProperties(a,c);e.materials[r]=h}else if((o=a.shader)!=null&&o.startsWith("VRM/Unlit")){const h=this._parseV0UnlitProperties(a,c);e.materials[r]=h}else a.shader==="VRM_USE_GLTFSHADER"||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${a.shader}`)}))})}_parseV0MToonProperties(n,e){var t,i,a,r,s,o,c,h,f,d,m,g,x,T,S,v,y,E,b,D,C,I,P,O,R,B,j,ee,se,re,W,te,K,oe,ie,Ce,Xe,nt,tt,gt,ge,Ae,Ze,ue,it,Mt,ot,Ke,Te,G,Me,De,Fe,Be,$e;const Je=(i=(t=n.keywordMap)==null?void 0:t._ALPHABLEND_ON)!=null?i:!1,k=((a=n.floatProperties)==null?void 0:a._ZWrite)===1&&Je,U=this._v0ParseRenderQueue(n),ce=(s=(r=n.keywordMap)==null?void 0:r._ALPHATEST_ON)!=null?s:!1,Ee=Je?"BLEND":ce?"MASK":"OPAQUE",Le=ce?(c=(o=n.floatProperties)==null?void 0:o._Cutoff)!=null?c:.5:void 0,vt=((f=(h=n.floatProperties)==null?void 0:h._CullMode)!=null?f:2)===0,qe=this._portTextureTransform(n),_t=((m=(d=n.vectorProperties)==null?void 0:d._Color)!=null?m:[1,1,1,1]).map((N,V)=>V===3?N:mf(N)),pt=(g=n.textureProperties)==null?void 0:g._MainTex,Ie=pt!=null?{index:pt,extensions:Xs({},qe)}:void 0,He=(T=(x=n.floatProperties)==null?void 0:x._BumpScale)!=null?T:1,ht=(S=n.textureProperties)==null?void 0:S._BumpMap,Q=ht!=null?{index:ht,scale:He,extensions:Xs({},qe)}:void 0,pe=((y=(v=n.vectorProperties)==null?void 0:v._EmissionColor)!=null?y:[0,0,0,1]).map(mf),Oe=(E=n.textureProperties)==null?void 0:E._EmissionMap,q=Oe!=null?{index:Oe,extensions:Xs({},qe)}:void 0,Ve=((D=(b=n.vectorProperties)==null?void 0:b._ShadeColor)!=null?D:[.97,.81,.86,1]).map(mf),me=(C=n.textureProperties)==null?void 0:C._ShadeTexture,We=me!=null?{index:me,extensions:Xs({},qe)}:void 0;let Ge=(P=(I=n.floatProperties)==null?void 0:I._ShadeShift)!=null?P:0,Re=(R=(O=n.floatProperties)==null?void 0:O._ShadeToony)!=null?R:.9;Re=$t.lerp(Re,1,.5+.5*Ge),Ge=-Ge-(1-Re);const rt=(j=(B=n.floatProperties)==null?void 0:B._IndirectLightIntensity)!=null?j:.1,yt=rt?1-rt:void 0,Gt=(ee=n.textureProperties)==null?void 0:ee._SphereAdd,Vt=Gt!=null?[1,1,1]:void 0,oi=Gt!=null?{index:Gt}:void 0,li=(re=(se=n.floatProperties)==null?void 0:se._RimLightingMix)!=null?re:0,co=(W=n.textureProperties)==null?void 0:W._RimTexture,Ls=co!=null?{index:co,extensions:Xs({},qe)}:void 0,Is=((K=(te=n.vectorProperties)==null?void 0:te._RimColor)!=null?K:[0,0,0,1]).map(mf),Ei=(ie=(oe=n.floatProperties)==null?void 0:oe._RimFresnelPower)!=null?ie:1,Us=(Xe=(Ce=n.floatProperties)==null?void 0:Ce._RimLift)!=null?Xe:0,ha=["none","worldCoordinates","screenCoordinates"][(tt=(nt=n.floatProperties)==null?void 0:nt._OutlineWidthMode)!=null?tt:0];let ki=(ge=(gt=n.floatProperties)==null?void 0:gt._OutlineWidth)!=null?ge:0;ki=.01*ki;const Ha=(Ae=n.textureProperties)==null?void 0:Ae._OutlineWidthTexture,Dn=Ha!=null?{index:Ha,extensions:Xs({},qe)}:void 0,Or=((ue=(Ze=n.vectorProperties)==null?void 0:Ze._OutlineColor)!=null?ue:[0,0,0]).map(mf),zs=((Mt=(it=n.floatProperties)==null?void 0:it._OutlineColorMode)!=null?Mt:0)===1?(Ke=(ot=n.floatProperties)==null?void 0:ot._OutlineLightingMix)!=null?Ke:1:0,uo=(Te=n.textureProperties)==null?void 0:Te._UvAnimMaskTexture,rr=uo!=null?{index:uo,extensions:Xs({},qe)}:void 0,fa=(Me=(G=n.floatProperties)==null?void 0:G._UvAnimScrollX)!=null?Me:0;let w=(Fe=(De=n.floatProperties)==null?void 0:De._UvAnimScrollY)!=null?Fe:0;w!=null&&(w=-w);const z=($e=(Be=n.floatProperties)==null?void 0:Be._UvAnimRotation)!=null?$e:0,Y={specVersion:"1.0",transparentWithZWrite:k,renderQueueOffsetNumber:U,shadeColorFactor:Ve,shadeMultiplyTexture:We,shadingShiftFactor:Ge,shadingToonyFactor:Re,giEqualizationFactor:yt,matcapFactor:Vt,matcapTexture:oi,rimLightingMixFactor:li,rimMultiplyTexture:Ls,parametricRimColorFactor:Is,parametricRimFresnelPowerFactor:Ei,parametricRimLiftFactor:Us,outlineWidthMode:ha,outlineWidthFactor:ki,outlineWidthMultiplyTexture:Dn,outlineColorFactor:Or,outlineLightingMixFactor:zs,uvAnimationMaskTexture:rr,uvAnimationScrollXSpeedFactor:fa,uvAnimationScrollYSpeedFactor:w,uvAnimationRotationSpeedFactor:z};return AD(Xs({},e),{pbrMetallicRoughness:{baseColorFactor:_t,baseColorTexture:Ie},normalTexture:Q,emissiveTexture:q,emissiveFactor:pe,alphaMode:Ee,alphaCutoff:Le,doubleSided:vt,extensions:{VRMC_materials_mtoon:Y}})}_parseV0UnlitProperties(n,e){var t,i,a,r,s;const o=n.shader==="VRM/UnlitTransparentZWrite",c=n.shader==="VRM/UnlitTransparent"||o,h=this._v0ParseRenderQueue(n),f=n.shader==="VRM/UnlitCutout",d=c?"BLEND":f?"MASK":"OPAQUE",m=f?(i=(t=n.floatProperties)==null?void 0:t._Cutoff)!=null?i:.5:void 0,g=this._portTextureTransform(n),x=((r=(a=n.vectorProperties)==null?void 0:a._Color)!=null?r:[1,1,1,1]).map(mf),T=(s=n.textureProperties)==null?void 0:s._MainTex,S=T!=null?{index:T,extensions:Xs({},g)}:void 0,v={specVersion:"1.0",transparentWithZWrite:o,renderQueueOffsetNumber:h,shadeColorFactor:x,shadeMultiplyTexture:S};return AD(Xs({},e),{pbrMetallicRoughness:{baseColorFactor:x,baseColorTexture:S},alphaMode:d,alphaCutoff:m,extensions:{VRMC_materials_mtoon:v}})}_portTextureTransform(n){var e,t,i,a,r;const s=(e=n.vectorProperties)==null?void 0:e._MainTex;if(s==null)return{};const o=[(t=s==null?void 0:s[0])!=null?t:0,(i=s==null?void 0:s[1])!=null?i:0],c=[(a=s==null?void 0:s[2])!=null?a:1,(r=s==null?void 0:s[3])!=null?r:1];return o[1]=1-c[1]-o[1],{KHR_texture_transform:{offset:o,scale:c}}}_v0ParseRenderQueue(n){var e,t;const i=n.shader==="VRM/UnlitTransparentZWrite",a=((e=n.keywordMap)==null?void 0:e._ALPHABLEND_ON)!=null||n.shader==="VRM/UnlitTransparent"||i,r=((t=n.floatProperties)==null?void 0:t._ZWrite)===1||i;let s=0;if(a){const o=n.renderQueue;o!=null&&(r?s=this._renderQueueMapTransparentZWrite.get(o):s=this._renderQueueMapTransparent.get(o))}return s}_populateRenderQueueMap(n){const e=new Set,t=new Set;n.forEach(i=>{var a,r;const s=i.shader==="VRM/UnlitTransparentZWrite",o=((a=i.keywordMap)==null?void 0:a._ALPHABLEND_ON)!=null||i.shader==="VRM/UnlitTransparent"||s,c=((r=i.floatProperties)==null?void 0:r._ZWrite)===1||s;if(o){const h=i.renderQueue;h!=null&&(c?t.add(h):e.add(h))}}),e.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${e.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),t.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${t.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(e).sort().forEach((i,a)=>{const r=Math.min(Math.max(a-e.size+1,-9),0);this._renderQueueMapTransparent.set(i,r)}),Array.from(t).sort().forEach((i,a)=>{const r=Math.min(Math.max(a,0),9);this._renderQueueMapTransparentZWrite.set(i,r)})}},RD=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),Ll=new L,C2=class extends Ia{constructor(n){super(),this._attrPosition=new Ot(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(OU);const e=new wt;e.setAttribute("position",this._attrPosition);const t=new Pi({color:16711935,depthTest:!1,depthWrite:!1});this._line=new ro(e,t),this.add(this._line),this.constraint=n}updateMatrixWorld(n){Ll.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,Ll.x,Ll.y,Ll.z),this.constraint.source&&Ll.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,Ll.x,Ll.y,Ll.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(n)}};function wD(n,e){return e.set(n.elements[12],n.elements[13],n.elements[14])}var yQ=new L,SQ=new L;function TQ(n,e){return n.decompose(yQ,e,SQ),e}function Wx(n){return n.invert?n.invert():n.inverse(),n}var tA=class{constructor(n,e){this.destination=n,this.source=e,this.weight=1}},EQ=new L,MQ=new L,bQ=new L,AQ=new Tt,RQ=new Tt,wQ=new Tt,CQ=class extends tA{get aimAxis(){return this._aimAxis}set aimAxis(n){this._aimAxis=n,this._v3AimAxis.set(n==="PositiveX"?1:n==="NegativeX"?-1:0,n==="PositiveY"?1:n==="NegativeY"?-1:0,n==="PositiveZ"?1:n==="NegativeZ"?-1:0)}get dependencies(){const n=new Set([this.source]);return this.destination.parent&&n.add(this.destination.parent),n}constructor(n,e){super(n,e),this._aimAxis="PositiveX",this._v3AimAxis=new L(1,0,0),this._dstRestQuat=new Tt}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);const n=AQ.identity(),e=RQ.identity();this.destination.parent&&(TQ(this.destination.parent.matrixWorld,n),Wx(e.copy(n)));const t=EQ.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(n),i=wD(this.source.matrixWorld,MQ).sub(wD(this.destination.matrixWorld,bQ)).normalize(),a=wQ.setFromUnitVectors(t,i).premultiply(e).multiply(n).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(a,this.weight)}};function NQ(n,e){const t=[n];let i=n.parent;for(;i!==null;)t.unshift(i),i=i.parent;t.forEach(a=>{e(a)})}var DQ=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(n){this._constraints.add(n);let e=this._objectConstraintsMap.get(n.destination);e==null&&(e=new Set,this._objectConstraintsMap.set(n.destination,e)),e.add(n)}deleteConstraint(n){this._constraints.delete(n),this._objectConstraintsMap.get(n.destination).delete(n)}setInitState(){const n=new Set,e=new Set;for(const t of this._constraints)this._processConstraint(t,n,e,i=>i.setInitState())}update(){const n=new Set,e=new Set;for(const t of this._constraints)this._processConstraint(t,n,e,i=>i.update())}_processConstraint(n,e,t,i){if(t.has(n))return;if(e.has(n))throw new Error("VRMNodeConstraintManager: Circular dependency detected while updating constraints");e.add(n);const a=n.dependencies;for(const r of a)NQ(r,s=>{const o=this._objectConstraintsMap.get(s);if(o)for(const c of o)this._processConstraint(c,e,t,i)});i(n),t.add(n)}},OQ=new Tt,LQ=new Tt,IQ=class extends tA{get dependencies(){return new Set([this.source])}constructor(n,e){super(n,e),this._dstRestQuat=new Tt,this._invSrcRestQuat=new Tt}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Wx(this._invSrcRestQuat.copy(this.source.quaternion))}update(){const n=OQ.copy(this._invSrcRestQuat).multiply(this.source.quaternion),e=LQ.copy(this._dstRestQuat).multiply(n);this.destination.quaternion.copy(this._dstRestQuat).slerp(e,this.weight)}},UQ=new L,PQ=new Tt,zQ=new Tt,BQ=class extends tA{get rollAxis(){return this._rollAxis}set rollAxis(n){this._rollAxis=n,this._v3RollAxis.set(n==="X"?1:0,n==="Y"?1:0,n==="Z"?1:0)}get dependencies(){return new Set([this.source])}constructor(n,e){super(n,e),this._rollAxis="X",this._v3RollAxis=new L(1,0,0),this._dstRestQuat=new Tt,this._invDstRestQuat=new Tt,this._invSrcRestQuatMulDstRestQuat=new Tt}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Wx(this._invDstRestQuat.copy(this._dstRestQuat)),Wx(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){const n=PQ.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),e=UQ.copy(this._v3RollAxis).applyQuaternion(n),i=zQ.setFromUnitVectors(e,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(n);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}},HQ=new Set(["1.0","1.0-beta"]),I8=class um{get name(){return um.EXTENSION_NAME}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot}afterRoot(e){return RD(this,null,function*(){e.userData.vrmNodeConstraintManager=yield this._import(e)})}_import(e){return RD(this,null,function*(){var t;const i=this.parser.json;if(!(((t=i.extensionsUsed)==null?void 0:t.indexOf(um.EXTENSION_NAME))!==-1))return null;const r=new DQ,s=yield this.parser.getDependencies("node");return s.forEach((o,c)=>{var h;const f=i.nodes[c],d=(h=f==null?void 0:f.extensions)==null?void 0:h[um.EXTENSION_NAME];if(d==null)return;const m=d.specVersion;if(!HQ.has(m)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${um.EXTENSION_NAME} specVersion "${m}"`);return}const g=d.constraint;if(g.roll!=null){const x=this._importRollConstraint(o,s,g.roll);r.addConstraint(x)}else if(g.aim!=null){const x=this._importAimConstraint(o,s,g.aim);r.addConstraint(x)}else if(g.rotation!=null){const x=this._importRotationConstraint(o,s,g.rotation);r.addConstraint(x)}}),e.scene.updateMatrixWorld(),r.setInitState(),r})}_importRollConstraint(e,t,i){const{source:a,rollAxis:r,weight:s}=i,o=t[a],c=new BQ(e,o);if(r!=null&&(c.rollAxis=r),s!=null&&(c.weight=s),this.helperRoot){const h=new C2(c);this.helperRoot.add(h)}return c}_importAimConstraint(e,t,i){const{source:a,aimAxis:r,weight:s}=i,o=t[a],c=new CQ(e,o);if(r!=null&&(c.aimAxis=r),s!=null&&(c.weight=s),this.helperRoot){const h=new C2(c);this.helperRoot.add(h)}return c}_importRotationConstraint(e,t,i){const{source:a,weight:r}=i,s=t[a],o=new IQ(e,s);if(r!=null&&(o.weight=r),this.helperRoot){const c=new C2(o);this.helperRoot.add(c)}return o}};I8.EXTENSION_NAME="VRMC_node_constraint";var FQ=I8,Hv=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),nA=class{},N2=new L,cu=new L,U8=class extends nA{get type(){return"capsule"}constructor(n){var e,t,i,a;super(),this.offset=(e=n==null?void 0:n.offset)!=null?e:new L(0,0,0),this.tail=(t=n==null?void 0:n.tail)!=null?t:new L(0,0,0),this.radius=(i=n==null?void 0:n.radius)!=null?i:0,this.inside=(a=n==null?void 0:n.inside)!=null?a:!1}calculateCollision(n,e,t,i){N2.setFromMatrixPosition(n),cu.subVectors(this.tail,this.offset).applyMatrix4(n),cu.sub(N2);const a=cu.lengthSq();i.copy(e).sub(N2);const r=cu.dot(i);r<=0||(a<=r||cu.multiplyScalar(r/a),i.sub(cu));const s=i.length(),o=this.inside?this.radius-t-s:s-t-this.radius;return o<0&&(i.multiplyScalar(1/s),this.inside&&i.negate()),o}},D2=new L,CD=new Et,P8=class extends nA{get type(){return"plane"}constructor(n){var e,t;super(),this.offset=(e=n==null?void 0:n.offset)!=null?e:new L(0,0,0),this.normal=(t=n==null?void 0:n.normal)!=null?t:new L(0,0,1)}calculateCollision(n,e,t,i){i.setFromMatrixPosition(n),i.negate().add(e),CD.getNormalMatrix(n),D2.copy(this.normal).applyNormalMatrix(CD).normalize();const a=i.dot(D2)-t;return i.copy(D2),a}},GQ=new L,z8=class extends nA{get type(){return"sphere"}constructor(n){var e,t,i;super(),this.offset=(e=n==null?void 0:n.offset)!=null?e:new L(0,0,0),this.radius=(t=n==null?void 0:n.radius)!=null?t:0,this.inside=(i=n==null?void 0:n.inside)!=null?i:!1}calculateCollision(n,e,t,i){i.subVectors(e,GQ.setFromMatrixPosition(n));const a=i.length(),r=this.inside?this.radius-t-a:a-t-this.radius;return r<0&&(i.multiplyScalar(1/a),this.inside&&i.negate()),r}},Ys=new L,VQ=class extends wt{constructor(n){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new L,this._currentTail=new L,this._shape=n,this._attrPos=new Ot(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;const e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,n=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),n=!0);const t=Ys.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(t)>1e-10&&(this._currentTail.copy(t),n=!0),n&&this._buildPosition()}_buildPosition(){Ys.copy(this._currentTail).sub(this._currentOffset);const n=Ys.length()/this._currentRadius;for(let i=0;i<=16;i++){const a=i/16*Math.PI;this._attrPos.setXYZ(i,-Math.sin(a),-Math.cos(a),0),this._attrPos.setXYZ(17+i,n+Math.sin(a),Math.cos(a),0),this._attrPos.setXYZ(34+i,-Math.sin(a),0,-Math.cos(a)),this._attrPos.setXYZ(51+i,n+Math.sin(a),0,Math.cos(a))}for(let i=0;i<32;i++){const a=i/16*Math.PI;this._attrPos.setXYZ(68+i,0,Math.sin(a),Math.cos(a)),this._attrPos.setXYZ(100+i,n,Math.sin(a),Math.cos(a))}const e=Math.atan2(Ys.y,Math.sqrt(Ys.x*Ys.x+Ys.z*Ys.z)),t=-Math.atan2(Ys.z,Ys.x);this.rotateZ(e),this.rotateY(t),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let n=0;n<34;n++){const e=(n+1)%34;this._attrIndex.setXY(n*2,n,e),this._attrIndex.setXY(68+n*2,34+n,34+e)}for(let n=0;n<32;n++){const e=(n+1)%32;this._attrIndex.setXY(136+n*2,68+n,68+e),this._attrIndex.setXY(200+n*2,100+n,100+e)}this._attrIndex.needsUpdate=!0}},kQ=class extends wt{constructor(n){super(),this.worldScale=1,this._currentOffset=new L,this._currentNormal=new L,this._shape=n,this._attrPos=new Ot(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),n=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),n=!0),n&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},WQ=class extends wt{constructor(n){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new L,this._shape=n,this._attrPos=new Ot(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;const e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,n=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),n=!0),n&&this._buildPosition()}_buildPosition(){for(let n=0;n<32;n++){const e=n/16*Math.PI;this._attrPos.setXYZ(n,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+n,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+n,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let n=0;n<32;n++){const e=(n+1)%32;this._attrIndex.setXY(n*2,n,e),this._attrIndex.setXY(64+n*2,32+n,32+e),this._attrIndex.setXY(128+n*2,64+n,64+e)}this._attrIndex.needsUpdate=!0}},XQ=new L,O2=class extends Ia{constructor(n){if(super(),this.matrixAutoUpdate=!1,this.collider=n,this.collider.shape instanceof z8)this._geometry=new WQ(this.collider.shape);else if(this.collider.shape instanceof U8)this._geometry=new VQ(this.collider.shape);else if(this.collider.shape instanceof P8)this._geometry=new kQ(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");const e=new Pi({color:16711935,depthTest:!1,depthWrite:!1});this._line=new nr(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(n){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);const e=this.matrix.elements;this._geometry.worldScale=XQ.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(n)}},YQ=class extends wt{constructor(n){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new L,this._springBone=n,this._attrPos=new Ot(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;const e=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,n=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),n=!0),n&&this._buildPosition()}_buildPosition(){for(let n=0;n<32;n++){const e=n/16*Math.PI;this._attrPos.setXYZ(n,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+n,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+n,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let n=0;n<32;n++){const e=(n+1)%32;this._attrIndex.setXY(n*2,n,e),this._attrIndex.setXY(64+n*2,32+n,32+e),this._attrIndex.setXY(128+n*2,64+n,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},qQ=new L,jQ=class extends Ia{constructor(n){super(),this.matrixAutoUpdate=!1,this.springBone=n,this._geometry=new YQ(this.springBone);const e=new Pi({color:16776960,depthTest:!1,depthWrite:!1});this._line=new nr(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(n){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);const e=this.matrix.elements;this._geometry.worldScale=qQ.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(n)}},L2=class extends Zt{constructor(n){super(),this.colliderMatrix=new ke,this.shape=n}updateWorldMatrix(n,e){super.updateWorldMatrix(n,e),ZQ(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function ZQ(n,e,t){const i=e.elements;n.copy(e),t&&(n.elements[12]=i[0]*t.x+i[4]*t.y+i[8]*t.z+i[12],n.elements[13]=i[1]*t.x+i[5]*t.y+i[9]*t.z+i[13],n.elements[14]=i[2]*t.x+i[6]*t.y+i[10]*t.z+i[14])}var KQ=new ke;function QQ(n){return n.invert?n.invert():n.getInverse(KQ.copy(n)),n}var JQ=class{constructor(n){this._inverseCache=new ke,this._shouldUpdateInverse=!0,this.matrix=n;const e={set:(t,i,a)=>(this._shouldUpdateInverse=!0,t[i]=a,!0)};this._originalElements=n.elements,n.elements=new Proxy(n.elements,e)}get inverse(){return this._shouldUpdateInverse&&(QQ(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},I2=new ke,gf=new L,qp=new L,jp=new L,Zp=new L,$Q=new ke,eJ=class{constructor(n,e,t={},i=[]){this._currentTail=new L,this._prevTail=new L,this._boneAxis=new L,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new ke,this._initialLocalRotation=new Tt,this._initialLocalChildPosition=new L;var a,r,s,o,c,h;this.bone=n,this.bone.matrixAutoUpdate=!1,this.child=e,this.settings={hitRadius:(a=t.hitRadius)!=null?a:0,stiffness:(r=t.stiffness)!=null?r:1,gravityPower:(s=t.gravityPower)!=null?s:0,gravityDir:(c=(o=t.gravityDir)==null?void 0:o.clone())!=null?c:new L(0,-1,0),dragForce:(h=t.dragForce)!=null?h:.4},this.colliderGroups=i}get dependencies(){const n=new Set,e=this.bone.parent;e&&n.add(e);for(let t=0;t{e(a)})}function CE(n,e){n.children.forEach(t=>{e(t)||CE(t,e)})}function nJ(n){var e;const t=new Map;for(const i of n){let a=i;do{const r=((e=t.get(a))!=null?e:0)+1;if(r===n.size)return a;t.set(a,r),a=a.parent}while(a!==null)}return null}var ND=class{constructor(){this._joints=new Set,this._sortedJoints=[],this._hasWarnedCircularDependency=!1,this._ancestors=[],this._objectSpringBonesMap=new Map,this._isSortedJointsDirty=!1,this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){const n=new Set;return this._joints.forEach(e=>{e.colliderGroups.forEach(t=>{n.add(t)})}),Array.from(n)}get colliders(){const n=new Set;return this.colliderGroups.forEach(e=>{e.colliders.forEach(t=>{n.add(t)})}),Array.from(n)}addJoint(n){this._joints.add(n);let e=this._objectSpringBonesMap.get(n.bone);e==null&&(e=new Set,this._objectSpringBonesMap.set(n.bone,e)),e.add(n),this._isSortedJointsDirty=!0}addSpringBone(n){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(n)}deleteJoint(n){this._joints.delete(n),this._objectSpringBonesMap.get(n.bone).delete(n),this._isSortedJointsDirty=!0}deleteSpringBone(n){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(n)}setInitState(){this._sortJoints();for(let n=0;n{var s,o;return((o=(s=this._objectSpringBonesMap.get(r))==null?void 0:s.size)!=null?o:0)>0?!0:(this._ancestors.push(r),!1)})),this._isSortedJointsDirty=!1}_insertJointSort(n,e,t,i,a){if(t.has(n))return;if(e.has(n)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected"),this._hasWarnedCircularDependency=!0);return}e.add(n);const r=n.dependencies;for(const s of r){let o=!1,c=null;tJ(s,h=>{const f=this._objectSpringBonesMap.get(h);if(f)for(const d of f)o=!0,this._insertJointSort(d,e,t,i,a);else o||(c=h)}),c&&a.add(c)}i.push(n),t.add(n)}_relevantChildrenUpdated(n){var e,t;return((t=(e=this._objectSpringBonesMap.get(n))==null?void 0:e.size)!=null?t:0)>0?!0:(n.updateWorldMatrix(!1,!1),!1)}},DD="VRMC_springBone_extended_collider",iJ=new Set(["1.0","1.0-beta"]),aJ=new Set(["1.0"]),B8=class wf{get name(){return wf.EXTENSION_NAME}constructor(e,t){var i;this.parser=e,this.jointHelperRoot=t==null?void 0:t.jointHelperRoot,this.colliderHelperRoot=t==null?void 0:t.colliderHelperRoot,this.useExtendedColliders=(i=t==null?void 0:t.useExtendedColliders)!=null?i:!0}afterRoot(e){return Hv(this,null,function*(){e.userData.vrmSpringBoneManager=yield this._import(e)})}_import(e){return Hv(this,null,function*(){const t=yield this._v1Import(e);if(t!=null)return t;const i=yield this._v0Import(e);return i??null})}_v1Import(e){return Hv(this,null,function*(){var t,i,a,r,s;const o=e.parser.json;if(!(((t=o.extensionsUsed)==null?void 0:t.indexOf(wf.EXTENSION_NAME))!==-1))return null;const h=new ND,f=yield e.parser.getDependencies("node"),d=(i=o.extensions)==null?void 0:i[wf.EXTENSION_NAME];if(!d)return null;const m=d.specVersion;if(!iJ.has(m))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${wf.EXTENSION_NAME} specVersion "${m}"`),null;const g=(a=d.colliders)==null?void 0:a.map((T,S)=>{var v,y,E,b,D,C,I,P,O,R,B,j,ee,se,re;const W=f[T.node];if(W==null)return console.warn(`VRMSpringBoneLoaderPlugin: The collider #${S} attempted to use the node #${T.node} but not found`),null;const te=T.shape,K=(v=T.extensions)==null?void 0:v[DD];if(this.useExtendedColliders&&K!=null){const oe=K.specVersion;if(!aJ.has(oe))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${DD} specVersion "${oe}". Fallbacking to the ${wf.EXTENSION_NAME} definition`);else{const ie=K.shape;if(ie.sphere)return this._importSphereCollider(W,{offset:new L().fromArray((y=ie.sphere.offset)!=null?y:[0,0,0]),radius:(E=ie.sphere.radius)!=null?E:0,inside:(b=ie.sphere.inside)!=null?b:!1});if(ie.capsule)return this._importCapsuleCollider(W,{offset:new L().fromArray((D=ie.capsule.offset)!=null?D:[0,0,0]),radius:(C=ie.capsule.radius)!=null?C:0,tail:new L().fromArray((I=ie.capsule.tail)!=null?I:[0,0,0]),inside:(P=ie.capsule.inside)!=null?P:!1});if(ie.plane)return this._importPlaneCollider(W,{offset:new L().fromArray((O=ie.plane.offset)!=null?O:[0,0,0]),normal:new L().fromArray((R=ie.plane.normal)!=null?R:[0,0,1])})}}if(te.sphere)return this._importSphereCollider(W,{offset:new L().fromArray((B=te.sphere.offset)!=null?B:[0,0,0]),radius:(j=te.sphere.radius)!=null?j:0,inside:!1});if(te.capsule)return this._importCapsuleCollider(W,{offset:new L().fromArray((ee=te.capsule.offset)!=null?ee:[0,0,0]),radius:(se=te.capsule.radius)!=null?se:0,tail:new L().fromArray((re=te.capsule.tail)!=null?re:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${S} has no valid shape`)}),x=(r=d.colliderGroups)==null?void 0:r.map((T,S)=>{var v;return{colliders:((v=T.colliders)!=null?v:[]).flatMap(E=>{const b=g==null?void 0:g[E];return b??(console.warn(`VRMSpringBoneLoaderPlugin: The colliderGroup #${S} attempted to use a collider #${E} but not found`),[])}),name:T.name}});return(s=d.springs)==null||s.forEach((T,S)=>{var v;const y=T.joints,E=(v=T.colliderGroups)==null?void 0:v.map(C=>{const I=x==null?void 0:x[C];if(I==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${S} attempted to use a colliderGroup ${C} but not found`);return I}),b=T.center!=null?f[T.center]:void 0;let D;y.forEach(C=>{if(D){const I=D.node,P=f[I],O=C.node,R=f[O],B={hitRadius:D.hitRadius,dragForce:D.dragForce,gravityPower:D.gravityPower,stiffness:D.stiffness,gravityDir:D.gravityDir!=null?new L().fromArray(D.gravityDir):void 0},j=this._importJoint(P,R,B,E);b&&(j.center=b),h.addJoint(j)}D=C})}),h.setInitState(),h})}_v0Import(e){return Hv(this,null,function*(){var t,i,a;const r=e.parser.json;if(!(((t=r.extensionsUsed)==null?void 0:t.indexOf("VRM"))!==-1))return null;const o=(i=r.extensions)==null?void 0:i.VRM,c=o==null?void 0:o.secondaryAnimation;if(!c)return null;const h=c==null?void 0:c.boneGroups;if(!h)return null;const f=new ND,d=yield e.parser.getDependencies("node"),m=(a=c.colliderGroups)==null?void 0:a.map(g=>{var x;const T=d[g.node];return{colliders:((x=g.colliders)!=null?x:[]).map((v,y)=>{var E,b,D;const C=new L(0,0,0);return v.offset&&C.set((E=v.offset.x)!=null?E:0,(b=v.offset.y)!=null?b:0,v.offset.z?-v.offset.z:0),this._importSphereCollider(T,{offset:C,radius:(D=v.radius)!=null?D:0,inside:!1})})}});return h==null||h.forEach((g,x)=>{const T=g.bones;T&&T.forEach(S=>{var v,y,E,b;const D=d[S],C=new L;g.gravityDir?C.set((v=g.gravityDir.x)!=null?v:0,(y=g.gravityDir.y)!=null?y:0,(E=g.gravityDir.z)!=null?E:0):C.set(0,-1,0);const I=g.center!=null?d[g.center]:void 0,P={hitRadius:g.hitRadius,dragForce:g.dragForce,gravityPower:g.gravityPower,stiffness:g.stiffiness,gravityDir:C},O=(b=g.colliderGroups)==null?void 0:b.map(R=>{const B=m==null?void 0:m[R];if(B==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${x} attempted to use a colliderGroup ${R} but not found`);return B});D.traverse(R=>{var B;const j=(B=R.children[0])!=null?B:null,ee=this._importJoint(R,j,P,O);I&&(ee.center=I),f.addJoint(ee)})})}),e.scene.updateMatrixWorld(),f.setInitState(),f})}_importJoint(e,t,i,a){const r=new eJ(e,t,i,a);if(this.jointHelperRoot){const s=new jQ(r);this.jointHelperRoot.add(s),s.renderOrder=this.jointHelperRoot.renderOrder}return r}_importSphereCollider(e,t){const i=new z8(t),a=new L2(i);if(e.add(a),this.colliderHelperRoot){const r=new O2(a);this.colliderHelperRoot.add(r),r.renderOrder=this.colliderHelperRoot.renderOrder}return a}_importCapsuleCollider(e,t){const i=new U8(t),a=new L2(i);if(e.add(a),this.colliderHelperRoot){const r=new O2(a);this.colliderHelperRoot.add(r),r.renderOrder=this.colliderHelperRoot.renderOrder}return a}_importPlaneCollider(e,t){const i=new P8(t),a=new L2(i);if(e.add(a),this.colliderHelperRoot){const r=new O2(a);this.colliderHelperRoot.add(r),r.renderOrder=this.colliderHelperRoot.renderOrder}return a}};B8.EXTENSION_NAME="VRMC_springBone";var rJ=B8,sJ=class{get name(){return"VRMLoaderPlugin"}constructor(n,e){var t,i,a,r,s,o,c,h,f,d;this.parser=n;const m=e==null?void 0:e.helperRoot,g=e==null?void 0:e.autoUpdateHumanBones;this.expressionPlugin=(t=e==null?void 0:e.expressionPlugin)!=null?t:new TK(n),this.firstPersonPlugin=(i=e==null?void 0:e.firstPersonPlugin)!=null?i:new MK(n),this.humanoidPlugin=(a=e==null?void 0:e.humanoidPlugin)!=null?a:new DK(n,{helperRoot:m,autoUpdateHumanBones:g}),this.lookAtPlugin=(r=e==null?void 0:e.lookAtPlugin)!=null?r:new YK(n,{helperRoot:m}),this.metaPlugin=(s=e==null?void 0:e.metaPlugin)!=null?s:new ZK(n),this.mtoonMaterialPlugin=(o=e==null?void 0:e.mtoonMaterialPlugin)!=null?o:new uQ(n),this.materialsHDREmissiveMultiplierPlugin=(c=e==null?void 0:e.materialsHDREmissiveMultiplierPlugin)!=null?c:new fQ(n),this.materialsV0CompatPlugin=(h=e==null?void 0:e.materialsV0CompatPlugin)!=null?h:new xQ(n),this.springBonePlugin=(f=e==null?void 0:e.springBonePlugin)!=null?f:new rJ(n,{colliderHelperRoot:m,jointHelperRoot:m}),this.nodeConstraintPlugin=(d=e==null?void 0:e.nodeConstraintPlugin)!=null?d:new FQ(n,{helperRoot:m})}beforeRoot(){return Pv(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(n){return Pv(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(n)})}getMaterialType(n){const e=this.mtoonMaterialPlugin.getMaterialType(n);return e??null}extendMaterialParams(n,e){return Pv(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(n,e),yield this.mtoonMaterialPlugin.extendMaterialParams(n,e)})}afterRoot(n){return Pv(this,null,function*(){yield this.metaPlugin.afterRoot(n),yield this.humanoidPlugin.afterRoot(n),yield this.expressionPlugin.afterRoot(n),yield this.lookAtPlugin.afterRoot(n),yield this.firstPersonPlugin.afterRoot(n),yield this.springBonePlugin.afterRoot(n),yield this.nodeConstraintPlugin.afterRoot(n),yield this.mtoonMaterialPlugin.afterRoot(n);const e=n.userData.vrmMeta,t=n.userData.vrmHumanoid;if(e&&t){const i=new QK({scene:n.scene,expressionManager:n.userData.vrmExpressionManager,firstPerson:n.userData.vrmFirstPerson,humanoid:t,lookAt:n.userData.vrmLookAt,meta:e,materials:n.userData.vrmMToonMaterials,springBoneManager:n.userData.vrmSpringBoneManager,nodeConstraintManager:n.userData.vrmNodeConstraintManager});n.userData.vrm=i}})}};function oJ(n){const e=new Set;return n.traverse(t=>{if(!t.isMesh)return;const i=t;e.add(i)}),e}function OD(n,e,t){if(e.size===1){const s=e.values().next().value;if(s.weight===1)return n[s.index]}const i=new Float32Array(n[0].count*3);let a=0;if(t)a=1;else for(const s of e)a+=s.weight;for(const s of e){const o=n[s.index],c=s.weight/a;for(let h=0;hf.getOrCreate(O)).join(","),I=`${b};${v};${C}`;let P=o.get(I);P==null&&(P=E.clone(),pJ(P,D,x),o.set(I,P)),y.geometry.setAttribute("skinIndex",P)}for(const y of g)y.bind(S,new ke)}}function uJ(n){const e=new Set;return n.traverse(t=>{if(!t.isSkinnedMesh)return;const i=t;e.add(i)}),e}function hJ(n,e){const t=new Set;for(let i=0;it)return!1;return!0}var U2=class{constructor(){this._objectIndexMap=new Map,this._index=0}get(n){return this._objectIndexMap.get(n)}getOrCreate(n){let e=this._objectIndexMap.get(n);return e==null&&(e=this._index,this._objectIndexMap.set(n,e),this._index++),e}};function gJ(n){var e,t,i,a;const r=new wt;r.name=n.name,r.setIndex(n.index);for(const[s,o]of Object.entries(n.attributes))r.setAttribute(s,o);for(const[s,o]of Object.entries(n.morphAttributes)){const c=s;r.morphAttributes[c]=o.concat()}r.morphTargetsRelative=n.morphTargetsRelative,r.groups=[];for(const s of n.groups)r.addGroup(s.start,s.count,s.materialIndex);return r.boundingSphere=(t=(e=n.boundingSphere)==null?void 0:e.clone())!=null?t:null,r.boundingBox=(a=(i=n.boundingBox)==null?void 0:i.clone())!=null?a:null,r.drawRange.start=n.drawRange.start,r.drawRange.count=n.drawRange.count,r.userData=n.userData,r}function LD(n){if(Object.values(n).forEach(e=>{e!=null&&e.isTexture&&e.dispose()}),n.isShaderMaterial){const e=n.uniforms;e&&Object.values(e).forEach(t=>{const i=t.value;i!=null&&i.isTexture&&i.dispose()})}n.dispose()}function vJ(n){const e=n.geometry;e&&e.dispose();const t=n.skeleton;t&&t.dispose();const i=n.material;i&&(Array.isArray(i)?i.forEach(a=>LD(a)):i&&LD(i))}function _J(n){n.traverse(vJ)}function xJ(n,e){var t,i;console.warn("VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.");const a=(t=e==null?void 0:e.experimentalSameBoneCounts)!=null?t:!1,r=[];n.traverse(c=>{c.type==="SkinnedMesh"&&r.push(c)});const s=new Map;let o=0;for(const c of r){const f=c.geometry.getAttribute("skinIndex");if(s.has(f))continue;const d=new Map,m=new Map;for(let g=0;g{var i,a,r,s;if(!t.isMesh)return;const o=t,c=o.geometry,h=c.index;if(h==null)return;const f=e.get(c);if(f!=null){o.geometry=f;return}const d=Object.values(c.attributes)[0].count,m=new Array(d);let g=0;const x=h.array;for(let b=0;b{y.addGroup(b.start,b.count,b.materialIndex)}),y.boundingBox=(a=(i=c.boundingBox)==null?void 0:i.clone())!=null?a:null,y.boundingSphere=(s=(r=c.boundingSphere)==null?void 0:r.clone())!=null?s:null,y.setDrawRange(c.drawRange.start,c.drawRange.count),y.userData=c.userData,e.set(c,y);{const b=h.array,D=new b.constructor(b.length);for(let C=0;C{const D=c.attributes[b];if(D.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");const C=D.array,{itemSize:I,normalized:P}=D,O=new C.constructor(S.length*I);S.forEach((R,B)=>{for(let j=0;j{for(let re=0;reee===0),y.morphAttributes[C][I]=new Ot(j,R,B)}}E&&(y.morphAttributes={}),o.geometry=y}),Array.from(e.keys()).forEach(t=>{t.dispose()})}function SJ(n){var e;((e=n.meta)==null?void 0:e.metaVersion)==="0"&&(n.scene.rotation.y=Math.PI)}var fh=class{constructor(){}};fh.combineMorphs=lJ;fh.combineSkeletons=cJ;fh.deepDispose=_J;fh.removeUnnecessaryJoints=xJ;fh.removeUnnecessaryVertices=yJ;fh.rotateVRM0=SJ;/*! +`;t.vertexShader=a+t.vertexShader,t.fragmentShader=a+t.fragmentShader,i<154&&(t.fragmentShader=t.fragmentShader.replace("#include ","#include "))}}get color(){return this.uniforms.litFactor.value}set color(n){this.uniforms.litFactor.value=n}get map(){return this.uniforms.map.value}set map(n){this.uniforms.map.value=n}get normalMap(){return this.uniforms.normalMap.value}set normalMap(n){this.uniforms.normalMap.value=n}get normalScale(){return this.uniforms.normalScale.value}set normalScale(n){this.uniforms.normalScale.value=n}get emissive(){return this.uniforms.emissive.value}set emissive(n){this.uniforms.emissive.value=n}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(n){this.uniforms.emissiveIntensity.value=n}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(n){this.uniforms.emissiveMap.value=n}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(n){this.uniforms.shadeColorFactor.value=n}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(n){this.uniforms.shadeMultiplyTexture.value=n}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(n){this.uniforms.shadingShiftFactor.value=n}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(n){this.uniforms.shadingShiftTexture.value=n}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(n){this.uniforms.shadingShiftTextureScale.value=n}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(n){this.uniforms.shadingToonyFactor.value=n}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(n){this.uniforms.giEqualizationFactor.value=n}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(n){this.uniforms.matcapFactor.value=n}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(n){this.uniforms.matcapTexture.value=n}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(n){this.uniforms.parametricRimColorFactor.value=n}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(n){this.uniforms.rimMultiplyTexture.value=n}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(n){this.uniforms.rimLightingMixFactor.value=n}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(n){this.uniforms.parametricRimFresnelPowerFactor.value=n}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(n){this.uniforms.parametricRimLiftFactor.value=n}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(n){this.uniforms.outlineWidthMultiplyTexture.value=n}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(n){this.uniforms.outlineWidthFactor.value=n}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(n){this.uniforms.outlineColorFactor.value=n}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(n){this.uniforms.outlineLightingMixFactor.value=n}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(n){this.uniforms.uvAnimationMaskTexture.value=n}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(n){this.uniforms.uvAnimationScrollXOffset.value=n}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(n){this.uniforms.uvAnimationScrollYOffset.value=n}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(n){this.uniforms.uvAnimationRotationPhase.value=n}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(n){this._ignoreVertexColor=n,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(n){this._v0CompatShade=n,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(n){this._debugMode=n,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(n){this._outlineWidthMode=n,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(n){this._isOutline=n,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(n){this._uploadUniformsWorkaround(),this._updateUVAnimation(n)}copy(n){return super.copy(n),this.map=n.map,this.normalMap=n.normalMap,this.emissiveMap=n.emissiveMap,this.shadeMultiplyTexture=n.shadeMultiplyTexture,this.shadingShiftTexture=n.shadingShiftTexture,this.matcapTexture=n.matcapTexture,this.rimMultiplyTexture=n.rimMultiplyTexture,this.outlineWidthMultiplyTexture=n.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=n.uvAnimationMaskTexture,this.normalMapType=n.normalMapType,this.uvAnimationScrollXSpeedFactor=n.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=n.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=n.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=n.ignoreVertexColor,this.v0CompatShade=n.v0CompatShade,this.debugMode=n.debugMode,this.outlineWidthMode=n.outlineWidthMode,this.isOutline=n.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(n){this.uniforms.uvAnimationScrollXOffset.value+=n*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=n*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=n*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){const n=parseInt(Cs,10),e=this.outlineWidthMultiplyTexture!==null,t=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:n,OUTLINE:this._isOutline,MTOON_USE_UV:e||t,MTOON_UVS_VERTEX_ONLY:e&&!t,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode==="normal",DEBUG_LITSHADERATE:this._debugMode==="litShadeRate",DEBUG_UV:this._debugMode==="uv",OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===AD.ScreenCoordinates}}_updateTextureMatrix(n,e){n.value&&(n.value.matrixAutoUpdate&&n.value.updateMatrix(),e.value.copy(n.value.matrix))}},uQ=new Set(["1.0","1.0-beta"]),I8=class S_{get name(){return S_.EXTENSION_NAME}constructor(e,t={}){var i,a,r,s;this.parser=e,this.materialType=(i=t.materialType)!=null?i:cQ,this.renderOrderOffset=(a=t.renderOrderOffset)!=null?a:0,this.v0CompatShade=(r=t.v0CompatShade)!=null?r:!1,this.debugMode=(s=t.debugMode)!=null?s:"none",this._mToonMaterialSet=new Set}beforeRoot(){return wu(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(e){return wu(this,null,function*(){e.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(e){return this._getMToonExtension(e)?this.materialType:null}extendMaterialParams(e,t){const i=this._getMToonExtension(e);return i?this._extendMaterialParams(i,t):null}loadMesh(e){return wu(this,null,function*(){var t;const i=this.parser,r=(t=i.json.meshes)==null?void 0:t[e];if(r==null)throw new Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${e}] of glTF but the mesh doesn't exist`);const s=r.primitives,o=yield i.loadMesh(e);if(s.length===1){const c=o,h=s[0].material;h!=null&&this._setupPrimitive(c,h)}else{const c=o;for(let h=0;h{var s;this._getMToonExtension(r)&&((s=a.extensions)!=null&&s.KHR_materials_unlit)&&delete a.extensions.KHR_materials_unlit})}_getMToonExtension(e){var t,i;const s=(t=this.parser.json.materials)==null?void 0:t[e];if(s==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}const o=(i=s.extensions)==null?void 0:i[S_.EXTENSION_NAME];if(o==null)return;const c=o.specVersion;if(!uQ.has(c)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${S_.EXTENSION_NAME} specVersion "${c}"`);return}return o}_extendMaterialParams(e,t){return wu(this,null,function*(){var i;delete t.metalness,delete t.roughness;const a=new aQ(this.parser,t);a.assignPrimitive("transparentWithZWrite",e.transparentWithZWrite),a.assignColor("shadeColorFactor",e.shadeColorFactor),a.assignTexture("shadeMultiplyTexture",e.shadeMultiplyTexture,!0),a.assignPrimitive("shadingShiftFactor",e.shadingShiftFactor),a.assignTexture("shadingShiftTexture",e.shadingShiftTexture,!0),a.assignPrimitive("shadingShiftTextureScale",(i=e.shadingShiftTexture)==null?void 0:i.scale),a.assignPrimitive("shadingToonyFactor",e.shadingToonyFactor),a.assignPrimitive("giEqualizationFactor",e.giEqualizationFactor),a.assignColor("matcapFactor",e.matcapFactor),a.assignTexture("matcapTexture",e.matcapTexture,!0),a.assignColor("parametricRimColorFactor",e.parametricRimColorFactor),a.assignTexture("rimMultiplyTexture",e.rimMultiplyTexture,!0),a.assignPrimitive("rimLightingMixFactor",e.rimLightingMixFactor),a.assignPrimitive("parametricRimFresnelPowerFactor",e.parametricRimFresnelPowerFactor),a.assignPrimitive("parametricRimLiftFactor",e.parametricRimLiftFactor),a.assignPrimitive("outlineWidthMode",e.outlineWidthMode),a.assignPrimitive("outlineWidthFactor",e.outlineWidthFactor),a.assignTexture("outlineWidthMultiplyTexture",e.outlineWidthMultiplyTexture,!1),a.assignColor("outlineColorFactor",e.outlineColorFactor),a.assignPrimitive("outlineLightingMixFactor",e.outlineLightingMixFactor),a.assignTexture("uvAnimationMaskTexture",e.uvAnimationMaskTexture,!1),a.assignPrimitive("uvAnimationScrollXSpeedFactor",e.uvAnimationScrollXSpeedFactor),a.assignPrimitive("uvAnimationScrollYSpeedFactor",e.uvAnimationScrollYSpeedFactor),a.assignPrimitive("uvAnimationRotationSpeedFactor",e.uvAnimationRotationSpeedFactor),a.assignPrimitive("v0CompatShade",this.v0CompatShade),a.assignPrimitive("debugMode",this.debugMode),yield a.pending})}_setupPrimitive(e,t){const i=this._getMToonExtension(t);if(i){const a=this._parseRenderOrder(i);e.renderOrder=a+this.renderOrderOffset,this._generateOutline(e),this._addToMaterialSet(e);return}}_shouldGenerateOutline(e){return typeof e.outlineWidthMode=="string"&&e.outlineWidthMode!=="none"&&typeof e.outlineWidthFactor=="number"&&e.outlineWidthFactor>0}_generateOutline(e){const t=e.material;if(!(t instanceof qn)||!this._shouldGenerateOutline(t))return;e.material=[t];const i=t.clone();i.name+=" (Outline)",i.isOutline=!0,i.side=Ui,e.material.push(i);const a=e.geometry,r=a.index?a.index.count:a.attributes.position.count/3;a.addGroup(0,r,0),a.addGroup(0,r,1)}_addToMaterialSet(e){const t=e.material,i=new Set;Array.isArray(t)?t.forEach(a=>i.add(a)):i.add(t);for(const a of i)this._mToonMaterialSet.add(a)}_parseRenderOrder(e){var t;return(e.transparentWithZWrite?0:19)+((t=e.renderQueueOffsetNumber)!=null?t:0)}};I8.EXTENSION_NAME="VRMC_materials_mtoon";var hQ=I8,fQ=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),U8=class DE{get name(){return DE.EXTENSION_NAME}constructor(e){this.parser=e}extendMaterialParams(e,t){return fQ(this,null,function*(){const i=this._getHDREmissiveMultiplierExtension(e);if(i==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");const a=i.emissiveMultiplier;t.emissiveIntensity=a})}_getHDREmissiveMultiplierExtension(e){var t,i;const s=(t=this.parser.json.materials)==null?void 0:t[e];if(s==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}const o=(i=s.extensions)==null?void 0:i[DE.EXTENSION_NAME];if(o!=null)return o}};U8.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var dQ=U8,pQ=Object.defineProperty,mQ=Object.defineProperties,gQ=Object.getOwnPropertyDescriptors,wD=Object.getOwnPropertySymbols,vQ=Object.prototype.hasOwnProperty,_Q=Object.prototype.propertyIsEnumerable,RD=(n,e,t)=>e in n?pQ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ys=(n,e)=>{for(var t in e||(e={}))vQ.call(e,t)&&RD(n,t,e[t]);if(wD)for(var t of wD(e))_Q.call(e,t)&&RD(n,t,e[t]);return n},CD=(n,e)=>mQ(n,gQ(e)),xQ=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())});function vf(n){return Math.pow(n,2.2)}var yQ=class{get name(){return"VRMMaterialsV0CompatPlugin"}constructor(n){var e;this.parser=n,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;const t=this.parser.json;t.extensionsUsed=(e=t.extensionsUsed)!=null?e:[],t.extensionsUsed.indexOf("KHR_texture_transform")===-1&&t.extensionsUsed.push("KHR_texture_transform")}beforeRoot(){return xQ(this,null,function*(){var n;const e=this.parser.json,t=(n=e.extensions)==null?void 0:n.VRM,i=t==null?void 0:t.materialProperties;i&&(this._populateRenderQueueMap(i),i.forEach((a,r)=>{var s,o;const c=(s=e.materials)==null?void 0:s[r];if(c==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${r}] of glTF but the material doesn't exist`);return}if(a.shader==="VRM/MToon"){const h=this._parseV0MToonProperties(a,c);e.materials[r]=h}else if((o=a.shader)!=null&&o.startsWith("VRM/Unlit")){const h=this._parseV0UnlitProperties(a,c);e.materials[r]=h}else a.shader==="VRM_USE_GLTFSHADER"||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${a.shader}`)}))})}_parseV0MToonProperties(n,e){var t,i,a,r,s,o,c,h,f,d,m,g,x,T,y,v,S,E,b,D,C,I,P,O,w,B,j,ee,se,re,W,te,K,oe,ie,Ce,Xe,nt,tt,gt,ge,Ae,Ze,ue,it,Mt,ot,Ke,Te,G,be,De,Fe,Be,$e;const Je=(i=(t=n.keywordMap)==null?void 0:t._ALPHABLEND_ON)!=null?i:!1,k=((a=n.floatProperties)==null?void 0:a._ZWrite)===1&&Je,U=this._v0ParseRenderQueue(n),ce=(s=(r=n.keywordMap)==null?void 0:r._ALPHATEST_ON)!=null?s:!1,Ee=Je?"BLEND":ce?"MASK":"OPAQUE",Le=ce?(c=(o=n.floatProperties)==null?void 0:o._Cutoff)!=null?c:.5:void 0,vt=((f=(h=n.floatProperties)==null?void 0:h._CullMode)!=null?f:2)===0,qe=this._portTextureTransform(n),_t=((m=(d=n.vectorProperties)==null?void 0:d._Color)!=null?m:[1,1,1,1]).map((N,V)=>V===3?N:vf(N)),pt=(g=n.textureProperties)==null?void 0:g._MainTex,Ie=pt!=null?{index:pt,extensions:Ys({},qe)}:void 0,He=(T=(x=n.floatProperties)==null?void 0:x._BumpScale)!=null?T:1,ht=(y=n.textureProperties)==null?void 0:y._BumpMap,Q=ht!=null?{index:ht,scale:He,extensions:Ys({},qe)}:void 0,pe=((S=(v=n.vectorProperties)==null?void 0:v._EmissionColor)!=null?S:[0,0,0,1]).map(vf),Oe=(E=n.textureProperties)==null?void 0:E._EmissionMap,q=Oe!=null?{index:Oe,extensions:Ys({},qe)}:void 0,Ve=((D=(b=n.vectorProperties)==null?void 0:b._ShadeColor)!=null?D:[.97,.81,.86,1]).map(vf),me=(C=n.textureProperties)==null?void 0:C._ShadeTexture,We=me!=null?{index:me,extensions:Ys({},qe)}:void 0;let Ge=(P=(I=n.floatProperties)==null?void 0:I._ShadeShift)!=null?P:0,we=(w=(O=n.floatProperties)==null?void 0:O._ShadeToony)!=null?w:.9;we=$t.lerp(we,1,.5+.5*Ge),Ge=-Ge-(1-we);const rt=(j=(B=n.floatProperties)==null?void 0:B._IndirectLightIntensity)!=null?j:.1,yt=rt?1-rt:void 0,Gt=(ee=n.textureProperties)==null?void 0:ee._SphereAdd,Vt=Gt!=null?[1,1,1]:void 0,li=Gt!=null?{index:Gt}:void 0,ci=(re=(se=n.floatProperties)==null?void 0:se._RimLightingMix)!=null?re:0,uo=(W=n.textureProperties)==null?void 0:W._RimTexture,Is=uo!=null?{index:uo,extensions:Ys({},qe)}:void 0,Us=((K=(te=n.vectorProperties)==null?void 0:te._RimColor)!=null?K:[0,0,0,1]).map(vf),bi=(ie=(oe=n.floatProperties)==null?void 0:oe._RimFresnelPower)!=null?ie:1,Ps=(Xe=(Ce=n.floatProperties)==null?void 0:Ce._RimLift)!=null?Xe:0,fa=["none","worldCoordinates","screenCoordinates"][(tt=(nt=n.floatProperties)==null?void 0:nt._OutlineWidthMode)!=null?tt:0];let Xi=(ge=(gt=n.floatProperties)==null?void 0:gt._OutlineWidth)!=null?ge:0;Xi=.01*Xi;const Fa=(Ae=n.textureProperties)==null?void 0:Ae._OutlineWidthTexture,Dn=Fa!=null?{index:Fa,extensions:Ys({},qe)}:void 0,Lr=((ue=(Ze=n.vectorProperties)==null?void 0:Ze._OutlineColor)!=null?ue:[0,0,0]).map(vf),Bs=((Mt=(it=n.floatProperties)==null?void 0:it._OutlineColorMode)!=null?Mt:0)===1?(Ke=(ot=n.floatProperties)==null?void 0:ot._OutlineLightingMix)!=null?Ke:1:0,ho=(Te=n.textureProperties)==null?void 0:Te._UvAnimMaskTexture,sr=ho!=null?{index:ho,extensions:Ys({},qe)}:void 0,da=(be=(G=n.floatProperties)==null?void 0:G._UvAnimScrollX)!=null?be:0;let R=(Fe=(De=n.floatProperties)==null?void 0:De._UvAnimScrollY)!=null?Fe:0;R!=null&&(R=-R);const z=($e=(Be=n.floatProperties)==null?void 0:Be._UvAnimRotation)!=null?$e:0,Y={specVersion:"1.0",transparentWithZWrite:k,renderQueueOffsetNumber:U,shadeColorFactor:Ve,shadeMultiplyTexture:We,shadingShiftFactor:Ge,shadingToonyFactor:we,giEqualizationFactor:yt,matcapFactor:Vt,matcapTexture:li,rimLightingMixFactor:ci,rimMultiplyTexture:Is,parametricRimColorFactor:Us,parametricRimFresnelPowerFactor:bi,parametricRimLiftFactor:Ps,outlineWidthMode:fa,outlineWidthFactor:Xi,outlineWidthMultiplyTexture:Dn,outlineColorFactor:Lr,outlineLightingMixFactor:Bs,uvAnimationMaskTexture:sr,uvAnimationScrollXSpeedFactor:da,uvAnimationScrollYSpeedFactor:R,uvAnimationRotationSpeedFactor:z};return CD(Ys({},e),{pbrMetallicRoughness:{baseColorFactor:_t,baseColorTexture:Ie},normalTexture:Q,emissiveTexture:q,emissiveFactor:pe,alphaMode:Ee,alphaCutoff:Le,doubleSided:vt,extensions:{VRMC_materials_mtoon:Y}})}_parseV0UnlitProperties(n,e){var t,i,a,r,s;const o=n.shader==="VRM/UnlitTransparentZWrite",c=n.shader==="VRM/UnlitTransparent"||o,h=this._v0ParseRenderQueue(n),f=n.shader==="VRM/UnlitCutout",d=c?"BLEND":f?"MASK":"OPAQUE",m=f?(i=(t=n.floatProperties)==null?void 0:t._Cutoff)!=null?i:.5:void 0,g=this._portTextureTransform(n),x=((r=(a=n.vectorProperties)==null?void 0:a._Color)!=null?r:[1,1,1,1]).map(vf),T=(s=n.textureProperties)==null?void 0:s._MainTex,y=T!=null?{index:T,extensions:Ys({},g)}:void 0,v={specVersion:"1.0",transparentWithZWrite:o,renderQueueOffsetNumber:h,shadeColorFactor:x,shadeMultiplyTexture:y};return CD(Ys({},e),{pbrMetallicRoughness:{baseColorFactor:x,baseColorTexture:y},alphaMode:d,alphaCutoff:m,extensions:{VRMC_materials_mtoon:v}})}_portTextureTransform(n){var e,t,i,a,r;const s=(e=n.vectorProperties)==null?void 0:e._MainTex;if(s==null)return{};const o=[(t=s==null?void 0:s[0])!=null?t:0,(i=s==null?void 0:s[1])!=null?i:0],c=[(a=s==null?void 0:s[2])!=null?a:1,(r=s==null?void 0:s[3])!=null?r:1];return o[1]=1-c[1]-o[1],{KHR_texture_transform:{offset:o,scale:c}}}_v0ParseRenderQueue(n){var e,t;const i=n.shader==="VRM/UnlitTransparentZWrite",a=((e=n.keywordMap)==null?void 0:e._ALPHABLEND_ON)!=null||n.shader==="VRM/UnlitTransparent"||i,r=((t=n.floatProperties)==null?void 0:t._ZWrite)===1||i;let s=0;if(a){const o=n.renderQueue;o!=null&&(r?s=this._renderQueueMapTransparentZWrite.get(o):s=this._renderQueueMapTransparent.get(o))}return s}_populateRenderQueueMap(n){const e=new Set,t=new Set;n.forEach(i=>{var a,r;const s=i.shader==="VRM/UnlitTransparentZWrite",o=((a=i.keywordMap)==null?void 0:a._ALPHABLEND_ON)!=null||i.shader==="VRM/UnlitTransparent"||s,c=((r=i.floatProperties)==null?void 0:r._ZWrite)===1||s;if(o){const h=i.renderQueue;h!=null&&(c?t.add(h):e.add(h))}}),e.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${e.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),t.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${t.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(e).sort().forEach((i,a)=>{const r=Math.min(Math.max(a-e.size+1,-9),0);this._renderQueueMapTransparent.set(i,r)}),Array.from(t).sort().forEach((i,a)=>{const r=Math.min(Math.max(a,0),9);this._renderQueueMapTransparentZWrite.set(i,r)})}},ND=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),Ul=new L,O2=class extends Ua{constructor(n){super(),this._attrPosition=new Ot(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(IU);const e=new Ct;e.setAttribute("position",this._attrPosition);const t=new Bi({color:16711935,depthTest:!1,depthWrite:!1});this._line=new so(e,t),this.add(this._line),this.constraint=n}updateMatrixWorld(n){Ul.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,Ul.x,Ul.y,Ul.z),this.constraint.source&&Ul.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,Ul.x,Ul.y,Ul.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(n)}};function DD(n,e){return e.set(n.elements[12],n.elements[13],n.elements[14])}var SQ=new L,TQ=new L;function EQ(n,e){return n.decompose(SQ,e,TQ),e}function qx(n){return n.invert?n.invert():n.inverse(),n}var aA=class{constructor(n,e){this.destination=n,this.source=e,this.weight=1}},MQ=new L,bQ=new L,AQ=new L,wQ=new St,RQ=new St,CQ=new St,NQ=class extends aA{get aimAxis(){return this._aimAxis}set aimAxis(n){this._aimAxis=n,this._v3AimAxis.set(n==="PositiveX"?1:n==="NegativeX"?-1:0,n==="PositiveY"?1:n==="NegativeY"?-1:0,n==="PositiveZ"?1:n==="NegativeZ"?-1:0)}get dependencies(){const n=new Set([this.source]);return this.destination.parent&&n.add(this.destination.parent),n}constructor(n,e){super(n,e),this._aimAxis="PositiveX",this._v3AimAxis=new L(1,0,0),this._dstRestQuat=new St}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);const n=wQ.identity(),e=RQ.identity();this.destination.parent&&(EQ(this.destination.parent.matrixWorld,n),qx(e.copy(n)));const t=MQ.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(n),i=DD(this.source.matrixWorld,bQ).sub(DD(this.destination.matrixWorld,AQ)).normalize(),a=CQ.setFromUnitVectors(t,i).premultiply(e).multiply(n).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(a,this.weight)}};function DQ(n,e){const t=[n];let i=n.parent;for(;i!==null;)t.unshift(i),i=i.parent;t.forEach(a=>{e(a)})}var OQ=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(n){this._constraints.add(n);let e=this._objectConstraintsMap.get(n.destination);e==null&&(e=new Set,this._objectConstraintsMap.set(n.destination,e)),e.add(n)}deleteConstraint(n){this._constraints.delete(n),this._objectConstraintsMap.get(n.destination).delete(n)}setInitState(){const n=new Set,e=new Set;for(const t of this._constraints)this._processConstraint(t,n,e,i=>i.setInitState())}update(){const n=new Set,e=new Set;for(const t of this._constraints)this._processConstraint(t,n,e,i=>i.update())}_processConstraint(n,e,t,i){if(t.has(n))return;if(e.has(n))throw new Error("VRMNodeConstraintManager: Circular dependency detected while updating constraints");e.add(n);const a=n.dependencies;for(const r of a)DQ(r,s=>{const o=this._objectConstraintsMap.get(s);if(o)for(const c of o)this._processConstraint(c,e,t,i)});i(n),t.add(n)}},LQ=new St,IQ=new St,UQ=class extends aA{get dependencies(){return new Set([this.source])}constructor(n,e){super(n,e),this._dstRestQuat=new St,this._invSrcRestQuat=new St}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),qx(this._invSrcRestQuat.copy(this.source.quaternion))}update(){const n=LQ.copy(this._invSrcRestQuat).multiply(this.source.quaternion),e=IQ.copy(this._dstRestQuat).multiply(n);this.destination.quaternion.copy(this._dstRestQuat).slerp(e,this.weight)}},PQ=new L,zQ=new St,BQ=new St,HQ=class extends aA{get rollAxis(){return this._rollAxis}set rollAxis(n){this._rollAxis=n,this._v3RollAxis.set(n==="X"?1:0,n==="Y"?1:0,n==="Z"?1:0)}get dependencies(){return new Set([this.source])}constructor(n,e){super(n,e),this._rollAxis="X",this._v3RollAxis=new L(1,0,0),this._dstRestQuat=new St,this._invDstRestQuat=new St,this._invSrcRestQuatMulDstRestQuat=new St}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),qx(this._invDstRestQuat.copy(this._dstRestQuat)),qx(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){const n=zQ.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),e=PQ.copy(this._v3RollAxis).applyQuaternion(n),i=BQ.setFromUnitVectors(e,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(n);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}},FQ=new Set(["1.0","1.0-beta"]),P8=class fm{get name(){return fm.EXTENSION_NAME}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot}afterRoot(e){return ND(this,null,function*(){e.userData.vrmNodeConstraintManager=yield this._import(e)})}_import(e){return ND(this,null,function*(){var t;const i=this.parser.json;if(!(((t=i.extensionsUsed)==null?void 0:t.indexOf(fm.EXTENSION_NAME))!==-1))return null;const r=new OQ,s=yield this.parser.getDependencies("node");return s.forEach((o,c)=>{var h;const f=i.nodes[c],d=(h=f==null?void 0:f.extensions)==null?void 0:h[fm.EXTENSION_NAME];if(d==null)return;const m=d.specVersion;if(!FQ.has(m)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${fm.EXTENSION_NAME} specVersion "${m}"`);return}const g=d.constraint;if(g.roll!=null){const x=this._importRollConstraint(o,s,g.roll);r.addConstraint(x)}else if(g.aim!=null){const x=this._importAimConstraint(o,s,g.aim);r.addConstraint(x)}else if(g.rotation!=null){const x=this._importRotationConstraint(o,s,g.rotation);r.addConstraint(x)}}),e.scene.updateMatrixWorld(),r.setInitState(),r})}_importRollConstraint(e,t,i){const{source:a,rollAxis:r,weight:s}=i,o=t[a],c=new HQ(e,o);if(r!=null&&(c.rollAxis=r),s!=null&&(c.weight=s),this.helperRoot){const h=new O2(c);this.helperRoot.add(h)}return c}_importAimConstraint(e,t,i){const{source:a,aimAxis:r,weight:s}=i,o=t[a],c=new NQ(e,o);if(r!=null&&(c.aimAxis=r),s!=null&&(c.weight=s),this.helperRoot){const h=new O2(c);this.helperRoot.add(h)}return c}_importRotationConstraint(e,t,i){const{source:a,weight:r}=i,s=t[a],o=new UQ(e,s);if(r!=null&&(o.weight=r),this.helperRoot){const c=new O2(o);this.helperRoot.add(c)}return o}};P8.EXTENSION_NAME="VRMC_node_constraint";var GQ=P8,Gv=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),rA=class{},L2=new L,hu=new L,z8=class extends rA{get type(){return"capsule"}constructor(n){var e,t,i,a;super(),this.offset=(e=n==null?void 0:n.offset)!=null?e:new L(0,0,0),this.tail=(t=n==null?void 0:n.tail)!=null?t:new L(0,0,0),this.radius=(i=n==null?void 0:n.radius)!=null?i:0,this.inside=(a=n==null?void 0:n.inside)!=null?a:!1}calculateCollision(n,e,t,i){L2.setFromMatrixPosition(n),hu.subVectors(this.tail,this.offset).applyMatrix4(n),hu.sub(L2);const a=hu.lengthSq();i.copy(e).sub(L2);const r=hu.dot(i);r<=0||(a<=r||hu.multiplyScalar(r/a),i.sub(hu));const s=i.length(),o=this.inside?this.radius-t-s:s-t-this.radius;return o<0&&(i.multiplyScalar(1/s),this.inside&&i.negate()),o}},I2=new L,OD=new Et,B8=class extends rA{get type(){return"plane"}constructor(n){var e,t;super(),this.offset=(e=n==null?void 0:n.offset)!=null?e:new L(0,0,0),this.normal=(t=n==null?void 0:n.normal)!=null?t:new L(0,0,1)}calculateCollision(n,e,t,i){i.setFromMatrixPosition(n),i.negate().add(e),OD.getNormalMatrix(n),I2.copy(this.normal).applyNormalMatrix(OD).normalize();const a=i.dot(I2)-t;return i.copy(I2),a}},VQ=new L,H8=class extends rA{get type(){return"sphere"}constructor(n){var e,t,i;super(),this.offset=(e=n==null?void 0:n.offset)!=null?e:new L(0,0,0),this.radius=(t=n==null?void 0:n.radius)!=null?t:0,this.inside=(i=n==null?void 0:n.inside)!=null?i:!1}calculateCollision(n,e,t,i){i.subVectors(e,VQ.setFromMatrixPosition(n));const a=i.length(),r=this.inside?this.radius-t-a:a-t-this.radius;return r<0&&(i.multiplyScalar(1/a),this.inside&&i.negate()),r}},qs=new L,kQ=class extends Ct{constructor(n){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new L,this._currentTail=new L,this._shape=n,this._attrPos=new Ot(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;const e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,n=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),n=!0);const t=qs.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(t)>1e-10&&(this._currentTail.copy(t),n=!0),n&&this._buildPosition()}_buildPosition(){qs.copy(this._currentTail).sub(this._currentOffset);const n=qs.length()/this._currentRadius;for(let i=0;i<=16;i++){const a=i/16*Math.PI;this._attrPos.setXYZ(i,-Math.sin(a),-Math.cos(a),0),this._attrPos.setXYZ(17+i,n+Math.sin(a),Math.cos(a),0),this._attrPos.setXYZ(34+i,-Math.sin(a),0,-Math.cos(a)),this._attrPos.setXYZ(51+i,n+Math.sin(a),0,Math.cos(a))}for(let i=0;i<32;i++){const a=i/16*Math.PI;this._attrPos.setXYZ(68+i,0,Math.sin(a),Math.cos(a)),this._attrPos.setXYZ(100+i,n,Math.sin(a),Math.cos(a))}const e=Math.atan2(qs.y,Math.sqrt(qs.x*qs.x+qs.z*qs.z)),t=-Math.atan2(qs.z,qs.x);this.rotateZ(e),this.rotateY(t),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let n=0;n<34;n++){const e=(n+1)%34;this._attrIndex.setXY(n*2,n,e),this._attrIndex.setXY(68+n*2,34+n,34+e)}for(let n=0;n<32;n++){const e=(n+1)%32;this._attrIndex.setXY(136+n*2,68+n,68+e),this._attrIndex.setXY(200+n*2,100+n,100+e)}this._attrIndex.needsUpdate=!0}},WQ=class extends Ct{constructor(n){super(),this.worldScale=1,this._currentOffset=new L,this._currentNormal=new L,this._shape=n,this._attrPos=new Ot(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),n=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),n=!0),n&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},XQ=class extends Ct{constructor(n){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new L,this._shape=n,this._attrPos=new Ot(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;const e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,n=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),n=!0),n&&this._buildPosition()}_buildPosition(){for(let n=0;n<32;n++){const e=n/16*Math.PI;this._attrPos.setXYZ(n,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+n,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+n,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let n=0;n<32;n++){const e=(n+1)%32;this._attrIndex.setXY(n*2,n,e),this._attrIndex.setXY(64+n*2,32+n,32+e),this._attrIndex.setXY(128+n*2,64+n,64+e)}this._attrIndex.needsUpdate=!0}},YQ=new L,U2=class extends Ua{constructor(n){if(super(),this.matrixAutoUpdate=!1,this.collider=n,this.collider.shape instanceof H8)this._geometry=new XQ(this.collider.shape);else if(this.collider.shape instanceof z8)this._geometry=new kQ(this.collider.shape);else if(this.collider.shape instanceof B8)this._geometry=new WQ(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");const e=new Bi({color:16711935,depthTest:!1,depthWrite:!1});this._line=new ir(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(n){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);const e=this.matrix.elements;this._geometry.worldScale=YQ.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(n)}},qQ=class extends Ct{constructor(n){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new L,this._springBone=n,this._attrPos=new Ot(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ot(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let n=!1;const e=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,n=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),n=!0),n&&this._buildPosition()}_buildPosition(){for(let n=0;n<32;n++){const e=n/16*Math.PI;this._attrPos.setXYZ(n,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+n,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+n,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let n=0;n<32;n++){const e=(n+1)%32;this._attrIndex.setXY(n*2,n,e),this._attrIndex.setXY(64+n*2,32+n,32+e),this._attrIndex.setXY(128+n*2,64+n,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},jQ=new L,ZQ=class extends Ua{constructor(n){super(),this.matrixAutoUpdate=!1,this.springBone=n,this._geometry=new qQ(this.springBone);const e=new Bi({color:16776960,depthTest:!1,depthWrite:!1});this._line=new ir(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(n){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);const e=this.matrix.elements;this._geometry.worldScale=jQ.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(n)}},P2=class extends Wt{constructor(n){super(),this.colliderMatrix=new ke,this.shape=n}updateWorldMatrix(n,e){super.updateWorldMatrix(n,e),KQ(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function KQ(n,e,t){const i=e.elements;n.copy(e),t&&(n.elements[12]=i[0]*t.x+i[4]*t.y+i[8]*t.z+i[12],n.elements[13]=i[1]*t.x+i[5]*t.y+i[9]*t.z+i[13],n.elements[14]=i[2]*t.x+i[6]*t.y+i[10]*t.z+i[14])}var QQ=new ke;function JQ(n){return n.invert?n.invert():n.getInverse(QQ.copy(n)),n}var $Q=class{constructor(n){this._inverseCache=new ke,this._shouldUpdateInverse=!0,this.matrix=n;const e={set:(t,i,a)=>(this._shouldUpdateInverse=!0,t[i]=a,!0)};this._originalElements=n.elements,n.elements=new Proxy(n.elements,e)}get inverse(){return this._shouldUpdateInverse&&(JQ(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},z2=new ke,_f=new L,Zp=new L,Kp=new L,Qp=new L,eJ=new ke,tJ=class{constructor(n,e,t={},i=[]){this._currentTail=new L,this._prevTail=new L,this._boneAxis=new L,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new ke,this._initialLocalRotation=new St,this._initialLocalChildPosition=new L;var a,r,s,o,c,h;this.bone=n,this.bone.matrixAutoUpdate=!1,this.child=e,this.settings={hitRadius:(a=t.hitRadius)!=null?a:0,stiffness:(r=t.stiffness)!=null?r:1,gravityPower:(s=t.gravityPower)!=null?s:0,gravityDir:(c=(o=t.gravityDir)==null?void 0:o.clone())!=null?c:new L(0,-1,0),dragForce:(h=t.dragForce)!=null?h:.4},this.colliderGroups=i}get dependencies(){const n=new Set,e=this.bone.parent;e&&n.add(e);for(let t=0;t{e(a)})}function OE(n,e){n.children.forEach(t=>{e(t)||OE(t,e)})}function iJ(n){var e;const t=new Map;for(const i of n){let a=i;do{const r=((e=t.get(a))!=null?e:0)+1;if(r===n.size)return a;t.set(a,r),a=a.parent}while(a!==null)}return null}var LD=class{constructor(){this._joints=new Set,this._sortedJoints=[],this._hasWarnedCircularDependency=!1,this._ancestors=[],this._objectSpringBonesMap=new Map,this._isSortedJointsDirty=!1,this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){const n=new Set;return this._joints.forEach(e=>{e.colliderGroups.forEach(t=>{n.add(t)})}),Array.from(n)}get colliders(){const n=new Set;return this.colliderGroups.forEach(e=>{e.colliders.forEach(t=>{n.add(t)})}),Array.from(n)}addJoint(n){this._joints.add(n);let e=this._objectSpringBonesMap.get(n.bone);e==null&&(e=new Set,this._objectSpringBonesMap.set(n.bone,e)),e.add(n),this._isSortedJointsDirty=!0}addSpringBone(n){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(n)}deleteJoint(n){this._joints.delete(n),this._objectSpringBonesMap.get(n.bone).delete(n),this._isSortedJointsDirty=!0}deleteSpringBone(n){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(n)}setInitState(){this._sortJoints();for(let n=0;n{var s,o;return((o=(s=this._objectSpringBonesMap.get(r))==null?void 0:s.size)!=null?o:0)>0?!0:(this._ancestors.push(r),!1)})),this._isSortedJointsDirty=!1}_insertJointSort(n,e,t,i,a){if(t.has(n))return;if(e.has(n)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected"),this._hasWarnedCircularDependency=!0);return}e.add(n);const r=n.dependencies;for(const s of r){let o=!1,c=null;nJ(s,h=>{const f=this._objectSpringBonesMap.get(h);if(f)for(const d of f)o=!0,this._insertJointSort(d,e,t,i,a);else o||(c=h)}),c&&a.add(c)}i.push(n),t.add(n)}_relevantChildrenUpdated(n){var e,t;return((t=(e=this._objectSpringBonesMap.get(n))==null?void 0:e.size)!=null?t:0)>0?!0:(n.updateWorldMatrix(!1,!1),!1)}},ID="VRMC_springBone_extended_collider",aJ=new Set(["1.0","1.0-beta"]),rJ=new Set(["1.0"]),F8=class Nf{get name(){return Nf.EXTENSION_NAME}constructor(e,t){var i;this.parser=e,this.jointHelperRoot=t==null?void 0:t.jointHelperRoot,this.colliderHelperRoot=t==null?void 0:t.colliderHelperRoot,this.useExtendedColliders=(i=t==null?void 0:t.useExtendedColliders)!=null?i:!0}afterRoot(e){return Gv(this,null,function*(){e.userData.vrmSpringBoneManager=yield this._import(e)})}_import(e){return Gv(this,null,function*(){const t=yield this._v1Import(e);if(t!=null)return t;const i=yield this._v0Import(e);return i??null})}_v1Import(e){return Gv(this,null,function*(){var t,i,a,r,s;const o=e.parser.json;if(!(((t=o.extensionsUsed)==null?void 0:t.indexOf(Nf.EXTENSION_NAME))!==-1))return null;const h=new LD,f=yield e.parser.getDependencies("node"),d=(i=o.extensions)==null?void 0:i[Nf.EXTENSION_NAME];if(!d)return null;const m=d.specVersion;if(!aJ.has(m))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Nf.EXTENSION_NAME} specVersion "${m}"`),null;const g=(a=d.colliders)==null?void 0:a.map((T,y)=>{var v,S,E,b,D,C,I,P,O,w,B,j,ee,se,re;const W=f[T.node];if(W==null)return console.warn(`VRMSpringBoneLoaderPlugin: The collider #${y} attempted to use the node #${T.node} but not found`),null;const te=T.shape,K=(v=T.extensions)==null?void 0:v[ID];if(this.useExtendedColliders&&K!=null){const oe=K.specVersion;if(!rJ.has(oe))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${ID} specVersion "${oe}". Fallbacking to the ${Nf.EXTENSION_NAME} definition`);else{const ie=K.shape;if(ie.sphere)return this._importSphereCollider(W,{offset:new L().fromArray((S=ie.sphere.offset)!=null?S:[0,0,0]),radius:(E=ie.sphere.radius)!=null?E:0,inside:(b=ie.sphere.inside)!=null?b:!1});if(ie.capsule)return this._importCapsuleCollider(W,{offset:new L().fromArray((D=ie.capsule.offset)!=null?D:[0,0,0]),radius:(C=ie.capsule.radius)!=null?C:0,tail:new L().fromArray((I=ie.capsule.tail)!=null?I:[0,0,0]),inside:(P=ie.capsule.inside)!=null?P:!1});if(ie.plane)return this._importPlaneCollider(W,{offset:new L().fromArray((O=ie.plane.offset)!=null?O:[0,0,0]),normal:new L().fromArray((w=ie.plane.normal)!=null?w:[0,0,1])})}}if(te.sphere)return this._importSphereCollider(W,{offset:new L().fromArray((B=te.sphere.offset)!=null?B:[0,0,0]),radius:(j=te.sphere.radius)!=null?j:0,inside:!1});if(te.capsule)return this._importCapsuleCollider(W,{offset:new L().fromArray((ee=te.capsule.offset)!=null?ee:[0,0,0]),radius:(se=te.capsule.radius)!=null?se:0,tail:new L().fromArray((re=te.capsule.tail)!=null?re:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${y} has no valid shape`)}),x=(r=d.colliderGroups)==null?void 0:r.map((T,y)=>{var v;return{colliders:((v=T.colliders)!=null?v:[]).flatMap(E=>{const b=g==null?void 0:g[E];return b??(console.warn(`VRMSpringBoneLoaderPlugin: The colliderGroup #${y} attempted to use a collider #${E} but not found`),[])}),name:T.name}});return(s=d.springs)==null||s.forEach((T,y)=>{var v;const S=T.joints,E=(v=T.colliderGroups)==null?void 0:v.map(C=>{const I=x==null?void 0:x[C];if(I==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${y} attempted to use a colliderGroup ${C} but not found`);return I}),b=T.center!=null?f[T.center]:void 0;let D;S.forEach(C=>{if(D){const I=D.node,P=f[I],O=C.node,w=f[O],B={hitRadius:D.hitRadius,dragForce:D.dragForce,gravityPower:D.gravityPower,stiffness:D.stiffness,gravityDir:D.gravityDir!=null?new L().fromArray(D.gravityDir):void 0},j=this._importJoint(P,w,B,E);b&&(j.center=b),h.addJoint(j)}D=C})}),h.setInitState(),h})}_v0Import(e){return Gv(this,null,function*(){var t,i,a;const r=e.parser.json;if(!(((t=r.extensionsUsed)==null?void 0:t.indexOf("VRM"))!==-1))return null;const o=(i=r.extensions)==null?void 0:i.VRM,c=o==null?void 0:o.secondaryAnimation;if(!c)return null;const h=c==null?void 0:c.boneGroups;if(!h)return null;const f=new LD,d=yield e.parser.getDependencies("node"),m=(a=c.colliderGroups)==null?void 0:a.map(g=>{var x;const T=d[g.node];return{colliders:((x=g.colliders)!=null?x:[]).map((v,S)=>{var E,b,D;const C=new L(0,0,0);return v.offset&&C.set((E=v.offset.x)!=null?E:0,(b=v.offset.y)!=null?b:0,v.offset.z?-v.offset.z:0),this._importSphereCollider(T,{offset:C,radius:(D=v.radius)!=null?D:0,inside:!1})})}});return h==null||h.forEach((g,x)=>{const T=g.bones;T&&T.forEach(y=>{var v,S,E,b;const D=d[y],C=new L;g.gravityDir?C.set((v=g.gravityDir.x)!=null?v:0,(S=g.gravityDir.y)!=null?S:0,(E=g.gravityDir.z)!=null?E:0):C.set(0,-1,0);const I=g.center!=null?d[g.center]:void 0,P={hitRadius:g.hitRadius,dragForce:g.dragForce,gravityPower:g.gravityPower,stiffness:g.stiffiness,gravityDir:C},O=(b=g.colliderGroups)==null?void 0:b.map(w=>{const B=m==null?void 0:m[w];if(B==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${x} attempted to use a colliderGroup ${w} but not found`);return B});D.traverse(w=>{var B;const j=(B=w.children[0])!=null?B:null,ee=this._importJoint(w,j,P,O);I&&(ee.center=I),f.addJoint(ee)})})}),e.scene.updateMatrixWorld(),f.setInitState(),f})}_importJoint(e,t,i,a){const r=new tJ(e,t,i,a);if(this.jointHelperRoot){const s=new ZQ(r);this.jointHelperRoot.add(s),s.renderOrder=this.jointHelperRoot.renderOrder}return r}_importSphereCollider(e,t){const i=new H8(t),a=new P2(i);if(e.add(a),this.colliderHelperRoot){const r=new U2(a);this.colliderHelperRoot.add(r),r.renderOrder=this.colliderHelperRoot.renderOrder}return a}_importCapsuleCollider(e,t){const i=new z8(t),a=new P2(i);if(e.add(a),this.colliderHelperRoot){const r=new U2(a);this.colliderHelperRoot.add(r),r.renderOrder=this.colliderHelperRoot.renderOrder}return a}_importPlaneCollider(e,t){const i=new B8(t),a=new P2(i);if(e.add(a),this.colliderHelperRoot){const r=new U2(a);this.colliderHelperRoot.add(r),r.renderOrder=this.colliderHelperRoot.renderOrder}return a}};F8.EXTENSION_NAME="VRMC_springBone";var sJ=F8,oJ=class{get name(){return"VRMLoaderPlugin"}constructor(n,e){var t,i,a,r,s,o,c,h,f,d;this.parser=n;const m=e==null?void 0:e.helperRoot,g=e==null?void 0:e.autoUpdateHumanBones;this.expressionPlugin=(t=e==null?void 0:e.expressionPlugin)!=null?t:new EK(n),this.firstPersonPlugin=(i=e==null?void 0:e.firstPersonPlugin)!=null?i:new bK(n),this.humanoidPlugin=(a=e==null?void 0:e.humanoidPlugin)!=null?a:new OK(n,{helperRoot:m,autoUpdateHumanBones:g}),this.lookAtPlugin=(r=e==null?void 0:e.lookAtPlugin)!=null?r:new qK(n,{helperRoot:m}),this.metaPlugin=(s=e==null?void 0:e.metaPlugin)!=null?s:new KK(n),this.mtoonMaterialPlugin=(o=e==null?void 0:e.mtoonMaterialPlugin)!=null?o:new hQ(n),this.materialsHDREmissiveMultiplierPlugin=(c=e==null?void 0:e.materialsHDREmissiveMultiplierPlugin)!=null?c:new dQ(n),this.materialsV0CompatPlugin=(h=e==null?void 0:e.materialsV0CompatPlugin)!=null?h:new yQ(n),this.springBonePlugin=(f=e==null?void 0:e.springBonePlugin)!=null?f:new sJ(n,{colliderHelperRoot:m,jointHelperRoot:m}),this.nodeConstraintPlugin=(d=e==null?void 0:e.nodeConstraintPlugin)!=null?d:new GQ(n,{helperRoot:m})}beforeRoot(){return Bv(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(n){return Bv(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(n)})}getMaterialType(n){const e=this.mtoonMaterialPlugin.getMaterialType(n);return e??null}extendMaterialParams(n,e){return Bv(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(n,e),yield this.mtoonMaterialPlugin.extendMaterialParams(n,e)})}afterRoot(n){return Bv(this,null,function*(){yield this.metaPlugin.afterRoot(n),yield this.humanoidPlugin.afterRoot(n),yield this.expressionPlugin.afterRoot(n),yield this.lookAtPlugin.afterRoot(n),yield this.firstPersonPlugin.afterRoot(n),yield this.springBonePlugin.afterRoot(n),yield this.nodeConstraintPlugin.afterRoot(n),yield this.mtoonMaterialPlugin.afterRoot(n);const e=n.userData.vrmMeta,t=n.userData.vrmHumanoid;if(e&&t){const i=new JK({scene:n.scene,expressionManager:n.userData.vrmExpressionManager,firstPerson:n.userData.vrmFirstPerson,humanoid:t,lookAt:n.userData.vrmLookAt,meta:e,materials:n.userData.vrmMToonMaterials,springBoneManager:n.userData.vrmSpringBoneManager,nodeConstraintManager:n.userData.vrmNodeConstraintManager});n.userData.vrm=i}})}};function lJ(n){const e=new Set;return n.traverse(t=>{if(!t.isMesh)return;const i=t;e.add(i)}),e}function UD(n,e,t){if(e.size===1){const s=e.values().next().value;if(s.weight===1)return n[s.index]}const i=new Float32Array(n[0].count*3);let a=0;if(t)a=1;else for(const s of e)a+=s.weight;for(const s of e){const o=n[s.index],c=s.weight/a;for(let h=0;hf.getOrCreate(O)).join(","),I=`${b};${v};${C}`;let P=o.get(I);P==null&&(P=E.clone(),mJ(P,D,x),o.set(I,P)),S.geometry.setAttribute("skinIndex",P)}for(const S of g)S.bind(y,new ke)}}function hJ(n){const e=new Set;return n.traverse(t=>{if(!t.isSkinnedMesh)return;const i=t;e.add(i)}),e}function fJ(n,e){const t=new Set;for(let i=0;it)return!1;return!0}var B2=class{constructor(){this._objectIndexMap=new Map,this._index=0}get(n){return this._objectIndexMap.get(n)}getOrCreate(n){let e=this._objectIndexMap.get(n);return e==null&&(e=this._index,this._objectIndexMap.set(n,e),this._index++),e}};function vJ(n){var e,t,i,a;const r=new Ct;r.name=n.name,r.setIndex(n.index);for(const[s,o]of Object.entries(n.attributes))r.setAttribute(s,o);for(const[s,o]of Object.entries(n.morphAttributes)){const c=s;r.morphAttributes[c]=o.concat()}r.morphTargetsRelative=n.morphTargetsRelative,r.groups=[];for(const s of n.groups)r.addGroup(s.start,s.count,s.materialIndex);return r.boundingSphere=(t=(e=n.boundingSphere)==null?void 0:e.clone())!=null?t:null,r.boundingBox=(a=(i=n.boundingBox)==null?void 0:i.clone())!=null?a:null,r.drawRange.start=n.drawRange.start,r.drawRange.count=n.drawRange.count,r.userData=n.userData,r}function PD(n){if(Object.values(n).forEach(e=>{e!=null&&e.isTexture&&e.dispose()}),n.isShaderMaterial){const e=n.uniforms;e&&Object.values(e).forEach(t=>{const i=t.value;i!=null&&i.isTexture&&i.dispose()})}n.dispose()}function _J(n){const e=n.geometry;e&&e.dispose();const t=n.skeleton;t&&t.dispose();const i=n.material;i&&(Array.isArray(i)?i.forEach(a=>PD(a)):i&&PD(i))}function xJ(n){n.traverse(_J)}function yJ(n,e){var t,i;console.warn("VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.");const a=(t=e==null?void 0:e.experimentalSameBoneCounts)!=null?t:!1,r=[];n.traverse(c=>{c.type==="SkinnedMesh"&&r.push(c)});const s=new Map;let o=0;for(const c of r){const f=c.geometry.getAttribute("skinIndex");if(s.has(f))continue;const d=new Map,m=new Map;for(let g=0;g{var i,a,r,s;if(!t.isMesh)return;const o=t,c=o.geometry,h=c.index;if(h==null)return;const f=e.get(c);if(f!=null){o.geometry=f;return}const d=Object.values(c.attributes)[0].count,m=new Array(d);let g=0;const x=h.array;for(let b=0;b{S.addGroup(b.start,b.count,b.materialIndex)}),S.boundingBox=(a=(i=c.boundingBox)==null?void 0:i.clone())!=null?a:null,S.boundingSphere=(s=(r=c.boundingSphere)==null?void 0:r.clone())!=null?s:null,S.setDrawRange(c.drawRange.start,c.drawRange.count),S.userData=c.userData,e.set(c,S);{const b=h.array,D=new b.constructor(b.length);for(let C=0;C{const D=c.attributes[b];if(D.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");const C=D.array,{itemSize:I,normalized:P}=D,O=new C.constructor(y.length*I);y.forEach((w,B)=>{for(let j=0;j{for(let re=0;reee===0),S.morphAttributes[C][I]=new Ot(j,w,B)}}E&&(S.morphAttributes={}),o.geometry=S}),Array.from(e.keys()).forEach(t=>{t.dispose()})}function TJ(n){var e;((e=n.meta)==null?void 0:e.metaVersion)==="0"&&(n.scene.rotation.y=Math.PI)}var ph=class{constructor(){}};ph.combineMorphs=cJ;ph.combineSkeletons=uJ;ph.deepDispose=xJ;ph.removeUnnecessaryJoints=yJ;ph.removeUnnecessaryVertices=SJ;ph.rotateVRM0=TJ;/*! * @pixiv/three-vrm-core v3.4.4 * The implementation of core features of VRM, for @pixiv/three-vrm * @@ -5029,19 +5029,19 @@ void main() { * Copyright (c) 2019-2025 pixiv Inc. * @pixiv/three-vrm-animation is distributed under MIT License * https://github.com/pixiv/three-vrm/blob/release/LICENSE - */var ID=(n,e,t)=>new Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),TJ={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};new je;new de;new L;new L;var UD={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function EJ(n){return n.invert?n.invert():n.inverse(),n}new L;new L;new L;new L;new L;new L(0,1,0);var MJ=new L,bJ=new L;function AJ(n,e){return n.matrixWorld.decompose(MJ,e,bJ),e}function P2(n){return[Math.atan2(-n.z,n.x),Math.atan2(n.y,Math.sqrt(n.x*n.x+n.z*n.z))]}function PD(n){const e=Math.round(n/2/Math.PI);return n-2*Math.PI*e}var zD=new L(0,0,1),RJ=new L,wJ=new L,CJ=new L,NJ=new Tt,z2=new Tt,BD=new Tt,DJ=new Tt,B2=new Ui,F8=class G8{constructor(e,t){this.offsetFromHeadBone=new L,this.autoUpdate=!0,this.faceFront=new L(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new Tt)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new Ui)}getEuler(e){return e.set($t.DEG2RAD*this._pitch,$t.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new G8(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){const t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){const t=this.humanoid.getRawBoneNode("head");return AJ(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(zD)<.01)return e.copy(this._restHeadWorldQuaternion).invert();const[t,i]=P2(this.faceFront);return B2.set(0,.5*Math.PI+t,i,"YZX"),e.setFromEuler(B2).premultiply(DJ.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(z2),this.getFaceFrontQuaternion(BD),e.copy(zD).applyQuaternion(z2).applyQuaternion(BD).applyEuler(this.getEuler(B2))}lookAt(e){const t=NJ.copy(this._restHeadWorldQuaternion).multiply(EJ(this.getLookAtWorldQuaternion(z2))),i=this.getLookAtWorldPosition(wJ),a=CJ.copy(e).sub(i).applyQuaternion(t).normalize(),[r,s]=P2(this.faceFront),[o,c]=P2(a),h=PD(o-r),f=PD(s-c);this._yaw=$t.RAD2DEG*h,this._pitch=$t.RAD2DEG*f,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(RJ)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};F8.EULER_ORDER="YXZ";var OJ=F8;new L(0,0,1);new Ui(0,0,0,"YXZ");var HD=180/Math.PI,H2=new Ui,FD=class extends Zt{constructor(n){super(),this.vrmLookAt=n,this.type="VRMLookAtQuaternionProxy";const e=this.rotation._onChangeCallback;this.rotation._onChange(()=>{e(),this._applyToLookAt()});const t=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{t(),this._applyToLookAt()})}_applyToLookAt(){H2.setFromQuaternion(this.quaternion,OJ.EULER_ORDER),this.vrmLookAt.yaw=HD*H2.y,this.vrmLookAt.pitch=HD*H2.x}};function LJ(n,e,t){var i,a;const r=new Map,s=new Map;for(const[o,c]of n.humanoidTracks.rotation.entries()){const h=(i=e.getNormalizedBoneNode(o))==null?void 0:i.name;if(h!=null){const f=new vc(`${h}.quaternion`,c.times,c.values.map((d,m)=>t==="0"&&m%2===0?-d:d));s.set(o,f)}}for(const[o,c]of n.humanoidTracks.translation.entries()){const h=(a=e.getNormalizedBoneNode(o))==null?void 0:a.name;if(h!=null){const f=n.restHipsPosition.y,m=e.normalizedRestPose.hips.position[1]/f,g=c.clone();g.values=g.values.map((x,T)=>(t==="0"&&T%3!==1?-x:x)*m),g.name=`${h}.position`,r.set(o,g)}}return{translation:r,rotation:s}}function IJ(n,e){const t=new Map,i=new Map;for(const[a,r]of n.expressionTracks.preset.entries()){const s=e.getExpressionTrackName(a);if(s!=null){const o=r.clone();o.name=s,t.set(a,o)}}for(const[a,r]of n.expressionTracks.custom.entries()){const s=e.getExpressionTrackName(a);if(s!=null){const o=r.clone();o.name=s,i.set(a,o)}}return{preset:t,custom:i}}function UJ(n,e){if(n.lookAtTrack==null)return null;const t=n.lookAtTrack.clone();return t.name=e,t}function PJ(n,e){const t=[],i=LJ(n,e.humanoid,e.meta.metaVersion);if(t.push(...i.translation.values()),t.push(...i.rotation.values()),e.expressionManager!=null){const a=IJ(n,e.expressionManager);t.push(...a.preset.values()),t.push(...a.custom.values())}if(e.lookAt!=null){let a=e.scene.children.find(s=>s instanceof FD);a==null?(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually"),a=new FD(e.lookAt),a.name="VRMLookAtQuaternionProxy",e.scene.add(a)):a.name===""&&(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually"),a.name="VRMLookAtQuaternionProxy");const r=UJ(n,`${a.name}.quaternion`);r!=null&&t.push(r)}return new Ku("Clip",n.duration,t)}var zJ=class{constructor(){this.duration=0,this.restHipsPosition=new L,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};function GD(n,e){const t=n.length,i=[];let a=[],r=0;for(let s=0;s{const v=a.animations[S],y=this._parseAnimation(T,v,c,h);return y.restHipsPosition=m,y});n.userData.vrmAnimations=x})}_createNodeMap(n){var e,t,i,a,r;const s=new Map,o=new Map,c=(e=n.humanoid)==null?void 0:e.humanBones;c&&Object.entries(c).forEach(([m,g])=>{const x=g==null?void 0:g.node;x!=null&&s.set(x,m)});const h=(t=n.expressions)==null?void 0:t.preset;h&&Object.entries(h).forEach(([m,g])=>{const x=g==null?void 0:g.node;x!=null&&o.set(x,m)});const f=(i=n.expressions)==null?void 0:i.custom;f&&Object.entries(f).forEach(([m,g])=>{const{node:x}=g;o.set(x,m)});const d=(r=(a=n.lookAt)==null?void 0:a.node)!=null?r:null;return{humanoidIndexToName:s,expressionsIndexToName:o,lookAtIndex:d}}_createBoneWorldMatrixMap(n,e){return ID(this,null,function*(){var t,i;n.scene.updateWorldMatrix(!1,!0);const a=yield n.parser.getDependencies("node"),r=new Map;if(e.humanoid==null)return r;for(const[s,o]of Object.entries(e.humanoid.humanBones)){const c=o==null?void 0:o.node;if(c!=null){const h=a[c];r.set(s,h.matrixWorld),s==="hips"&&r.set("hipsParent",(i=(t=h.parent)==null?void 0:t.matrixWorld)!=null?i:BJ)}}return r})}_parseAnimation(n,e,t,i){const a=n.tracks,r=e.channels,s=new zJ;return s.duration=n.duration,r.forEach((o,c)=>{const{node:h,path:f}=o.target,d=a[c];if(h==null)return;const m=t.humanoidIndexToName.get(h);if(m!=null){let x=UD[m];for(;x!=null&&i.get(x)==null;)x=UD[x];if(x==null&&(x="hipsParent"),f==="translation")if(m!=="hips")console.warn(`The loading animation contains a translation track for ${m}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{const T=i.get("hipsParent"),S=GD(d.values,3).flatMap(y=>Kp.fromArray(y).applyMatrix4(T).toArray()),v=d.clone();v.values=new Float32Array(S),s.humanoidTracks.translation.set(m,v)}else if(f==="rotation"){const T=i.get(m),S=i.get(x);T.decompose(Kp,F2,Kp),F2.invert(),S.decompose(Kp,VD,Kp);const v=GD(d.values,4).flatMap(E=>HJ.fromArray(E).premultiply(VD).multiply(F2).toArray()),y=d.clone();y.values=new Float32Array(v),s.humanoidTracks.rotation.set(m,y)}else throw new Error(`Invalid path "${f}"`);return}const g=t.expressionsIndexToName.get(h);if(g!=null){if(f==="translation"){const x=d.times,T=new Float32Array(d.values.length/3);for(let v=0;vnew Promise((i,a)=>{var r=c=>{try{o(t.next(c))}catch(h){a(h)}},s=c=>{try{o(t.throw(c))}catch(h){a(h)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,s);o((t=t.apply(n,e)).next())}),EJ={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};new je;new de;new L;new L;var BD={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function MJ(n){return n.invert?n.invert():n.inverse(),n}new L;new L;new L;new L;new L;new L(0,1,0);var bJ=new L,AJ=new L;function wJ(n,e){return n.matrixWorld.decompose(bJ,e,AJ),e}function H2(n){return[Math.atan2(-n.z,n.x),Math.atan2(n.y,Math.sqrt(n.x*n.x+n.z*n.z))]}function HD(n){const e=Math.round(n/2/Math.PI);return n-2*Math.PI*e}var FD=new L(0,0,1),RJ=new L,CJ=new L,NJ=new L,DJ=new St,F2=new St,GD=new St,OJ=new St,G2=new Ei,V8=class k8{constructor(e,t){this.offsetFromHeadBone=new L,this.autoUpdate=!0,this.faceFront=new L(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new St)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new Ei)}getEuler(e){return e.set($t.DEG2RAD*this._pitch,$t.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new k8(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){const t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){const t=this.humanoid.getRawBoneNode("head");return wJ(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(FD)<.01)return e.copy(this._restHeadWorldQuaternion).invert();const[t,i]=H2(this.faceFront);return G2.set(0,.5*Math.PI+t,i,"YZX"),e.setFromEuler(G2).premultiply(OJ.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(F2),this.getFaceFrontQuaternion(GD),e.copy(FD).applyQuaternion(F2).applyQuaternion(GD).applyEuler(this.getEuler(G2))}lookAt(e){const t=DJ.copy(this._restHeadWorldQuaternion).multiply(MJ(this.getLookAtWorldQuaternion(F2))),i=this.getLookAtWorldPosition(CJ),a=NJ.copy(e).sub(i).applyQuaternion(t).normalize(),[r,s]=H2(this.faceFront),[o,c]=H2(a),h=HD(o-r),f=HD(s-c);this._yaw=$t.RAD2DEG*h,this._pitch=$t.RAD2DEG*f,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(RJ)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};V8.EULER_ORDER="YXZ";var LJ=V8;new L(0,0,1);new Ei(0,0,0,"YXZ");var VD=180/Math.PI,V2=new Ei,kD=class extends Wt{constructor(n){super(),this.vrmLookAt=n,this.type="VRMLookAtQuaternionProxy";const e=this.rotation._onChangeCallback;this.rotation._onChange(()=>{e(),this._applyToLookAt()});const t=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{t(),this._applyToLookAt()})}_applyToLookAt(){V2.setFromQuaternion(this.quaternion,LJ.EULER_ORDER),this.vrmLookAt.yaw=VD*V2.y,this.vrmLookAt.pitch=VD*V2.x}};function IJ(n,e,t){var i,a;const r=new Map,s=new Map;for(const[o,c]of n.humanoidTracks.rotation.entries()){const h=(i=e.getNormalizedBoneNode(o))==null?void 0:i.name;if(h!=null){const f=new yc(`${h}.quaternion`,c.times,c.values.map((d,m)=>t==="0"&&m%2===0?-d:d));s.set(o,f)}}for(const[o,c]of n.humanoidTracks.translation.entries()){const h=(a=e.getNormalizedBoneNode(o))==null?void 0:a.name;if(h!=null){const f=n.restHipsPosition.y,m=e.normalizedRestPose.hips.position[1]/f,g=c.clone();g.values=g.values.map((x,T)=>(t==="0"&&T%3!==1?-x:x)*m),g.name=`${h}.position`,r.set(o,g)}}return{translation:r,rotation:s}}function UJ(n,e){const t=new Map,i=new Map;for(const[a,r]of n.expressionTracks.preset.entries()){const s=e.getExpressionTrackName(a);if(s!=null){const o=r.clone();o.name=s,t.set(a,o)}}for(const[a,r]of n.expressionTracks.custom.entries()){const s=e.getExpressionTrackName(a);if(s!=null){const o=r.clone();o.name=s,i.set(a,o)}}return{preset:t,custom:i}}function PJ(n,e){if(n.lookAtTrack==null)return null;const t=n.lookAtTrack.clone();return t.name=e,t}function zJ(n,e){const t=[],i=IJ(n,e.humanoid,e.meta.metaVersion);if(t.push(...i.translation.values()),t.push(...i.rotation.values()),e.expressionManager!=null){const a=UJ(n,e.expressionManager);t.push(...a.preset.values()),t.push(...a.custom.values())}if(e.lookAt!=null){let a=e.scene.children.find(s=>s instanceof kD);a==null?(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually"),a=new kD(e.lookAt),a.name="VRMLookAtQuaternionProxy",e.scene.add(a)):a.name===""&&(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually"),a.name="VRMLookAtQuaternionProxy");const r=PJ(n,`${a.name}.quaternion`);r!=null&&t.push(r)}return new Ju("Clip",n.duration,t)}var BJ=class{constructor(){this.duration=0,this.restHipsPosition=new L,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};function WD(n,e){const t=n.length,i=[];let a=[],r=0;for(let s=0;s{const v=a.animations[y],S=this._parseAnimation(T,v,c,h);return S.restHipsPosition=m,S});n.userData.vrmAnimations=x})}_createNodeMap(n){var e,t,i,a,r;const s=new Map,o=new Map,c=(e=n.humanoid)==null?void 0:e.humanBones;c&&Object.entries(c).forEach(([m,g])=>{const x=g==null?void 0:g.node;x!=null&&s.set(x,m)});const h=(t=n.expressions)==null?void 0:t.preset;h&&Object.entries(h).forEach(([m,g])=>{const x=g==null?void 0:g.node;x!=null&&o.set(x,m)});const f=(i=n.expressions)==null?void 0:i.custom;f&&Object.entries(f).forEach(([m,g])=>{const{node:x}=g;o.set(x,m)});const d=(r=(a=n.lookAt)==null?void 0:a.node)!=null?r:null;return{humanoidIndexToName:s,expressionsIndexToName:o,lookAtIndex:d}}_createBoneWorldMatrixMap(n,e){return zD(this,null,function*(){var t,i;n.scene.updateWorldMatrix(!1,!0);const a=yield n.parser.getDependencies("node"),r=new Map;if(e.humanoid==null)return r;for(const[s,o]of Object.entries(e.humanoid.humanBones)){const c=o==null?void 0:o.node;if(c!=null){const h=a[c];r.set(s,h.matrixWorld),s==="hips"&&r.set("hipsParent",(i=(t=h.parent)==null?void 0:t.matrixWorld)!=null?i:HJ)}}return r})}_parseAnimation(n,e,t,i){const a=n.tracks,r=e.channels,s=new BJ;return s.duration=n.duration,r.forEach((o,c)=>{const{node:h,path:f}=o.target,d=a[c];if(h==null)return;const m=t.humanoidIndexToName.get(h);if(m!=null){let x=BD[m];for(;x!=null&&i.get(x)==null;)x=BD[x];if(x==null&&(x="hipsParent"),f==="translation")if(m!=="hips")console.warn(`The loading animation contains a translation track for ${m}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{const T=i.get("hipsParent"),y=WD(d.values,3).flatMap(S=>Jp.fromArray(S).applyMatrix4(T).toArray()),v=d.clone();v.values=new Float32Array(y),s.humanoidTracks.translation.set(m,v)}else if(f==="rotation"){const T=i.get(m),y=i.get(x);T.decompose(Jp,k2,Jp),k2.invert(),y.decompose(Jp,XD,Jp);const v=WD(d.values,4).flatMap(E=>FJ.fromArray(E).premultiply(XD).multiply(k2).toArray()),S=d.clone();S.values=new Float32Array(v),s.humanoidTracks.rotation.set(m,S)}else throw new Error(`Invalid path "${f}"`);return}const g=t.expressionsIndexToName.get(h);if(g!=null){if(f==="translation"){const x=d.times,T=new Float32Array(d.values.length/3);for(let v=0;ve in n?kJ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,XJ=(n,e,t)=>(WJ(n,e+"",t),t);class YJ{constructor(){XJ(this,"_listeners")}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const a=this._listeners[e];if(a!==void 0){const r=a.indexOf(t);r!==-1&&a.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const a=i.slice(0);for(let r=0,s=a.length;re in n?qJ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Dt=(n,e,t)=>(jJ(n,typeof e!="symbol"?e+"":e,t),t);const Fv=new sh,kD=new Fo,ZJ=Math.cos(70*(Math.PI/180)),WD=(n,e)=>(n%e+e)%e;let KJ=class extends YJ{constructor(e,t){super(),Dt(this,"object"),Dt(this,"domElement"),Dt(this,"enabled",!0),Dt(this,"target",new L),Dt(this,"minDistance",0),Dt(this,"maxDistance",1/0),Dt(this,"minZoom",0),Dt(this,"maxZoom",1/0),Dt(this,"minPolarAngle",0),Dt(this,"maxPolarAngle",Math.PI),Dt(this,"minAzimuthAngle",-1/0),Dt(this,"maxAzimuthAngle",1/0),Dt(this,"enableDamping",!1),Dt(this,"dampingFactor",.05),Dt(this,"enableZoom",!0),Dt(this,"zoomSpeed",1),Dt(this,"enableRotate",!0),Dt(this,"rotateSpeed",1),Dt(this,"enablePan",!0),Dt(this,"panSpeed",1),Dt(this,"screenSpacePanning",!0),Dt(this,"keyPanSpeed",7),Dt(this,"zoomToCursor",!1),Dt(this,"autoRotate",!1),Dt(this,"autoRotateSpeed",2),Dt(this,"reverseOrbit",!1),Dt(this,"reverseHorizontalOrbit",!1),Dt(this,"reverseVerticalOrbit",!1),Dt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Dt(this,"mouseButtons",{LEFT:mu.ROTATE,MIDDLE:mu.DOLLY,RIGHT:mu.PAN}),Dt(this,"touches",{ONE:gu.ROTATE,TWO:gu.DOLLY_PAN}),Dt(this,"target0"),Dt(this,"position0"),Dt(this,"zoom0"),Dt(this,"_domElementKeyEvents",null),Dt(this,"getPolarAngle"),Dt(this,"getAzimuthalAngle"),Dt(this,"setPolarAngle"),Dt(this,"setAzimuthalAngle"),Dt(this,"getDistance"),Dt(this,"getZoomScale"),Dt(this,"listenToKeyEvents"),Dt(this,"stopListenToKeyEvents"),Dt(this,"saveState"),Dt(this,"reset"),Dt(this,"update"),Dt(this,"connect"),Dt(this,"dispose"),Dt(this,"dollyIn"),Dt(this,"dollyOut"),Dt(this,"getScale"),Dt(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>f.phi,this.getAzimuthalAngle=()=>f.theta,this.setPolarAngle=Q=>{let pe=WD(Q,2*Math.PI),Oe=f.phi;Oe<0&&(Oe+=2*Math.PI),pe<0&&(pe+=2*Math.PI);let q=Math.abs(pe-Oe);2*Math.PI-q{let pe=WD(Q,2*Math.PI),Oe=f.theta;Oe<0&&(Oe+=2*Math.PI),pe<0&&(pe+=2*Math.PI);let q=Math.abs(pe-Oe);2*Math.PI-qi.object.position.distanceTo(i.target),this.listenToKeyEvents=Q=>{Q.addEventListener("keydown",ye),this._domElementKeyEvents=Q},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ye),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(a),i.update(),c=o.NONE},this.update=(()=>{const Q=new L,pe=new L(0,1,0),Oe=new Tt().setFromUnitVectors(e.up,pe),q=Oe.clone().invert(),Ve=new L,me=new Tt,We=2*Math.PI;return function(){const Re=i.object.position;Oe.setFromUnitVectors(e.up,pe),q.copy(Oe).invert(),Q.copy(Re).sub(i.target),Q.applyQuaternion(Oe),f.setFromVector3(Q),i.autoRotate&&c===o.NONE&&se(j()),i.enableDamping?(f.theta+=d.theta*i.dampingFactor,f.phi+=d.phi*i.dampingFactor):(f.theta+=d.theta,f.phi+=d.phi);let rt=i.minAzimuthAngle,yt=i.maxAzimuthAngle;isFinite(rt)&&isFinite(yt)&&(rt<-Math.PI?rt+=We:rt>Math.PI&&(rt-=We),yt<-Math.PI?yt+=We:yt>Math.PI&&(yt-=We),rt<=yt?f.theta=Math.max(rt,Math.min(yt,f.theta)):f.theta=f.theta>(rt+yt)/2?Math.max(rt,f.theta):Math.min(yt,f.theta)),f.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,f.phi)),f.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(g,i.dampingFactor):i.target.add(g),i.zoomToCursor&&O||i.object.isOrthographicCamera?f.radius=nt(f.radius):f.radius=nt(f.radius*m),Q.setFromSpherical(f),Q.applyQuaternion(q),Re.copy(i.target).add(Q),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(d.theta*=1-i.dampingFactor,d.phi*=1-i.dampingFactor,g.multiplyScalar(1-i.dampingFactor)):(d.set(0,0,0),g.set(0,0,0));let Gt=!1;if(i.zoomToCursor&&O){let Vt=null;if(i.object instanceof ui&&i.object.isPerspectiveCamera){const oi=Q.length();Vt=nt(oi*m);const li=oi-Vt;i.object.position.addScaledVector(I,li),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const oi=new L(P.x,P.y,0);oi.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/m)),i.object.updateProjectionMatrix(),Gt=!0;const li=new L(P.x,P.y,0);li.unproject(i.object),i.object.position.sub(li).add(oi),i.object.updateMatrixWorld(),Vt=Q.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Vt!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Vt).add(i.object.position):(Fv.origin.copy(i.object.position),Fv.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(Fv.direction))h||8*(1-me.dot(i.object.quaternion))>h?(i.dispatchEvent(a),Ve.copy(i.object.position),me.copy(i.object.quaternion),Gt=!1,!0):!1}})(),this.connect=Q=>{i.domElement=Q,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",_t),i.domElement.addEventListener("pointerdown",ct),i.domElement.addEventListener("pointercancel",U),i.domElement.addEventListener("wheel",Le)},this.dispose=()=>{var Q,pe,Oe,q,Ve,me;i.domElement&&(i.domElement.style.touchAction="auto"),(Q=i.domElement)==null||Q.removeEventListener("contextmenu",_t),(pe=i.domElement)==null||pe.removeEventListener("pointerdown",ct),(Oe=i.domElement)==null||Oe.removeEventListener("pointercancel",U),(q=i.domElement)==null||q.removeEventListener("wheel",Le),(Ve=i.domElement)==null||Ve.ownerDocument.removeEventListener("pointermove",k),(me=i.domElement)==null||me.ownerDocument.removeEventListener("pointerup",U),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",ye)};const i=this,a={type:"change"},r={type:"start"},s={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=o.NONE;const h=1e-6,f=new hE,d=new hE;let m=1;const g=new L,x=new de,T=new de,S=new de,v=new de,y=new de,E=new de,b=new de,D=new de,C=new de,I=new L,P=new de;let O=!1;const R=[],B={};function j(){return 2*Math.PI/60/60*i.autoRotateSpeed}function ee(){return Math.pow(.95,i.zoomSpeed)}function se(Q){i.reverseOrbit||i.reverseHorizontalOrbit?d.theta+=Q:d.theta-=Q}function re(Q){i.reverseOrbit||i.reverseVerticalOrbit?d.phi+=Q:d.phi-=Q}const W=(()=>{const Q=new L;return function(Oe,q){Q.setFromMatrixColumn(q,0),Q.multiplyScalar(-Oe),g.add(Q)}})(),te=(()=>{const Q=new L;return function(Oe,q){i.screenSpacePanning===!0?Q.setFromMatrixColumn(q,1):(Q.setFromMatrixColumn(q,0),Q.crossVectors(i.object.up,Q)),Q.multiplyScalar(Oe),g.add(Q)}})(),K=(()=>{const Q=new L;return function(Oe,q){const Ve=i.domElement;if(Ve&&i.object instanceof ui&&i.object.isPerspectiveCamera){const me=i.object.position;Q.copy(me).sub(i.target);let We=Q.length();We*=Math.tan(i.object.fov/2*Math.PI/180),W(2*Oe*We/Ve.clientHeight,i.object.matrix),te(2*q*We/Ve.clientHeight,i.object.matrix)}else Ve&&i.object instanceof io&&i.object.isOrthographicCamera?(W(Oe*(i.object.right-i.object.left)/i.object.zoom/Ve.clientWidth,i.object.matrix),te(q*(i.object.top-i.object.bottom)/i.object.zoom/Ve.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function oe(Q){i.object instanceof ui&&i.object.isPerspectiveCamera||i.object instanceof io&&i.object.isOrthographicCamera?m=Q:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function ie(Q){oe(m/Q)}function Ce(Q){oe(m*Q)}function Xe(Q){if(!i.zoomToCursor||!i.domElement)return;O=!0;const pe=i.domElement.getBoundingClientRect(),Oe=Q.clientX-pe.left,q=Q.clientY-pe.top,Ve=pe.width,me=pe.height;P.x=Oe/Ve*2-1,P.y=-(q/me)*2+1,I.set(P.x,P.y,1).unproject(i.object).sub(i.object.position).normalize()}function nt(Q){return Math.max(i.minDistance,Math.min(i.maxDistance,Q))}function tt(Q){x.set(Q.clientX,Q.clientY)}function gt(Q){Xe(Q),b.set(Q.clientX,Q.clientY)}function ge(Q){v.set(Q.clientX,Q.clientY)}function Ae(Q){T.set(Q.clientX,Q.clientY),S.subVectors(T,x).multiplyScalar(i.rotateSpeed);const pe=i.domElement;pe&&(se(2*Math.PI*S.x/pe.clientHeight),re(2*Math.PI*S.y/pe.clientHeight)),x.copy(T),i.update()}function Ze(Q){D.set(Q.clientX,Q.clientY),C.subVectors(D,b),C.y>0?ie(ee()):C.y<0&&Ce(ee()),b.copy(D),i.update()}function ue(Q){y.set(Q.clientX,Q.clientY),E.subVectors(y,v).multiplyScalar(i.panSpeed),K(E.x,E.y),v.copy(y),i.update()}function it(Q){Xe(Q),Q.deltaY<0?Ce(ee()):Q.deltaY>0&&ie(ee()),i.update()}function Mt(Q){let pe=!1;switch(Q.code){case i.keys.UP:K(0,i.keyPanSpeed),pe=!0;break;case i.keys.BOTTOM:K(0,-i.keyPanSpeed),pe=!0;break;case i.keys.LEFT:K(i.keyPanSpeed,0),pe=!0;break;case i.keys.RIGHT:K(-i.keyPanSpeed,0),pe=!0;break}pe&&(Q.preventDefault(),i.update())}function ot(){if(R.length==1)x.set(R[0].pageX,R[0].pageY);else{const Q=.5*(R[0].pageX+R[1].pageX),pe=.5*(R[0].pageY+R[1].pageY);x.set(Q,pe)}}function Ke(){if(R.length==1)v.set(R[0].pageX,R[0].pageY);else{const Q=.5*(R[0].pageX+R[1].pageX),pe=.5*(R[0].pageY+R[1].pageY);v.set(Q,pe)}}function Te(){const Q=R[0].pageX-R[1].pageX,pe=R[0].pageY-R[1].pageY,Oe=Math.sqrt(Q*Q+pe*pe);b.set(0,Oe)}function G(){i.enableZoom&&Te(),i.enablePan&&Ke()}function Me(){i.enableZoom&&Te(),i.enableRotate&&ot()}function De(Q){if(R.length==1)T.set(Q.pageX,Q.pageY);else{const Oe=ht(Q),q=.5*(Q.pageX+Oe.x),Ve=.5*(Q.pageY+Oe.y);T.set(q,Ve)}S.subVectors(T,x).multiplyScalar(i.rotateSpeed);const pe=i.domElement;pe&&(se(2*Math.PI*S.x/pe.clientHeight),re(2*Math.PI*S.y/pe.clientHeight)),x.copy(T)}function Fe(Q){if(R.length==1)y.set(Q.pageX,Q.pageY);else{const pe=ht(Q),Oe=.5*(Q.pageX+pe.x),q=.5*(Q.pageY+pe.y);y.set(Oe,q)}E.subVectors(y,v).multiplyScalar(i.panSpeed),K(E.x,E.y),v.copy(y)}function Be(Q){const pe=ht(Q),Oe=Q.pageX-pe.x,q=Q.pageY-pe.y,Ve=Math.sqrt(Oe*Oe+q*q);D.set(0,Ve),C.set(0,Math.pow(D.y/b.y,i.zoomSpeed)),ie(C.y),b.copy(D)}function $e(Q){i.enableZoom&&Be(Q),i.enablePan&&Fe(Q)}function Je(Q){i.enableZoom&&Be(Q),i.enableRotate&&De(Q)}function ct(Q){var pe,Oe;i.enabled!==!1&&(R.length===0&&((pe=i.domElement)==null||pe.ownerDocument.addEventListener("pointermove",k),(Oe=i.domElement)==null||Oe.ownerDocument.addEventListener("pointerup",U)),pt(Q),Q.pointerType==="touch"?vt(Q):ce(Q))}function k(Q){i.enabled!==!1&&(Q.pointerType==="touch"?qe(Q):Ee(Q))}function U(Q){var pe,Oe,q;Ie(Q),R.length===0&&((pe=i.domElement)==null||pe.releasePointerCapture(Q.pointerId),(Oe=i.domElement)==null||Oe.ownerDocument.removeEventListener("pointermove",k),(q=i.domElement)==null||q.ownerDocument.removeEventListener("pointerup",U)),i.dispatchEvent(s),c=o.NONE}function ce(Q){let pe;switch(Q.button){case 0:pe=i.mouseButtons.LEFT;break;case 1:pe=i.mouseButtons.MIDDLE;break;case 2:pe=i.mouseButtons.RIGHT;break;default:pe=-1}switch(pe){case mu.DOLLY:if(i.enableZoom===!1)return;gt(Q),c=o.DOLLY;break;case mu.ROTATE:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(i.enablePan===!1)return;ge(Q),c=o.PAN}else{if(i.enableRotate===!1)return;tt(Q),c=o.ROTATE}break;case mu.PAN:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(i.enableRotate===!1)return;tt(Q),c=o.ROTATE}else{if(i.enablePan===!1)return;ge(Q),c=o.PAN}break;default:c=o.NONE}c!==o.NONE&&i.dispatchEvent(r)}function Ee(Q){if(i.enabled!==!1)switch(c){case o.ROTATE:if(i.enableRotate===!1)return;Ae(Q);break;case o.DOLLY:if(i.enableZoom===!1)return;Ze(Q);break;case o.PAN:if(i.enablePan===!1)return;ue(Q);break}}function Le(Q){i.enabled===!1||i.enableZoom===!1||c!==o.NONE&&c!==o.ROTATE||(Q.preventDefault(),i.dispatchEvent(r),it(Q),i.dispatchEvent(s))}function ye(Q){i.enabled===!1||i.enablePan===!1||Mt(Q)}function vt(Q){switch(He(Q),R.length){case 1:switch(i.touches.ONE){case gu.ROTATE:if(i.enableRotate===!1)return;ot(),c=o.TOUCH_ROTATE;break;case gu.PAN:if(i.enablePan===!1)return;Ke(),c=o.TOUCH_PAN;break;default:c=o.NONE}break;case 2:switch(i.touches.TWO){case gu.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;G(),c=o.TOUCH_DOLLY_PAN;break;case gu.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Me(),c=o.TOUCH_DOLLY_ROTATE;break;default:c=o.NONE}break;default:c=o.NONE}c!==o.NONE&&i.dispatchEvent(r)}function qe(Q){switch(He(Q),c){case o.TOUCH_ROTATE:if(i.enableRotate===!1)return;De(Q),i.update();break;case o.TOUCH_PAN:if(i.enablePan===!1)return;Fe(Q),i.update();break;case o.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;$e(Q),i.update();break;case o.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Je(Q),i.update();break;default:c=o.NONE}}function _t(Q){i.enabled!==!1&&Q.preventDefault()}function pt(Q){R.push(Q)}function Ie(Q){delete B[Q.pointerId];for(let pe=0;pe{Ce(Q),i.update()},this.dollyOut=(Q=ee())=>{ie(Q),i.update()},this.getScale=()=>m,this.setScale=Q=>{oe(Q),i.update()},this.getZoomScale=()=>ee(),t!==void 0&&this.connect(t),this.update()}};function QJ(n,e,t){const i=Qi(g=>g.size),a=Qi(g=>g.viewport),r=typeof n=="number"?n:i.width*a.dpr,s=i.height*a.dpr,o=(typeof n=="number"?t:n)||{},{samples:c=0,depth:h,...f}=o,d=h??o.depthBuffer,m=be.useMemo(()=>{const g=new _i(r,s,{minFilter:Ht,magFilter:Ht,type:Xn,...f});return d&&(g.depthTexture=new U0(r,s,ri)),g.samples=c,g},[]);return be.useLayoutEffect(()=>{m.setSize(r,s),c&&(m.samples=c)},[c,m,r,s]),be.useEffect(()=>()=>m.dispose(),[]),m}const JJ=n=>typeof n=="function",V8=be.forwardRef(({envMap:n,resolution:e=256,frames:t=1/0,makeDefault:i,children:a,...r},s)=>{const o=Qi(({set:S})=>S),c=Qi(({camera:S})=>S),h=Qi(({size:S})=>S),f=be.useRef(null);be.useImperativeHandle(s,()=>f.current,[]);const d=be.useRef(null),m=QJ(e);be.useLayoutEffect(()=>{r.manual||(f.current.aspect=h.width/h.height)},[h,r]),be.useLayoutEffect(()=>{f.current.updateProjectionMatrix()});let g=0,x=null;const T=JJ(a);return Ac(S=>{T&&(t===1/0||g{if(i){const S=c;return o(()=>({camera:f.current})),()=>o(()=>({camera:S}))}},[f,i,o]),be.createElement(be.Fragment,null,be.createElement("perspectiveCamera",Yx({ref:f},r),!T&&a),be.createElement("group",{ref:d},T&&a(m.texture)))}),$J=be.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:a=!0,keyEvents:r=!1,onChange:s,onStart:o,onEnd:c,...h},f)=>{const d=Qi(C=>C.invalidate),m=Qi(C=>C.camera),g=Qi(C=>C.gl),x=Qi(C=>C.events),T=Qi(C=>C.setEvents),S=Qi(C=>C.set),v=Qi(C=>C.get),y=Qi(C=>C.performance),E=e||m,b=i||x.connected||g.domElement,D=be.useMemo(()=>new KJ(E),[E]);return Ac(()=>{D.enabled&&D.update()},-1),be.useEffect(()=>(r&&D.connect(r===!0?b:r),D.connect(b),()=>void D.dispose()),[r,b,t,D,d]),be.useEffect(()=>{const C=O=>{d(),t&&y.regress(),s&&s(O)},I=O=>{o&&o(O)},P=O=>{c&&c(O)};return D.addEventListener("change",C),D.addEventListener("start",I),D.addEventListener("end",P),()=>{D.removeEventListener("start",I),D.removeEventListener("end",P),D.removeEventListener("change",C)}},[s,o,c,D,d,T]),be.useEffect(()=>{if(n){const C=v().controls;return S({controls:D}),()=>S({controls:C})}},[n,D]),be.createElement("primitive",Yx({ref:f,object:D,enableDamping:a},h))});/** + */function Zx(){return Zx=Object.assign?Object.assign.bind():function(n){for(var e=1;ee in n?WJ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,YJ=(n,e,t)=>(XJ(n,e+"",t),t);class qJ{constructor(){YJ(this,"_listeners")}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const a=this._listeners[e];if(a!==void 0){const r=a.indexOf(t);r!==-1&&a.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const a=i.slice(0);for(let r=0,s=a.length;re in n?jJ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Dt=(n,e,t)=>(ZJ(n,typeof e!="symbol"?e+"":e,t),t);const Vv=new lh,YD=new Go,KJ=Math.cos(70*(Math.PI/180)),qD=(n,e)=>(n%e+e)%e;let QJ=class extends qJ{constructor(e,t){super(),Dt(this,"object"),Dt(this,"domElement"),Dt(this,"enabled",!0),Dt(this,"target",new L),Dt(this,"minDistance",0),Dt(this,"maxDistance",1/0),Dt(this,"minZoom",0),Dt(this,"maxZoom",1/0),Dt(this,"minPolarAngle",0),Dt(this,"maxPolarAngle",Math.PI),Dt(this,"minAzimuthAngle",-1/0),Dt(this,"maxAzimuthAngle",1/0),Dt(this,"enableDamping",!1),Dt(this,"dampingFactor",.05),Dt(this,"enableZoom",!0),Dt(this,"zoomSpeed",1),Dt(this,"enableRotate",!0),Dt(this,"rotateSpeed",1),Dt(this,"enablePan",!0),Dt(this,"panSpeed",1),Dt(this,"screenSpacePanning",!0),Dt(this,"keyPanSpeed",7),Dt(this,"zoomToCursor",!1),Dt(this,"autoRotate",!1),Dt(this,"autoRotateSpeed",2),Dt(this,"reverseOrbit",!1),Dt(this,"reverseHorizontalOrbit",!1),Dt(this,"reverseVerticalOrbit",!1),Dt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Dt(this,"mouseButtons",{LEFT:vu.ROTATE,MIDDLE:vu.DOLLY,RIGHT:vu.PAN}),Dt(this,"touches",{ONE:_u.ROTATE,TWO:_u.DOLLY_PAN}),Dt(this,"target0"),Dt(this,"position0"),Dt(this,"zoom0"),Dt(this,"_domElementKeyEvents",null),Dt(this,"getPolarAngle"),Dt(this,"getAzimuthalAngle"),Dt(this,"setPolarAngle"),Dt(this,"setAzimuthalAngle"),Dt(this,"getDistance"),Dt(this,"getZoomScale"),Dt(this,"listenToKeyEvents"),Dt(this,"stopListenToKeyEvents"),Dt(this,"saveState"),Dt(this,"reset"),Dt(this,"update"),Dt(this,"connect"),Dt(this,"dispose"),Dt(this,"dollyIn"),Dt(this,"dollyOut"),Dt(this,"getScale"),Dt(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>f.phi,this.getAzimuthalAngle=()=>f.theta,this.setPolarAngle=Q=>{let pe=qD(Q,2*Math.PI),Oe=f.phi;Oe<0&&(Oe+=2*Math.PI),pe<0&&(pe+=2*Math.PI);let q=Math.abs(pe-Oe);2*Math.PI-q{let pe=qD(Q,2*Math.PI),Oe=f.theta;Oe<0&&(Oe+=2*Math.PI),pe<0&&(pe+=2*Math.PI);let q=Math.abs(pe-Oe);2*Math.PI-qi.object.position.distanceTo(i.target),this.listenToKeyEvents=Q=>{Q.addEventListener("keydown",ye),this._domElementKeyEvents=Q},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ye),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(a),i.update(),c=o.NONE},this.update=(()=>{const Q=new L,pe=new L(0,1,0),Oe=new St().setFromUnitVectors(e.up,pe),q=Oe.clone().invert(),Ve=new L,me=new St,We=2*Math.PI;return function(){const we=i.object.position;Oe.setFromUnitVectors(e.up,pe),q.copy(Oe).invert(),Q.copy(we).sub(i.target),Q.applyQuaternion(Oe),f.setFromVector3(Q),i.autoRotate&&c===o.NONE&&se(j()),i.enableDamping?(f.theta+=d.theta*i.dampingFactor,f.phi+=d.phi*i.dampingFactor):(f.theta+=d.theta,f.phi+=d.phi);let rt=i.minAzimuthAngle,yt=i.maxAzimuthAngle;isFinite(rt)&&isFinite(yt)&&(rt<-Math.PI?rt+=We:rt>Math.PI&&(rt-=We),yt<-Math.PI?yt+=We:yt>Math.PI&&(yt-=We),rt<=yt?f.theta=Math.max(rt,Math.min(yt,f.theta)):f.theta=f.theta>(rt+yt)/2?Math.max(rt,f.theta):Math.min(yt,f.theta)),f.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,f.phi)),f.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(g,i.dampingFactor):i.target.add(g),i.zoomToCursor&&O||i.object.isOrthographicCamera?f.radius=nt(f.radius):f.radius=nt(f.radius*m),Q.setFromSpherical(f),Q.applyQuaternion(q),we.copy(i.target).add(Q),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(d.theta*=1-i.dampingFactor,d.phi*=1-i.dampingFactor,g.multiplyScalar(1-i.dampingFactor)):(d.set(0,0,0),g.set(0,0,0));let Gt=!1;if(i.zoomToCursor&&O){let Vt=null;if(i.object instanceof hi&&i.object.isPerspectiveCamera){const li=Q.length();Vt=nt(li*m);const ci=li-Vt;i.object.position.addScaledVector(I,ci),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const li=new L(P.x,P.y,0);li.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/m)),i.object.updateProjectionMatrix(),Gt=!0;const ci=new L(P.x,P.y,0);ci.unproject(i.object),i.object.position.sub(ci).add(li),i.object.updateMatrixWorld(),Vt=Q.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Vt!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Vt).add(i.object.position):(Vv.origin.copy(i.object.position),Vv.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(Vv.direction))h||8*(1-me.dot(i.object.quaternion))>h?(i.dispatchEvent(a),Ve.copy(i.object.position),me.copy(i.object.quaternion),Gt=!1,!0):!1}})(),this.connect=Q=>{i.domElement=Q,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",_t),i.domElement.addEventListener("pointerdown",ct),i.domElement.addEventListener("pointercancel",U),i.domElement.addEventListener("wheel",Le)},this.dispose=()=>{var Q,pe,Oe,q,Ve,me;i.domElement&&(i.domElement.style.touchAction="auto"),(Q=i.domElement)==null||Q.removeEventListener("contextmenu",_t),(pe=i.domElement)==null||pe.removeEventListener("pointerdown",ct),(Oe=i.domElement)==null||Oe.removeEventListener("pointercancel",U),(q=i.domElement)==null||q.removeEventListener("wheel",Le),(Ve=i.domElement)==null||Ve.ownerDocument.removeEventListener("pointermove",k),(me=i.domElement)==null||me.ownerDocument.removeEventListener("pointerup",U),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",ye)};const i=this,a={type:"change"},r={type:"start"},s={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=o.NONE;const h=1e-6,f=new pE,d=new pE;let m=1;const g=new L,x=new de,T=new de,y=new de,v=new de,S=new de,E=new de,b=new de,D=new de,C=new de,I=new L,P=new de;let O=!1;const w=[],B={};function j(){return 2*Math.PI/60/60*i.autoRotateSpeed}function ee(){return Math.pow(.95,i.zoomSpeed)}function se(Q){i.reverseOrbit||i.reverseHorizontalOrbit?d.theta+=Q:d.theta-=Q}function re(Q){i.reverseOrbit||i.reverseVerticalOrbit?d.phi+=Q:d.phi-=Q}const W=(()=>{const Q=new L;return function(Oe,q){Q.setFromMatrixColumn(q,0),Q.multiplyScalar(-Oe),g.add(Q)}})(),te=(()=>{const Q=new L;return function(Oe,q){i.screenSpacePanning===!0?Q.setFromMatrixColumn(q,1):(Q.setFromMatrixColumn(q,0),Q.crossVectors(i.object.up,Q)),Q.multiplyScalar(Oe),g.add(Q)}})(),K=(()=>{const Q=new L;return function(Oe,q){const Ve=i.domElement;if(Ve&&i.object instanceof hi&&i.object.isPerspectiveCamera){const me=i.object.position;Q.copy(me).sub(i.target);let We=Q.length();We*=Math.tan(i.object.fov/2*Math.PI/180),W(2*Oe*We/Ve.clientHeight,i.object.matrix),te(2*q*We/Ve.clientHeight,i.object.matrix)}else Ve&&i.object instanceof ao&&i.object.isOrthographicCamera?(W(Oe*(i.object.right-i.object.left)/i.object.zoom/Ve.clientWidth,i.object.matrix),te(q*(i.object.top-i.object.bottom)/i.object.zoom/Ve.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function oe(Q){i.object instanceof hi&&i.object.isPerspectiveCamera||i.object instanceof ao&&i.object.isOrthographicCamera?m=Q:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function ie(Q){oe(m/Q)}function Ce(Q){oe(m*Q)}function Xe(Q){if(!i.zoomToCursor||!i.domElement)return;O=!0;const pe=i.domElement.getBoundingClientRect(),Oe=Q.clientX-pe.left,q=Q.clientY-pe.top,Ve=pe.width,me=pe.height;P.x=Oe/Ve*2-1,P.y=-(q/me)*2+1,I.set(P.x,P.y,1).unproject(i.object).sub(i.object.position).normalize()}function nt(Q){return Math.max(i.minDistance,Math.min(i.maxDistance,Q))}function tt(Q){x.set(Q.clientX,Q.clientY)}function gt(Q){Xe(Q),b.set(Q.clientX,Q.clientY)}function ge(Q){v.set(Q.clientX,Q.clientY)}function Ae(Q){T.set(Q.clientX,Q.clientY),y.subVectors(T,x).multiplyScalar(i.rotateSpeed);const pe=i.domElement;pe&&(se(2*Math.PI*y.x/pe.clientHeight),re(2*Math.PI*y.y/pe.clientHeight)),x.copy(T),i.update()}function Ze(Q){D.set(Q.clientX,Q.clientY),C.subVectors(D,b),C.y>0?ie(ee()):C.y<0&&Ce(ee()),b.copy(D),i.update()}function ue(Q){S.set(Q.clientX,Q.clientY),E.subVectors(S,v).multiplyScalar(i.panSpeed),K(E.x,E.y),v.copy(S),i.update()}function it(Q){Xe(Q),Q.deltaY<0?Ce(ee()):Q.deltaY>0&&ie(ee()),i.update()}function Mt(Q){let pe=!1;switch(Q.code){case i.keys.UP:K(0,i.keyPanSpeed),pe=!0;break;case i.keys.BOTTOM:K(0,-i.keyPanSpeed),pe=!0;break;case i.keys.LEFT:K(i.keyPanSpeed,0),pe=!0;break;case i.keys.RIGHT:K(-i.keyPanSpeed,0),pe=!0;break}pe&&(Q.preventDefault(),i.update())}function ot(){if(w.length==1)x.set(w[0].pageX,w[0].pageY);else{const Q=.5*(w[0].pageX+w[1].pageX),pe=.5*(w[0].pageY+w[1].pageY);x.set(Q,pe)}}function Ke(){if(w.length==1)v.set(w[0].pageX,w[0].pageY);else{const Q=.5*(w[0].pageX+w[1].pageX),pe=.5*(w[0].pageY+w[1].pageY);v.set(Q,pe)}}function Te(){const Q=w[0].pageX-w[1].pageX,pe=w[0].pageY-w[1].pageY,Oe=Math.sqrt(Q*Q+pe*pe);b.set(0,Oe)}function G(){i.enableZoom&&Te(),i.enablePan&&Ke()}function be(){i.enableZoom&&Te(),i.enableRotate&&ot()}function De(Q){if(w.length==1)T.set(Q.pageX,Q.pageY);else{const Oe=ht(Q),q=.5*(Q.pageX+Oe.x),Ve=.5*(Q.pageY+Oe.y);T.set(q,Ve)}y.subVectors(T,x).multiplyScalar(i.rotateSpeed);const pe=i.domElement;pe&&(se(2*Math.PI*y.x/pe.clientHeight),re(2*Math.PI*y.y/pe.clientHeight)),x.copy(T)}function Fe(Q){if(w.length==1)S.set(Q.pageX,Q.pageY);else{const pe=ht(Q),Oe=.5*(Q.pageX+pe.x),q=.5*(Q.pageY+pe.y);S.set(Oe,q)}E.subVectors(S,v).multiplyScalar(i.panSpeed),K(E.x,E.y),v.copy(S)}function Be(Q){const pe=ht(Q),Oe=Q.pageX-pe.x,q=Q.pageY-pe.y,Ve=Math.sqrt(Oe*Oe+q*q);D.set(0,Ve),C.set(0,Math.pow(D.y/b.y,i.zoomSpeed)),ie(C.y),b.copy(D)}function $e(Q){i.enableZoom&&Be(Q),i.enablePan&&Fe(Q)}function Je(Q){i.enableZoom&&Be(Q),i.enableRotate&&De(Q)}function ct(Q){var pe,Oe;i.enabled!==!1&&(w.length===0&&((pe=i.domElement)==null||pe.ownerDocument.addEventListener("pointermove",k),(Oe=i.domElement)==null||Oe.ownerDocument.addEventListener("pointerup",U)),pt(Q),Q.pointerType==="touch"?vt(Q):ce(Q))}function k(Q){i.enabled!==!1&&(Q.pointerType==="touch"?qe(Q):Ee(Q))}function U(Q){var pe,Oe,q;Ie(Q),w.length===0&&((pe=i.domElement)==null||pe.releasePointerCapture(Q.pointerId),(Oe=i.domElement)==null||Oe.ownerDocument.removeEventListener("pointermove",k),(q=i.domElement)==null||q.ownerDocument.removeEventListener("pointerup",U)),i.dispatchEvent(s),c=o.NONE}function ce(Q){let pe;switch(Q.button){case 0:pe=i.mouseButtons.LEFT;break;case 1:pe=i.mouseButtons.MIDDLE;break;case 2:pe=i.mouseButtons.RIGHT;break;default:pe=-1}switch(pe){case vu.DOLLY:if(i.enableZoom===!1)return;gt(Q),c=o.DOLLY;break;case vu.ROTATE:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(i.enablePan===!1)return;ge(Q),c=o.PAN}else{if(i.enableRotate===!1)return;tt(Q),c=o.ROTATE}break;case vu.PAN:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(i.enableRotate===!1)return;tt(Q),c=o.ROTATE}else{if(i.enablePan===!1)return;ge(Q),c=o.PAN}break;default:c=o.NONE}c!==o.NONE&&i.dispatchEvent(r)}function Ee(Q){if(i.enabled!==!1)switch(c){case o.ROTATE:if(i.enableRotate===!1)return;Ae(Q);break;case o.DOLLY:if(i.enableZoom===!1)return;Ze(Q);break;case o.PAN:if(i.enablePan===!1)return;ue(Q);break}}function Le(Q){i.enabled===!1||i.enableZoom===!1||c!==o.NONE&&c!==o.ROTATE||(Q.preventDefault(),i.dispatchEvent(r),it(Q),i.dispatchEvent(s))}function ye(Q){i.enabled===!1||i.enablePan===!1||Mt(Q)}function vt(Q){switch(He(Q),w.length){case 1:switch(i.touches.ONE){case _u.ROTATE:if(i.enableRotate===!1)return;ot(),c=o.TOUCH_ROTATE;break;case _u.PAN:if(i.enablePan===!1)return;Ke(),c=o.TOUCH_PAN;break;default:c=o.NONE}break;case 2:switch(i.touches.TWO){case _u.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;G(),c=o.TOUCH_DOLLY_PAN;break;case _u.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;be(),c=o.TOUCH_DOLLY_ROTATE;break;default:c=o.NONE}break;default:c=o.NONE}c!==o.NONE&&i.dispatchEvent(r)}function qe(Q){switch(He(Q),c){case o.TOUCH_ROTATE:if(i.enableRotate===!1)return;De(Q),i.update();break;case o.TOUCH_PAN:if(i.enablePan===!1)return;Fe(Q),i.update();break;case o.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;$e(Q),i.update();break;case o.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Je(Q),i.update();break;default:c=o.NONE}}function _t(Q){i.enabled!==!1&&Q.preventDefault()}function pt(Q){w.push(Q)}function Ie(Q){delete B[Q.pointerId];for(let pe=0;pe{Ce(Q),i.update()},this.dollyOut=(Q=ee())=>{ie(Q),i.update()},this.getScale=()=>m,this.setScale=Q=>{oe(Q),i.update()},this.getZoomScale=()=>ee(),t!==void 0&&this.connect(t),this.update()}};function JJ(n,e,t){const i=Oi(g=>g.size),a=Oi(g=>g.viewport),r=typeof n=="number"?n:i.width*a.dpr,s=i.height*a.dpr,o=(typeof n=="number"?t:n)||{},{samples:c=0,depth:h,...f}=o,d=h??o.depthBuffer,m=Me.useMemo(()=>{const g=new xi(r,s,{minFilter:Ht,magFilter:Ht,type:Xn,...f});return d&&(g.depthTexture=new z0(r,s,si)),g.samples=c,g},[]);return Me.useLayoutEffect(()=>{m.setSize(r,s),c&&(m.samples=c)},[c,m,r,s]),Me.useEffect(()=>()=>m.dispose(),[]),m}const $J=n=>typeof n=="function",W8=Me.forwardRef(({envMap:n,resolution:e=256,frames:t=1/0,makeDefault:i,children:a,...r},s)=>{const o=Oi(({set:y})=>y),c=Oi(({camera:y})=>y),h=Oi(({size:y})=>y),f=Me.useRef(null);Me.useImperativeHandle(s,()=>f.current,[]);const d=Me.useRef(null),m=JJ(e);Me.useLayoutEffect(()=>{r.manual||(f.current.aspect=h.width/h.height)},[h,r]),Me.useLayoutEffect(()=>{f.current.updateProjectionMatrix()});let g=0,x=null;const T=$J(a);return cl(y=>{T&&(t===1/0||g{if(i){const y=c;return o(()=>({camera:f.current})),()=>o(()=>({camera:y}))}},[f,i,o]),Me.createElement(Me.Fragment,null,Me.createElement("perspectiveCamera",Zx({ref:f},r),!T&&a),Me.createElement("group",{ref:d},T&&a(m.texture)))}),e$=Me.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:a=!0,keyEvents:r=!1,onChange:s,onStart:o,onEnd:c,...h},f)=>{const d=Oi(C=>C.invalidate),m=Oi(C=>C.camera),g=Oi(C=>C.gl),x=Oi(C=>C.events),T=Oi(C=>C.setEvents),y=Oi(C=>C.set),v=Oi(C=>C.get),S=Oi(C=>C.performance),E=e||m,b=i||x.connected||g.domElement,D=Me.useMemo(()=>new QJ(E),[E]);return cl(()=>{D.enabled&&D.update()},-1),Me.useEffect(()=>(r&&D.connect(r===!0?b:r),D.connect(b),()=>void D.dispose()),[r,b,t,D,d]),Me.useEffect(()=>{const C=O=>{d(),t&&S.regress(),s&&s(O)},I=O=>{o&&o(O)},P=O=>{c&&c(O)};return D.addEventListener("change",C),D.addEventListener("start",I),D.addEventListener("end",P),()=>{D.removeEventListener("start",I),D.removeEventListener("end",P),D.removeEventListener("change",C)}},[s,o,c,D,d,T]),Me.useEffect(()=>{if(n){const C=v().controls;return y({controls:D}),()=>y({controls:C})}},[n,D]),Me.createElement("primitive",Zx({ref:f,object:D,enableDamping:a},h))});/** * postprocessing v6.38.0 build Sat Nov 08 2025 * https://github.com/pmndrs/postprocessing * Copyright 2015-2025 Raoul van Rüschen * @license Zlib - */var G2=1/1e3,e$=1e3,t$=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*G2}get fixedDelta(){return this._fixedDelta*G2}set fixedDelta(n){this._fixedDelta=n*e$}get elapsed(){return this._elapsed*G2}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(n!==void 0?n:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(n){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},n$=(()=>{const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]),t=new wt;return t.setAttribute("position",new Ot(n,3)),t.setAttribute("uv",new Ot(e,2)),t})(),Pa=class NE{static get fullscreenGeometry(){return n$}constructor(e="Pass",t=new Ad,i=new io){this.name=e,this.renderer=null,this.scene=t,this.camera=i,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new si(NE.fullscreenGeometry,e),t.frustumCulled=!1,this.scene===null&&(this.scene=new Ad),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=Sc){}render(e,t,i,a,r){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,i){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof _i||t instanceof qn||t instanceof Nn||t instanceof NE)&&this[e].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},i$=class extends Pa{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,i,a){const r=n.state.buffers.stencil;r.setLocked(!1),r.setTest(!1)}},a$=`#ifdef COLOR_WRITE + */var W2=1/1e3,t$=1e3,n$=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*W2}get fixedDelta(){return this._fixedDelta*W2}set fixedDelta(n){this._fixedDelta=n*t$}get elapsed(){return this._elapsed*W2}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(n!==void 0?n:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(n){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},i$=(()=>{const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]),t=new Ct;return t.setAttribute("position",new Ot(n,3)),t.setAttribute("uv",new Ot(e,2)),t})(),za=class LE{static get fullscreenGeometry(){return i$}constructor(e="Pass",t=new Rd,i=new ao){this.name=e,this.renderer=null,this.scene=t,this.camera=i,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new oi(LE.fullscreenGeometry,e),t.frustumCulled=!1,this.scene===null&&(this.scene=new Rd),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=Mc){}render(e,t,i,a,r){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,i){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof xi||t instanceof qn||t instanceof Nn||t instanceof LE)&&this[e].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},a$=class extends za{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,i,a){const r=n.state.buffers.stencil;r.setLocked(!1),r.setTest(!1)}},r$=`#ifdef COLOR_WRITE #include #include #ifdef FRAMEBUFFER_PRECISION_HIGH @@ -5085,7 +5085,7 @@ gl_FragColor=vec4(0.0); #ifdef DEPTH_WRITE gl_FragDepth=readDepth(vUv); #endif -}`,iA="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",r$=class extends Fi{constructor(){super({name:"CopyMaterial",defines:{DEPTH_PACKING:"0",COLOR_WRITE:"1"},uniforms:{inputBuffer:new J(null),depthBuffer:new J(null),channelWeights:new J(null),opacity:new J(1)},blending:Sa,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:a$,vertexShader:iA}),this.depthFunc=i0}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(n){const e=n!==null;this.colorWrite!==e&&(e?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=e,this.needsUpdate=!0),this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){const e=n!==null;this.depthWrite!==e&&(e?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=e,this.depthWrite=e,this.needsUpdate=!0),this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(n){n!==null?(this.defines.USE_WEIGHTS="1",this.uniforms.channelWeights.value=n):delete this.defines.USE_WEIGHTS,this.needsUpdate=!0}setInputBuffer(n){this.uniforms.inputBuffer.value=n}getOpacity(n){return this.uniforms.opacity.value}setOpacity(n){this.uniforms.opacity.value=n}},k8=class extends Pa{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new r$,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new _i(1,1,{minFilter:Ht,magFilter:Ht,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,i,a){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==Ii?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":n!==null&&n.outputColorSpace===En&&(this.renderTarget.texture.colorSpace=En))}},XD=new je,W8=class extends Pa{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,i,a){const r=this.overrideClearColor,s=this.overrideClearAlpha,o=n.getClearAlpha(),c=r!==null,h=s>=0;c?(n.getClearColor(XD),n.setClearColor(r,h?s:o)):h&&n.setClearAlpha(s),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),c?n.setClearColor(XD,o):h&&n.setClearAlpha(o)}},s$=class extends Pa{constructor(n,e){super("MaskPass",n,e),this.needsSwap=!1,this.clearPass=new W8(!1,!1,!0),this.inverse=!1}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get inverted(){return this.inverse}set inverted(n){this.inverse=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(n){this.inverted=n}render(n,e,t,i,a){const r=n.getContext(),s=n.state.buffers,o=this.scene,c=this.camera,h=this.clearPass,f=this.inverted?0:1,d=1-f;s.color.setMask(!1),s.depth.setMask(!1),s.color.setLocked(!0),s.depth.setLocked(!0),s.stencil.setTest(!0),s.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),s.stencil.setFunc(r.ALWAYS,f,4294967295),s.stencil.setClear(d),s.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?h.render(n,null):(h.render(n,e),h.render(n,t))),this.renderToScreen?(n.setRenderTarget(null),n.render(o,c)):(n.setRenderTarget(e),n.render(o,c),n.setRenderTarget(t),n.render(o,c)),s.color.setLocked(!1),s.depth.setLocked(!1),s.stencil.setLocked(!1),s.stencil.setFunc(r.EQUAL,1,4294967295),s.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),s.stencil.setLocked(!0)}},o$=class{constructor(n=null,{depthBuffer:e=!0,stencilBuffer:t=!1,multisampling:i=0,frameBufferType:a}={}){this.renderer=null,this.inputBuffer=this.createBuffer(e,t,a,i),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new k8,this.depthTexture=null,this.passes=[],this.timer=new t$,this.autoRenderToScreen=!0,this.setRenderer(n)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(n){const e=this.inputBuffer,t=this.multisampling;t>0&&n>0?(this.inputBuffer.samples=n,this.outputBuffer.samples=n,this.inputBuffer.dispose(),this.outputBuffer.dispose()):t!==n&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,n),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(n){if(this.renderer=n,n!==null){const e=n.getSize(new de),t=n.getContext().getContextAttributes().alpha,i=this.inputBuffer.texture.type;i===Ii&&n.outputColorSpace===En&&(this.inputBuffer.texture.colorSpace=En,this.outputBuffer.texture.colorSpace=En,this.inputBuffer.dispose(),this.outputBuffer.dispose()),n.autoClear=!1,this.setSize(e.width,e.height);for(const a of this.passes)a.initialize(n,t,i)}}replaceRenderer(n,e=!0){const t=this.renderer,i=t.domElement.parentNode;return this.setRenderer(n),e&&i!==null&&(i.removeChild(t.domElement),i.appendChild(n.domElement)),t}createDepthTexture(){const n=this.depthTexture=new U0;return this.inputBuffer.depthTexture=n,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(n.format=Yu,n.type=Xu):n.type=Ns,n}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const n of this.passes)n.setDepthTexture(null)}}createBuffer(n,e,t,i){const a=this.renderer,r=a===null?new de:a.getDrawingBufferSize(new de),s={minFilter:Ht,magFilter:Ht,stencilBuffer:e,depthBuffer:n,type:t},o=new _i(r.width,r.height,s);return i>0&&(o.samples=i),t===Ii&&a!==null&&a.outputColorSpace===En&&(o.texture.colorSpace=En),o.texture.name="EffectComposer.Buffer",o.texture.generateMipmaps=!1,o}setMainScene(n){for(const e of this.passes)e.mainScene=n}setMainCamera(n){for(const e of this.passes)e.mainCamera=n}addPass(n,e){const t=this.passes,i=this.renderer,a=i.getDrawingBufferSize(new de),r=i.getContext().getContextAttributes().alpha,s=this.inputBuffer.texture.type;if(n.setRenderer(i),n.setSize(a.width,a.height),n.initialize(i,r,s),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),n.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,n):t.push(n),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),n.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const o=this.createDepthTexture();for(n of t)n.setDepthTexture(o)}else n.setDepthTexture(this.depthTexture)}removePass(n){const e=this.passes,t=e.indexOf(n);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){const r=(o,c)=>o||c.needsDepthTexture;e.reduce(r,!1)||(n.getDepthTexture()===this.depthTexture&&n.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(n.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){const n=this.passes;this.deleteDepthTexture(),n.length>0&&(this.autoRenderToScreen&&(n[n.length-1].renderToScreen=!1),this.passes=[])}render(n){const e=this.renderer,t=this.copyPass;let i=this.inputBuffer,a=this.outputBuffer,r=!1,s,o,c;n===void 0&&(this.timer.update(),n=this.timer.getDelta());for(const h of this.passes)h.enabled&&(h.render(e,i,a,n,r),h.needsSwap&&(r&&(t.renderToScreen=h.renderToScreen,s=e.getContext(),o=e.state.buffers.stencil,o.setFunc(s.NOTEQUAL,1,4294967295),t.render(e,i,a,n,r),o.setFunc(s.EQUAL,1,4294967295)),c=i,i=a,a=c),h instanceof s$?r=!0:h instanceof i$&&(r=!1))}setSize(n,e,t){const i=this.renderer,a=i.getSize(new de);(n===void 0||e===void 0)&&(n=a.width,e=a.height),(a.width!==n||a.height!==e)&&i.setSize(n,e,t);const r=i.getDrawingBufferSize(new de);this.inputBuffer.setSize(r.width,r.height),this.outputBuffer.setSize(r.width,r.height);for(const s of this.passes)s.setSize(r.width,r.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const n of this.passes)n.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),Pa.fullscreenGeometry.dispose()}},Jo={NONE:0,DEPTH:1,CONVOLUTION:2},_n={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},l$=class{constructor(){this.shaderParts=new Map([[_n.FRAGMENT_HEAD,null],[_n.FRAGMENT_MAIN_UV,null],[_n.FRAGMENT_MAIN_IMAGE,null],[_n.VERTEX_HEAD,null],[_n.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=Jo.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=Wn}},V2=!1,YD=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case la:t=this.materialsFlatShadedDoubleSide;break;case Oi:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case la:t=this.materialsDoubleSide;break;case Oi:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(n){if(!(n instanceof Fi))return n.clone();const e=n.uniforms,t=new Map;for(const a in e){const r=e[a].value;r.isRenderTargetTexture&&(e[a].value=null,t.set(a,r))}const i=n.clone();for(const a of t)e[a[0]].value=a[1],i.uniforms[a[0]].value=a[1];return i}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[this.cloneMaterial(n),this.cloneMaterial(n),this.cloneMaterial(n)];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=Cs;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=Oi,i}),this.materialsDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=la,i}),this.materialsFlatShaded=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i}),this.materialsFlatShadedBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=Oi,i}),this.materialsFlatShadedDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=la,i})}}render(n,e,t){const i=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,V2){const a=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const r of a)r[0].material=r[1];this.meshCount!==a.size&&a.clear()}else{const a=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=a}n.shadowMap.enabled=i}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return V2}static set workaroundEnabled(n){V2=n}},Il=-1,as=class extends tr{constructor(n,e=Il,t=Il,i=1){super(),this.resizable=n,this.baseSize=new de(1,1),this.preferredSize=new de(e,t),this.target=this.preferredSize,this.s=i,this.effectiveSize=new de,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,i=this.scale;e.width!==Il?t.width=e.width:e.height!==Il?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*i),e.height!==Il?t.height=e.height:e.width!==Il?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*i)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(Il),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return Il}},ln={ADD:0,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},c$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb,y.a),y.a*opacity);}",u$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb)*0.5,y.a),y.a*opacity);}",h$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.xy,xHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}",f$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/b)),vec3(1.0),step(1.0,a));return mix(x,vec4(z,y.a),y.a*opacity);}",d$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(x,vec4(z,y.a),y.a*opacity);}",p$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb,y.rgb),y.a),y.a*opacity);}",m$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(abs(x.rgb-y.rgb),y.a),y.a*opacity);}",g$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb/max(y.rgb,1e-12),y.a),y.a*opacity);}",v$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb-2.0*x.rgb*y.rgb),y.a),y.a*opacity);}",_$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=min(x.rgb,1.0);vec3 b=min(y.rgb,1.0);vec3 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(x,vec4(z,y.a),y.a*opacity);}",x$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(step(1.0,x.rgb+y.rgb),y.a),y.a*opacity);}",y$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.x,xHSL.yz));return mix(x,vec4(z,y.a),y.a*opacity);}",S$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-y.rgb,y.a),y.a*opacity);}",T$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(y.rgb*(1.0-x.rgb),y.a),y.a*opacity);}",E$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb,y.rgb),y.a),y.a*opacity);}",M$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(y.rgb+x.rgb-1.0,0.0,1.0),y.a),y.a*opacity);}",b$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb+y.rgb,1.0),y.a),y.a*opacity);}",A$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(2.0*y.rgb+x.rgb-1.0,0.0,1.0),y.a),y.a*opacity);}",R$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.xy,yHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}",w$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb*y.rgb,y.a),y.a*opacity);}",C$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-abs(1.0-x.rgb-y.rgb),y.a),y.a*opacity);}",N$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,y.a*opacity);}",D$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(2.0*y.rgb*x.rgb,1.0-2.0*(1.0-y.rgb)*(1.0-x.rgb),step(0.5,x.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}",O$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 y2=2.0*y.rgb;vec3 z=mix(mix(y2,x.rgb,step(0.5*x.rgb,y.rgb)),max(y2-1.0,vec3(0.0)),step(x.rgb,y2-1.0));return mix(x,vec4(z,y.a),y.a*opacity);}",L$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(min(x.rgb*x.rgb/max(1.0-y.rgb,1e-12),1.0),y.rgb,step(1.0,y.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}",I$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.x,yHSL.y,xHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}",U$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb-min(x.rgb*y.rgb,1.0),y.a),y.a*opacity);}",P$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb;vec3 b=y.rgb;vec3 y2=2.0*b;vec3 w=step(0.5,b);vec3 c=a-(1.0-y2)*a*(1.0-a);vec3 d=mix(a+(y2-1.0)*(sqrt(a)-a),a+(y2-1.0)*a*((16.0*a-12.0)*a+3.0),w*(1.0-step(0.25,a)));vec3 z=mix(c,d,w);return mix(x,vec4(z,y.a),y.a*opacity);}",z$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",B$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb+y.rgb-1.0,0.0),y.a),y.a*opacity);}",H$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(max(1.0-min((1.0-x.rgb)/(2.0*y.rgb),1.0),0.0),min(x.rgb/(2.0*(1.0-y.rgb)),1.0),step(0.5,y.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}",F$=new Map([[ln.ADD,c$],[ln.AVERAGE,u$],[ln.COLOR,h$],[ln.COLOR_BURN,f$],[ln.COLOR_DODGE,d$],[ln.DARKEN,p$],[ln.DIFFERENCE,m$],[ln.DIVIDE,g$],[ln.DST,null],[ln.EXCLUSION,v$],[ln.HARD_LIGHT,_$],[ln.HARD_MIX,x$],[ln.HUE,y$],[ln.INVERT,S$],[ln.INVERT_RGB,T$],[ln.LIGHTEN,E$],[ln.LINEAR_BURN,M$],[ln.LINEAR_DODGE,b$],[ln.LINEAR_LIGHT,A$],[ln.LUMINOSITY,R$],[ln.MULTIPLY,w$],[ln.NEGATION,C$],[ln.NORMAL,N$],[ln.OVERLAY,D$],[ln.PIN_LIGHT,O$],[ln.REFLECT,L$],[ln.SATURATION,I$],[ln.SCREEN,U$],[ln.SOFT_LIGHT,P$],[ln.SRC,z$],[ln.SUBTRACT,B$],[ln.VIVID_LIGHT,H$]]),G$=class extends tr{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new J(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return F$.get(this.blendFunction)}},m0=class extends tr{constructor(n,e,{attributes:t=Jo.NONE,blendFunction:i=ln.NORMAL,defines:a=new Map,uniforms:r=new Map,extensions:s=null,vertexShader:o=null}={}){super(),this.name=n,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=o,this.defines=a,this.uniforms=r,this.extensions=s,this.blendMode=new G$(i),this.blendMode.addEventListener("change",c=>this.setChanged()),this._inputColorSpace=Wn,this._outputColorSpace=Na}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(n){this._inputColorSpace=n,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(n){this._outputColorSpace=n,this.setChanged()}set mainScene(n){}set mainCamera(n){}getName(){return this.name}setRenderer(n){this.renderer=n}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(n){this.attributes=n,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(n){this.fragmentShader=n,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(n){this.vertexShader=n,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(n,e=Sc){}update(n,e,t){}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof _i||e instanceof qn||e instanceof Nn||e instanceof Pa)&&this[n].dispose()}}},V$=`#include +}`,sA="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",s$=class extends Vi{constructor(){super({name:"CopyMaterial",defines:{DEPTH_PACKING:"0",COLOR_WRITE:"1"},uniforms:{inputBuffer:new J(null),depthBuffer:new J(null),channelWeights:new J(null),opacity:new J(1)},blending:Ta,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:r$,vertexShader:sA}),this.depthFunc=r0}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(n){const e=n!==null;this.colorWrite!==e&&(e?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=e,this.needsUpdate=!0),this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){const e=n!==null;this.depthWrite!==e&&(e?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=e,this.depthWrite=e,this.needsUpdate=!0),this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(n){n!==null?(this.defines.USE_WEIGHTS="1",this.uniforms.channelWeights.value=n):delete this.defines.USE_WEIGHTS,this.needsUpdate=!0}setInputBuffer(n){this.uniforms.inputBuffer.value=n}getOpacity(n){return this.uniforms.opacity.value}setOpacity(n){this.uniforms.opacity.value=n}},X8=class extends za{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new s$,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new xi(1,1,{minFilter:Ht,magFilter:Ht,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,i,a){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==zi?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":n!==null&&n.outputColorSpace===En&&(this.renderTarget.texture.colorSpace=En))}},jD=new je,Y8=class extends za{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,i,a){const r=this.overrideClearColor,s=this.overrideClearAlpha,o=n.getClearAlpha(),c=r!==null,h=s>=0;c?(n.getClearColor(jD),n.setClearColor(r,h?s:o)):h&&n.setClearAlpha(s),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),c?n.setClearColor(jD,o):h&&n.setClearAlpha(o)}},o$=class extends za{constructor(n,e){super("MaskPass",n,e),this.needsSwap=!1,this.clearPass=new Y8(!1,!1,!0),this.inverse=!1}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get inverted(){return this.inverse}set inverted(n){this.inverse=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(n){this.inverted=n}render(n,e,t,i,a){const r=n.getContext(),s=n.state.buffers,o=this.scene,c=this.camera,h=this.clearPass,f=this.inverted?0:1,d=1-f;s.color.setMask(!1),s.depth.setMask(!1),s.color.setLocked(!0),s.depth.setLocked(!0),s.stencil.setTest(!0),s.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),s.stencil.setFunc(r.ALWAYS,f,4294967295),s.stencil.setClear(d),s.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?h.render(n,null):(h.render(n,e),h.render(n,t))),this.renderToScreen?(n.setRenderTarget(null),n.render(o,c)):(n.setRenderTarget(e),n.render(o,c),n.setRenderTarget(t),n.render(o,c)),s.color.setLocked(!1),s.depth.setLocked(!1),s.stencil.setLocked(!1),s.stencil.setFunc(r.EQUAL,1,4294967295),s.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),s.stencil.setLocked(!0)}},l$=class{constructor(n=null,{depthBuffer:e=!0,stencilBuffer:t=!1,multisampling:i=0,frameBufferType:a}={}){this.renderer=null,this.inputBuffer=this.createBuffer(e,t,a,i),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new X8,this.depthTexture=null,this.passes=[],this.timer=new n$,this.autoRenderToScreen=!0,this.setRenderer(n)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(n){const e=this.inputBuffer,t=this.multisampling;t>0&&n>0?(this.inputBuffer.samples=n,this.outputBuffer.samples=n,this.inputBuffer.dispose(),this.outputBuffer.dispose()):t!==n&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,n),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(n){if(this.renderer=n,n!==null){const e=n.getSize(new de),t=n.getContext().getContextAttributes().alpha,i=this.inputBuffer.texture.type;i===zi&&n.outputColorSpace===En&&(this.inputBuffer.texture.colorSpace=En,this.outputBuffer.texture.colorSpace=En,this.inputBuffer.dispose(),this.outputBuffer.dispose()),n.autoClear=!1,this.setSize(e.width,e.height);for(const a of this.passes)a.initialize(n,t,i)}}replaceRenderer(n,e=!0){const t=this.renderer,i=t.domElement.parentNode;return this.setRenderer(n),e&&i!==null&&(i.removeChild(t.domElement),i.appendChild(n.domElement)),t}createDepthTexture(){const n=this.depthTexture=new z0;return this.inputBuffer.depthTexture=n,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(n.format=ju,n.type=qu):n.type=Ds,n}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const n of this.passes)n.setDepthTexture(null)}}createBuffer(n,e,t,i){const a=this.renderer,r=a===null?new de:a.getDrawingBufferSize(new de),s={minFilter:Ht,magFilter:Ht,stencilBuffer:e,depthBuffer:n,type:t},o=new xi(r.width,r.height,s);return i>0&&(o.samples=i),t===zi&&a!==null&&a.outputColorSpace===En&&(o.texture.colorSpace=En),o.texture.name="EffectComposer.Buffer",o.texture.generateMipmaps=!1,o}setMainScene(n){for(const e of this.passes)e.mainScene=n}setMainCamera(n){for(const e of this.passes)e.mainCamera=n}addPass(n,e){const t=this.passes,i=this.renderer,a=i.getDrawingBufferSize(new de),r=i.getContext().getContextAttributes().alpha,s=this.inputBuffer.texture.type;if(n.setRenderer(i),n.setSize(a.width,a.height),n.initialize(i,r,s),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),n.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,n):t.push(n),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),n.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const o=this.createDepthTexture();for(n of t)n.setDepthTexture(o)}else n.setDepthTexture(this.depthTexture)}removePass(n){const e=this.passes,t=e.indexOf(n);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){const r=(o,c)=>o||c.needsDepthTexture;e.reduce(r,!1)||(n.getDepthTexture()===this.depthTexture&&n.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(n.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){const n=this.passes;this.deleteDepthTexture(),n.length>0&&(this.autoRenderToScreen&&(n[n.length-1].renderToScreen=!1),this.passes=[])}render(n){const e=this.renderer,t=this.copyPass;let i=this.inputBuffer,a=this.outputBuffer,r=!1,s,o,c;n===void 0&&(this.timer.update(),n=this.timer.getDelta());for(const h of this.passes)h.enabled&&(h.render(e,i,a,n,r),h.needsSwap&&(r&&(t.renderToScreen=h.renderToScreen,s=e.getContext(),o=e.state.buffers.stencil,o.setFunc(s.NOTEQUAL,1,4294967295),t.render(e,i,a,n,r),o.setFunc(s.EQUAL,1,4294967295)),c=i,i=a,a=c),h instanceof o$?r=!0:h instanceof a$&&(r=!1))}setSize(n,e,t){const i=this.renderer,a=i.getSize(new de);(n===void 0||e===void 0)&&(n=a.width,e=a.height),(a.width!==n||a.height!==e)&&i.setSize(n,e,t);const r=i.getDrawingBufferSize(new de);this.inputBuffer.setSize(r.width,r.height),this.outputBuffer.setSize(r.width,r.height);for(const s of this.passes)s.setSize(r.width,r.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const n of this.passes)n.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),za.fullscreenGeometry.dispose()}},$o={NONE:0,DEPTH:1,CONVOLUTION:2},_n={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},c$=class{constructor(){this.shaderParts=new Map([[_n.FRAGMENT_HEAD,null],[_n.FRAGMENT_MAIN_UV,null],[_n.FRAGMENT_MAIN_IMAGE,null],[_n.VERTEX_HEAD,null],[_n.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=$o.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=Wn}},X2=!1,ZD=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case ca:t=this.materialsFlatShadedDoubleSide;break;case Ui:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case ca:t=this.materialsDoubleSide;break;case Ui:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(n){if(!(n instanceof Vi))return n.clone();const e=n.uniforms,t=new Map;for(const a in e){const r=e[a].value;r.isRenderTargetTexture&&(e[a].value=null,t.set(a,r))}const i=n.clone();for(const a of t)e[a[0]].value=a[1],i.uniforms[a[0]].value=a[1];return i}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[this.cloneMaterial(n),this.cloneMaterial(n),this.cloneMaterial(n)];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=Ns;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=Ui,i}),this.materialsDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=ca,i}),this.materialsFlatShaded=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i}),this.materialsFlatShadedBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=Ui,i}),this.materialsFlatShadedDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=ca,i})}}render(n,e,t){const i=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,X2){const a=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const r of a)r[0].material=r[1];this.meshCount!==a.size&&a.clear()}else{const a=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=a}n.shadowMap.enabled=i}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return X2}static set workaroundEnabled(n){X2=n}},Pl=-1,rs=class extends nr{constructor(n,e=Pl,t=Pl,i=1){super(),this.resizable=n,this.baseSize=new de(1,1),this.preferredSize=new de(e,t),this.target=this.preferredSize,this.s=i,this.effectiveSize=new de,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,i=this.scale;e.width!==Pl?t.width=e.width:e.height!==Pl?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*i),e.height!==Pl?t.height=e.height:e.width!==Pl?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*i)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(Pl),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return Pl}},ln={ADD:0,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},u$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb,y.a),y.a*opacity);}",h$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb)*0.5,y.a),y.a*opacity);}",f$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.xy,xHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}",d$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/b)),vec3(1.0),step(1.0,a));return mix(x,vec4(z,y.a),y.a*opacity);}",p$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(x,vec4(z,y.a),y.a*opacity);}",m$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb,y.rgb),y.a),y.a*opacity);}",g$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(abs(x.rgb-y.rgb),y.a),y.a*opacity);}",v$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb/max(y.rgb,1e-12),y.a),y.a*opacity);}",_$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb-2.0*x.rgb*y.rgb),y.a),y.a*opacity);}",x$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=min(x.rgb,1.0);vec3 b=min(y.rgb,1.0);vec3 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(x,vec4(z,y.a),y.a*opacity);}",y$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(step(1.0,x.rgb+y.rgb),y.a),y.a*opacity);}",S$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.x,xHSL.yz));return mix(x,vec4(z,y.a),y.a*opacity);}",T$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-y.rgb,y.a),y.a*opacity);}",E$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(y.rgb*(1.0-x.rgb),y.a),y.a*opacity);}",M$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb,y.rgb),y.a),y.a*opacity);}",b$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(y.rgb+x.rgb-1.0,0.0,1.0),y.a),y.a*opacity);}",A$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb+y.rgb,1.0),y.a),y.a*opacity);}",w$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(2.0*y.rgb+x.rgb-1.0,0.0,1.0),y.a),y.a*opacity);}",R$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.xy,yHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}",C$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb*y.rgb,y.a),y.a*opacity);}",N$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-abs(1.0-x.rgb-y.rgb),y.a),y.a*opacity);}",D$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,y.a*opacity);}",O$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(2.0*y.rgb*x.rgb,1.0-2.0*(1.0-y.rgb)*(1.0-x.rgb),step(0.5,x.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}",L$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 y2=2.0*y.rgb;vec3 z=mix(mix(y2,x.rgb,step(0.5*x.rgb,y.rgb)),max(y2-1.0,vec3(0.0)),step(x.rgb,y2-1.0));return mix(x,vec4(z,y.a),y.a*opacity);}",I$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(min(x.rgb*x.rgb/max(1.0-y.rgb,1e-12),1.0),y.rgb,step(1.0,y.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}",U$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.x,yHSL.y,xHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}",P$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb-min(x.rgb*y.rgb,1.0),y.a),y.a*opacity);}",z$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb;vec3 b=y.rgb;vec3 y2=2.0*b;vec3 w=step(0.5,b);vec3 c=a-(1.0-y2)*a*(1.0-a);vec3 d=mix(a+(y2-1.0)*(sqrt(a)-a),a+(y2-1.0)*a*((16.0*a-12.0)*a+3.0),w*(1.0-step(0.25,a)));vec3 z=mix(c,d,w);return mix(x,vec4(z,y.a),y.a*opacity);}",B$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",H$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb+y.rgb-1.0,0.0),y.a),y.a*opacity);}",F$="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(max(1.0-min((1.0-x.rgb)/(2.0*y.rgb),1.0),0.0),min(x.rgb/(2.0*(1.0-y.rgb)),1.0),step(0.5,y.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}",G$=new Map([[ln.ADD,u$],[ln.AVERAGE,h$],[ln.COLOR,f$],[ln.COLOR_BURN,d$],[ln.COLOR_DODGE,p$],[ln.DARKEN,m$],[ln.DIFFERENCE,g$],[ln.DIVIDE,v$],[ln.DST,null],[ln.EXCLUSION,_$],[ln.HARD_LIGHT,x$],[ln.HARD_MIX,y$],[ln.HUE,S$],[ln.INVERT,T$],[ln.INVERT_RGB,E$],[ln.LIGHTEN,M$],[ln.LINEAR_BURN,b$],[ln.LINEAR_DODGE,A$],[ln.LINEAR_LIGHT,w$],[ln.LUMINOSITY,R$],[ln.MULTIPLY,C$],[ln.NEGATION,N$],[ln.NORMAL,D$],[ln.OVERLAY,O$],[ln.PIN_LIGHT,L$],[ln.REFLECT,I$],[ln.SATURATION,U$],[ln.SCREEN,P$],[ln.SOFT_LIGHT,z$],[ln.SRC,B$],[ln.SUBTRACT,H$],[ln.VIVID_LIGHT,F$]]),V$=class extends nr{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new J(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return G$.get(this.blendFunction)}},v0=class extends nr{constructor(n,e,{attributes:t=$o.NONE,blendFunction:i=ln.NORMAL,defines:a=new Map,uniforms:r=new Map,extensions:s=null,vertexShader:o=null}={}){super(),this.name=n,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=o,this.defines=a,this.uniforms=r,this.extensions=s,this.blendMode=new V$(i),this.blendMode.addEventListener("change",c=>this.setChanged()),this._inputColorSpace=Wn,this._outputColorSpace=Da}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(n){this._inputColorSpace=n,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(n){this._outputColorSpace=n,this.setChanged()}set mainScene(n){}set mainCamera(n){}getName(){return this.name}setRenderer(n){this.renderer=n}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(n){this.attributes=n,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(n){this.fragmentShader=n,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(n){this.vertexShader=n,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(n,e=Mc){}update(n,e,t){}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof xi||e instanceof qn||e instanceof Nn||e instanceof za)&&this[n].dispose()}}},k$=`#include #ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; #else @@ -5107,7 +5107,7 @@ gl_FragColor=texel*mask; #else gl_FragColor=vec4(l*mask); #endif -}`,k$=class extends Fi{constructor(n=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:ws.replace(/\D+/g,"")},uniforms:{inputBuffer:new J(null),threshold:new J(0),smoothing:new J(1),range:new J(null)},blending:Sa,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:V$,vertexShader:iA}),this.colorOutput=n,this.luminanceRange=e}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get threshold(){return this.uniforms.threshold.value}set threshold(n){this.smoothing>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=n}getThreshold(){return this.threshold}setThreshold(n){this.threshold=n}get smoothing(){return this.uniforms.smoothing.value}set smoothing(n){this.threshold>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=n}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(n){this.smoothing=n}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(n){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(n){n?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(n){return this.colorOutput}setColorOutputEnabled(n){this.colorOutput=n}get useRange(){return this.luminanceRange!==null}set useRange(n){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(n){n!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=n,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(n){this.luminanceRange=n}},W$=class extends Pa{constructor({renderTarget:n,luminanceRange:e,colorOutput:t,resolutionScale:i=1,width:a=as.AUTO_SIZE,height:r=as.AUTO_SIZE,resolutionX:s=a,resolutionY:o=r}={}){super("LuminancePass"),this.fullscreenMaterial=new k$(t,e),this.needsSwap=!1,this.renderTarget=n,this.renderTarget===void 0&&(this.renderTarget=new _i(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const c=this.resolution=new as(this,s,o,i);c.addEventListener("change",h=>this.setSize(c.baseWidth,c.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(n,e,t,i,a){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}initialize(n,e,t){t!==void 0&&t!==Ii&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},DE=class extends Pa{constructor(n,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=n,this.input=e}setInput(n){this.input=n}render(n,e,t,i,a){const r=this.fullscreenMaterial.uniforms;e!==null&&r!==void 0&&r[this.input]!==void 0&&(r[this.input].value=e.texture),n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}initialize(n,e,t){t!==void 0&&t!==Ii&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},aA=class extends Pa{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new W8,this.overrideMaterialManager=t===null?null:new YD(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new YD(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,i,a){const r=this.scene,s=this.camera,o=this.selection,c=s.layers.mask,h=r.background,f=n.shadowMap.autoUpdate,d=this.renderToScreen?null:e;o!==null&&s.layers.set(o.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(r.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(d),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,r,s):n.render(r,s),s.layers.mask=c,r.background=h,n.shadowMap.autoUpdate=f}},Ya={LINEAR:0,REINHARD:1,REINHARD2:2,REINHARD2_ADAPTIVE:3,OPTIMIZED_CINEON:5,CINEON:5,ACES_FILMIC:6,AGX:7,NEUTRAL:8},X$=`#include +}`,W$=class extends Vi{constructor(n=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:Cs.replace(/\D+/g,"")},uniforms:{inputBuffer:new J(null),threshold:new J(0),smoothing:new J(1),range:new J(null)},blending:Ta,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:k$,vertexShader:sA}),this.colorOutput=n,this.luminanceRange=e}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get threshold(){return this.uniforms.threshold.value}set threshold(n){this.smoothing>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=n}getThreshold(){return this.threshold}setThreshold(n){this.threshold=n}get smoothing(){return this.uniforms.smoothing.value}set smoothing(n){this.threshold>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=n}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(n){this.smoothing=n}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(n){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(n){n?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(n){return this.colorOutput}setColorOutputEnabled(n){this.colorOutput=n}get useRange(){return this.luminanceRange!==null}set useRange(n){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(n){n!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=n,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(n){this.luminanceRange=n}},X$=class extends za{constructor({renderTarget:n,luminanceRange:e,colorOutput:t,resolutionScale:i=1,width:a=rs.AUTO_SIZE,height:r=rs.AUTO_SIZE,resolutionX:s=a,resolutionY:o=r}={}){super("LuminancePass"),this.fullscreenMaterial=new W$(t,e),this.needsSwap=!1,this.renderTarget=n,this.renderTarget===void 0&&(this.renderTarget=new xi(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const c=this.resolution=new rs(this,s,o,i);c.addEventListener("change",h=>this.setSize(c.baseWidth,c.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(n,e,t,i,a){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}initialize(n,e,t){t!==void 0&&t!==zi&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},IE=class extends za{constructor(n,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=n,this.input=e}setInput(n){this.input=n}render(n,e,t,i,a){const r=this.fullscreenMaterial.uniforms;e!==null&&r!==void 0&&r[this.input]!==void 0&&(r[this.input].value=e.texture),n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}initialize(n,e,t){t!==void 0&&t!==zi&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},oA=class extends za{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new Y8,this.overrideMaterialManager=t===null?null:new ZD(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new ZD(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,i,a){const r=this.scene,s=this.camera,o=this.selection,c=s.layers.mask,h=r.background,f=n.shadowMap.autoUpdate,d=this.renderToScreen?null:e;o!==null&&s.layers.set(o.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(r.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(d),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,r,s):n.render(r,s),s.layers.mask=c,r.background=h,n.shadowMap.autoUpdate=f}},qa={LINEAR:0,REINHARD:1,REINHARD2:2,REINHARD2_ADAPTIVE:3,OPTIMIZED_CINEON:5,CINEON:5,ACES_FILMIC:6,AGX:7,NEUTRAL:8},Y$=`#include #ifdef GL_FRAGMENT_PRECISION_HIGH uniform highp sampler2D depthBuffer; #else @@ -5128,7 +5128,7 @@ vec3 n[4];n[0]=texture2D(normalBuffer,vUv0).rgb;n[1]=texture2D(normalBuffer,vUv1 #else vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0); #endif -gl_FragColor=vec4(n[index],d[index]);}`,Y$="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",q$=class extends Fi{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new J(null),normalBuffer:new J(null),texelSize:new J(new de)},blending:Sa,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:X$,vertexShader:Y$})}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Sc){this.depthBuffer=n,this.depthPacking=e}set normalBuffer(n){this.uniforms.normalBuffer.value=n,n!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(n){this.normalBuffer=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},j$=class extends Pa{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=as.AUTO_SIZE,height:i=as.AUTO_SIZE,resolutionX:a=t,resolutionY:r=i}={}){super("DepthDownsamplingPass");const s=new q$;s.normalBuffer=n,this.fullscreenMaterial=s,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new _i(1,1,{minFilter:Fn,magFilter:Fn,depthBuffer:!1,type:ri}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const o=this.resolution=new as(this,a,r,e);o.addEventListener("change",c=>this.setSize(o.baseWidth,o.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=Sc){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,i,a){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const i=n.getContext();if(!(i.getExtension("EXT_color_buffer_float")||i.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},Z$=`#include +gl_FragColor=vec4(n[index],d[index]);}`,q$="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",j$=class extends Vi{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new J(null),normalBuffer:new J(null),texelSize:new J(new de)},blending:Ta,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Y$,vertexShader:q$})}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Mc){this.depthBuffer=n,this.depthPacking=e}set normalBuffer(n){this.uniforms.normalBuffer.value=n,n!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(n){this.normalBuffer=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},Z$=class extends za{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=rs.AUTO_SIZE,height:i=rs.AUTO_SIZE,resolutionX:a=t,resolutionY:r=i}={}){super("DepthDownsamplingPass");const s=new j$;s.normalBuffer=n,this.fullscreenMaterial=s,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new xi(1,1,{minFilter:Fn,magFilter:Fn,depthBuffer:!1,type:si}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const o=this.resolution=new rs(this,a,r,e);o.addEventListener("change",c=>this.setSize(o.baseWidth,o.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=Mc){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,i,a){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const i=n.getContext();if(!(i.getExtension("EXT_color_buffer_float")||i.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},K$=`#include #define packFloatToRGBA(v) packDepthToRGBA(v) #define unpackRGBAToFloat(v) unpackRGBAToDepth(v) uniform lowp sampler2D luminanceBuffer0;uniform lowp sampler2D luminanceBuffer1;uniform float minLuminance;uniform float deltaTime;uniform float tau;varying vec2 vUv;void main(){float l0=unpackRGBAToFloat(texture2D(luminanceBuffer0,vUv)); @@ -5137,7 +5137,7 @@ float l1=texture2DLodEXT(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r; #else float l1=textureLod(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r; #endif -l0=max(minLuminance,l0);l1=max(minLuminance,l1);float adaptedLum=l0+(l1-l0)*(1.0-exp(-deltaTime*tau));gl_FragColor=(adaptedLum==1.0)?vec4(1.0):packFloatToRGBA(adaptedLum);}`,K$=class extends Fi{constructor(){super({name:"AdaptiveLuminanceMaterial",defines:{MIP_LEVEL_1X1:"0.0"},uniforms:{luminanceBuffer0:new J(null),luminanceBuffer1:new J(null),minLuminance:new J(.01),deltaTime:new J(0),tau:new J(1)},extensions:{shaderTextureLOD:!0},blending:Sa,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Z$,vertexShader:iA})}set luminanceBuffer0(n){this.uniforms.luminanceBuffer0.value=n}setLuminanceBuffer0(n){this.uniforms.luminanceBuffer0.value=n}set luminanceBuffer1(n){this.uniforms.luminanceBuffer1.value=n}setLuminanceBuffer1(n){this.uniforms.luminanceBuffer1.value=n}set mipLevel1x1(n){this.defines.MIP_LEVEL_1X1=n.toFixed(1),this.needsUpdate=!0}setMipLevel1x1(n){this.mipLevel1x1=n}set deltaTime(n){this.uniforms.deltaTime.value=n}setDeltaTime(n){this.uniforms.deltaTime.value=n}get minLuminance(){return this.uniforms.minLuminance.value}set minLuminance(n){this.uniforms.minLuminance.value=n}getMinLuminance(){return this.uniforms.minLuminance.value}setMinLuminance(n){this.uniforms.minLuminance.value=n}get adaptationRate(){return this.uniforms.tau.value}set adaptationRate(n){this.uniforms.tau.value=n}getAdaptationRate(){return this.uniforms.tau.value}setAdaptationRate(n){this.uniforms.tau.value=n}},Q$=class extends Pa{constructor(n,{minLuminance:e=.01,adaptationRate:t=1}={}){super("AdaptiveLuminancePass"),this.fullscreenMaterial=new K$,this.needsSwap=!1,this.renderTargetPrevious=new _i(1,1,{minFilter:Fn,magFilter:Fn,depthBuffer:!1}),this.renderTargetPrevious.texture.name="Luminance.Previous";const i=this.fullscreenMaterial;i.luminanceBuffer0=this.renderTargetPrevious.texture,i.luminanceBuffer1=n,i.minLuminance=e,i.adaptationRate=t,this.renderTargetAdapted=this.renderTargetPrevious.clone(),this.renderTargetAdapted.texture.name="Luminance.Adapted",this.copyPass=new k8(this.renderTargetPrevious,!1)}get texture(){return this.renderTargetAdapted.texture}getTexture(){return this.renderTargetAdapted.texture}set mipLevel1x1(n){this.fullscreenMaterial.mipLevel1x1=n}get adaptationRate(){return this.fullscreenMaterial.adaptationRate}set adaptationRate(n){this.fullscreenMaterial.adaptationRate=n}render(n,e,t,i,a){this.fullscreenMaterial.deltaTime=i,n.setRenderTarget(this.renderToScreen?null:this.renderTargetAdapted),n.render(this.scene,this.camera),this.copyPass.render(n,this.renderTargetAdapted)}},J$=`#include +l0=max(minLuminance,l0);l1=max(minLuminance,l1);float adaptedLum=l0+(l1-l0)*(1.0-exp(-deltaTime*tau));gl_FragColor=(adaptedLum==1.0)?vec4(1.0):packFloatToRGBA(adaptedLum);}`,Q$=class extends Vi{constructor(){super({name:"AdaptiveLuminanceMaterial",defines:{MIP_LEVEL_1X1:"0.0"},uniforms:{luminanceBuffer0:new J(null),luminanceBuffer1:new J(null),minLuminance:new J(.01),deltaTime:new J(0),tau:new J(1)},extensions:{shaderTextureLOD:!0},blending:Ta,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:K$,vertexShader:sA})}set luminanceBuffer0(n){this.uniforms.luminanceBuffer0.value=n}setLuminanceBuffer0(n){this.uniforms.luminanceBuffer0.value=n}set luminanceBuffer1(n){this.uniforms.luminanceBuffer1.value=n}setLuminanceBuffer1(n){this.uniforms.luminanceBuffer1.value=n}set mipLevel1x1(n){this.defines.MIP_LEVEL_1X1=n.toFixed(1),this.needsUpdate=!0}setMipLevel1x1(n){this.mipLevel1x1=n}set deltaTime(n){this.uniforms.deltaTime.value=n}setDeltaTime(n){this.uniforms.deltaTime.value=n}get minLuminance(){return this.uniforms.minLuminance.value}set minLuminance(n){this.uniforms.minLuminance.value=n}getMinLuminance(){return this.uniforms.minLuminance.value}setMinLuminance(n){this.uniforms.minLuminance.value=n}get adaptationRate(){return this.uniforms.tau.value}set adaptationRate(n){this.uniforms.tau.value=n}getAdaptationRate(){return this.uniforms.tau.value}setAdaptationRate(n){this.uniforms.tau.value=n}},J$=class extends za{constructor(n,{minLuminance:e=.01,adaptationRate:t=1}={}){super("AdaptiveLuminancePass"),this.fullscreenMaterial=new Q$,this.needsSwap=!1,this.renderTargetPrevious=new xi(1,1,{minFilter:Fn,magFilter:Fn,depthBuffer:!1}),this.renderTargetPrevious.texture.name="Luminance.Previous";const i=this.fullscreenMaterial;i.luminanceBuffer0=this.renderTargetPrevious.texture,i.luminanceBuffer1=n,i.minLuminance=e,i.adaptationRate=t,this.renderTargetAdapted=this.renderTargetPrevious.clone(),this.renderTargetAdapted.texture.name="Luminance.Adapted",this.copyPass=new X8(this.renderTargetPrevious,!1)}get texture(){return this.renderTargetAdapted.texture}getTexture(){return this.renderTargetAdapted.texture}set mipLevel1x1(n){this.fullscreenMaterial.mipLevel1x1=n}get adaptationRate(){return this.fullscreenMaterial.adaptationRate}set adaptationRate(n){this.fullscreenMaterial.adaptationRate=n}render(n,e,t,i,a){this.fullscreenMaterial.deltaTime=i,n.setRenderTarget(this.renderToScreen?null:this.renderTargetAdapted),n.render(this.scene,this.camera),this.copyPass.render(n,this.renderTargetAdapted)}},$$=`#include uniform float whitePoint; #if TONE_MAPPING_MODE == 2 || TONE_MAPPING_MODE == 3 uniform float middleGrey; @@ -5170,7 +5170,7 @@ outputColor=vec4(Uncharted2ToneMapping(inputColor.rgb),inputColor.a); #else outputColor=vec4(toneMapping(inputColor.rgb),inputColor.a); #endif -}`,$$=class extends m0{constructor({blendFunction:n=ln.SRC,adaptive:e=!1,mode:t=e?Ya.REINHARD2_ADAPTIVE:Ya.AGX,resolution:i=256,maxLuminance:a=4,whitePoint:r=a,middleGrey:s=.6,minLuminance:o=.01,averageLuminance:c=1,adaptationRate:h=1}={}){super("ToneMappingEffect",J$,{blendFunction:n,uniforms:new Map([["luminanceBuffer",new J(null)],["maxLuminance",new J(a)],["whitePoint",new J(r)],["middleGrey",new J(s)],["averageLuminance",new J(c)]])}),this.renderTargetLuminance=new _i(1,1,{minFilter:Er,depthBuffer:!1}),this.renderTargetLuminance.texture.generateMipmaps=!0,this.renderTargetLuminance.texture.name="Luminance",this.luminancePass=new W$({renderTarget:this.renderTargetLuminance}),this.adaptiveLuminancePass=new Q$(this.luminancePass.texture,{minLuminance:o,adaptationRate:h}),this.uniforms.get("luminanceBuffer").value=this.adaptiveLuminancePass.texture,this.resolution=i,this.mode=t}get mode(){return Number(this.defines.get("TONE_MAPPING_MODE"))}set mode(n){if(this.mode===n)return;const t=ws.replace(/\D+/g,"")>=168?"CineonToneMapping(texel)":"OptimizedCineonToneMapping(texel)";switch(this.defines.clear(),this.defines.set("TONE_MAPPING_MODE",n.toFixed(0)),n){case Ya.LINEAR:this.defines.set("toneMapping(texel)","LinearToneMapping(texel)");break;case Ya.REINHARD:this.defines.set("toneMapping(texel)","ReinhardToneMapping(texel)");break;case Ya.CINEON:case Ya.OPTIMIZED_CINEON:this.defines.set("toneMapping(texel)",t);break;case Ya.ACES_FILMIC:this.defines.set("toneMapping(texel)","ACESFilmicToneMapping(texel)");break;case Ya.AGX:this.defines.set("toneMapping(texel)","AgXToneMapping(texel)");break;case Ya.NEUTRAL:this.defines.set("toneMapping(texel)","NeutralToneMapping(texel)");break;default:this.defines.set("toneMapping(texel)","texel");break}this.adaptiveLuminancePass.enabled=n===Ya.REINHARD2_ADAPTIVE,this.setChanged()}getMode(){return this.mode}setMode(n){this.mode=n}get whitePoint(){return this.uniforms.get("whitePoint").value}set whitePoint(n){this.uniforms.get("whitePoint").value=n}get middleGrey(){return this.uniforms.get("middleGrey").value}set middleGrey(n){this.uniforms.get("middleGrey").value=n}get averageLuminance(){return this.uniforms.get("averageLuminance").value}set averageLuminance(n){this.uniforms.get("averageLuminance").value=n}get adaptiveLuminanceMaterial(){return this.adaptiveLuminancePass.fullscreenMaterial}getAdaptiveLuminanceMaterial(){return this.adaptiveLuminanceMaterial}get resolution(){return this.luminancePass.resolution.width}set resolution(n){const e=Math.max(0,Math.ceil(Math.log2(n))),t=Math.pow(2,e);this.luminancePass.resolution.setPreferredSize(t,t),this.adaptiveLuminanceMaterial.mipLevel1x1=e}getResolution(){return this.resolution}setResolution(n){this.resolution=n}get adaptive(){return this.mode===Ya.REINHARD2_ADAPTIVE}set adaptive(n){this.mode=n?Ya.REINHARD2_ADAPTIVE:Ya.REINHARD2}get adaptationRate(){return this.adaptiveLuminanceMaterial.adaptationRate}set adaptationRate(n){this.adaptiveLuminanceMaterial.adaptationRate=n}get distinction(){return console.warn(this.name,"distinction was removed."),1}set distinction(n){console.warn(this.name,"distinction was removed.")}update(n,e,t){this.adaptiveLuminancePass.enabled&&(this.luminancePass.render(n,e),this.adaptiveLuminancePass.render(n,null,null,t))}initialize(n,e,t){this.adaptiveLuminancePass.initialize(n,e,t)}},eee=`#include +}`,eee=class extends v0{constructor({blendFunction:n=ln.SRC,adaptive:e=!1,mode:t=e?qa.REINHARD2_ADAPTIVE:qa.AGX,resolution:i=256,maxLuminance:a=4,whitePoint:r=a,middleGrey:s=.6,minLuminance:o=.01,averageLuminance:c=1,adaptationRate:h=1}={}){super("ToneMappingEffect",$$,{blendFunction:n,uniforms:new Map([["luminanceBuffer",new J(null)],["maxLuminance",new J(a)],["whitePoint",new J(r)],["middleGrey",new J(s)],["averageLuminance",new J(c)]])}),this.renderTargetLuminance=new xi(1,1,{minFilter:Mr,depthBuffer:!1}),this.renderTargetLuminance.texture.generateMipmaps=!0,this.renderTargetLuminance.texture.name="Luminance",this.luminancePass=new X$({renderTarget:this.renderTargetLuminance}),this.adaptiveLuminancePass=new J$(this.luminancePass.texture,{minLuminance:o,adaptationRate:h}),this.uniforms.get("luminanceBuffer").value=this.adaptiveLuminancePass.texture,this.resolution=i,this.mode=t}get mode(){return Number(this.defines.get("TONE_MAPPING_MODE"))}set mode(n){if(this.mode===n)return;const t=Cs.replace(/\D+/g,"")>=168?"CineonToneMapping(texel)":"OptimizedCineonToneMapping(texel)";switch(this.defines.clear(),this.defines.set("TONE_MAPPING_MODE",n.toFixed(0)),n){case qa.LINEAR:this.defines.set("toneMapping(texel)","LinearToneMapping(texel)");break;case qa.REINHARD:this.defines.set("toneMapping(texel)","ReinhardToneMapping(texel)");break;case qa.CINEON:case qa.OPTIMIZED_CINEON:this.defines.set("toneMapping(texel)",t);break;case qa.ACES_FILMIC:this.defines.set("toneMapping(texel)","ACESFilmicToneMapping(texel)");break;case qa.AGX:this.defines.set("toneMapping(texel)","AgXToneMapping(texel)");break;case qa.NEUTRAL:this.defines.set("toneMapping(texel)","NeutralToneMapping(texel)");break;default:this.defines.set("toneMapping(texel)","texel");break}this.adaptiveLuminancePass.enabled=n===qa.REINHARD2_ADAPTIVE,this.setChanged()}getMode(){return this.mode}setMode(n){this.mode=n}get whitePoint(){return this.uniforms.get("whitePoint").value}set whitePoint(n){this.uniforms.get("whitePoint").value=n}get middleGrey(){return this.uniforms.get("middleGrey").value}set middleGrey(n){this.uniforms.get("middleGrey").value=n}get averageLuminance(){return this.uniforms.get("averageLuminance").value}set averageLuminance(n){this.uniforms.get("averageLuminance").value=n}get adaptiveLuminanceMaterial(){return this.adaptiveLuminancePass.fullscreenMaterial}getAdaptiveLuminanceMaterial(){return this.adaptiveLuminanceMaterial}get resolution(){return this.luminancePass.resolution.width}set resolution(n){const e=Math.max(0,Math.ceil(Math.log2(n))),t=Math.pow(2,e);this.luminancePass.resolution.setPreferredSize(t,t),this.adaptiveLuminanceMaterial.mipLevel1x1=e}getResolution(){return this.resolution}setResolution(n){this.resolution=n}get adaptive(){return this.mode===qa.REINHARD2_ADAPTIVE}set adaptive(n){this.mode=n?qa.REINHARD2_ADAPTIVE:qa.REINHARD2}get adaptationRate(){return this.adaptiveLuminanceMaterial.adaptationRate}set adaptationRate(n){this.adaptiveLuminanceMaterial.adaptationRate=n}get distinction(){return console.warn(this.name,"distinction was removed."),1}set distinction(n){console.warn(this.name,"distinction was removed.")}update(n,e,t){this.adaptiveLuminancePass.enabled&&(this.luminancePass.render(n,e),this.adaptiveLuminancePass.render(n,null,null,t))}initialize(n,e,t){this.adaptiveLuminancePass.initialize(n,e,t)}},tee=`#include #include #include #define packFloatToRGBA(v) packDepthToRGBA(v) @@ -5209,30 +5209,30 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar); #include #endif #include -}`,tee="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",nee=class extends Fi{constructor(n,e,t,i,a=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:ws.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new J(null),depthBuffer:new J(null),resolution:new J(new de),texelSize:new J(new de),cameraNear:new J(.3),cameraFar:new J(1e3),aspect:new J(1),time:new J(0)},blending:Sa,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:a}),n&&this.setShaderParts(n),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(i)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Sc){this.depthBuffer=n,this.depthPacking=e}setShaderData(n){this.setShaderParts(n.shaderParts),this.setDefines(n.defines),this.setUniforms(n.uniforms),this.setExtensions(n.extensions)}setShaderParts(n){return this.fragmentShader=eee.replace(_n.FRAGMENT_HEAD,n.get(_n.FRAGMENT_HEAD)||"").replace(_n.FRAGMENT_MAIN_UV,n.get(_n.FRAGMENT_MAIN_UV)||"").replace(_n.FRAGMENT_MAIN_IMAGE,n.get(_n.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=tee.replace(_n.VERTEX_HEAD,n.get(_n.VERTEX_HEAD)||"").replace(_n.VERTEX_MAIN_SUPPORT,n.get(_n.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(n){for(const e of n.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(n){for(const e of n.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(n){this.extensions={};for(const e of n)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(n){this.encodeOutput!==n&&(n?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(n){return this.encodeOutput}setOutputEncodingEnabled(n){this.encodeOutput=n}get time(){return this.uniforms.time.value}set time(n){this.uniforms.time.value=n}setDeltaTime(n){this.uniforms.time.value+=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof ui?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(n,e){const t=this.uniforms;t.resolution.value.set(n,e),t.texelSize.value.set(1/n,1/e),t.aspect.value=n/e}static get Section(){return _n}};function qD(n,e,t){for(const i of e){const a="$1"+n+i.charAt(0).toUpperCase()+i.slice(1),r=new RegExp("([^\\.])(\\b"+i+"\\b)","g");for(const s of t.entries())s[1]!==null&&t.set(s[0],s[1].replace(r,a))}}function iee(n,e,t){let i=e.getFragmentShader(),a=e.getVertexShader();const r=i!==void 0&&/mainImage/.test(i),s=i!==void 0&&/mainUv/.test(i);if(t.attributes|=e.getAttributes(),i===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(s&&t.attributes&Jo.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!r&&!s)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const o=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,c=t.shaderParts;let h=c.get(_n.FRAGMENT_HEAD)||"",f=c.get(_n.FRAGMENT_MAIN_UV)||"",d=c.get(_n.FRAGMENT_MAIN_IMAGE)||"",m=c.get(_n.VERTEX_HEAD)||"",g=c.get(_n.VERTEX_MAIN_SUPPORT)||"";const x=new Set,T=new Set;if(s&&(f+=` ${n}MainUv(UV); -`,t.uvTransformation=!0),a!==null&&/mainSupport/.test(a)){const y=/mainSupport *\([\w\s]*?uv\s*?\)/.test(a);g+=` ${n}MainSupport(`,g+=y?`vUv); +}`,nee="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",iee=class extends Vi{constructor(n,e,t,i,a=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:Cs.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new J(null),depthBuffer:new J(null),resolution:new J(new de),texelSize:new J(new de),cameraNear:new J(.3),cameraFar:new J(1e3),aspect:new J(1),time:new J(0)},blending:Ta,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:a}),n&&this.setShaderParts(n),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(i)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Mc){this.depthBuffer=n,this.depthPacking=e}setShaderData(n){this.setShaderParts(n.shaderParts),this.setDefines(n.defines),this.setUniforms(n.uniforms),this.setExtensions(n.extensions)}setShaderParts(n){return this.fragmentShader=tee.replace(_n.FRAGMENT_HEAD,n.get(_n.FRAGMENT_HEAD)||"").replace(_n.FRAGMENT_MAIN_UV,n.get(_n.FRAGMENT_MAIN_UV)||"").replace(_n.FRAGMENT_MAIN_IMAGE,n.get(_n.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=nee.replace(_n.VERTEX_HEAD,n.get(_n.VERTEX_HEAD)||"").replace(_n.VERTEX_MAIN_SUPPORT,n.get(_n.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(n){for(const e of n.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(n){for(const e of n.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(n){this.extensions={};for(const e of n)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(n){this.encodeOutput!==n&&(n?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(n){return this.encodeOutput}setOutputEncodingEnabled(n){this.encodeOutput=n}get time(){return this.uniforms.time.value}set time(n){this.uniforms.time.value=n}setDeltaTime(n){this.uniforms.time.value+=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof hi?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(n,e){const t=this.uniforms;t.resolution.value.set(n,e),t.texelSize.value.set(1/n,1/e),t.aspect.value=n/e}static get Section(){return _n}};function KD(n,e,t){for(const i of e){const a="$1"+n+i.charAt(0).toUpperCase()+i.slice(1),r=new RegExp("([^\\.])(\\b"+i+"\\b)","g");for(const s of t.entries())s[1]!==null&&t.set(s[0],s[1].replace(r,a))}}function aee(n,e,t){let i=e.getFragmentShader(),a=e.getVertexShader();const r=i!==void 0&&/mainImage/.test(i),s=i!==void 0&&/mainUv/.test(i);if(t.attributes|=e.getAttributes(),i===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(s&&t.attributes&$o.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!r&&!s)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const o=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,c=t.shaderParts;let h=c.get(_n.FRAGMENT_HEAD)||"",f=c.get(_n.FRAGMENT_MAIN_UV)||"",d=c.get(_n.FRAGMENT_MAIN_IMAGE)||"",m=c.get(_n.VERTEX_HEAD)||"",g=c.get(_n.VERTEX_MAIN_SUPPORT)||"";const x=new Set,T=new Set;if(s&&(f+=` ${n}MainUv(UV); +`,t.uvTransformation=!0),a!==null&&/mainSupport/.test(a)){const S=/mainSupport *\([\w\s]*?uv\s*?\)/.test(a);g+=` ${n}MainSupport(`,g+=S?`vUv); `:`); -`;for(const E of a.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const b of E[1].split(/\s*,\s*/))t.varyings.add(b),x.add(b),T.add(b);for(const E of a.matchAll(o))T.add(E[1])}for(const y of i.matchAll(o))T.add(y[1]);for(const y of e.defines.keys())T.add(y.replace(/\([\w\s,]*\)/g,""));for(const y of e.uniforms.keys())T.add(y);T.delete("while"),T.delete("for"),T.delete("if"),e.uniforms.forEach((y,E)=>t.uniforms.set(n+E.charAt(0).toUpperCase()+E.slice(1),y)),e.defines.forEach((y,E)=>t.defines.set(n+E.charAt(0).toUpperCase()+E.slice(1),y));const S=new Map([["fragment",i],["vertex",a]]);qD(n,T,t.defines),qD(n,T,S),i=S.get("fragment"),a=S.get("vertex");const v=e.blendMode;if(t.blendModes.set(v.blendFunction,v),r){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(d+=e.inputColorSpace===En?`color0 = sRGBTransferOETF(color0); +`;for(const E of a.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const b of E[1].split(/\s*,\s*/))t.varyings.add(b),x.add(b),T.add(b);for(const E of a.matchAll(o))T.add(E[1])}for(const S of i.matchAll(o))T.add(S[1]);for(const S of e.defines.keys())T.add(S.replace(/\([\w\s,]*\)/g,""));for(const S of e.uniforms.keys())T.add(S);T.delete("while"),T.delete("for"),T.delete("if"),e.uniforms.forEach((S,E)=>t.uniforms.set(n+E.charAt(0).toUpperCase()+E.slice(1),S)),e.defines.forEach((S,E)=>t.defines.set(n+E.charAt(0).toUpperCase()+E.slice(1),S));const y=new Map([["fragment",i],["vertex",a]]);KD(n,T,t.defines),KD(n,T,y),i=y.get("fragment"),a=y.get("vertex");const v=e.blendMode;if(t.blendModes.set(v.blendFunction,v),r){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(d+=e.inputColorSpace===En?`color0 = sRGBTransferOETF(color0); `:`color0 = sRGBToLinear(color0); - `),e.outputColorSpace!==Na?t.colorSpace=e.outputColorSpace:e.inputColorSpace!==null&&(t.colorSpace=e.inputColorSpace);const y=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;d+=`${n}MainImage(color0, UV, `,t.attributes&Jo.DEPTH&&y.test(i)&&(d+="depth, ",t.readDepth=!0),d+=`color1); + `),e.outputColorSpace!==Da?t.colorSpace=e.outputColorSpace:e.inputColorSpace!==null&&(t.colorSpace=e.inputColorSpace);const S=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;d+=`${n}MainImage(color0, UV, `,t.attributes&$o.DEPTH&&S.test(i)&&(d+="depth, ",t.readDepth=!0),d+=`color1); `;const E=n+"BlendOpacity";t.uniforms.set(E,v.opacity),d+=`color0 = blend${v.blendFunction}(color0, color1, ${E}); `,h+=`uniform float ${E}; `}if(h+=i+` `,a!==null&&(m+=a+` -`),c.set(_n.FRAGMENT_HEAD,h),c.set(_n.FRAGMENT_MAIN_UV,f),c.set(_n.FRAGMENT_MAIN_IMAGE,d),c.set(_n.VERTEX_HEAD,m),c.set(_n.VERTEX_MAIN_SUPPORT,g),e.extensions!==null)for(const y of e.extensions)t.extensions.add(y)}}var aee=class extends Pa{constructor(n,...e){super("EffectPass"),this.fullscreenMaterial=new nee(null,null,null,n),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(n){for(const e of this.effects)e.mainScene=n}set mainCamera(n){this.fullscreenMaterial.copyCameraSettings(n);for(const e of this.effects)e.mainCamera=n}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(n){this.fullscreenMaterial.encodeOutput=n}get dithering(){return this.fullscreenMaterial.dithering}set dithering(n){const e=this.fullscreenMaterial;e.dithering=n,e.needsUpdate=!0}setEffects(n){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=n.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const n=new l$;let e=0;for(const s of this.effects)if(s.blendMode.blendFunction===ln.DST)n.attributes|=s.getAttributes()&Jo.DEPTH;else{if(n.attributes&s.getAttributes()&Jo.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${s.name})`);iee("e"+e++,s,n)}let t=n.shaderParts.get(_n.FRAGMENT_HEAD),i=n.shaderParts.get(_n.FRAGMENT_MAIN_IMAGE),a=n.shaderParts.get(_n.FRAGMENT_MAIN_UV);const r=/\bblend\b/g;for(const s of n.blendModes.values())t+=s.getShaderCode().replace(r,`blend${s.blendFunction}`)+` -`;n.attributes&Jo.DEPTH?(n.readDepth&&(i=`float depth = readDepth(UV); +`),c.set(_n.FRAGMENT_HEAD,h),c.set(_n.FRAGMENT_MAIN_UV,f),c.set(_n.FRAGMENT_MAIN_IMAGE,d),c.set(_n.VERTEX_HEAD,m),c.set(_n.VERTEX_MAIN_SUPPORT,g),e.extensions!==null)for(const S of e.extensions)t.extensions.add(S)}}var ree=class extends za{constructor(n,...e){super("EffectPass"),this.fullscreenMaterial=new iee(null,null,null,n),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(n){for(const e of this.effects)e.mainScene=n}set mainCamera(n){this.fullscreenMaterial.copyCameraSettings(n);for(const e of this.effects)e.mainCamera=n}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(n){this.fullscreenMaterial.encodeOutput=n}get dithering(){return this.fullscreenMaterial.dithering}set dithering(n){const e=this.fullscreenMaterial;e.dithering=n,e.needsUpdate=!0}setEffects(n){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=n.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const n=new c$;let e=0;for(const s of this.effects)if(s.blendMode.blendFunction===ln.DST)n.attributes|=s.getAttributes()&$o.DEPTH;else{if(n.attributes&s.getAttributes()&$o.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${s.name})`);aee("e"+e++,s,n)}let t=n.shaderParts.get(_n.FRAGMENT_HEAD),i=n.shaderParts.get(_n.FRAGMENT_MAIN_IMAGE),a=n.shaderParts.get(_n.FRAGMENT_MAIN_UV);const r=/\bblend\b/g;for(const s of n.blendModes.values())t+=s.getShaderCode().replace(r,`blend${s.blendFunction}`)+` +`;n.attributes&$o.DEPTH?(n.readDepth&&(i=`float depth = readDepth(UV); `+i),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,n.colorSpace===En&&(i+=`color0 = sRGBToLinear(color0); `),n.uvTransformation?(a=`vec2 transformedUv = vUv; `+a,n.defines.set("UV","transformedUv")):n.defines.set("UV","vUv"),n.shaderParts.set(_n.FRAGMENT_HEAD,t),n.shaderParts.set(_n.FRAGMENT_MAIN_IMAGE,i),n.shaderParts.set(_n.FRAGMENT_MAIN_UV,a);for(const[s,o]of n.shaderParts)o!==null&&n.shaderParts.set(s,o.trim().replace(/^#/,` -#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,e=Sc){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(n,e)}render(n,e,t,i,a){for(const r of this.effects)r.update(n,e,i);if(!this.skipRendering||this.renderToScreen){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,r.time+=i*this.timeScale,n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}}setSize(n,e){this.fullscreenMaterial.setSize(n,e);for(const t of this.effects)t.setSize(n,e)}initialize(n,e,t){this.renderer=n;for(const i of this.effects)i.initialize(n,e,t);this.updateMaterial(),t!==void 0&&t!==Ii&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},ree=class extends Pa{constructor(n,e,{renderTarget:t,resolutionScale:i=1,width:a=as.AUTO_SIZE,height:r=as.AUTO_SIZE,resolutionX:s=a,resolutionY:o=r}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new aA(n,e,new Lb);const c=this.renderPass;c.ignoreBackground=!0,c.skipShadowMapUpdate=!0;const h=c.getClearPass();h.overrideClearColor=new je(7829503),h.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new _i(1,1,{minFilter:Fn,magFilter:Fn}),this.renderTarget.texture.name="NormalPass.Target");const f=this.resolution=new as(this,s,o,i);f.addEventListener("change",d=>this.setSize(f.baseWidth,f.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,a){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}};function Bm(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}new de;new de;function X8(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var Wr=function n(e,t,i){var a=this;X8(this,n),Bm(this,"dot2",function(r,s){return a.x*r+a.y*s}),Bm(this,"dot3",function(r,s,o){return a.x*r+a.y*s+a.z*o}),this.x=e,this.y=t,this.z=i},see=[new Wr(1,1,0),new Wr(-1,1,0),new Wr(1,-1,0),new Wr(-1,-1,0),new Wr(1,0,1),new Wr(-1,0,1),new Wr(1,0,-1),new Wr(-1,0,-1),new Wr(0,1,1),new Wr(0,-1,1),new Wr(0,1,-1),new Wr(0,-1,-1)],jD=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],ZD=new Array(512),KD=new Array(512),oee=function(e){e>0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var i;t&1?i=jD[t]^e&255:i=jD[t]^e>>8&255,ZD[t]=ZD[t+256]=i,KD[t]=KD[t+256]=see[i%12]}};oee(0);function lee(n){if(typeof n=="number")n=Math.abs(n);else if(typeof n=="string"){var e=n;n=0;for(var t=0;t(n.getAttributes()&2)===2,uee=be.memo(be.forwardRef(({children:n,camera:e,scene:t,resolutionScale:i,enabled:a=!0,renderPriority:r=1,autoClear:s=!0,depthBuffer:o,enableNormalPass:c,stencilBuffer:h,multisampling:f=8,frameBufferType:d=Xn},m)=>{const{gl:g,scene:x,camera:T,size:S}=Qi(),v=t||x,y=e||T,[E,b,D]=be.useMemo(()=>{const P=new o$(g,{depthBuffer:o,stencilBuffer:h,multisampling:f,frameBufferType:d});P.addPass(new aA(v,y));let O=null,R=null;return c&&(R=new ree(v,y),R.enabled=!1,P.addPass(R),i!==void 0&&(O=new j$({normalBuffer:R.texture,resolutionScale:i}),O.enabled=!1,P.addPass(O))),[P,R,O]},[y,g,o,h,f,d,v,c,i]);be.useEffect(()=>E==null?void 0:E.setSize(S.width,S.height),[E,S]),Ac((P,O)=>{if(a){const R=g.autoClear;g.autoClear=s,h&&!s&&g.clearStencil(),E.render(O),g.autoClear=R}},a?r:0);const C=be.useRef(null);be.useLayoutEffect(()=>{var R;const P=[],O=C.current.__r3f;if(O&&E){const B=O.children;for(let j=0;j{for(const B of P)E==null||E.removePass(B);b&&(b.enabled=!1),D&&(D.enabled=!1)}},[E,n,y,b,D]),be.useEffect(()=>{const P=g.toneMapping;return g.toneMapping=ns,()=>{g.toneMapping=P}},[g]);const I=be.useMemo(()=>({composer:E,normalPass:b,downSamplingPass:D,resolutionScale:i,camera:y,scene:v}),[E,b,D,i,y,v]);return be.useImperativeHandle(m,()=>E,[E]),Nt.jsx(rA.Provider,{value:I,children:Nt.jsx("group",{ref:C,children:n})})}));let hee=0;const $D=new WeakMap,fee=(n,e)=>function({blendFunction:t=e==null?void 0:e.blendFunction,opacity:i=e==null?void 0:e.opacity,...a}){let r=$D.get(n);if(!r){const c=`@react-three/postprocessing/${n.name}-${hee++}`;l8({[c]:n}),$D.set(n,r=c)}const s=Qi(c=>c.camera),o=hM.useMemo(()=>[...(e==null?void 0:e.args)??[],...a.args??[{...e,...a}]],[JSON.stringify(a)]);return Nt.jsx(r,{camera:s,"blendMode-blendFunction":t,"blendMode-opacity-value":i,...a,args:o})},dee=fee($$);var pee="Invariant failed";function qx(n,e){if(!n)throw new Error(pee)}const mee=new L;function Y8(n,e,t=new L,i){const{x:a,y:r,z:s}=n,o=e.x,c=e.y,h=e.z,f=a*a*o,d=r*r*c,m=s*s*h,g=f+d+m,x=Math.sqrt(1/g);if(!Number.isFinite(x))return;const T=mee.copy(n).multiplyScalar(x);if(g<((i==null?void 0:i.centerTolerance)??.1))return t.copy(T);const S=T.multiply(e).multiplyScalar(2);let v=(1-x)*n.length()/(S.length()/2),y=0,E,b,D,C;do{v-=y,E=1/(1+v*o),b=1/(1+v*c),D=1/(1+v*h);const I=E*E,P=b*b,O=D*D,R=I*E,B=P*b,j=O*D;C=f*I+d*P+m*O-1,y=C/((f*R*o+d*B*c+m*j*h)*-2)}while(Math.abs(C)>1e-12);return t.set(a*E,r*b,s*D)}const vf=new L,k2=new L,W2=new L,OE=class{constructor(e,t,i){this.radii=new L(e,t,i)}get minimumRadius(){return Math.min(this.radii.x,this.radii.y,this.radii.z)}get maximumRadius(){return Math.max(this.radii.x,this.radii.y,this.radii.z)}get flattening(){return 1-this.minimumRadius/this.maximumRadius}get eccentricity(){return Math.sqrt(this.eccentricitySquared)}get eccentricitySquared(){const e=this.maximumRadius**2,t=this.minimumRadius**2;return(e-t)/e}reciprocalRadii(e=new L){const{x:t,y:i,z:a}=this.radii;return e.set(1/t,1/i,1/a)}reciprocalRadiiSquared(e=new L){const{x:t,y:i,z:a}=this.radii;return e.set(1/t**2,1/i**2,1/a**2)}projectOnSurface(e,t=new L,i){return Y8(e,this.reciprocalRadiiSquared(),t,i)}getSurfaceNormal(e,t=new L){return t.multiplyVectors(this.reciprocalRadiiSquared(vf),e).normalize()}getEastNorthUpVectors(e,t=new L,i=new L,a=new L){this.getSurfaceNormal(e,a),t.set(-e.y,e.x,0).normalize(),i.crossVectors(a,t).normalize()}getEastNorthUpFrame(e,t=new ke){const i=vf,a=k2,r=W2;return this.getEastNorthUpVectors(e,i,a,r),t.makeBasis(i,a,r).setPosition(e)}getNorthUpEastFrame(e,t=new ke){const i=vf,a=k2,r=W2;return this.getEastNorthUpVectors(e,i,a,r),t.makeBasis(a,r,i).setPosition(e)}getIntersection(e,t=new L){const i=this.reciprocalRadii(vf),a=k2.copy(i).multiply(e.origin),r=W2.copy(i).multiply(e.direction),s=a.lengthSq(),o=r.lengthSq(),c=a.dot(r),h=c**2-o*(s-1);if(s===1)return t.copy(e.origin);if(s>1){if(c>=0||h<0)return;const f=Math.sqrt(h),d=(-c-f)/o,m=(-c+f)/o;return e.at(Math.min(d,m),t)}if(s<1){const f=c**2-o*(s-1),d=Math.sqrt(f),m=(-c+d)/o;return e.at(m,t)}if(c<0)return e.at(-c/o,t)}getOsculatingSphereCenter(e,t,i=new L){qx(this.radii.x===this.radii.y);const a=this.radii.x**2,r=this.radii.z**2,s=vf.set(e.x/a,e.y/a,e.z/r).normalize();return i.copy(s.multiplyScalar(-t).add(e))}getNormalAtHorizon(e,t,i=new L){qx(this.radii.x===this.radii.y);const a=this.radii.x**2,r=this.radii.z**2,s=e,o=t;let c=(s.x*o.x+s.y*o.y)/a+s.z*o.z/r;c/=(s.x**2+s.y**2)/a+s.z**2/r;const h=vf.copy(o).multiplyScalar(-c).add(e);return i.set(h.x/a,h.y/a,h.z/r).normalize()}};OE.WGS84=new OE(6378137,6378137,6356752314245179e-9);let g0=OE;const Gv=new L,eO=new L,hm=class LE{constructor(e=0,t=0,i=0){this.longitude=e,this.latitude=t,this.height=i}set(e,t,i){return this.longitude=e,this.latitude=t,i!=null&&(this.height=i),this}clone(){return new LE(this.longitude,this.latitude,this.height)}copy(e){return this.longitude=e.longitude,this.latitude=e.latitude,this.height=e.height,this}equals(e){return e.longitude===this.longitude&&e.latitude===this.latitude&&e.height===this.height}setLongitude(e){return this.longitude=e,this}setLatitude(e){return this.latitude=e,this}setHeight(e){return this.height=e,this}normalize(){return this.longitudethis.setSize(f.baseWidth,f.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,a){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}};function Fm(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}new de;new de;function q8(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var Xr=function n(e,t,i){var a=this;q8(this,n),Fm(this,"dot2",function(r,s){return a.x*r+a.y*s}),Fm(this,"dot3",function(r,s,o){return a.x*r+a.y*s+a.z*o}),this.x=e,this.y=t,this.z=i},oee=[new Xr(1,1,0),new Xr(-1,1,0),new Xr(1,-1,0),new Xr(-1,-1,0),new Xr(1,0,1),new Xr(-1,0,1),new Xr(1,0,-1),new Xr(-1,0,-1),new Xr(0,1,1),new Xr(0,-1,1),new Xr(0,1,-1),new Xr(0,-1,-1)],QD=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],JD=new Array(512),$D=new Array(512),lee=function(e){e>0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var i;t&1?i=QD[t]^e&255:i=QD[t]^e>>8&255,JD[t]=JD[t+256]=i,$D[t]=$D[t+256]=oee[i%12]}};lee(0);function cee(n){if(typeof n=="number")n=Math.abs(n);else if(typeof n=="string"){var e=n;n=0;for(var t=0;t(n.getAttributes()&2)===2,hee=Me.memo(Me.forwardRef(({children:n,camera:e,scene:t,resolutionScale:i,enabled:a=!0,renderPriority:r=1,autoClear:s=!0,depthBuffer:o,enableNormalPass:c,stencilBuffer:h,multisampling:f=8,frameBufferType:d=Xn},m)=>{const{gl:g,scene:x,camera:T,size:y}=Oi(),v=t||x,S=e||T,[E,b,D]=Me.useMemo(()=>{const P=new l$(g,{depthBuffer:o,stencilBuffer:h,multisampling:f,frameBufferType:d});P.addPass(new oA(v,S));let O=null,w=null;return c&&(w=new see(v,S),w.enabled=!1,P.addPass(w),i!==void 0&&(O=new Z$({normalBuffer:w.texture,resolutionScale:i}),O.enabled=!1,P.addPass(O))),[P,w,O]},[S,g,o,h,f,d,v,c,i]);Me.useEffect(()=>E==null?void 0:E.setSize(y.width,y.height),[E,y]),cl((P,O)=>{if(a){const w=g.autoClear;g.autoClear=s,h&&!s&&g.clearStencil(),E.render(O),g.autoClear=w}},a?r:0);const C=Me.useRef(null);Me.useLayoutEffect(()=>{var w;const P=[],O=C.current.__r3f;if(O&&E){const B=O.children;for(let j=0;j{for(const B of P)E==null||E.removePass(B);b&&(b.enabled=!1),D&&(D.enabled=!1)}},[E,n,S,b,D]),Me.useEffect(()=>{const P=g.toneMapping;return g.toneMapping=is,()=>{g.toneMapping=P}},[g]);const I=Me.useMemo(()=>({composer:E,normalPass:b,downSamplingPass:D,resolutionScale:i,camera:S,scene:v}),[E,b,D,i,S,v]);return Me.useImperativeHandle(m,()=>E,[E]),Rt.jsx(lA.Provider,{value:I,children:Rt.jsx("group",{ref:C,children:n})})}));let fee=0;const nO=new WeakMap,dee=(n,e)=>function({blendFunction:t=e==null?void 0:e.blendFunction,opacity:i=e==null?void 0:e.opacity,...a}){let r=nO.get(n);if(!r){const c=`@react-three/postprocessing/${n.name}-${fee++}`;u8({[c]:n}),nO.set(n,r=c)}const s=Oi(c=>c.camera),o=dM.useMemo(()=>[...(e==null?void 0:e.args)??[],...a.args??[{...e,...a}]],[JSON.stringify(a)]);return Rt.jsx(r,{camera:s,"blendMode-blendFunction":t,"blendMode-opacity-value":i,...a,args:o})},pee=dee(eee);var mee="Invariant failed";function Kx(n,e){if(!n)throw new Error(mee)}const gee=new L;function j8(n,e,t=new L,i){const{x:a,y:r,z:s}=n,o=e.x,c=e.y,h=e.z,f=a*a*o,d=r*r*c,m=s*s*h,g=f+d+m,x=Math.sqrt(1/g);if(!Number.isFinite(x))return;const T=gee.copy(n).multiplyScalar(x);if(g<((i==null?void 0:i.centerTolerance)??.1))return t.copy(T);const y=T.multiply(e).multiplyScalar(2);let v=(1-x)*n.length()/(y.length()/2),S=0,E,b,D,C;do{v-=S,E=1/(1+v*o),b=1/(1+v*c),D=1/(1+v*h);const I=E*E,P=b*b,O=D*D,w=I*E,B=P*b,j=O*D;C=f*I+d*P+m*O-1,S=C/((f*w*o+d*B*c+m*j*h)*-2)}while(Math.abs(C)>1e-12);return t.set(a*E,r*b,s*D)}const xf=new L,Y2=new L,q2=new L,UE=class{constructor(e,t,i){this.radii=new L(e,t,i)}get minimumRadius(){return Math.min(this.radii.x,this.radii.y,this.radii.z)}get maximumRadius(){return Math.max(this.radii.x,this.radii.y,this.radii.z)}get flattening(){return 1-this.minimumRadius/this.maximumRadius}get eccentricity(){return Math.sqrt(this.eccentricitySquared)}get eccentricitySquared(){const e=this.maximumRadius**2,t=this.minimumRadius**2;return(e-t)/e}reciprocalRadii(e=new L){const{x:t,y:i,z:a}=this.radii;return e.set(1/t,1/i,1/a)}reciprocalRadiiSquared(e=new L){const{x:t,y:i,z:a}=this.radii;return e.set(1/t**2,1/i**2,1/a**2)}projectOnSurface(e,t=new L,i){return j8(e,this.reciprocalRadiiSquared(),t,i)}getSurfaceNormal(e,t=new L){return t.multiplyVectors(this.reciprocalRadiiSquared(xf),e).normalize()}getEastNorthUpVectors(e,t=new L,i=new L,a=new L){this.getSurfaceNormal(e,a),t.set(-e.y,e.x,0).normalize(),i.crossVectors(a,t).normalize()}getEastNorthUpFrame(e,t=new ke){const i=xf,a=Y2,r=q2;return this.getEastNorthUpVectors(e,i,a,r),t.makeBasis(i,a,r).setPosition(e)}getNorthUpEastFrame(e,t=new ke){const i=xf,a=Y2,r=q2;return this.getEastNorthUpVectors(e,i,a,r),t.makeBasis(a,r,i).setPosition(e)}getIntersection(e,t=new L){const i=this.reciprocalRadii(xf),a=Y2.copy(i).multiply(e.origin),r=q2.copy(i).multiply(e.direction),s=a.lengthSq(),o=r.lengthSq(),c=a.dot(r),h=c**2-o*(s-1);if(s===1)return t.copy(e.origin);if(s>1){if(c>=0||h<0)return;const f=Math.sqrt(h),d=(-c-f)/o,m=(-c+f)/o;return e.at(Math.min(d,m),t)}if(s<1){const f=c**2-o*(s-1),d=Math.sqrt(f),m=(-c+d)/o;return e.at(m,t)}if(c<0)return e.at(-c/o,t)}getOsculatingSphereCenter(e,t,i=new L){Kx(this.radii.x===this.radii.y);const a=this.radii.x**2,r=this.radii.z**2,s=xf.set(e.x/a,e.y/a,e.z/r).normalize();return i.copy(s.multiplyScalar(-t).add(e))}getNormalAtHorizon(e,t,i=new L){Kx(this.radii.x===this.radii.y);const a=this.radii.x**2,r=this.radii.z**2,s=e,o=t;let c=(s.x*o.x+s.y*o.y)/a+s.z*o.z/r;c/=(s.x**2+s.y**2)/a+s.z**2/r;const h=xf.copy(o).multiplyScalar(-c).add(e);return i.set(h.x/a,h.y/a,h.z/r).normalize()}};UE.WGS84=new UE(6378137,6378137,6356752314245179e-9);let _0=UE;const kv=new L,iO=new L,dm=class PE{constructor(e=0,t=0,i=0){this.longitude=e,this.latitude=t,this.height=i}set(e,t,i){return this.longitude=e,this.latitude=t,i!=null&&(this.height=i),this}clone(){return new PE(this.longitude,this.latitude,this.height)}copy(e){return this.longitude=e.longitude,this.latitude=e.latitude,this.height=e.height,this}equals(e){return e.longitude===this.longitude&&e.latitude===this.latitude&&e.height===this.height}setLongitude(e){return this.longitude=e,this}setLatitude(e){return this.latitude=e,this}setHeight(e){return this.height=e,this}normalize(){return this.longitude Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE version 0.8.2 -*/var $r=Uint8Array,kf=Uint16Array,gee=Int32Array,j8=new $r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Z8=new $r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),vee=new $r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),K8=function(n,e){for(var t=new kf(31),i=0;i<31;++i)t[i]=e+=1<>1|($n&21845)<<1;Ul=(Ul&52428)>>2|(Ul&13107)<<2,Ul=(Ul&61680)>>4|(Ul&3855)<<4,IE[$n]=((Ul&65280)>>8|(Ul&255)<<8)>>1}var Hm=function(n,e,t){for(var i=n.length,a=0,r=new kf(e);a>c]=h}else for(o=new kf(i),a=0;a>15-n[a]);return o},V0=new $r(288);for(var $n=0;$n<144;++$n)V0[$n]=8;for(var $n=144;$n<256;++$n)V0[$n]=9;for(var $n=256;$n<280;++$n)V0[$n]=7;for(var $n=280;$n<288;++$n)V0[$n]=8;var $8=new $r(32);for(var $n=0;$n<32;++$n)$8[$n]=5;var See=Hm(V0,9,1),Tee=Hm($8,5,1),X2=function(n){for(var e=n[0],t=1;te&&(e=n[t]);return e},vs=function(n,e,t){var i=e/8|0;return(n[i]|n[i+1]<<8)>>(e&7)&t},Y2=function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},Eee=function(n){return(n+7)/8|0},Mee=function(n,e,t){return(t==null||t>n.length)&&(t=n.length),new $r(n.subarray(e,t))},bee=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ss=function(n,e,t){var i=new Error(e||bee[n]);if(i.code=n,Error.captureStackTrace&&Error.captureStackTrace(i,Ss),!t)throw i;return i},Aee=function(n,e,t,i){var a=n.length,r=0;if(!a||e.f&&!e.l)return t||new $r(0);var s=!t,o=s||e.i!=2,c=e.i;s&&(t=new $r(a*3));var h=function(Mt){var ot=t.length;if(Mt>ot){var Ke=new $r(Math.max(ot*2,Mt));Ke.set(t),t=Ke}},f=e.f||0,d=e.p||0,m=e.b||0,g=e.l,x=e.d,T=e.m,S=e.n,v=a*8;do{if(!g){f=vs(n,d,1);var y=vs(n,d+1,3);if(d+=3,y)if(y==1)g=See,x=Tee,T=9,S=5;else if(y==2){var C=vs(n,d,31)+257,I=vs(n,d+10,15)+4,P=C+vs(n,d+5,31)+1;d+=14;for(var O=new $r(P),R=new $r(19),B=0;B>4;if(E<16)O[B++]=E;else{var W=0,te=0;for(E==16?(te=3+vs(n,d,3),d+=2,W=O[B-1]):E==17?(te=3+vs(n,d,7),d+=3):E==18&&(te=11+vs(n,d,127),d+=7);te--;)O[B++]=W}}var K=O.subarray(0,C),oe=O.subarray(C);T=X2(K),S=X2(oe),g=Hm(K,T,1),x=Hm(oe,S,1)}else Ss(1);else{var E=Eee(d)+4,b=n[E-4]|n[E-3]<<8,D=E+b;if(D>a){c&&Ss(0);break}o&&h(m+b),t.set(n.subarray(E,D),m),e.b=m+=b,e.p=d=D*8,e.f=f;continue}if(d>v){c&&Ss(0);break}}o&&h(m+131072);for(var ie=(1<>4;if(d+=W&15,d>v){c&&Ss(0);break}if(W||Ss(2),nt<256)t[m++]=nt;else if(nt==256){Xe=d,g=null;break}else{var tt=nt-254;if(nt>264){var B=nt-257,gt=j8[B];tt=vs(n,d,(1<>4;ge||Ss(3),d+=ge&15;var oe=yee[Ae];if(Ae>3){var gt=Z8[Ae];oe+=Y2(n,d)&(1<v){c&&Ss(0);break}o&&h(m+131072);var Ze=m+tt;if(m>4>7||(n[0]<<8|n[1])%31)&&Ss(6,"invalid zlib data"),(n[1]>>5&1)==1&&Ss(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function Vv(n,e){return Aee(n.subarray(wee(n),-4),{i:2},e,e)}var Cee=typeof TextDecoder<"u"&&new TextDecoder,Nee=0;try{Cee.decode(Ree,{stream:!0}),Nee=1}catch{}class eP extends g6{constructor(e){super(e),this.type=Xn,this.outputFormat=Jn}parse(e){const O=Math.pow(2.7182818,2.2);function R(w,z){let Y=0;for(let V=0;V<65536;++V)(V==0||w[V>>3]&1<<(V&7))&&(z[Y++]=V);const N=Y-1;for(;Y<65536;)z[Y++]=0;return N}function B(w){for(let z=0;z<16384;z++)w[z]={},w[z].len=0,w[z].lit=0,w[z].p=null}const j={l:0,c:0,lc:0};function ee(w,z,Y,N,V){for(;Y>Y&(1<0;--Y){const N=z+se[Y]>>1;se[Y]=z,z=N}for(let Y=0;Y<65537;++Y){const N=w[Y];N>0&&(w[Y]=N|se[N]++<<6)}}function W(w,z,Y,N,V,Z){const H=z;let X=0,ne=0;for(;N<=V;N++){if(H.value-z.value>Y)return!1;ee(6,X,ne,w,H);const ae=j.l;if(X=j.c,ne=j.lc,Z[N]=ae,ae==63){if(H.value-z.value>Y)throw new Error("Something wrong with hufUnpackEncTable");ee(8,X,ne,w,H);let fe=j.l+6;if(X=j.c,ne=j.lc,N+fe>V+1)throw new Error("Something wrong with hufUnpackEncTable");for(;fe--;)Z[N++]=0;N--}else if(ae>=59){let fe=ae-59+2;if(N+fe>V+1)throw new Error("Something wrong with hufUnpackEncTable");for(;fe--;)Z[N++]=0;N--}}re(Z)}function te(w){return w&63}function K(w){return w>>6}function oe(w,z,Y,N){for(;z<=Y;z++){const V=K(w[z]),Z=te(w[z]);if(V>>Z)throw new Error("Invalid table entry");if(Z>14){const H=N[V>>Z-14];if(H.len)throw new Error("Invalid table entry");if(H.lit++,H.p){const X=H.p;H.p=new Array(H.lit);for(let ne=0;ne0;X--){const ne=N[(V<<14-Z)+H];if(ne.len||ne.p)throw new Error("Invalid table entry");ne.len=Z,ne.lit=z,H++}}}return!0}const ie={c:0,lc:0};function Ce(w,z,Y,N){w=w<<8|Q(Y,N),z+=8,ie.c=w,ie.lc=z}const Xe={c:0,lc:0};function nt(w,z,Y,N,V,Z,H,X,ne){if(w==z){N<8&&(Ce(Y,N,V,Z),Y=ie.c,N=ie.lc),N-=8;let ae=Y>>N;if(ae=new Uint8Array([ae])[0],X.value+ae>ne)return!1;const fe=H[X.value-1];for(;ae-- >0;)H[X.value++]=fe}else if(X.value32767?z-65536:z}const ge={a:0,b:0};function Ae(w,z){const Y=gt(w),V=gt(z),Z=Y+(V&1)+(V>>1),H=Z,X=Z-V;ge.a=H,ge.b=X}function Ze(w,z){const Y=tt(w),N=tt(z),V=Y-(N>>1)&65535,Z=N+V-32768&65535;ge.a=Z,ge.b=V}function ue(w,z,Y,N,V,Z,H){const X=H<16384,ne=Y>V?V:Y;let ae=1,fe,_e;for(;ae<=ne;)ae<<=1;for(ae>>=1,fe=ae,ae>>=1;ae>=1;){_e=0;const Se=_e+Z*(V-fe),we=Z*ae,Pe=Z*fe,ze=N*ae,Ye=N*fe;let lt,St,bt,ft;for(;_e<=Se;_e+=Pe){let At=_e;const st=_e+N*(Y-fe);for(;At<=st;At+=Ye){const Kt=At+ze,On=At+we,Xt=On+ze;X?(Ae(w[At+z],w[On+z]),lt=ge.a,bt=ge.b,Ae(w[Kt+z],w[Xt+z]),St=ge.a,ft=ge.b,Ae(lt,St),w[At+z]=ge.a,w[Kt+z]=ge.b,Ae(bt,ft),w[On+z]=ge.a,w[Xt+z]=ge.b):(Ze(w[At+z],w[On+z]),lt=ge.a,bt=ge.b,Ze(w[Kt+z],w[Xt+z]),St=ge.a,ft=ge.b,Ze(lt,St),w[At+z]=ge.a,w[Kt+z]=ge.b,Ze(bt,ft),w[On+z]=ge.a,w[Xt+z]=ge.b)}if(Y&ae){const Kt=At+we;X?Ae(w[At+z],w[Kt+z]):Ze(w[At+z],w[Kt+z]),lt=ge.a,w[Kt+z]=ge.b,w[At+z]=lt}}if(V&ae){let At=_e;const st=_e+N*(Y-fe);for(;At<=st;At+=Ye){const Kt=At+ze;X?Ae(w[At+z],w[Kt+z]):Ze(w[At+z],w[Kt+z]),lt=ge.a,w[Kt+z]=ge.b,w[At+z]=lt}}fe=ae,ae>>=1}return _e}function it(w,z,Y,N,V,Z,H,X,ne){let ae=0,fe=0;const _e=H,Se=Math.trunc(N.value+(V+7)/8);for(;N.value=14;){const Pe=ae>>fe-14&16383,ze=z[Pe];if(ze.len)fe-=ze.len,nt(ze.lit,Z,ae,fe,Y,N,X,ne,_e),ae=Xe.c,fe=Xe.lc;else{if(!ze.p)throw new Error("hufDecode issues");let Ye;for(Ye=0;Ye=lt&&K(w[ze.p[Ye]])==(ae>>fe-lt&(1<>=we,fe-=we;fe>0;){const Pe=z[ae<<14-fe&16383];if(Pe.len)fe-=Pe.len,nt(Pe.lit,Z,ae,fe,Y,N,X,ne,_e),ae=Xe.c,fe=Xe.lc;else throw new Error("hufDecode issues")}return!0}function Mt(w,z,Y,N,V,Z){const H={value:0},X=Y.value,ne=ht(z,Y),ae=ht(z,Y);Y.value+=4;const fe=ht(z,Y);if(Y.value+=4,ne<0||ne>=65537||ae<0||ae>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const _e=new Array(65537),Se=new Array(16384);B(Se);const we=N-(Y.value-X);if(W(w,Y,we,ne,ae,_e),fe>8*(N-(Y.value-X)))throw new Error("Something wrong with hufUncompress");oe(_e,ne,ae,Se),it(_e,Se,w,Y,fe,ae,Z,V,H)}function ot(w,z,Y){for(let N=0;NZ||(z[V++]=w[Y++],V>Z));)z[V++]=w[N++]}function G(w){let z=w.byteLength;const Y=new Array;let N=0;const V=new DataView(w);for(;z>0;){const Z=V.getInt8(N++);if(Z<0){const H=-Z;z-=H+1;for(let X=0;X>8==255?V+=N&255:(Y[V]=N,V++),w.value++}function Be(w,z){z[0]=me(w[0]),z[1]=me(w[1]),z[2]=me(w[5]),z[3]=me(w[6]),z[4]=me(w[14]),z[5]=me(w[15]),z[6]=me(w[27]),z[7]=me(w[28]),z[8]=me(w[2]),z[9]=me(w[4]),z[10]=me(w[7]),z[11]=me(w[13]),z[12]=me(w[16]),z[13]=me(w[26]),z[14]=me(w[29]),z[15]=me(w[42]),z[16]=me(w[3]),z[17]=me(w[8]),z[18]=me(w[12]),z[19]=me(w[17]),z[20]=me(w[25]),z[21]=me(w[30]),z[22]=me(w[41]),z[23]=me(w[43]),z[24]=me(w[9]),z[25]=me(w[11]),z[26]=me(w[18]),z[27]=me(w[24]),z[28]=me(w[31]),z[29]=me(w[40]),z[30]=me(w[44]),z[31]=me(w[53]),z[32]=me(w[10]),z[33]=me(w[19]),z[34]=me(w[23]),z[35]=me(w[32]),z[36]=me(w[39]),z[37]=me(w[45]),z[38]=me(w[52]),z[39]=me(w[54]),z[40]=me(w[20]),z[41]=me(w[22]),z[42]=me(w[33]),z[43]=me(w[38]),z[44]=me(w[46]),z[45]=me(w[51]),z[46]=me(w[55]),z[47]=me(w[60]),z[48]=me(w[21]),z[49]=me(w[34]),z[50]=me(w[37]),z[51]=me(w[47]),z[52]=me(w[50]),z[53]=me(w[56]),z[54]=me(w[59]),z[55]=me(w[61]),z[56]=me(w[35]),z[57]=me(w[36]),z[58]=me(w[48]),z[59]=me(w[49]),z[60]=me(w[57]),z[61]=me(w[58]),z[62]=me(w[62]),z[63]=me(w[63])}function $e(w){const z=.5*Math.cos(.7853975),Y=.5*Math.cos(3.14159/16),N=.5*Math.cos(3.14159/8),V=.5*Math.cos(3*3.14159/16),Z=.5*Math.cos(5*3.14159/16),H=.5*Math.cos(3*3.14159/8),X=.5*Math.cos(7*3.14159/16),ne=new Array(4),ae=new Array(4),fe=new Array(4),_e=new Array(4);for(let Se=0;Se<8;++Se){const we=Se*8;ne[0]=N*w[we+2],ne[1]=H*w[we+2],ne[2]=N*w[we+6],ne[3]=H*w[we+6],ae[0]=Y*w[we+1]+V*w[we+3]+Z*w[we+5]+X*w[we+7],ae[1]=V*w[we+1]-X*w[we+3]-Y*w[we+5]-Z*w[we+7],ae[2]=Z*w[we+1]-Y*w[we+3]+X*w[we+5]+V*w[we+7],ae[3]=X*w[we+1]-Z*w[we+3]+V*w[we+5]-Y*w[we+7],fe[0]=z*(w[we+0]+w[we+4]),fe[3]=z*(w[we+0]-w[we+4]),fe[1]=ne[0]+ne[3],fe[2]=ne[1]-ne[2],_e[0]=fe[0]+fe[1],_e[1]=fe[3]+fe[2],_e[2]=fe[3]-fe[2],_e[3]=fe[0]-fe[1],w[we+0]=_e[0]+ae[0],w[we+1]=_e[1]+ae[1],w[we+2]=_e[2]+ae[2],w[we+3]=_e[3]+ae[3],w[we+4]=_e[3]-ae[3],w[we+5]=_e[2]-ae[2],w[we+6]=_e[1]-ae[1],w[we+7]=_e[0]-ae[0]}for(let Se=0;Se<8;++Se)ne[0]=N*w[16+Se],ne[1]=H*w[16+Se],ne[2]=N*w[48+Se],ne[3]=H*w[48+Se],ae[0]=Y*w[8+Se]+V*w[24+Se]+Z*w[40+Se]+X*w[56+Se],ae[1]=V*w[8+Se]-X*w[24+Se]-Y*w[40+Se]-Z*w[56+Se],ae[2]=Z*w[8+Se]-Y*w[24+Se]+X*w[40+Se]+V*w[56+Se],ae[3]=X*w[8+Se]-Z*w[24+Se]+V*w[40+Se]-Y*w[56+Se],fe[0]=z*(w[Se]+w[32+Se]),fe[3]=z*(w[Se]-w[32+Se]),fe[1]=ne[0]+ne[3],fe[2]=ne[1]-ne[2],_e[0]=fe[0]+fe[1],_e[1]=fe[3]+fe[2],_e[2]=fe[3]-fe[2],_e[3]=fe[0]-fe[1],w[0+Se]=_e[0]+ae[0],w[8+Se]=_e[1]+ae[1],w[16+Se]=_e[2]+ae[2],w[24+Se]=_e[3]+ae[3],w[32+Se]=_e[3]-ae[3],w[40+Se]=_e[2]-ae[2],w[48+Se]=_e[1]-ae[1],w[56+Se]=_e[0]-ae[0]}function Je(w){for(let z=0;z<64;++z){const Y=w[0][z],N=w[1][z],V=w[2][z];w[0][z]=Y+1.5747*V,w[1][z]=Y-.1873*N-.4682*V,w[2][z]=Y+1.8556*N}}function ct(w,z,Y){for(let N=0;N<64;++N)z[Y+N]=aE.toHalfFloat(k(w[N]))}function k(w){return w<=1?Math.sign(w)*Math.pow(Math.abs(w),2.2):Math.sign(w)*Math.pow(O,Math.abs(w)-1)}function U(w){return new DataView(w.array.buffer,w.offset.value,w.size)}function ce(w){const z=w.viewer.buffer.slice(w.offset.value,w.offset.value+w.size),Y=new Uint8Array(G(z)),N=new Uint8Array(Y.length);return Ke(Y),Te(Y,N),new DataView(N.buffer)}function Ee(w){const z=w.array.slice(w.offset.value,w.offset.value+w.size),Y=Vv(z),N=new Uint8Array(Y.length);return Ke(Y),Te(Y,N),new DataView(N.buffer)}function Le(w){const z=w.viewer,Y={value:w.offset.value},N=new Uint16Array(w.columns*w.lines*(w.inputChannels.length*w.type)),V=new Uint8Array(8192);let Z=0;const H=new Array(w.inputChannels.length);for(let Pe=0,ze=w.inputChannels.length;Pe=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(X<=ne)for(let Pe=0;Pe0;){const ze=qe(z.buffer,Y),Ye=pe(z,Y),lt=Ye>>2&3,St=(Ye>>4)-1,bt=new Int8Array([St])[0],ft=pe(z,Y);Z.push({name:ze,index:bt,type:ft,compression:lt}),H-=ze.length+3}const X=rr.channels,ne=new Array(w.inputChannels.length);for(let ze=0;ze=0&&(ae.idx[St.index]=ze),Ye.offset=ze)}}let fe,_e,Se;if(V.acCompressedSize>0)switch(V.acCompression){case 0:fe=new Uint16Array(V.totalAcUncompressedCount),Mt(w.array,z,Y,V.acCompressedSize,fe,V.totalAcUncompressedCount);break;case 1:const ze=w.array.slice(Y.value,Y.value+V.totalAcUncompressedCount),Ye=Vv(ze);fe=new Uint16Array(Ye.buffer),Y.value+=V.totalAcUncompressedCount;break}if(V.dcCompressedSize>0){const ze={array:w.array,offset:Y,size:V.dcCompressedSize};_e=new Uint16Array(Ee(ze).buffer),Y.value+=V.dcCompressedSize}if(V.rleRawSize>0){const ze=w.array.slice(Y.value,Y.value+V.rleCompressedSize),Ye=Vv(ze);Se=G(Ye.buffer),Y.value+=V.rleCompressedSize}let we=0;const Pe=new Array(ne.length);for(let ze=0;ze>10,Y=w&1023;return(w>>15?-1:1)*(z?z===31?Y?NaN:1/0:Math.pow(2,z-15)*(1+Y/1024):6103515625e-14*(Y/1024))}function We(w,z){const Y=w.getUint16(z.value,!0);return z.value+=2,Y}function Ge(w,z){return me(We(w,z))}function Re(w,z,Y,N){const V=Y.value,Z=[];for(;Y.value>4]}}function co(w,z){const Y=q(w,z),N=q(w,z);return[Y,N]}function Ls(w,z){const Y=q(w,z),N=q(w,z),V=q(w,z);return[Y,N,V]}function Is(w,z,Y,N,V){if(N==="string"||N==="stringvector"||N==="iccProfile")return _t(z,Y,V);if(N==="chlist")return Re(w,z,Y,V);if(N==="chromaticities")return rt(w,Y);if(N==="compression")return yt(w,Y);if(N==="box2i")return Gt(w,Y);if(N==="envmap")return oi(w,Y);if(N==="tiledesc")return li(w,Y);if(N==="lineOrder")return Vt(w,Y);if(N==="float")return q(w,Y);if(N==="v2f")return co(w,Y);if(N==="v3f")return Ls(w,Y);if(N==="int")return He(w,Y);if(N==="rational")return pt(w,Y);if(N==="timecode")return Ie(w,Y);if(N==="preview")return Y.value+=V,"skipped";Y.value+=V}function Ei(w,z){const Y=Math.log2(w);return z=="ROUND_DOWN"?Math.floor(Y):Math.ceil(Y)}function Us(w,z,Y){let N=0;switch(w.levelMode){case"ONE_LEVEL":N=1;break;case"MIPMAP_LEVELS":N=Ei(Math.max(z,Y),w.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return N}function ha(w,z,Y,N){const V=new Array(w);for(let Z=0;Zw.width?w.width-H:w.blockWidth,w.lines=X+w.blockHeight>w.height?w.height-X:w.blockHeight;const ne=w.columns*w.totalBytes,fe=w.sizew.height?w.height-V:w.blockHeight;const Z=w.columns*w.totalBytes,X=w.size=w.height)continue;const _e=ne*Z,Se=(w.height-1-fe)*w.outLineWidth;for(let we=0;weSe:H.scanOrder=Se=>H.height-1-Se,w.spec.singleTile){H.blockHeight=w.tiles.ySize,H.blockWidth=w.tiles.xSize;const Se=Us(w.tiles,H.width,H.height),we=ha(Se,H.width,w.tiles.xSize,w.tiles.roundingMode),Pe=ha(Se,H.height,w.tiles.ySize,w.tiles.roundingMode);H.tileCount=we[0]*Pe[0];for(let ze=0;ze{qx(s instanceof ArrayBuffer);try{t(s)}catch(o){a!=null?a(o):console.error(o),this.manager.itemError(e)}},i,a)}};function tP(n){var e,t;return n instanceof Kb?n.getContext().getExtension("OES_texture_float_linear")!=null:((t=(e=n.backend).hasFeature)==null?void 0:t.call(e,"float32-filterable"))??!1}const Oee=128,Lee=128,Iee=64,Uee="9627216cc50057994c98a2118f3c4a23765d43b9",nP=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${Uee}/packages/core/assets/stbn.bin`,Pee="This is not an object",zee="This is not a Float16Array object",tO="This constructor is not a subclass of Float16Array",iP="The constructor property value is not an object",Bee="Species constructor didn't return TypedArray object",Hee="Derived constructor created TypedArray object which was too small length",Fm="Attempting to access detached ArrayBuffer",UE="Cannot convert undefined or null to object",PE="Cannot mix BigInt and other types, use explicit conversions",nO="@@iterator property is not callable",iO="Reduce of empty array with no initial value",Fee="The comparison function must be either a function or undefined",q2="Offset is out of bounds";function jn(n){return(e,...t)=>qa(n,e,t)}function jd(n,e){return jn(Dd(n,e).get)}const{apply:qa,construct:fm,defineProperty:Gee,get:j2,getOwnPropertyDescriptor:Dd,getPrototypeOf:k0,has:zE,ownKeys:aP,set:aO,setPrototypeOf:rP}=Reflect,Vee=Proxy,{EPSILON:kee,MAX_SAFE_INTEGER:rO,isFinite:sP,isNaN:Od}=Number,{iterator:so,species:Wee,toStringTag:sA,for:Xee}=Symbol,Ld=Object,{create:oy,defineProperty:W0,freeze:Yee,is:sO}=Ld,BE=Ld.prototype,qee=BE.__lookupGetter__?jn(BE.__lookupGetter__):(n,e)=>{if(n==null)throw ii(UE);let t=Ld(n);do{const i=Dd(t,e);if(i!==void 0)return Wo(i,"get")?i.get:void 0}while((t=k0(t))!==null)},Wo=Ld.hasOwn||jn(BE.hasOwnProperty),oP=Array,lP=oP.isArray,ly=oP.prototype,jee=jn(ly.join),Zee=jn(ly.push),Kee=jn(ly.toLocaleString),oA=ly[so],Qee=jn(oA),{abs:Jee,trunc:cP}=Math,cy=ArrayBuffer,$ee=cy.isView,uP=cy.prototype,ete=jn(uP.slice),tte=jd(uP,"byteLength"),HE=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null,nte=HE&&jd(HE.prototype,"byteLength"),lA=k0(Uint8Array),ite=lA.from,na=lA.prototype,ate=na[so],rte=jn(na.keys),ste=jn(na.values),ote=jn(na.entries),lte=jn(na.set),oO=jn(na.reverse),cte=jn(na.fill),ute=jn(na.copyWithin),lO=jn(na.sort),Qp=jn(na.slice),hte=jn(na.subarray),ji=jd(na,"buffer"),uu=jd(na,"byteOffset"),Tn=jd(na,"length"),hP=jd(na,sA),fte=Uint8Array,_r=Uint16Array,cO=(...n)=>qa(ite,_r,n),cA=Uint32Array,dte=Float32Array,Ju=k0([][so]()),uy=jn(Ju.next),pte=jn(function*(){}().next),mte=k0(Ju),gte=DataView.prototype,vte=jn(gte.getUint16),ii=TypeError,Z2=RangeError,fP=WeakSet,dP=fP.prototype,_te=jn(dP.add),xte=jn(dP.has),hy=WeakMap,uA=hy.prototype,jx=jn(uA.get),yte=jn(uA.has),hA=jn(uA.set),pP=new hy,Ste=oy(null,{next:{value:function(){const n=jx(pP,this);return uy(n)}},[so]:{value:function(){return this}}});function dm(n){if(n[so]===oA&&Ju.next===uy)return n;const e=oy(Ste);return hA(pP,e,Qee(n)),e}const mP=new hy,gP=oy(mte,{next:{value:function(){const n=jx(mP,this);return pte(n)},writable:!0,configurable:!0}});for(const n of aP(Ju))n!=="next"&&W0(gP,n,Dd(Ju,n));function uO(n){const e=oy(gP);return hA(mP,e,n),e}function Zx(n){return n!==null&&typeof n=="object"||typeof n=="function"}function hO(n){return n!==null&&typeof n=="object"}function Kx(n){return hP(n)!==void 0}function FE(n){const e=hP(n);return e==="BigInt64Array"||e==="BigUint64Array"}function Tte(n){try{return lP(n)?!1:(tte(n),!0)}catch{return!1}}function vP(n){if(HE===null)return!1;try{return nte(n),!0}catch{return!1}}function Ete(n){return Tte(n)||vP(n)}function fO(n){return lP(n)?n[so]===oA&&Ju.next===uy:!1}function Mte(n){return Kx(n)?n[so]===ate&&Ju.next===uy:!1}function kv(n){if(typeof n!="string")return!1;const e=+n;return n!==e+""||!sP(e)?!1:e===cP(e)}const Qx=Xee("__Float16Array__");function bte(n){if(!hO(n))return!1;const e=k0(n);if(!hO(e))return!1;const t=e.constructor;if(t===void 0)return!1;if(!Zx(t))throw ii(iP);return zE(t,Qx)}const GE=1/kee;function Ate(n){return n+GE-GE}const _P=6103515625e-14,Rte=65504,xP=.0009765625,dO=xP*_P,wte=xP*GE;function Cte(n){const e=+n;if(!sP(e)||e===0)return e;const t=e>0?1:-1,i=Jee(e);if(i<_P)return t*Ate(i/dO)*dO;const a=(1+wte)*i,r=a-(a-i);return r>Rte||Od(r)?t*(1/0):t*r}const yP=new cy(4),SP=new dte(yP),TP=new cA(yP),_s=new _r(512),xs=new fte(512);for(let n=0;n<256;++n){const e=n-127;e<-24?(_s[n]=0,_s[n|256]=32768,xs[n]=24,xs[n|256]=24):e<-14?(_s[n]=1024>>-e-14,_s[n|256]=1024>>-e-14|32768,xs[n]=-e-1,xs[n|256]=-e-1):e<=15?(_s[n]=e+15<<10,_s[n|256]=e+15<<10|32768,xs[n]=13,xs[n|256]=13):e<128?(_s[n]=31744,_s[n|256]=64512,xs[n]=24,xs[n|256]=24):(_s[n]=31744,_s[n|256]=64512,xs[n]=13,xs[n|256]=13)}function js(n){SP[0]=Cte(n);const e=TP[0],t=e>>23&511;return _s[t]+((e&8388607)>>xs[t])}const fA=new cA(2048);for(let n=1;n<1024;++n){let e=n<<13,t=0;for(;!(e&8388608);)e<<=1,t-=8388608;e&=-8388609,t+=947912704,fA[n]=e|t}for(let n=1024;n<2048;++n)fA[n]=939524096+(n-1024<<13);const Zd=new cA(64);for(let n=1;n<31;++n)Zd[n]=n<<23;Zd[31]=1199570944;Zd[32]=2147483648;for(let n=33;n<63;++n)Zd[n]=2147483648+(n-32<<23);Zd[63]=3347054592;const EP=new _r(64);for(let n=1;n<64;++n)n!==32&&(EP[n]=1024);function An(n){const e=n>>10;return TP[0]=fA[EP[e]+(n&1023)]+Zd[e],SP[0]}function Po(n){const e=+n;return Od(e)||e===0?0:cP(e)}function K2(n){const e=Po(n);return e<0?0:ee)return 1;if(n===0&&e===0){const a=sO(n,0),r=sO(e,0);if(!a&&r)return-1;if(a&&!r)return 1}return 0}const dA=2,Jx=new hy;function Wf(n){return yte(Jx,n)||!$ee(n)&&bte(n)}function Sn(n){if(!Wf(n))throw ii(zee)}function Xv(n,e){const t=Wf(n),i=Kx(n);if(!t&&!i)throw ii(Bee);if(typeof e=="number"){let a;if(t){const r=Jt(n);a=Tn(r)}else a=Tn(n);if(a=0?a:i+a;if(!(r<0||r>=i))return An(t[r])}with(e,t){Sn(this);const i=Jt(this),a=Tn(i),r=Po(e),s=r>=0?r:a+r,o=+t;if(s<0||s>=a)throw Z2(q2);const c=new _r(ji(i),uu(i),Tn(i)),h=new Zi(ji(Qp(c))),f=Jt(h);return f[s]=js(o),h}map(e,...t){Sn(this);const i=Jt(this),a=Tn(i),r=t[0],s=Wv(i,Zi);if(s===Zi){const c=new Zi(a),h=Jt(c);for(let f=0;f=0;--o)r=e(r,An(i[o]),o,this);return r}forEach(e,...t){Sn(this);const i=Jt(this),a=Tn(i),r=t[0];for(let s=0;s=0;--s){const o=An(i[s]);if(qa(e,r,[o,s,this]))return o}}findLastIndex(e,...t){Sn(this);const i=Jt(this),a=Tn(i),r=t[0];for(let s=a-1;s>=0;--s){const o=An(i[s]);if(qa(e,r,[o,s,this]))return s}return-1}every(e,...t){Sn(this);const i=Jt(this),a=Tn(i),r=t[0];for(let s=0;sr)throw Z2(q2);for(let c=0;ci(An(a),An(r))),this}toSorted(e){Sn(this);const t=Jt(this);if(e!==void 0&&typeof e!="function")throw new ii(Fee);const i=e!==void 0?e:pO,a=new _r(ji(t),uu(t),Tn(t)),r=new Zi(ji(Qp(a))),s=Jt(r);return lO(s,(o,c)=>i(An(o),An(c))),r}slice(e,t){Sn(this);const i=Jt(this),a=Wv(i,Zi);if(a===Zi){const x=new _r(ji(i),uu(i),Tn(i));return new Zi(ji(Qp(x,e,t)))}const r=Tn(i),s=Po(e),o=t===void 0?r:Po(t);let c;s===-1/0?c=0:s<0?c=r+s>0?r+s:0:c=r0?r+o:0:h=r0?h-c:0,d=new a(f);if(Xv(d,f),f===0)return d;const m=ji(i);if(Gm(m))throw ii(Fm);let g=0;for(;c=1?Po(t[0]):a-1;if(r===-1/0)return-1;r>=0?r=r=0;--s)if(Wo(i,s)&&An(i[s])===e)return s;return-1}includes(e,...t){Sn(this);const i=Jt(this),a=Tn(i);let r=Po(t[0]);if(r===1/0)return!1;r<0&&(r+=a,r<0&&(r=0));const s=Od(e);for(let o=r;o{try{t(this.parser(s))}catch(o){a!=null?a(o):console.error(o),this.manager.itemError(e)}},i,a)}};function Lte(n){const e=n instanceof Int8Array?w1:n instanceof Uint8Array||n instanceof Uint8ClampedArray?Ii:n instanceof Int16Array?C1:n instanceof Uint16Array?Wu:n instanceof Int32Array?D0:n instanceof Uint32Array?Ns:n instanceof ll?Xn:n instanceof Float32Array||n instanceof Float64Array?ri:null;return qx(e!=null),e}let xu=class extends Ti{constructor(e,t,i={},a){super(a),this.textureClass=e,this.parser=t,this.options={format:Jn,minFilter:Ht,magFilter:Ht,...i}}load(e,t,i,a){const r=new this.textureClass,s=new Ote(this.parser,this.manager);return s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(this.withCredentials),s.load(e,o=>{r.image.data=o instanceof ll?new Uint16Array(o.buffer):o;const{width:c,height:h,depth:f,...d}=this.options;c!=null&&(r.image.width=c),h!=null&&(r.image.height=h),"depth"in r.image&&f!=null&&(r.image.depth=f),r.type=Lte(o),Object.assign(r,d),r.needsUpdate=!0,t==null||t(r)},i,a),r}};const e1=$t.clamp;$t.euclideanModulo;$t.inverseLerp;const bP=$t.lerp,Ite=$t.degToRad;$t.radToDeg;$t.isPowerOfTwo;$t.ceilPowerOfTwo;$t.floorPowerOfTwo;$t.normalize;function Ute(n,e,t,i=0,a=1){return $t.mapLinear(n,e,t,i,a)}function Pte(n){return Math.min(Math.max(n,0),1)}function dn(n){return(e,t)=>{e instanceof qn?Object.defineProperty(e,t,{enumerable:!0,get(){var i;return((i=this.defines)==null?void 0:i[n])!=null},set(i){var a;i!==this[t]&&(i?(this.defines??(this.defines={}),this.defines[n]="1"):(a=this.defines)==null||delete a[n],this.needsUpdate=!0)}}):Object.defineProperty(e,t,{enumerable:!0,get(){return this.defines.has(n)},set(i){i!==this[t]&&(i?this.defines.set(n,"1"):this.defines.delete(n),this.setChanged())}})}}function dh(n,{min:e=Number.MIN_SAFE_INTEGER,max:t=Number.MAX_SAFE_INTEGER}={}){return(i,a)=>{i instanceof qn?Object.defineProperty(i,a,{enumerable:!0,get(){var s;const r=(s=this.defines)==null?void 0:s[n];return r!=null?parseInt(r,10):0},set(r){const s=this[a];r!==s&&(this.defines??(this.defines={}),this.defines[n]=e1(r,e,t).toFixed(0),this.needsUpdate=!0)}}):Object.defineProperty(i,a,{enumerable:!0,get(){const r=this.defines.get(n);return r!=null?parseInt(r,10):0},set(r){const s=this[a];r!==s&&(this.defines.set(n,e1(r,e,t).toFixed(0)),this.setChanged())}})}}function pA(n,{min:e=-1/0,max:t=1/0,precision:i=7}={}){return(a,r)=>{a instanceof qn?Object.defineProperty(a,r,{enumerable:!0,get(){var o;const s=(o=this.defines)==null?void 0:o[n];return s!=null?parseFloat(s):0},set(s){const o=this[r];s!==o&&(this.defines??(this.defines={}),this.defines[n]=e1(s,e,t).toFixed(i),this.needsUpdate=!0)}}):Object.defineProperty(a,r,{enumerable:!0,get(){const s=this.defines.get(n);return s!=null?parseFloat(s):0},set(s){const o=this[r];s!==o&&(this.defines.set(n,e1(s,e,t).toFixed(i)),this.setChanged())}})}}function AP(n,{validate:e}={}){return(t,i)=>{t instanceof qn?Object.defineProperty(t,i,{enumerable:!0,get(){var a;return((a=this.defines)==null?void 0:a[n])??""},set(a){if(a!==this[i]){if((e==null?void 0:e(a))===!1){console.error(`Expression validation failed: ${a}`);return}this.defines??(this.defines={}),this.defines[n]=a,this.needsUpdate=!0}}}):Object.defineProperty(t,i,{enumerable:!0,get(){return this.defines.get(n)??""},set(a){if(a!==this[i]){if((e==null?void 0:e(a))===!1){console.error(`Expression validation failed: ${a}`);return}this.defines.set(n,a),this.setChanged()}}})}}function gO(n,...e){const t={};for(let i=0;ia[s],set:o=>{a[s]=o}}}return Object.defineProperties(n,t),n}function vO(n,e,t){const i={};for(const a of t)i[a]={enumerable:!0,get:()=>e.uniforms[a].value,set:r=>{e.uniforms[a].value=r}};return Object.defineProperties(n,i),n}class Q2 extends Ti{constructor(e={},t){super(t),this.options=e}load(e,t,i,a){const{width:r,height:s,depth:o}=this.options,c=new is(null,r,s,o),h=new eP(this.manager);return h.setRequestHeader(this.requestHeader),h.setPath(this.path),h.setWithCredentials(this.withCredentials),h.load(e,f=>{const{image:d}=f;c.image={data:d.data,width:r??d.width,height:s??d.height,depth:o??Math.sqrt(d.height)},c.type=f.type,c.format=f.format,c.colorSpace=f.colorSpace,c.needsUpdate=!0;try{t==null||t(c)}catch(m){a!=null?a(m):console.error(m),this.manager.itemError(e)}},i,a),c}}class _O extends Ti{constructor(e={},t){super(t),this.options=e}load(e,t,i,a){const{width:r,height:s}=this.options,o=new Ja(null,r,s),c=new eP(this.manager);return c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,h=>{const{image:f}=h;o.image={data:f.data,width:r??f.width,height:s??f.height},o.type=h.type,o.format=h.format,o.colorSpace=h.colorSpace,o.needsUpdate=!0;try{t==null||t(o)}catch(d){a!=null?a(d):console.error(d),this.manager.itemError(e)}},i,a),o}}const zte=/^[ \t]*#include +"([\w\d./]+)"/gm;function Ca(n,e){return n.replace(zte,(t,i)=>{const a=i.split("/").reduce((r,s)=>typeof r!="string"&&r!=null?r[s]:void 0,e);if(typeof a!="string")throw new Error(`Could not find include for ${i}.`);return Ca(a,e)})}let Yv;function Bte(){if(Yv!=null)return Yv;const n=new Uint32Array([268435456]);return Yv=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)[0]===0,Yv}function Hte(n,e,t,i=!0){if(i===Bte())return new e(n);const a=Object.assign(new DataView(n),{getFloat16(s,o){return Dte(this,s,o)}}),r=new e(a.byteLength/e.BYTES_PER_ELEMENT);for(let s=0,o=0;snew Uint8Array(n),Jp=(n,e)=>Hte(n,ll,"getFloat16",e);class wP extends xu{constructor(e){super(is,RP,{format:bs,minFilter:Fn,magFilter:Fn,wrapS:Ta,wrapT:Ta,wrapR:Ta,width:Oee,height:Lee,depth:Iee},e)}}const Fte=/#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*i)\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Gte(n,e,t,i){let a="";for(let r=parseInt(e,10);r>1|(ei&21845)<<1;zl=(zl&52428)>>2|(zl&13107)<<2,zl=(zl&61680)>>4|(zl&3855)<<4,zE[ei]=((zl&65280)>>8|(zl&255)<<8)>>1}var Gm=function(n,e,t){for(var i=n.length,a=0,r=new Xf(e);a>c]=h}else for(o=new Xf(i),a=0;a>15-n[a]);return o},W0=new es(288);for(var ei=0;ei<144;++ei)W0[ei]=8;for(var ei=144;ei<256;++ei)W0[ei]=9;for(var ei=256;ei<280;++ei)W0[ei]=7;for(var ei=280;ei<288;++ei)W0[ei]=8;var tP=new es(32);for(var ei=0;ei<32;++ei)tP[ei]=5;var Tee=Gm(W0,9,1),Eee=Gm(tP,5,1),j2=function(n){for(var e=n[0],t=1;te&&(e=n[t]);return e},_s=function(n,e,t){var i=e/8|0;return(n[i]|n[i+1]<<8)>>(e&7)&t},Z2=function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},Mee=function(n){return(n+7)/8|0},bee=function(n,e,t){return(t==null||t>n.length)&&(t=n.length),new es(n.subarray(e,t))},Aee=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ts=function(n,e,t){var i=new Error(e||Aee[n]);if(i.code=n,Error.captureStackTrace&&Error.captureStackTrace(i,Ts),!t)throw i;return i},wee=function(n,e,t,i){var a=n.length,r=0;if(!a||e.f&&!e.l)return t||new es(0);var s=!t,o=s||e.i!=2,c=e.i;s&&(t=new es(a*3));var h=function(Mt){var ot=t.length;if(Mt>ot){var Ke=new es(Math.max(ot*2,Mt));Ke.set(t),t=Ke}},f=e.f||0,d=e.p||0,m=e.b||0,g=e.l,x=e.d,T=e.m,y=e.n,v=a*8;do{if(!g){f=_s(n,d,1);var S=_s(n,d+1,3);if(d+=3,S)if(S==1)g=Tee,x=Eee,T=9,y=5;else if(S==2){var C=_s(n,d,31)+257,I=_s(n,d+10,15)+4,P=C+_s(n,d+5,31)+1;d+=14;for(var O=new es(P),w=new es(19),B=0;B>4;if(E<16)O[B++]=E;else{var W=0,te=0;for(E==16?(te=3+_s(n,d,3),d+=2,W=O[B-1]):E==17?(te=3+_s(n,d,7),d+=3):E==18&&(te=11+_s(n,d,127),d+=7);te--;)O[B++]=W}}var K=O.subarray(0,C),oe=O.subarray(C);T=j2(K),y=j2(oe),g=Gm(K,T,1),x=Gm(oe,y,1)}else Ts(1);else{var E=Mee(d)+4,b=n[E-4]|n[E-3]<<8,D=E+b;if(D>a){c&&Ts(0);break}o&&h(m+b),t.set(n.subarray(E,D),m),e.b=m+=b,e.p=d=D*8,e.f=f;continue}if(d>v){c&&Ts(0);break}}o&&h(m+131072);for(var ie=(1<>4;if(d+=W&15,d>v){c&&Ts(0);break}if(W||Ts(2),nt<256)t[m++]=nt;else if(nt==256){Xe=d,g=null;break}else{var tt=nt-254;if(nt>264){var B=nt-257,gt=K8[B];tt=_s(n,d,(1<>4;ge||Ts(3),d+=ge&15;var oe=See[Ae];if(Ae>3){var gt=Q8[Ae];oe+=Z2(n,d)&(1<v){c&&Ts(0);break}o&&h(m+131072);var Ze=m+tt;if(m>4>7||(n[0]<<8|n[1])%31)&&Ts(6,"invalid zlib data"),(n[1]>>5&1)==1&&Ts(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function Wv(n,e){return wee(n.subarray(Cee(n),-4),{i:2},e,e)}var Nee=typeof TextDecoder<"u"&&new TextDecoder,Dee=0;try{Nee.decode(Ree,{stream:!0}),Dee=1}catch{}class nP extends _6{constructor(e){super(e),this.type=Xn,this.outputFormat=$n}parse(e){const O=Math.pow(2.7182818,2.2);function w(R,z){let Y=0;for(let V=0;V<65536;++V)(V==0||R[V>>3]&1<<(V&7))&&(z[Y++]=V);const N=Y-1;for(;Y<65536;)z[Y++]=0;return N}function B(R){for(let z=0;z<16384;z++)R[z]={},R[z].len=0,R[z].lit=0,R[z].p=null}const j={l:0,c:0,lc:0};function ee(R,z,Y,N,V){for(;Y>Y&(1<0;--Y){const N=z+se[Y]>>1;se[Y]=z,z=N}for(let Y=0;Y<65537;++Y){const N=R[Y];N>0&&(R[Y]=N|se[N]++<<6)}}function W(R,z,Y,N,V,Z){const H=z;let X=0,ne=0;for(;N<=V;N++){if(H.value-z.value>Y)return!1;ee(6,X,ne,R,H);const ae=j.l;if(X=j.c,ne=j.lc,Z[N]=ae,ae==63){if(H.value-z.value>Y)throw new Error("Something wrong with hufUnpackEncTable");ee(8,X,ne,R,H);let fe=j.l+6;if(X=j.c,ne=j.lc,N+fe>V+1)throw new Error("Something wrong with hufUnpackEncTable");for(;fe--;)Z[N++]=0;N--}else if(ae>=59){let fe=ae-59+2;if(N+fe>V+1)throw new Error("Something wrong with hufUnpackEncTable");for(;fe--;)Z[N++]=0;N--}}re(Z)}function te(R){return R&63}function K(R){return R>>6}function oe(R,z,Y,N){for(;z<=Y;z++){const V=K(R[z]),Z=te(R[z]);if(V>>Z)throw new Error("Invalid table entry");if(Z>14){const H=N[V>>Z-14];if(H.len)throw new Error("Invalid table entry");if(H.lit++,H.p){const X=H.p;H.p=new Array(H.lit);for(let ne=0;ne0;X--){const ne=N[(V<<14-Z)+H];if(ne.len||ne.p)throw new Error("Invalid table entry");ne.len=Z,ne.lit=z,H++}}}return!0}const ie={c:0,lc:0};function Ce(R,z,Y,N){R=R<<8|Q(Y,N),z+=8,ie.c=R,ie.lc=z}const Xe={c:0,lc:0};function nt(R,z,Y,N,V,Z,H,X,ne){if(R==z){N<8&&(Ce(Y,N,V,Z),Y=ie.c,N=ie.lc),N-=8;let ae=Y>>N;if(ae=new Uint8Array([ae])[0],X.value+ae>ne)return!1;const fe=H[X.value-1];for(;ae-- >0;)H[X.value++]=fe}else if(X.value32767?z-65536:z}const ge={a:0,b:0};function Ae(R,z){const Y=gt(R),V=gt(z),Z=Y+(V&1)+(V>>1),H=Z,X=Z-V;ge.a=H,ge.b=X}function Ze(R,z){const Y=tt(R),N=tt(z),V=Y-(N>>1)&65535,Z=N+V-32768&65535;ge.a=Z,ge.b=V}function ue(R,z,Y,N,V,Z,H){const X=H<16384,ne=Y>V?V:Y;let ae=1,fe,_e;for(;ae<=ne;)ae<<=1;for(ae>>=1,fe=ae,ae>>=1;ae>=1;){_e=0;const Se=_e+Z*(V-fe),Re=Z*ae,Pe=Z*fe,ze=N*ae,Ye=N*fe;let lt,Tt,bt,ft;for(;_e<=Se;_e+=Pe){let At=_e;const st=_e+N*(Y-fe);for(;At<=st;At+=Ye){const Kt=At+ze,On=At+Re,Yt=On+ze;X?(Ae(R[At+z],R[On+z]),lt=ge.a,bt=ge.b,Ae(R[Kt+z],R[Yt+z]),Tt=ge.a,ft=ge.b,Ae(lt,Tt),R[At+z]=ge.a,R[Kt+z]=ge.b,Ae(bt,ft),R[On+z]=ge.a,R[Yt+z]=ge.b):(Ze(R[At+z],R[On+z]),lt=ge.a,bt=ge.b,Ze(R[Kt+z],R[Yt+z]),Tt=ge.a,ft=ge.b,Ze(lt,Tt),R[At+z]=ge.a,R[Kt+z]=ge.b,Ze(bt,ft),R[On+z]=ge.a,R[Yt+z]=ge.b)}if(Y&ae){const Kt=At+Re;X?Ae(R[At+z],R[Kt+z]):Ze(R[At+z],R[Kt+z]),lt=ge.a,R[Kt+z]=ge.b,R[At+z]=lt}}if(V&ae){let At=_e;const st=_e+N*(Y-fe);for(;At<=st;At+=Ye){const Kt=At+ze;X?Ae(R[At+z],R[Kt+z]):Ze(R[At+z],R[Kt+z]),lt=ge.a,R[Kt+z]=ge.b,R[At+z]=lt}}fe=ae,ae>>=1}return _e}function it(R,z,Y,N,V,Z,H,X,ne){let ae=0,fe=0;const _e=H,Se=Math.trunc(N.value+(V+7)/8);for(;N.value=14;){const Pe=ae>>fe-14&16383,ze=z[Pe];if(ze.len)fe-=ze.len,nt(ze.lit,Z,ae,fe,Y,N,X,ne,_e),ae=Xe.c,fe=Xe.lc;else{if(!ze.p)throw new Error("hufDecode issues");let Ye;for(Ye=0;Ye=lt&&K(R[ze.p[Ye]])==(ae>>fe-lt&(1<>=Re,fe-=Re;fe>0;){const Pe=z[ae<<14-fe&16383];if(Pe.len)fe-=Pe.len,nt(Pe.lit,Z,ae,fe,Y,N,X,ne,_e),ae=Xe.c,fe=Xe.lc;else throw new Error("hufDecode issues")}return!0}function Mt(R,z,Y,N,V,Z){const H={value:0},X=Y.value,ne=ht(z,Y),ae=ht(z,Y);Y.value+=4;const fe=ht(z,Y);if(Y.value+=4,ne<0||ne>=65537||ae<0||ae>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const _e=new Array(65537),Se=new Array(16384);B(Se);const Re=N-(Y.value-X);if(W(R,Y,Re,ne,ae,_e),fe>8*(N-(Y.value-X)))throw new Error("Something wrong with hufUncompress");oe(_e,ne,ae,Se),it(_e,Se,R,Y,fe,ae,Z,V,H)}function ot(R,z,Y){for(let N=0;NZ||(z[V++]=R[Y++],V>Z));)z[V++]=R[N++]}function G(R){let z=R.byteLength;const Y=new Array;let N=0;const V=new DataView(R);for(;z>0;){const Z=V.getInt8(N++);if(Z<0){const H=-Z;z-=H+1;for(let X=0;X>8==255?V+=N&255:(Y[V]=N,V++),R.value++}function Be(R,z){z[0]=me(R[0]),z[1]=me(R[1]),z[2]=me(R[5]),z[3]=me(R[6]),z[4]=me(R[14]),z[5]=me(R[15]),z[6]=me(R[27]),z[7]=me(R[28]),z[8]=me(R[2]),z[9]=me(R[4]),z[10]=me(R[7]),z[11]=me(R[13]),z[12]=me(R[16]),z[13]=me(R[26]),z[14]=me(R[29]),z[15]=me(R[42]),z[16]=me(R[3]),z[17]=me(R[8]),z[18]=me(R[12]),z[19]=me(R[17]),z[20]=me(R[25]),z[21]=me(R[30]),z[22]=me(R[41]),z[23]=me(R[43]),z[24]=me(R[9]),z[25]=me(R[11]),z[26]=me(R[18]),z[27]=me(R[24]),z[28]=me(R[31]),z[29]=me(R[40]),z[30]=me(R[44]),z[31]=me(R[53]),z[32]=me(R[10]),z[33]=me(R[19]),z[34]=me(R[23]),z[35]=me(R[32]),z[36]=me(R[39]),z[37]=me(R[45]),z[38]=me(R[52]),z[39]=me(R[54]),z[40]=me(R[20]),z[41]=me(R[22]),z[42]=me(R[33]),z[43]=me(R[38]),z[44]=me(R[46]),z[45]=me(R[51]),z[46]=me(R[55]),z[47]=me(R[60]),z[48]=me(R[21]),z[49]=me(R[34]),z[50]=me(R[37]),z[51]=me(R[47]),z[52]=me(R[50]),z[53]=me(R[56]),z[54]=me(R[59]),z[55]=me(R[61]),z[56]=me(R[35]),z[57]=me(R[36]),z[58]=me(R[48]),z[59]=me(R[49]),z[60]=me(R[57]),z[61]=me(R[58]),z[62]=me(R[62]),z[63]=me(R[63])}function $e(R){const z=.5*Math.cos(.7853975),Y=.5*Math.cos(3.14159/16),N=.5*Math.cos(3.14159/8),V=.5*Math.cos(3*3.14159/16),Z=.5*Math.cos(5*3.14159/16),H=.5*Math.cos(3*3.14159/8),X=.5*Math.cos(7*3.14159/16),ne=new Array(4),ae=new Array(4),fe=new Array(4),_e=new Array(4);for(let Se=0;Se<8;++Se){const Re=Se*8;ne[0]=N*R[Re+2],ne[1]=H*R[Re+2],ne[2]=N*R[Re+6],ne[3]=H*R[Re+6],ae[0]=Y*R[Re+1]+V*R[Re+3]+Z*R[Re+5]+X*R[Re+7],ae[1]=V*R[Re+1]-X*R[Re+3]-Y*R[Re+5]-Z*R[Re+7],ae[2]=Z*R[Re+1]-Y*R[Re+3]+X*R[Re+5]+V*R[Re+7],ae[3]=X*R[Re+1]-Z*R[Re+3]+V*R[Re+5]-Y*R[Re+7],fe[0]=z*(R[Re+0]+R[Re+4]),fe[3]=z*(R[Re+0]-R[Re+4]),fe[1]=ne[0]+ne[3],fe[2]=ne[1]-ne[2],_e[0]=fe[0]+fe[1],_e[1]=fe[3]+fe[2],_e[2]=fe[3]-fe[2],_e[3]=fe[0]-fe[1],R[Re+0]=_e[0]+ae[0],R[Re+1]=_e[1]+ae[1],R[Re+2]=_e[2]+ae[2],R[Re+3]=_e[3]+ae[3],R[Re+4]=_e[3]-ae[3],R[Re+5]=_e[2]-ae[2],R[Re+6]=_e[1]-ae[1],R[Re+7]=_e[0]-ae[0]}for(let Se=0;Se<8;++Se)ne[0]=N*R[16+Se],ne[1]=H*R[16+Se],ne[2]=N*R[48+Se],ne[3]=H*R[48+Se],ae[0]=Y*R[8+Se]+V*R[24+Se]+Z*R[40+Se]+X*R[56+Se],ae[1]=V*R[8+Se]-X*R[24+Se]-Y*R[40+Se]-Z*R[56+Se],ae[2]=Z*R[8+Se]-Y*R[24+Se]+X*R[40+Se]+V*R[56+Se],ae[3]=X*R[8+Se]-Z*R[24+Se]+V*R[40+Se]-Y*R[56+Se],fe[0]=z*(R[Se]+R[32+Se]),fe[3]=z*(R[Se]-R[32+Se]),fe[1]=ne[0]+ne[3],fe[2]=ne[1]-ne[2],_e[0]=fe[0]+fe[1],_e[1]=fe[3]+fe[2],_e[2]=fe[3]-fe[2],_e[3]=fe[0]-fe[1],R[0+Se]=_e[0]+ae[0],R[8+Se]=_e[1]+ae[1],R[16+Se]=_e[2]+ae[2],R[24+Se]=_e[3]+ae[3],R[32+Se]=_e[3]-ae[3],R[40+Se]=_e[2]-ae[2],R[48+Se]=_e[1]-ae[1],R[56+Se]=_e[0]-ae[0]}function Je(R){for(let z=0;z<64;++z){const Y=R[0][z],N=R[1][z],V=R[2][z];R[0][z]=Y+1.5747*V,R[1][z]=Y-.1873*N-.4682*V,R[2][z]=Y+1.8556*N}}function ct(R,z,Y){for(let N=0;N<64;++N)z[Y+N]=oE.toHalfFloat(k(R[N]))}function k(R){return R<=1?Math.sign(R)*Math.pow(Math.abs(R),2.2):Math.sign(R)*Math.pow(O,Math.abs(R)-1)}function U(R){return new DataView(R.array.buffer,R.offset.value,R.size)}function ce(R){const z=R.viewer.buffer.slice(R.offset.value,R.offset.value+R.size),Y=new Uint8Array(G(z)),N=new Uint8Array(Y.length);return Ke(Y),Te(Y,N),new DataView(N.buffer)}function Ee(R){const z=R.array.slice(R.offset.value,R.offset.value+R.size),Y=Wv(z),N=new Uint8Array(Y.length);return Ke(Y),Te(Y,N),new DataView(N.buffer)}function Le(R){const z=R.viewer,Y={value:R.offset.value},N=new Uint16Array(R.columns*R.lines*(R.inputChannels.length*R.type)),V=new Uint8Array(8192);let Z=0;const H=new Array(R.inputChannels.length);for(let Pe=0,ze=R.inputChannels.length;Pe=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(X<=ne)for(let Pe=0;Pe0;){const ze=qe(z.buffer,Y),Ye=pe(z,Y),lt=Ye>>2&3,Tt=(Ye>>4)-1,bt=new Int8Array([Tt])[0],ft=pe(z,Y);Z.push({name:ze,index:bt,type:ft,compression:lt}),H-=ze.length+3}const X=sr.channels,ne=new Array(R.inputChannels.length);for(let ze=0;ze=0&&(ae.idx[Tt.index]=ze),Ye.offset=ze)}}let fe,_e,Se;if(V.acCompressedSize>0)switch(V.acCompression){case 0:fe=new Uint16Array(V.totalAcUncompressedCount),Mt(R.array,z,Y,V.acCompressedSize,fe,V.totalAcUncompressedCount);break;case 1:const ze=R.array.slice(Y.value,Y.value+V.totalAcUncompressedCount),Ye=Wv(ze);fe=new Uint16Array(Ye.buffer),Y.value+=V.totalAcUncompressedCount;break}if(V.dcCompressedSize>0){const ze={array:R.array,offset:Y,size:V.dcCompressedSize};_e=new Uint16Array(Ee(ze).buffer),Y.value+=V.dcCompressedSize}if(V.rleRawSize>0){const ze=R.array.slice(Y.value,Y.value+V.rleCompressedSize),Ye=Wv(ze);Se=G(Ye.buffer),Y.value+=V.rleCompressedSize}let Re=0;const Pe=new Array(ne.length);for(let ze=0;ze>10,Y=R&1023;return(R>>15?-1:1)*(z?z===31?Y?NaN:1/0:Math.pow(2,z-15)*(1+Y/1024):6103515625e-14*(Y/1024))}function We(R,z){const Y=R.getUint16(z.value,!0);return z.value+=2,Y}function Ge(R,z){return me(We(R,z))}function we(R,z,Y,N){const V=Y.value,Z=[];for(;Y.value>4]}}function uo(R,z){const Y=q(R,z),N=q(R,z);return[Y,N]}function Is(R,z){const Y=q(R,z),N=q(R,z),V=q(R,z);return[Y,N,V]}function Us(R,z,Y,N,V){if(N==="string"||N==="stringvector"||N==="iccProfile")return _t(z,Y,V);if(N==="chlist")return we(R,z,Y,V);if(N==="chromaticities")return rt(R,Y);if(N==="compression")return yt(R,Y);if(N==="box2i")return Gt(R,Y);if(N==="envmap")return li(R,Y);if(N==="tiledesc")return ci(R,Y);if(N==="lineOrder")return Vt(R,Y);if(N==="float")return q(R,Y);if(N==="v2f")return uo(R,Y);if(N==="v3f")return Is(R,Y);if(N==="int")return He(R,Y);if(N==="rational")return pt(R,Y);if(N==="timecode")return Ie(R,Y);if(N==="preview")return Y.value+=V,"skipped";Y.value+=V}function bi(R,z){const Y=Math.log2(R);return z=="ROUND_DOWN"?Math.floor(Y):Math.ceil(Y)}function Ps(R,z,Y){let N=0;switch(R.levelMode){case"ONE_LEVEL":N=1;break;case"MIPMAP_LEVELS":N=bi(Math.max(z,Y),R.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return N}function fa(R,z,Y,N){const V=new Array(R);for(let Z=0;ZR.width?R.width-H:R.blockWidth,R.lines=X+R.blockHeight>R.height?R.height-X:R.blockHeight;const ne=R.columns*R.totalBytes,fe=R.sizeR.height?R.height-V:R.blockHeight;const Z=R.columns*R.totalBytes,X=R.size=R.height)continue;const _e=ne*Z,Se=(R.height-1-fe)*R.outLineWidth;for(let Re=0;ReSe:H.scanOrder=Se=>H.height-1-Se,R.spec.singleTile){H.blockHeight=R.tiles.ySize,H.blockWidth=R.tiles.xSize;const Se=Ps(R.tiles,H.width,H.height),Re=fa(Se,H.width,R.tiles.xSize,R.tiles.roundingMode),Pe=fa(Se,H.height,R.tiles.ySize,R.tiles.roundingMode);H.tileCount=Re[0]*Pe[0];for(let ze=0;ze{Kx(s instanceof ArrayBuffer);try{t(s)}catch(o){a!=null?a(o):console.error(o),this.manager.itemError(e)}},i,a)}};function iP(n){var e,t;return n instanceof $b?n.getContext().getExtension("OES_texture_float_linear")!=null:((t=(e=n.backend).hasFeature)==null?void 0:t.call(e,"float32-filterable"))??!1}const Lee=128,Iee=128,Uee=64,Pee="9627216cc50057994c98a2118f3c4a23765d43b9",aP=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${Pee}/packages/core/assets/stbn.bin`,zee="This is not an object",Bee="This is not a Float16Array object",aO="This constructor is not a subclass of Float16Array",rP="The constructor property value is not an object",Hee="Species constructor didn't return TypedArray object",Fee="Derived constructor created TypedArray object which was too small length",Vm="Attempting to access detached ArrayBuffer",BE="Cannot convert undefined or null to object",HE="Cannot mix BigInt and other types, use explicit conversions",rO="@@iterator property is not callable",sO="Reduce of empty array with no initial value",Gee="The comparison function must be either a function or undefined",K2="Offset is out of bounds";function jn(n){return(e,...t)=>ja(n,e,t)}function Kd(n,e){return jn(Ld(n,e).get)}const{apply:ja,construct:pm,defineProperty:Vee,get:Q2,getOwnPropertyDescriptor:Ld,getPrototypeOf:X0,has:FE,ownKeys:sP,set:oO,setPrototypeOf:oP}=Reflect,kee=Proxy,{EPSILON:Wee,MAX_SAFE_INTEGER:lO,isFinite:lP,isNaN:Id}=Number,{iterator:oo,species:Xee,toStringTag:cA,for:Yee}=Symbol,Ud=Object,{create:uy,defineProperty:Y0,freeze:qee,is:cO}=Ud,GE=Ud.prototype,jee=GE.__lookupGetter__?jn(GE.__lookupGetter__):(n,e)=>{if(n==null)throw ai(BE);let t=Ud(n);do{const i=Ld(t,e);if(i!==void 0)return Xo(i,"get")?i.get:void 0}while((t=X0(t))!==null)},Xo=Ud.hasOwn||jn(GE.hasOwnProperty),cP=Array,uP=cP.isArray,hy=cP.prototype,Zee=jn(hy.join),Kee=jn(hy.push),Qee=jn(hy.toLocaleString),uA=hy[oo],Jee=jn(uA),{abs:$ee,trunc:hP}=Math,fy=ArrayBuffer,ete=fy.isView,fP=fy.prototype,tte=jn(fP.slice),nte=Kd(fP,"byteLength"),VE=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null,ite=VE&&Kd(VE.prototype,"byteLength"),hA=X0(Uint8Array),ate=hA.from,ia=hA.prototype,rte=ia[oo],ste=jn(ia.keys),ote=jn(ia.values),lte=jn(ia.entries),cte=jn(ia.set),uO=jn(ia.reverse),ute=jn(ia.fill),hte=jn(ia.copyWithin),hO=jn(ia.sort),$p=jn(ia.slice),fte=jn(ia.subarray),Ki=Kd(ia,"buffer"),fu=Kd(ia,"byteOffset"),Tn=Kd(ia,"length"),dP=Kd(ia,cA),dte=Uint8Array,xr=Uint16Array,fO=(...n)=>ja(ate,xr,n),fA=Uint32Array,pte=Float32Array,eh=X0([][oo]()),dy=jn(eh.next),mte=jn(function*(){}().next),gte=X0(eh),vte=DataView.prototype,_te=jn(vte.getUint16),ai=TypeError,J2=RangeError,pP=WeakSet,mP=pP.prototype,xte=jn(mP.add),yte=jn(mP.has),py=WeakMap,dA=py.prototype,Qx=jn(dA.get),Ste=jn(dA.has),pA=jn(dA.set),gP=new py,Tte=uy(null,{next:{value:function(){const n=Qx(gP,this);return dy(n)}},[oo]:{value:function(){return this}}});function mm(n){if(n[oo]===uA&&eh.next===dy)return n;const e=uy(Tte);return pA(gP,e,Jee(n)),e}const vP=new py,_P=uy(gte,{next:{value:function(){const n=Qx(vP,this);return mte(n)},writable:!0,configurable:!0}});for(const n of sP(eh))n!=="next"&&Y0(_P,n,Ld(eh,n));function dO(n){const e=uy(_P);return pA(vP,e,n),e}function Jx(n){return n!==null&&typeof n=="object"||typeof n=="function"}function pO(n){return n!==null&&typeof n=="object"}function $x(n){return dP(n)!==void 0}function kE(n){const e=dP(n);return e==="BigInt64Array"||e==="BigUint64Array"}function Ete(n){try{return uP(n)?!1:(nte(n),!0)}catch{return!1}}function xP(n){if(VE===null)return!1;try{return ite(n),!0}catch{return!1}}function Mte(n){return Ete(n)||xP(n)}function mO(n){return uP(n)?n[oo]===uA&&eh.next===dy:!1}function bte(n){return $x(n)?n[oo]===rte&&eh.next===dy:!1}function Xv(n){if(typeof n!="string")return!1;const e=+n;return n!==e+""||!lP(e)?!1:e===hP(e)}const e1=Yee("__Float16Array__");function Ate(n){if(!pO(n))return!1;const e=X0(n);if(!pO(e))return!1;const t=e.constructor;if(t===void 0)return!1;if(!Jx(t))throw ai(rP);return FE(t,e1)}const WE=1/Wee;function wte(n){return n+WE-WE}const yP=6103515625e-14,Rte=65504,SP=.0009765625,gO=SP*yP,Cte=SP*WE;function Nte(n){const e=+n;if(!lP(e)||e===0)return e;const t=e>0?1:-1,i=$ee(e);if(iRte||Id(r)?t*(1/0):t*r}const TP=new fy(4),EP=new pte(TP),MP=new fA(TP),xs=new xr(512),ys=new dte(512);for(let n=0;n<256;++n){const e=n-127;e<-24?(xs[n]=0,xs[n|256]=32768,ys[n]=24,ys[n|256]=24):e<-14?(xs[n]=1024>>-e-14,xs[n|256]=1024>>-e-14|32768,ys[n]=-e-1,ys[n|256]=-e-1):e<=15?(xs[n]=e+15<<10,xs[n|256]=e+15<<10|32768,ys[n]=13,ys[n|256]=13):e<128?(xs[n]=31744,xs[n|256]=64512,ys[n]=24,ys[n|256]=24):(xs[n]=31744,xs[n|256]=64512,ys[n]=13,ys[n|256]=13)}function Zs(n){EP[0]=Nte(n);const e=MP[0],t=e>>23&511;return xs[t]+((e&8388607)>>ys[t])}const mA=new fA(2048);for(let n=1;n<1024;++n){let e=n<<13,t=0;for(;!(e&8388608);)e<<=1,t-=8388608;e&=-8388609,t+=947912704,mA[n]=e|t}for(let n=1024;n<2048;++n)mA[n]=939524096+(n-1024<<13);const Qd=new fA(64);for(let n=1;n<31;++n)Qd[n]=n<<23;Qd[31]=1199570944;Qd[32]=2147483648;for(let n=33;n<63;++n)Qd[n]=2147483648+(n-32<<23);Qd[63]=3347054592;const bP=new xr(64);for(let n=1;n<64;++n)n!==32&&(bP[n]=1024);function An(n){const e=n>>10;return MP[0]=mA[bP[e]+(n&1023)]+Qd[e],EP[0]}function zo(n){const e=+n;return Id(e)||e===0?0:hP(e)}function $2(n){const e=zo(n);return e<0?0:ee)return 1;if(n===0&&e===0){const a=cO(n,0),r=cO(e,0);if(!a&&r)return-1;if(a&&!r)return 1}return 0}const gA=2,t1=new py;function Yf(n){return Ste(t1,n)||!ete(n)&&Ate(n)}function Sn(n){if(!Yf(n))throw ai(Bee)}function qv(n,e){const t=Yf(n),i=$x(n);if(!t&&!i)throw ai(Hee);if(typeof e=="number"){let a;if(t){const r=Jt(n);a=Tn(r)}else a=Tn(n);if(a=0?a:i+a;if(!(r<0||r>=i))return An(t[r])}with(e,t){Sn(this);const i=Jt(this),a=Tn(i),r=zo(e),s=r>=0?r:a+r,o=+t;if(s<0||s>=a)throw J2(K2);const c=new xr(Ki(i),fu(i),Tn(i)),h=new Qi(Ki($p(c))),f=Jt(h);return f[s]=Zs(o),h}map(e,...t){Sn(this);const i=Jt(this),a=Tn(i),r=t[0],s=Yv(i,Qi);if(s===Qi){const c=new Qi(a),h=Jt(c);for(let f=0;f=0;--o)r=e(r,An(i[o]),o,this);return r}forEach(e,...t){Sn(this);const i=Jt(this),a=Tn(i),r=t[0];for(let s=0;s=0;--s){const o=An(i[s]);if(ja(e,r,[o,s,this]))return o}}findLastIndex(e,...t){Sn(this);const i=Jt(this),a=Tn(i),r=t[0];for(let s=a-1;s>=0;--s){const o=An(i[s]);if(ja(e,r,[o,s,this]))return s}return-1}every(e,...t){Sn(this);const i=Jt(this),a=Tn(i),r=t[0];for(let s=0;sr)throw J2(K2);for(let c=0;ci(An(a),An(r))),this}toSorted(e){Sn(this);const t=Jt(this);if(e!==void 0&&typeof e!="function")throw new ai(Gee);const i=e!==void 0?e:vO,a=new xr(Ki(t),fu(t),Tn(t)),r=new Qi(Ki($p(a))),s=Jt(r);return hO(s,(o,c)=>i(An(o),An(c))),r}slice(e,t){Sn(this);const i=Jt(this),a=Yv(i,Qi);if(a===Qi){const x=new xr(Ki(i),fu(i),Tn(i));return new Qi(Ki($p(x,e,t)))}const r=Tn(i),s=zo(e),o=t===void 0?r:zo(t);let c;s===-1/0?c=0:s<0?c=r+s>0?r+s:0:c=r0?r+o:0:h=r0?h-c:0,d=new a(f);if(qv(d,f),f===0)return d;const m=Ki(i);if(km(m))throw ai(Vm);let g=0;for(;c=1?zo(t[0]):a-1;if(r===-1/0)return-1;r>=0?r=r=0;--s)if(Xo(i,s)&&An(i[s])===e)return s;return-1}includes(e,...t){Sn(this);const i=Jt(this),a=Tn(i);let r=zo(t[0]);if(r===1/0)return!1;r<0&&(r+=a,r<0&&(r=0));const s=Id(e);for(let o=r;o{try{t(this.parser(s))}catch(o){a!=null?a(o):console.error(o),this.manager.itemError(e)}},i,a)}};function Ite(n){const e=n instanceof Int8Array?D1:n instanceof Uint8Array||n instanceof Uint8ClampedArray?zi:n instanceof Int16Array?O1:n instanceof Uint16Array?Yu:n instanceof Int32Array?L0:n instanceof Uint32Array?Ds:n instanceof ul?Xn:n instanceof Float32Array||n instanceof Float64Array?si:null;return Kx(e!=null),e}let Su=class extends Mi{constructor(e,t,i={},a){super(a),this.textureClass=e,this.parser=t,this.options={format:$n,minFilter:Ht,magFilter:Ht,...i}}load(e,t,i,a){const r=new this.textureClass,s=new Lte(this.parser,this.manager);return s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(this.withCredentials),s.load(e,o=>{r.image.data=o instanceof ul?new Uint16Array(o.buffer):o;const{width:c,height:h,depth:f,...d}=this.options;c!=null&&(r.image.width=c),h!=null&&(r.image.height=h),"depth"in r.image&&f!=null&&(r.image.depth=f),r.type=Ite(o),Object.assign(r,d),r.needsUpdate=!0,t==null||t(r)},i,a),r}};const i1=$t.clamp;$t.euclideanModulo;$t.inverseLerp;const wP=$t.lerp,Ute=$t.degToRad;$t.radToDeg;$t.isPowerOfTwo;$t.ceilPowerOfTwo;$t.floorPowerOfTwo;$t.normalize;function Pte(n,e,t,i=0,a=1){return $t.mapLinear(n,e,t,i,a)}function zte(n){return Math.min(Math.max(n,0),1)}function dn(n){return(e,t)=>{e instanceof qn?Object.defineProperty(e,t,{enumerable:!0,get(){var i;return((i=this.defines)==null?void 0:i[n])!=null},set(i){var a;i!==this[t]&&(i?(this.defines??(this.defines={}),this.defines[n]="1"):(a=this.defines)==null||delete a[n],this.needsUpdate=!0)}}):Object.defineProperty(e,t,{enumerable:!0,get(){return this.defines.has(n)},set(i){i!==this[t]&&(i?this.defines.set(n,"1"):this.defines.delete(n),this.setChanged())}})}}function mh(n,{min:e=Number.MIN_SAFE_INTEGER,max:t=Number.MAX_SAFE_INTEGER}={}){return(i,a)=>{i instanceof qn?Object.defineProperty(i,a,{enumerable:!0,get(){var s;const r=(s=this.defines)==null?void 0:s[n];return r!=null?parseInt(r,10):0},set(r){const s=this[a];r!==s&&(this.defines??(this.defines={}),this.defines[n]=i1(r,e,t).toFixed(0),this.needsUpdate=!0)}}):Object.defineProperty(i,a,{enumerable:!0,get(){const r=this.defines.get(n);return r!=null?parseInt(r,10):0},set(r){const s=this[a];r!==s&&(this.defines.set(n,i1(r,e,t).toFixed(0)),this.setChanged())}})}}function vA(n,{min:e=-1/0,max:t=1/0,precision:i=7}={}){return(a,r)=>{a instanceof qn?Object.defineProperty(a,r,{enumerable:!0,get(){var o;const s=(o=this.defines)==null?void 0:o[n];return s!=null?parseFloat(s):0},set(s){const o=this[r];s!==o&&(this.defines??(this.defines={}),this.defines[n]=i1(s,e,t).toFixed(i),this.needsUpdate=!0)}}):Object.defineProperty(a,r,{enumerable:!0,get(){const s=this.defines.get(n);return s!=null?parseFloat(s):0},set(s){const o=this[r];s!==o&&(this.defines.set(n,i1(s,e,t).toFixed(i)),this.setChanged())}})}}function RP(n,{validate:e}={}){return(t,i)=>{t instanceof qn?Object.defineProperty(t,i,{enumerable:!0,get(){var a;return((a=this.defines)==null?void 0:a[n])??""},set(a){if(a!==this[i]){if((e==null?void 0:e(a))===!1){console.error(`Expression validation failed: ${a}`);return}this.defines??(this.defines={}),this.defines[n]=a,this.needsUpdate=!0}}}):Object.defineProperty(t,i,{enumerable:!0,get(){return this.defines.get(n)??""},set(a){if(a!==this[i]){if((e==null?void 0:e(a))===!1){console.error(`Expression validation failed: ${a}`);return}this.defines.set(n,a),this.setChanged()}}})}}function xO(n,...e){const t={};for(let i=0;ia[s],set:o=>{a[s]=o}}}return Object.defineProperties(n,t),n}function yO(n,e,t){const i={};for(const a of t)i[a]={enumerable:!0,get:()=>e.uniforms[a].value,set:r=>{e.uniforms[a].value=r}};return Object.defineProperties(n,i),n}class e3 extends Mi{constructor(e={},t){super(t),this.options=e}load(e,t,i,a){const{width:r,height:s,depth:o}=this.options,c=new as(null,r,s,o),h=new nP(this.manager);return h.setRequestHeader(this.requestHeader),h.setPath(this.path),h.setWithCredentials(this.withCredentials),h.load(e,f=>{const{image:d}=f;c.image={data:d.data,width:r??d.width,height:s??d.height,depth:o??Math.sqrt(d.height)},c.type=f.type,c.format=f.format,c.colorSpace=f.colorSpace,c.needsUpdate=!0;try{t==null||t(c)}catch(m){a!=null?a(m):console.error(m),this.manager.itemError(e)}},i,a),c}}class SO extends Mi{constructor(e={},t){super(t),this.options=e}load(e,t,i,a){const{width:r,height:s}=this.options,o=new $a(null,r,s),c=new nP(this.manager);return c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,h=>{const{image:f}=h;o.image={data:f.data,width:r??f.width,height:s??f.height},o.type=h.type,o.format=h.format,o.colorSpace=h.colorSpace,o.needsUpdate=!0;try{t==null||t(o)}catch(d){a!=null?a(d):console.error(d),this.manager.itemError(e)}},i,a),o}}const Bte=/^[ \t]*#include +"([\w\d./]+)"/gm;function Na(n,e){return n.replace(Bte,(t,i)=>{const a=i.split("/").reduce((r,s)=>typeof r!="string"&&r!=null?r[s]:void 0,e);if(typeof a!="string")throw new Error(`Could not find include for ${i}.`);return Na(a,e)})}let jv;function Hte(){if(jv!=null)return jv;const n=new Uint32Array([268435456]);return jv=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)[0]===0,jv}function Fte(n,e,t,i=!0){if(i===Hte())return new e(n);const a=Object.assign(new DataView(n),{getFloat16(s,o){return Ote(this,s,o)}}),r=new e(a.byteLength/e.BYTES_PER_ELEMENT);for(let s=0,o=0;snew Uint8Array(n),em=(n,e)=>Fte(n,ul,"getFloat16",e);class NP extends Su{constructor(e){super(as,CP,{format:As,minFilter:Fn,magFilter:Fn,wrapS:Ea,wrapT:Ea,wrapR:Ea,width:Lee,height:Iee,depth:Uee},e)}}const Gte=/#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*i)\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Vte(n,e,t,i){let a="";for(let r=parseInt(e,10);r= 0.0 ? 1.0 : -1.0, v.y >= 0.0 ? 1.0 : -1.0); @@ -5455,7 +5455,7 @@ vec3 unpackVec2ToNormal(vec2 e) { } return normalize(v); } -`,jte=`float raySphereFirstIntersection( +`,Zte=`float raySphereFirstIntersection( const vec3 origin, const vec3 direction, const vec3 center, @@ -5589,7 +5589,7 @@ void raySphereIntersections( ) { raySphereIntersections(origin, direction, vec3(0.0), radius, intersection1, intersection2); } -`,Zte=`vec3 screenToView( +`,Kte=`vec3 screenToView( const vec2 uv, const float depth, const float viewZ, @@ -5601,7 +5601,7 @@ void raySphereIntersections( clip *= clipW; return (inverseProjectionMatrix * clip).xyz; } -`,Kte=`// A fifth-order polynomial approximation of Turbo color map. +`,Qte=`// A fifth-order polynomial approximation of Turbo color map. // See: https://observablehq.com/@mbostock/turbo // prettier-ignore vec3 turbo(const float x) { @@ -5610,7 +5610,7 @@ vec3 turbo(const float x) { float b = 0.1067 + x * (12.5925 - x * (60.1097 - x * (109.0745 - x * (88.5066 - x * 26.8183)))); return vec3(r, g, b); } -`,Qte=`// Reference: https://www.gamedev.net/tutorials/programming/graphics/contact-hardening-soft-shadows-made-fast-r4906/ +`,Jte=`// Reference: https://www.gamedev.net/tutorials/programming/graphics/contact-hardening-soft-shadows-made-fast-r4906/ vec2 vogelDisk(const int index, const int sampleCount, const float phi) { const float goldenAngle = 2.39996322972865332; @@ -5618,7 +5618,7 @@ vec2 vogelDisk(const int index, const int sampleCount, const float phi) { float theta = float(index) * goldenAngle + phi; return r * vec2(cos(theta), sin(theta)); } -`,CP=Vte,NP=kte,Jte=Wte,DP=Xte,mA=Yte,$te=qte,fy=jte,ene=Zte,OP=Kte,LP=Qte,Kd=64,Qd=16,dy=32,py=128,my=32,gy=8,Uu=gy*my,Pu=py,zu=dy,Jd=256,$d=64,t1=1/1e3,tne=new L;function gA(n,e,t,i){const a=t.projectOnSurface(n,tne);return a!=null?t.getOsculatingSphereCenter(a,e,i).negate():i.setScalar(0)}var nne="Invariant failed";function ine(n,e){if(!n)throw new Error(nne)}const xO=typeof window<"u"&&window.requestIdleCallback!=null?window.requestIdleCallback:function(n,e={}){const t=e.timeout??1,i=performance.now();return setTimeout(function(){n({get didTimeout(){return e.timeout!=null?!1:performance.now()-i-1>t},timeRemaining:function(){return Math.max(0,1+(performance.now()-i))}})},1)},Zs=`// Based on: https://github.com/ebruneton/precomputed_atmospheric_scattering/blob/master/atmosphere/functions.glsl +`,DP=kte,OP=Wte,$te=Xte,LP=Yte,_A=qte,ene=jte,my=Zte,tne=Kte,IP=Qte,UP=Jte,Jd=64,$d=16,gy=32,vy=128,_y=32,xy=8,zu=xy*_y,Bu=vy,Hu=gy,ep=256,tp=64,a1=1/1e3,nne=new L;function xA(n,e,t,i){const a=t.projectOnSurface(n,nne);return a!=null?t.getOsculatingSphereCenter(a,e,i).negate():i.setScalar(0)}var ine="Invariant failed";function ane(n,e){if(!n)throw new Error(ine)}const TO=typeof window<"u"&&window.requestIdleCallback!=null?window.requestIdleCallback:function(n,e={}){const t=e.timeout??1,i=performance.now();return setTimeout(function(){n({get didTimeout(){return e.timeout!=null?!1:performance.now()-i-1>t},timeRemaining:function(){return Math.max(0,1+(performance.now()-i))}})},1)},Ks=`// Based on: https://github.com/ebruneton/precomputed_atmospheric_scattering/blob/master/atmosphere/functions.glsl /** * Copyright (c) 2017 Eric Bruneton @@ -5898,7 +5898,7 @@ IrradianceSpectrum GetIrradiance( vec2 uv = GetIrradianceTextureUvFromRMuS(atmosphere, r, mu_s); return IrradianceSpectrum(texture(irradiance_texture, uv)); } -`,Ks=`// Based on: https://github.com/ebruneton/precomputed_atmospheric_scattering/blob/master/atmosphere/definitions.glsl +`,Qs=`// Based on: https://github.com/ebruneton/precomputed_atmospheric_scattering/blob/master/atmosphere/definitions.glsl /** * Copyright (c) 2017 Eric Bruneton @@ -6041,7 +6041,7 @@ struct AtmosphereParameters { DimensionlessSpectrum ground_albedo; Number mu_s_min; }; -`,vy=`// Based on: https://github.com/ebruneton/precomputed_atmospheric_scattering/blob/master/atmosphere/functions.glsl +`,yy=`// Based on: https://github.com/ebruneton/precomputed_atmospheric_scattering/blob/master/atmosphere/functions.glsl /** * Copyright (c) 2017 Eric Bruneton @@ -6502,7 +6502,7 @@ Illuminance3 GetSunAndSkyScalarIlluminance( #define GetSkyRadianceToPoint GetSkyLuminanceToPoint #define GetSunAndSkyIrradiance GetSunAndSkyIlluminance #define GetSunAndSkyScalarIrradiance GetSunAndSkyScalarIlluminance -`,_f=`// Based on: https://github.com/ebruneton/precomputed_atmospheric_scattering/blob/master/atmosphere/functions.glsl +`,yf=`// Based on: https://github.com/ebruneton/precomputed_atmospheric_scattering/blob/master/atmosphere/functions.glsl /** * Copyright (c) 2017 Eric Bruneton @@ -7143,7 +7143,7 @@ IrradianceSpectrum ComputeIndirectIrradianceTexture( single_rayleigh_scattering_texture, single_mie_scattering_texture, multiple_scattering_texture, r, mu_s, scattering_order); } -`,ane=new L(.2126,.7152,.0722),rne=["solarIrradiance","sunAngularRadius","bottomRadius","topRadius","rayleighDensity","rayleighScattering","mieDensity","mieScattering","mieExtinction","miePhaseFunctionG","absorptionDensity","absorptionExtinction","groundAlbedo","muSMin","skyRadianceToLuminance","sunRadianceToLuminance"];function sne(n,e){if(e!=null)for(const t of rne){const i=e[t];i!=null&&(n[t]instanceof L?n[t].copy(i):n[t]=i)}}class xf{constructor(e,t,i,a,r){this.width=e,this.expTerm=t,this.expScale=i,this.linearTerm=a,this.constantTerm=r}toUniform(){return new J({width:this.width,exp_term:this.expTerm,exp_scale:this.expScale,linear_term:this.linearTerm,constant_term:this.constantTerm})}}const VE=class{constructor(e){this.solarIrradiance=new L(1.474,1.8504,1.91198),this.sunAngularRadius=.004675,this.bottomRadius=636e4,this.topRadius=642e4,this.rayleighDensity=[new xf(0,0,0,0,0),new xf(0,1,-.125,0,0)],this.rayleighScattering=new L(.005802,.013558,.0331),this.mieDensity=[new xf(0,0,0,0,0),new xf(0,1,-.833333,0,0)],this.mieScattering=new L(.003996,.003996,.003996),this.mieExtinction=new L(.00444,.00444,.00444),this.miePhaseFunctionG=.8,this.absorptionDensity=[new xf(25,0,0,1/15,-2/3),new xf(0,0,0,-1/15,8/3)],this.absorptionExtinction=new L(65e-5,.001881,85e-6),this.groundAlbedo=new je().setScalar(.1),this.muSMin=Math.cos(Ite(120)),this.sunRadianceToLuminance=new L(98242.786222,69954.398112,66475.012354),this.skyRadianceToLuminance=new L(114974.916437,71305.954816,65310.548555),this.sunRadianceToRelativeLuminance=new L,this.skyRadianceToRelativeLuminance=new L,sne(this,e);const t=ane.dot(this.sunRadianceToLuminance);this.sunRadianceToRelativeLuminance.copy(this.sunRadianceToLuminance).divideScalar(t),this.skyRadianceToRelativeLuminance.copy(this.skyRadianceToLuminance).divideScalar(t)}toUniform(){return new J({solar_irradiance:this.solarIrradiance,sun_angular_radius:this.sunAngularRadius,bottom_radius:this.bottomRadius*t1,top_radius:this.topRadius*t1,rayleigh_density:{layers:this.rayleighDensity.map(e=>e.toUniform().value)},rayleigh_scattering:this.rayleighScattering,mie_density:{layers:this.mieDensity.map(e=>e.toUniform().value)},mie_scattering:this.mieScattering,mie_extinction:this.mieExtinction,mie_phase_function_g:this.miePhaseFunctionG,absorption_density:{layers:this.absorptionDensity.map(e=>e.toUniform().value)},absorption_extinction:this.absorptionExtinction,ground_albedo:this.groundAlbedo,mu_s_min:this.muSMin})}};VE.DEFAULT=new VE;let Y0=VE;const one=`precision highp sampler2DArray; +`,rne=new L(.2126,.7152,.0722),sne=["solarIrradiance","sunAngularRadius","bottomRadius","topRadius","rayleighDensity","rayleighScattering","mieDensity","mieScattering","mieExtinction","miePhaseFunctionG","absorptionDensity","absorptionExtinction","groundAlbedo","muSMin","skyRadianceToLuminance","sunRadianceToLuminance"];function one(n,e){if(e!=null)for(const t of sne){const i=e[t];i!=null&&(n[t]instanceof L?n[t].copy(i):n[t]=i)}}class Sf{constructor(e,t,i,a,r){this.width=e,this.expTerm=t,this.expScale=i,this.linearTerm=a,this.constantTerm=r}toUniform(){return new J({width:this.width,exp_term:this.expTerm,exp_scale:this.expScale,linear_term:this.linearTerm,constant_term:this.constantTerm})}}const XE=class{constructor(e){this.solarIrradiance=new L(1.474,1.8504,1.91198),this.sunAngularRadius=.004675,this.bottomRadius=636e4,this.topRadius=642e4,this.rayleighDensity=[new Sf(0,0,0,0,0),new Sf(0,1,-.125,0,0)],this.rayleighScattering=new L(.005802,.013558,.0331),this.mieDensity=[new Sf(0,0,0,0,0),new Sf(0,1,-.833333,0,0)],this.mieScattering=new L(.003996,.003996,.003996),this.mieExtinction=new L(.00444,.00444,.00444),this.miePhaseFunctionG=.8,this.absorptionDensity=[new Sf(25,0,0,1/15,-2/3),new Sf(0,0,0,-1/15,8/3)],this.absorptionExtinction=new L(65e-5,.001881,85e-6),this.groundAlbedo=new je().setScalar(.1),this.muSMin=Math.cos(Ute(120)),this.sunRadianceToLuminance=new L(98242.786222,69954.398112,66475.012354),this.skyRadianceToLuminance=new L(114974.916437,71305.954816,65310.548555),this.sunRadianceToRelativeLuminance=new L,this.skyRadianceToRelativeLuminance=new L,one(this,e);const t=rne.dot(this.sunRadianceToLuminance);this.sunRadianceToRelativeLuminance.copy(this.sunRadianceToLuminance).divideScalar(t),this.skyRadianceToRelativeLuminance.copy(this.skyRadianceToLuminance).divideScalar(t)}toUniform(){return new J({solar_irradiance:this.solarIrradiance,sun_angular_radius:this.sunAngularRadius,bottom_radius:this.bottomRadius*a1,top_radius:this.topRadius*a1,rayleigh_density:{layers:this.rayleighDensity.map(e=>e.toUniform().value)},rayleigh_scattering:this.rayleighScattering,mie_density:{layers:this.mieDensity.map(e=>e.toUniform().value)},mie_scattering:this.mieScattering,mie_extinction:this.mieExtinction,mie_phase_function_g:this.miePhaseFunctionG,absorption_density:{layers:this.absorptionDensity.map(e=>e.toUniform().value)},absorption_extinction:this.absorptionExtinction,ground_albedo:this.groundAlbedo,mu_s_min:this.muSMin})}};XE.DEFAULT=new XE;let j0=XE;const lne=`precision highp sampler2DArray; #include "core/depth" #include "core/math" @@ -7512,7 +7512,7 @@ void mainImage(const vec4 inputColor, const vec2 uv, out vec4 outputColor) { outputColor.rgb = outputColor.rgb * (1.0 - overlay.a) + overlay.rgb; #endif // HAS_OVERLAY } -`,lne=`uniform mat4 inverseViewMatrix; +`,cne=`uniform mat4 inverseViewMatrix; uniform mat4 inverseProjectionMatrix; uniform vec3 cameraPosition; uniform mat4 worldToECEFMatrix; @@ -7571,7 +7571,7 @@ void mainSupport() { vec3 radii = ellipsoidRadii * METER_TO_LENGTH_UNIT; vEllipsoidRadiiSquared = radii * radii; } -`,IP=`vec3 getLunarRadiance(const float moonAngularRadius) { +`,PP=`vec3 getLunarRadiance(const float moonAngularRadius) { // Not a physical number but the order of 10^-6 relative to the sun may fit. vec3 radiance = ATMOSPHERE.solar_irradiance * @@ -7657,9 +7657,9 @@ vec3 getSkyRadiance( return radiance; } -`;var cne=Object.defineProperty,ir=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&cne(e,t,a),a};const une=new L,hne=new L,fne=new q8,UP={blendFunction:ln.NORMAL,octEncodedNormal:!1,reconstructNormal:!1,ellipsoid:g0.WGS84,correctAltitude:!0,correctGeometricError:!0,sunLight:!1,skyLight:!1,transmittance:!0,inscatter:!0,albedoScale:1,sky:!1,sun:!0,moon:!0,moonAngularRadius:.0045,lunarRadianceScale:1,ground:!0};let za=class extends m0{constructor(e=new Tc,t,i=Y0.DEFAULT){const{blendFunction:a,normalBuffer:r=null,octEncodedNormal:s,reconstructNormal:o,irradianceTexture:c=null,scatteringTexture:h=null,transmittanceTexture:f=null,singleMieScatteringTexture:d=null,higherOrderScatteringTexture:m=null,ellipsoid:g,correctAltitude:x,correctGeometricError:T,sunDirection:S,sunIrradiance:v,sunLight:y,skyIrradiance:E,skyLight:b,transmittance:D,inscatter:C,irradianceScale:I,albedoScale:P,sky:O,sun:R,moon:B,moonDirection:j,moonAngularRadius:ee,lunarRadianceScale:se,ground:re}={...UP,...t};super("AerialPerspectiveEffect",X0(Ca(one,{core:{depth:NP,packing:$te,math:mA,transform:ene,raySphereIntersection:fy,cascadedShadowMaps:CP,interleavedGradientNoise:DP,vogelDisk:LP},bruneton:{common:Zs,definitions:Ks,runtime:vy},sky:IP})),{blendFunction:a,vertexShader:lne,attributes:Jo.DEPTH,uniforms:new Map(Object.entries({normalBuffer:new J(r),projectionMatrix:new J(new ke),viewMatrix:new J(new ke),inverseProjectionMatrix:new J(new ke),inverseViewMatrix:new J(new ke),cameraPosition:new J(new L),bottomRadius:new J(i.bottomRadius),ellipsoidRadii:new J(new L),worldToECEFMatrix:new J(new ke),altitudeCorrection:new J(new L),geometricErrorCorrectionAmount:new J(0),sunDirection:new J((S==null?void 0:S.clone())??new L),albedoScale:new J(I??P),moonDirection:new J((j==null?void 0:j.clone())??new L),moonAngularRadius:new J(ee),lunarRadianceScale:new J(se),overlayBuffer:new J(null),shadowBuffer:new J(null),shadowMapSize:new J(new de),shadowIntervals:new J([]),shadowMatrices:new J([]),inverseShadowMatrices:new J([]),shadowFar:new J(0),shadowTopHeight:new J(0),shadowRadius:new J(3),stbnTexture:new J(null),frame:new J(0),shadowLengthBuffer:new J(null),lightingMaskBuffer:new J(null),ATMOSPHERE:i.toUniform(),SUN_SPECTRAL_RADIANCE_TO_LUMINANCE:new J(i.sunRadianceToRelativeLuminance),SKY_SPECTRAL_RADIANCE_TO_LUMINANCE:new J(i.skyRadianceToRelativeLuminance),irradiance_texture:new J(c),scattering_texture:new J(h),transmittance_texture:new J(f),single_mie_scattering_texture:new J(null),higher_order_scattering_texture:new J(null)})),defines:new Map([["TRANSMITTANCE_TEXTURE_WIDTH",Jd.toFixed(0)],["TRANSMITTANCE_TEXTURE_HEIGHT",$d.toFixed(0)],["SCATTERING_TEXTURE_R_SIZE",dy.toFixed(0)],["SCATTERING_TEXTURE_MU_SIZE",py.toFixed(0)],["SCATTERING_TEXTURE_MU_S_SIZE",my.toFixed(0)],["SCATTERING_TEXTURE_NU_SIZE",gy.toFixed(0)],["IRRADIANCE_TEXTURE_WIDTH",Kd.toFixed(0)],["IRRADIANCE_TEXTURE_HEIGHT",Qd.toFixed(0)],["METER_TO_LENGTH_UNIT",t1.toFixed(7)]])}),this.camera=e,this.atmosphere=i,this.overlay=null,this.shadow=null,this.shadowLength=null,this.lightingMask=null,this.combinedScatteringTextures=!1,this.hasHigherOrderScatteringTexture=!1,this.shadowSampleCount=8,this.octEncodedNormal=s,this.reconstructNormal=o,this.singleMieScatteringTexture=d,this.higherOrderScatteringTexture=m,this.ellipsoid=g,this.correctAltitude=x,this.correctGeometricError=T,this.sunLight=v??y,this.skyLight=E??b,this.transmittance=D,this.inscatter=C,this.sky=O,this.sun=R,this.moon=B,this.ground=re}get mainCamera(){return this.camera}set mainCamera(e){this.camera=e}copyCameraSettings(e){const{projectionMatrix:t,matrixWorldInverse:i,projectionMatrixInverse:a,matrixWorld:r}=e,s=this.uniforms;s.get("projectionMatrix").value.copy(t),s.get("viewMatrix").value.copy(i),s.get("inverseProjectionMatrix").value.copy(a),s.get("inverseViewMatrix").value.copy(r);const o=e.getWorldPosition(s.get("cameraPosition").value),c=s.get("worldToECEFMatrix").value,h=une.copy(o).applyMatrix4(c);try{const d=fne.setFromECEF(h).height,m=hne.set(0,this.ellipsoid.maximumRadius,-Math.max(0,d)).applyMatrix4(t);s.get("geometricErrorCorrectionAmount").value=Pte(Ute(m.y,41.5,13.8,0,1))}catch{return}const f=s.get("altitudeCorrection");this.correctAltitude?gA(h,this.atmosphere.bottomRadius,this.ellipsoid,f.value):f.value.setScalar(0)}updateOverlay(){let e=!1;const{uniforms:t,defines:i,overlay:a}=this,r=i.has("HAS_OVERLAY"),s=a!=null;return s!==r&&(s?i.set("HAS_OVERLAY","1"):(i.delete("HAS_OVERLAY"),t.get("overlayBuffer").value=null),e=!0),s&&(t.get("overlayBuffer").value=a.map),e}updateShadow(){let e=!1;const{uniforms:t,defines:i,shadow:a}=this,r=i.has("HAS_SHADOW"),s=a!=null;if(s!==r&&(s?i.set("HAS_SHADOW","1"):(i.delete("HAS_SHADOW"),t.get("shadowBuffer").value=null),e=!0),s){const o=i.get("SHADOW_CASCADE_COUNT"),c=`${a.cascadeCount}`;o!==c&&(i.set("SHADOW_CASCADE_COUNT",a.cascadeCount.toFixed(0)),e=!0),t.get("shadowBuffer").value=a.map,t.get("shadowMapSize").value=a.mapSize,t.get("shadowIntervals").value=a.intervals,t.get("shadowMatrices").value=a.matrices,t.get("inverseShadowMatrices").value=a.inverseMatrices,t.get("shadowFar").value=a.far,t.get("shadowTopHeight").value=a.topHeight}return e}updateShadowLength(){let e=!1;const{uniforms:t,defines:i,shadowLength:a}=this,r=i.has("HAS_SHADOW_LENGTH"),s=a!=null;return s!==r&&(s?i.set("HAS_SHADOW_LENGTH","1"):(i.delete("HAS_SHADOW_LENGTH"),t.get("shadowLengthBuffer").value=null),e=!0),s&&(t.get("shadowLengthBuffer").value=a.map),e}updateLightingMask(){let e=!1;const{uniforms:t,defines:i,lightingMask:a}=this,r=i.has("HAS_LIGHTING_MASK"),s=a!=null;if(s!==r&&(s?i.set("HAS_LIGHTING_MASK","1"):(i.delete("HAS_LIGHTING_MASK"),t.get("lightingMaskBuffer").value=null),e=!0),s){t.get("lightingMaskBuffer").value=a.map;const o=i.get("LIGHTING_MASK_CHANNEL"),c=a.channel;c!==o&&(/^[rgba]$/.test(c)?(i.set("LIGHTING_MASK_CHANNEL",c),e=!0):console.error(`Expression validation failed: ${c}`))}return e}update(e,t,i){this.copyCameraSettings(this.camera);let a=!1;a||(a=this.updateOverlay()),a||(a=this.updateShadow()),a||(a=this.updateShadowLength()),a||(a=this.updateLightingMask()),a&&this.setChanged(),++this.uniforms.get("frame").value}get normalBuffer(){return this.uniforms.get("normalBuffer").value}set normalBuffer(e){this.uniforms.get("normalBuffer").value=e}get irradianceTexture(){return this.uniforms.get("irradiance_texture").value}set irradianceTexture(e){this.uniforms.get("irradiance_texture").value=e}get scatteringTexture(){return this.uniforms.get("scattering_texture").value}set scatteringTexture(e){this.uniforms.get("scattering_texture").value=e}get transmittanceTexture(){return this.uniforms.get("transmittance_texture").value}set transmittanceTexture(e){this.uniforms.get("transmittance_texture").value=e}get singleMieScatteringTexture(){return this.uniforms.get("single_mie_scattering_texture").value}set singleMieScatteringTexture(e){this.uniforms.get("single_mie_scattering_texture").value=e,this.combinedScatteringTextures=e==null}get higherOrderScatteringTexture(){return this.uniforms.get("higher_order_scattering_texture").value}set higherOrderScatteringTexture(e){this.uniforms.get("higher_order_scattering_texture").value=e,this.hasHigherOrderScatteringTexture=e!=null}get ellipsoid(){return this._ellipsoid}set ellipsoid(e){this._ellipsoid=e,this.uniforms.get("ellipsoidRadii").value.copy(e.radii)}get worldToECEFMatrix(){return this.uniforms.get("worldToECEFMatrix").value}get sunDirection(){return this.uniforms.get("sunDirection").value}get sunIrradiance(){return this.sunLight}set sunIrradiance(e){this.sunLight=e}get skyIrradiance(){return this.skyLight}set skyIrradiance(e){this.skyLight=e}get irradianceScale(){return this.albedoScale}set irradianceScale(e){this.albedoScale=e}get albedoScale(){return this.uniforms.get("albedoScale").value}set albedoScale(e){this.uniforms.get("albedoScale").value=e}get moonDirection(){return this.uniforms.get("moonDirection").value}get moonAngularRadius(){return this.uniforms.get("moonAngularRadius").value}set moonAngularRadius(e){this.uniforms.get("moonAngularRadius").value=e}get lunarRadianceScale(){return this.uniforms.get("lunarRadianceScale").value}set lunarRadianceScale(e){this.uniforms.get("lunarRadianceScale").value=e}get stbnTexture(){return this.uniforms.get("stbnTexture").value}set stbnTexture(e){this.uniforms.get("stbnTexture").value=e}get shadowRadius(){return this.uniforms.get("shadowRadius").value}set shadowRadius(e){this.uniforms.get("shadowRadius").value=e}};ir([dn("OCT_ENCODED_NORMAL")],za.prototype,"octEncodedNormal");ir([dn("RECONSTRUCT_NORMAL")],za.prototype,"reconstructNormal");ir([dn("COMBINED_SCATTERING_TEXTURES")],za.prototype,"combinedScatteringTextures");ir([dn("HAS_HIGHER_ORDER_SCATTERING_TEXTURE")],za.prototype,"hasHigherOrderScatteringTexture");ir([dn("CORRECT_GEOMETRIC_ERROR")],za.prototype,"correctGeometricError");ir([dn("SUN_LIGHT")],za.prototype,"sunLight");ir([dn("SKY_LIGHT")],za.prototype,"skyLight");ir([dn("TRANSMITTANCE")],za.prototype,"transmittance");ir([dn("INSCATTER")],za.prototype,"inscatter");ir([dn("SKY")],za.prototype,"sky");ir([dn("SUN")],za.prototype,"sun");ir([dn("MOON")],za.prototype,"moon");ir([dn("GROUND")],za.prototype,"ground");ir([dh("SHADOW_SAMPLE_COUNT",{min:1,max:16})],za.prototype,"shadowSampleCount");var dne=Object.defineProperty,PP=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&dne(e,t,a),a};const pne=new L;function mne(n,e){let t="",i="";for(let a=1;a{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&une(e,t,a),a};const hne=new L,fne=new L,dne=new Z8,zP={blendFunction:ln.NORMAL,octEncodedNormal:!1,reconstructNormal:!1,ellipsoid:_0.WGS84,correctAltitude:!0,correctGeometricError:!0,sunLight:!1,skyLight:!1,transmittance:!0,inscatter:!0,albedoScale:1,sky:!1,sun:!0,moon:!0,moonAngularRadius:.0045,lunarRadianceScale:1,ground:!0};let Ba=class extends v0{constructor(e=new bc,t,i=j0.DEFAULT){const{blendFunction:a,normalBuffer:r=null,octEncodedNormal:s,reconstructNormal:o,irradianceTexture:c=null,scatteringTexture:h=null,transmittanceTexture:f=null,singleMieScatteringTexture:d=null,higherOrderScatteringTexture:m=null,ellipsoid:g,correctAltitude:x,correctGeometricError:T,sunDirection:y,sunIrradiance:v,sunLight:S,skyIrradiance:E,skyLight:b,transmittance:D,inscatter:C,irradianceScale:I,albedoScale:P,sky:O,sun:w,moon:B,moonDirection:j,moonAngularRadius:ee,lunarRadianceScale:se,ground:re}={...zP,...t};super("AerialPerspectiveEffect",q0(Na(lne,{core:{depth:OP,packing:ene,math:_A,transform:tne,raySphereIntersection:my,cascadedShadowMaps:DP,interleavedGradientNoise:LP,vogelDisk:UP},bruneton:{common:Ks,definitions:Qs,runtime:yy},sky:PP})),{blendFunction:a,vertexShader:cne,attributes:$o.DEPTH,uniforms:new Map(Object.entries({normalBuffer:new J(r),projectionMatrix:new J(new ke),viewMatrix:new J(new ke),inverseProjectionMatrix:new J(new ke),inverseViewMatrix:new J(new ke),cameraPosition:new J(new L),bottomRadius:new J(i.bottomRadius),ellipsoidRadii:new J(new L),worldToECEFMatrix:new J(new ke),altitudeCorrection:new J(new L),geometricErrorCorrectionAmount:new J(0),sunDirection:new J((y==null?void 0:y.clone())??new L),albedoScale:new J(I??P),moonDirection:new J((j==null?void 0:j.clone())??new L),moonAngularRadius:new J(ee),lunarRadianceScale:new J(se),overlayBuffer:new J(null),shadowBuffer:new J(null),shadowMapSize:new J(new de),shadowIntervals:new J([]),shadowMatrices:new J([]),inverseShadowMatrices:new J([]),shadowFar:new J(0),shadowTopHeight:new J(0),shadowRadius:new J(3),stbnTexture:new J(null),frame:new J(0),shadowLengthBuffer:new J(null),lightingMaskBuffer:new J(null),ATMOSPHERE:i.toUniform(),SUN_SPECTRAL_RADIANCE_TO_LUMINANCE:new J(i.sunRadianceToRelativeLuminance),SKY_SPECTRAL_RADIANCE_TO_LUMINANCE:new J(i.skyRadianceToRelativeLuminance),irradiance_texture:new J(c),scattering_texture:new J(h),transmittance_texture:new J(f),single_mie_scattering_texture:new J(null),higher_order_scattering_texture:new J(null)})),defines:new Map([["TRANSMITTANCE_TEXTURE_WIDTH",ep.toFixed(0)],["TRANSMITTANCE_TEXTURE_HEIGHT",tp.toFixed(0)],["SCATTERING_TEXTURE_R_SIZE",gy.toFixed(0)],["SCATTERING_TEXTURE_MU_SIZE",vy.toFixed(0)],["SCATTERING_TEXTURE_MU_S_SIZE",_y.toFixed(0)],["SCATTERING_TEXTURE_NU_SIZE",xy.toFixed(0)],["IRRADIANCE_TEXTURE_WIDTH",Jd.toFixed(0)],["IRRADIANCE_TEXTURE_HEIGHT",$d.toFixed(0)],["METER_TO_LENGTH_UNIT",a1.toFixed(7)]])}),this.camera=e,this.atmosphere=i,this.overlay=null,this.shadow=null,this.shadowLength=null,this.lightingMask=null,this.combinedScatteringTextures=!1,this.hasHigherOrderScatteringTexture=!1,this.shadowSampleCount=8,this.octEncodedNormal=s,this.reconstructNormal=o,this.singleMieScatteringTexture=d,this.higherOrderScatteringTexture=m,this.ellipsoid=g,this.correctAltitude=x,this.correctGeometricError=T,this.sunLight=v??S,this.skyLight=E??b,this.transmittance=D,this.inscatter=C,this.sky=O,this.sun=w,this.moon=B,this.ground=re}get mainCamera(){return this.camera}set mainCamera(e){this.camera=e}copyCameraSettings(e){const{projectionMatrix:t,matrixWorldInverse:i,projectionMatrixInverse:a,matrixWorld:r}=e,s=this.uniforms;s.get("projectionMatrix").value.copy(t),s.get("viewMatrix").value.copy(i),s.get("inverseProjectionMatrix").value.copy(a),s.get("inverseViewMatrix").value.copy(r);const o=e.getWorldPosition(s.get("cameraPosition").value),c=s.get("worldToECEFMatrix").value,h=hne.copy(o).applyMatrix4(c);try{const d=dne.setFromECEF(h).height,m=fne.set(0,this.ellipsoid.maximumRadius,-Math.max(0,d)).applyMatrix4(t);s.get("geometricErrorCorrectionAmount").value=zte(Pte(m.y,41.5,13.8,0,1))}catch{return}const f=s.get("altitudeCorrection");this.correctAltitude?xA(h,this.atmosphere.bottomRadius,this.ellipsoid,f.value):f.value.setScalar(0)}updateOverlay(){let e=!1;const{uniforms:t,defines:i,overlay:a}=this,r=i.has("HAS_OVERLAY"),s=a!=null;return s!==r&&(s?i.set("HAS_OVERLAY","1"):(i.delete("HAS_OVERLAY"),t.get("overlayBuffer").value=null),e=!0),s&&(t.get("overlayBuffer").value=a.map),e}updateShadow(){let e=!1;const{uniforms:t,defines:i,shadow:a}=this,r=i.has("HAS_SHADOW"),s=a!=null;if(s!==r&&(s?i.set("HAS_SHADOW","1"):(i.delete("HAS_SHADOW"),t.get("shadowBuffer").value=null),e=!0),s){const o=i.get("SHADOW_CASCADE_COUNT"),c=`${a.cascadeCount}`;o!==c&&(i.set("SHADOW_CASCADE_COUNT",a.cascadeCount.toFixed(0)),e=!0),t.get("shadowBuffer").value=a.map,t.get("shadowMapSize").value=a.mapSize,t.get("shadowIntervals").value=a.intervals,t.get("shadowMatrices").value=a.matrices,t.get("inverseShadowMatrices").value=a.inverseMatrices,t.get("shadowFar").value=a.far,t.get("shadowTopHeight").value=a.topHeight}return e}updateShadowLength(){let e=!1;const{uniforms:t,defines:i,shadowLength:a}=this,r=i.has("HAS_SHADOW_LENGTH"),s=a!=null;return s!==r&&(s?i.set("HAS_SHADOW_LENGTH","1"):(i.delete("HAS_SHADOW_LENGTH"),t.get("shadowLengthBuffer").value=null),e=!0),s&&(t.get("shadowLengthBuffer").value=a.map),e}updateLightingMask(){let e=!1;const{uniforms:t,defines:i,lightingMask:a}=this,r=i.has("HAS_LIGHTING_MASK"),s=a!=null;if(s!==r&&(s?i.set("HAS_LIGHTING_MASK","1"):(i.delete("HAS_LIGHTING_MASK"),t.get("lightingMaskBuffer").value=null),e=!0),s){t.get("lightingMaskBuffer").value=a.map;const o=i.get("LIGHTING_MASK_CHANNEL"),c=a.channel;c!==o&&(/^[rgba]$/.test(c)?(i.set("LIGHTING_MASK_CHANNEL",c),e=!0):console.error(`Expression validation failed: ${c}`))}return e}update(e,t,i){this.copyCameraSettings(this.camera);let a=!1;a||(a=this.updateOverlay()),a||(a=this.updateShadow()),a||(a=this.updateShadowLength()),a||(a=this.updateLightingMask()),a&&this.setChanged(),++this.uniforms.get("frame").value}get normalBuffer(){return this.uniforms.get("normalBuffer").value}set normalBuffer(e){this.uniforms.get("normalBuffer").value=e}get irradianceTexture(){return this.uniforms.get("irradiance_texture").value}set irradianceTexture(e){this.uniforms.get("irradiance_texture").value=e}get scatteringTexture(){return this.uniforms.get("scattering_texture").value}set scatteringTexture(e){this.uniforms.get("scattering_texture").value=e}get transmittanceTexture(){return this.uniforms.get("transmittance_texture").value}set transmittanceTexture(e){this.uniforms.get("transmittance_texture").value=e}get singleMieScatteringTexture(){return this.uniforms.get("single_mie_scattering_texture").value}set singleMieScatteringTexture(e){this.uniforms.get("single_mie_scattering_texture").value=e,this.combinedScatteringTextures=e==null}get higherOrderScatteringTexture(){return this.uniforms.get("higher_order_scattering_texture").value}set higherOrderScatteringTexture(e){this.uniforms.get("higher_order_scattering_texture").value=e,this.hasHigherOrderScatteringTexture=e!=null}get ellipsoid(){return this._ellipsoid}set ellipsoid(e){this._ellipsoid=e,this.uniforms.get("ellipsoidRadii").value.copy(e.radii)}get worldToECEFMatrix(){return this.uniforms.get("worldToECEFMatrix").value}get sunDirection(){return this.uniforms.get("sunDirection").value}get sunIrradiance(){return this.sunLight}set sunIrradiance(e){this.sunLight=e}get skyIrradiance(){return this.skyLight}set skyIrradiance(e){this.skyLight=e}get irradianceScale(){return this.albedoScale}set irradianceScale(e){this.albedoScale=e}get albedoScale(){return this.uniforms.get("albedoScale").value}set albedoScale(e){this.uniforms.get("albedoScale").value=e}get moonDirection(){return this.uniforms.get("moonDirection").value}get moonAngularRadius(){return this.uniforms.get("moonAngularRadius").value}set moonAngularRadius(e){this.uniforms.get("moonAngularRadius").value=e}get lunarRadianceScale(){return this.uniforms.get("lunarRadianceScale").value}set lunarRadianceScale(e){this.uniforms.get("lunarRadianceScale").value=e}get stbnTexture(){return this.uniforms.get("stbnTexture").value}set stbnTexture(e){this.uniforms.get("stbnTexture").value=e}get shadowRadius(){return this.uniforms.get("shadowRadius").value}set shadowRadius(e){this.uniforms.get("shadowRadius").value=e}};ar([dn("OCT_ENCODED_NORMAL")],Ba.prototype,"octEncodedNormal");ar([dn("RECONSTRUCT_NORMAL")],Ba.prototype,"reconstructNormal");ar([dn("COMBINED_SCATTERING_TEXTURES")],Ba.prototype,"combinedScatteringTextures");ar([dn("HAS_HIGHER_ORDER_SCATTERING_TEXTURE")],Ba.prototype,"hasHigherOrderScatteringTexture");ar([dn("CORRECT_GEOMETRIC_ERROR")],Ba.prototype,"correctGeometricError");ar([dn("SUN_LIGHT")],Ba.prototype,"sunLight");ar([dn("SKY_LIGHT")],Ba.prototype,"skyLight");ar([dn("TRANSMITTANCE")],Ba.prototype,"transmittance");ar([dn("INSCATTER")],Ba.prototype,"inscatter");ar([dn("SKY")],Ba.prototype,"sky");ar([dn("SUN")],Ba.prototype,"sun");ar([dn("MOON")],Ba.prototype,"moon");ar([dn("GROUND")],Ba.prototype,"ground");ar([mh("SHADOW_SAMPLE_COUNT",{min:1,max:16})],Ba.prototype,"shadowSampleCount");var pne=Object.defineProperty,BP=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&pne(e,t,a),a};const mne=new L;function gne(n,e){let t="",i="";for(let a=1;a",t).replace("#include ",i)}const vA={ellipsoid:g0.WGS84,correctAltitude:!0,renderTargetCount:1};class q0 extends ch{constructor(e,t=Y0.DEFAULT){const{irradianceTexture:i=null,scatteringTexture:a=null,transmittanceTexture:r=null,singleMieScatteringTexture:s=null,higherOrderScatteringTexture:o=null,ellipsoid:c,correctAltitude:h,sunDirection:f,sunAngularRadius:d,renderTargetCount:m,...g}={...vA,...e};super({toneMapped:!1,depthWrite:!1,depthTest:!1,...g,uniforms:{cameraPosition:new J(new L),worldToECEFMatrix:new J(new ke),altitudeCorrection:new J(new L),sunDirection:new J((f==null?void 0:f.clone())??new L),ATMOSPHERE:t.toUniform(),SUN_SPECTRAL_RADIANCE_TO_LUMINANCE:new J(t.sunRadianceToRelativeLuminance),SKY_SPECTRAL_RADIANCE_TO_LUMINANCE:new J(t.skyRadianceToRelativeLuminance),irradiance_texture:new J(i),scattering_texture:new J(a),transmittance_texture:new J(r),single_mie_scattering_texture:new J(null),higher_order_scattering_texture:new J(null),...g.uniforms},defines:{PI:`${Math.PI}`,TRANSMITTANCE_TEXTURE_WIDTH:Jd.toFixed(0),TRANSMITTANCE_TEXTURE_HEIGHT:$d.toFixed(0),SCATTERING_TEXTURE_R_SIZE:dy.toFixed(0),SCATTERING_TEXTURE_MU_SIZE:py.toFixed(0),SCATTERING_TEXTURE_MU_S_SIZE:my.toFixed(0),SCATTERING_TEXTURE_NU_SIZE:gy.toFixed(0),IRRADIANCE_TEXTURE_WIDTH:Kd.toFixed(0),IRRADIANCE_TEXTURE_HEIGHT:Qd.toFixed(0),METER_TO_LENGTH_UNIT:t1.toFixed(7),...g.defines}}),this.atmosphere=t,this.combinedScatteringTextures=!1,this.hasHigherOrderScatteringTexture=!1,this.singleMieScatteringTexture=s,this.higherOrderScatteringTexture=o,this.ellipsoid=c,this.correctAltitude=h,d!=null&&(this.sunAngularRadius=d),this.renderTargetCount=m}copyCameraSettings(e){const t=this.uniforms,i=e.getWorldPosition(t.cameraPosition.value),a=pne.copy(i).applyMatrix4(t.worldToECEFMatrix.value),r=t.altitudeCorrection.value;this.correctAltitude?gA(a,this.atmosphere.bottomRadius,this.ellipsoid,r):r.setScalar(0)}onBeforeCompile(e,t){e.fragmentShader=mne(e.fragmentShader,this.renderTargetCount)}onBeforeRender(e,t,i,a,r,s){this.copyCameraSettings(i)}get irradianceTexture(){return this.uniforms.irradiance_texture.value}set irradianceTexture(e){this.uniforms.irradiance_texture.value=e}get scatteringTexture(){return this.uniforms.scattering_texture.value}set scatteringTexture(e){this.uniforms.scattering_texture.value=e}get transmittanceTexture(){return this.uniforms.transmittance_texture.value}set transmittanceTexture(e){this.uniforms.transmittance_texture.value=e}get singleMieScatteringTexture(){return this.uniforms.single_mie_scattering_texture.value}set singleMieScatteringTexture(e){this.uniforms.single_mie_scattering_texture.value=e,this.combinedScatteringTextures=e==null}get higherOrderScatteringTexture(){return this.uniforms.higher_order_scattering_texture.value}set higherOrderScatteringTexture(e){this.uniforms.higher_order_scattering_texture.value=e,this.hasHigherOrderScatteringTexture=e!=null}get worldToECEFMatrix(){return this.uniforms.worldToECEFMatrix.value}get sunDirection(){return this.uniforms.sunDirection.value}get sunAngularRadius(){return this.uniforms.ATMOSPHERE.value.sun_angular_radius}set sunAngularRadius(e){this.uniforms.ATMOSPHERE.value.sun_angular_radius=e}get renderTargetCount(){return this._renderTargetCount}set renderTargetCount(e){e!==this.renderTargetCount&&(this._renderTargetCount=e,this.needsUpdate=!0)}}PP([dn("COMBINED_SCATTERING_TEXTURES")],q0.prototype,"combinedScatteringTextures");PP([dn("HAS_HIGHER_ORDER_SCATTERING_TEXTURE")],q0.prototype,"hasHigherOrderScatteringTexture");/** +`;return n.replace("#include ",t).replace("#include ",i)}const yA={ellipsoid:_0.WGS84,correctAltitude:!0,renderTargetCount:1};class Z0 extends hh{constructor(e,t=j0.DEFAULT){const{irradianceTexture:i=null,scatteringTexture:a=null,transmittanceTexture:r=null,singleMieScatteringTexture:s=null,higherOrderScatteringTexture:o=null,ellipsoid:c,correctAltitude:h,sunDirection:f,sunAngularRadius:d,renderTargetCount:m,...g}={...yA,...e};super({toneMapped:!1,depthWrite:!1,depthTest:!1,...g,uniforms:{cameraPosition:new J(new L),worldToECEFMatrix:new J(new ke),altitudeCorrection:new J(new L),sunDirection:new J((f==null?void 0:f.clone())??new L),ATMOSPHERE:t.toUniform(),SUN_SPECTRAL_RADIANCE_TO_LUMINANCE:new J(t.sunRadianceToRelativeLuminance),SKY_SPECTRAL_RADIANCE_TO_LUMINANCE:new J(t.skyRadianceToRelativeLuminance),irradiance_texture:new J(i),scattering_texture:new J(a),transmittance_texture:new J(r),single_mie_scattering_texture:new J(null),higher_order_scattering_texture:new J(null),...g.uniforms},defines:{PI:`${Math.PI}`,TRANSMITTANCE_TEXTURE_WIDTH:ep.toFixed(0),TRANSMITTANCE_TEXTURE_HEIGHT:tp.toFixed(0),SCATTERING_TEXTURE_R_SIZE:gy.toFixed(0),SCATTERING_TEXTURE_MU_SIZE:vy.toFixed(0),SCATTERING_TEXTURE_MU_S_SIZE:_y.toFixed(0),SCATTERING_TEXTURE_NU_SIZE:xy.toFixed(0),IRRADIANCE_TEXTURE_WIDTH:Jd.toFixed(0),IRRADIANCE_TEXTURE_HEIGHT:$d.toFixed(0),METER_TO_LENGTH_UNIT:a1.toFixed(7),...g.defines}}),this.atmosphere=t,this.combinedScatteringTextures=!1,this.hasHigherOrderScatteringTexture=!1,this.singleMieScatteringTexture=s,this.higherOrderScatteringTexture=o,this.ellipsoid=c,this.correctAltitude=h,d!=null&&(this.sunAngularRadius=d),this.renderTargetCount=m}copyCameraSettings(e){const t=this.uniforms,i=e.getWorldPosition(t.cameraPosition.value),a=mne.copy(i).applyMatrix4(t.worldToECEFMatrix.value),r=t.altitudeCorrection.value;this.correctAltitude?xA(a,this.atmosphere.bottomRadius,this.ellipsoid,r):r.setScalar(0)}onBeforeCompile(e,t){e.fragmentShader=gne(e.fragmentShader,this.renderTargetCount)}onBeforeRender(e,t,i,a,r,s){this.copyCameraSettings(i)}get irradianceTexture(){return this.uniforms.irradiance_texture.value}set irradianceTexture(e){this.uniforms.irradiance_texture.value=e}get scatteringTexture(){return this.uniforms.scattering_texture.value}set scatteringTexture(e){this.uniforms.scattering_texture.value=e}get transmittanceTexture(){return this.uniforms.transmittance_texture.value}set transmittanceTexture(e){this.uniforms.transmittance_texture.value=e}get singleMieScatteringTexture(){return this.uniforms.single_mie_scattering_texture.value}set singleMieScatteringTexture(e){this.uniforms.single_mie_scattering_texture.value=e,this.combinedScatteringTextures=e==null}get higherOrderScatteringTexture(){return this.uniforms.higher_order_scattering_texture.value}set higherOrderScatteringTexture(e){this.uniforms.higher_order_scattering_texture.value=e,this.hasHigherOrderScatteringTexture=e!=null}get worldToECEFMatrix(){return this.uniforms.worldToECEFMatrix.value}get sunDirection(){return this.uniforms.sunDirection.value}get sunAngularRadius(){return this.uniforms.ATMOSPHERE.value.sun_angular_radius}set sunAngularRadius(e){this.uniforms.ATMOSPHERE.value.sun_angular_radius=e}get renderTargetCount(){return this._renderTargetCount}set renderTargetCount(e){e!==this.renderTargetCount&&(this._renderTargetCount=e,this.needsUpdate=!0)}}BP([dn("COMBINED_SCATTERING_TEXTURES")],Z0.prototype,"combinedScatteringTextures");BP([dn("HAS_HIGHER_ORDER_SCATTERING_TEXTURE")],Z0.prototype,"hasHigherOrderScatteringTexture");/** @preserve Astronomy library for JavaScript (browser and Node.js). @@ -7690,7 +7690,7 @@ vec3 getSkyRadiance( * @fileoverview Astronomy calculation library for browser scripting and Node.js. * @author Don Cross * @license MIT - */const gne=173.1446326846693,vne=14959787069098932e-8,$u=.017453292519943295,_ne=365.24217,yO=new Date("2000-01-01T12:00:00Z"),zo=2*Math.PI,Pl=3600*(180/Math.PI),Xf=484813681109536e-20,xne=10800*60,yne=2*xne,Sne=6378.1366,Tne=Sne/vne,Ene=81.30056,_A=.0002959122082855911,kE=2825345909524226e-22,WE=8459715185680659e-23,XE=1292024916781969e-23,YE=1524358900784276e-23;function y_(n){if(!Number.isFinite(n))throw console.trace(),`Value is not a finite number: ${n}`;return n}function yf(n){return n-Math.floor(n)}var zn;(function(n){n.Sun="Sun",n.Moon="Moon",n.Mercury="Mercury",n.Venus="Venus",n.Earth="Earth",n.Mars="Mars",n.Jupiter="Jupiter",n.Saturn="Saturn",n.Uranus="Uranus",n.Neptune="Neptune",n.Pluto="Pluto",n.SSB="SSB",n.EMB="EMB",n.Star1="Star1",n.Star2="Star2",n.Star3="Star3",n.Star4="Star4",n.Star5="Star5",n.Star6="Star6",n.Star7="Star7",n.Star8="Star8"})(zn||(zn={}));const Mne=[zn.Star1,zn.Star2,zn.Star3,zn.Star4,zn.Star5,zn.Star6,zn.Star7,zn.Star8],bne=[{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0}];function Ane(n){const e=Mne.indexOf(n);return e>=0?bne[e]:null}function zP(n){const e=Ane(n);return e&&e.dist>0?e:null}var rl;(function(n){n[n.From2000=0]="From2000",n[n.Into2000=1]="Into2000"})(rl||(rl={}));const Yf={Mercury:[[[[4.40250710144,0,0],[.40989414977,1.48302034195,26087.9031415742],[.050462942,4.47785489551,52175.8062831484],[.00855346844,1.16520322459,78263.70942472259],[.00165590362,4.11969163423,104351.61256629678],[.00034561897,.77930768443,130439.51570787099],[7583476e-11,3.71348404924,156527.41884944518]],[[26087.90313685529,0,0],[.01131199811,6.21874197797,26087.9031415742],[.00292242298,3.04449355541,52175.8062831484],[.00075775081,6.08568821653,78263.70942472259],[.00019676525,2.80965111777,104351.61256629678]]],[[[.11737528961,1.98357498767,26087.9031415742],[.02388076996,5.03738959686,52175.8062831484],[.01222839532,3.14159265359,0],[.0054325181,1.79644363964,78263.70942472259],[.0012977877,4.83232503958,104351.61256629678],[.00031866927,1.58088495658,130439.51570787099],[7963301e-11,4.60972126127,156527.41884944518]],[[.00274646065,3.95008450011,26087.9031415742],[.00099737713,3.14159265359,0]]],[[[.39528271651,0,0],[.07834131818,6.19233722598,26087.9031415742],[.00795525558,2.95989690104,52175.8062831484],[.00121281764,6.01064153797,78263.70942472259],[.00021921969,2.77820093972,104351.61256629678],[4354065e-11,5.82894543774,130439.51570787099]],[[.0021734774,4.65617158665,26087.9031415742],[.00044141826,1.42385544001,52175.8062831484]]]],Venus:[[[[3.17614666774,0,0],[.01353968419,5.59313319619,10213.285546211],[.00089891645,5.30650047764,20426.571092422],[5477194e-11,4.41630661466,7860.4193924392],[3455741e-11,2.6996444782,11790.6290886588],[2372061e-11,2.99377542079,3930.2096962196],[1317168e-11,5.18668228402,26.2983197998],[1664146e-11,4.25018630147,1577.3435424478],[1438387e-11,4.15745084182,9683.5945811164],[1200521e-11,6.15357116043,30639.856638633]],[[10213.28554621638,0,0],[.00095617813,2.4640651111,10213.285546211],[7787201e-11,.6247848222,20426.571092422]]],[[[.05923638472,.26702775812,10213.285546211],[.00040107978,1.14737178112,20426.571092422],[.00032814918,3.14159265359,0]],[[.00287821243,1.88964962838,10213.285546211]]],[[[.72334820891,0,0],[.00489824182,4.02151831717,10213.285546211],[1658058e-11,4.90206728031,20426.571092422],[1378043e-11,1.12846591367,11790.6290886588],[1632096e-11,2.84548795207,7860.4193924392],[498395e-11,2.58682193892,9683.5945811164],[221985e-11,2.01346696541,19367.1891622328],[237454e-11,2.55136053886,15720.8387848784]],[[.00034551041,.89198706276,10213.285546211]]]],Earth:[[[[1.75347045673,0,0],[.03341656453,4.66925680415,6283.0758499914],[.00034894275,4.62610242189,12566.1516999828],[3417572e-11,2.82886579754,3.523118349],[3497056e-11,2.74411783405,5753.3848848968],[3135899e-11,3.62767041756,77713.7714681205],[2676218e-11,4.41808345438,7860.4193924392],[2342691e-11,6.13516214446,3930.2096962196],[1273165e-11,2.03709657878,529.6909650946],[1324294e-11,.74246341673,11506.7697697936],[901854e-11,2.04505446477,26.2983197998],[1199167e-11,1.10962946234,1577.3435424478],[857223e-11,3.50849152283,398.1490034082],[779786e-11,1.17882681962,5223.6939198022],[99025e-10,5.23268072088,5884.9268465832],[753141e-11,2.53339052847,5507.5532386674],[505267e-11,4.58292599973,18849.2275499742],[492392e-11,4.20505711826,775.522611324],[356672e-11,2.91954114478,.0673103028],[284125e-11,1.89869240932,796.2980068164],[242879e-11,.34481445893,5486.777843175],[317087e-11,5.84901948512,11790.6290886588],[271112e-11,.31486255375,10977.078804699],[206217e-11,4.80646631478,2544.3144198834],[205478e-11,1.86953770281,5573.1428014331],[202318e-11,2.45767790232,6069.7767545534],[126225e-11,1.08295459501,20.7753954924],[155516e-11,.83306084617,213.299095438]],[[6283.0758499914,0,0],[.00206058863,2.67823455808,6283.0758499914],[4303419e-11,2.63512233481,12566.1516999828]],[[8721859e-11,1.07253635559,6283.0758499914]]],[[],[[.00227777722,3.4137662053,6283.0758499914],[3805678e-11,3.37063423795,12566.1516999828]]],[[[1.00013988784,0,0],[.01670699632,3.09846350258,6283.0758499914],[.00013956024,3.05524609456,12566.1516999828],[308372e-10,5.19846674381,77713.7714681205],[1628463e-11,1.17387558054,5753.3848848968],[1575572e-11,2.84685214877,7860.4193924392],[924799e-11,5.45292236722,11506.7697697936],[542439e-11,4.56409151453,3930.2096962196],[47211e-10,3.66100022149,5884.9268465832],[85831e-11,1.27079125277,161000.6857376741],[57056e-11,2.01374292245,83996.84731811189],[55736e-11,5.2415979917,71430.69561812909],[174844e-11,3.01193636733,18849.2275499742],[243181e-11,4.2734953079,11790.6290886588]],[[.00103018607,1.10748968172,6283.0758499914],[1721238e-11,1.06442300386,12566.1516999828]],[[4359385e-11,5.78455133808,6283.0758499914]]]],Mars:[[[[6.20347711581,0,0],[.18656368093,5.0503710027,3340.6124266998],[.01108216816,5.40099836344,6681.2248533996],[.00091798406,5.75478744667,10021.8372800994],[.00027744987,5.97049513147,3.523118349],[.00010610235,2.93958560338,2281.2304965106],[.00012315897,.84956094002,2810.9214616052],[8926784e-11,4.15697846427,.0172536522],[8715691e-11,6.11005153139,13362.4497067992],[6797556e-11,.36462229657,398.1490034082],[7774872e-11,3.33968761376,5621.8429232104],[3575078e-11,1.6618650571,2544.3144198834],[4161108e-11,.22814971327,2942.4634232916],[3075252e-11,.85696614132,191.4482661116],[2628117e-11,.64806124465,3337.0893083508],[2937546e-11,6.07893711402,.0673103028],[2389414e-11,5.03896442664,796.2980068164],[2579844e-11,.02996736156,3344.1355450488],[1528141e-11,1.14979301996,6151.533888305],[1798806e-11,.65634057445,529.6909650946],[1264357e-11,3.62275122593,5092.1519581158],[1286228e-11,3.06796065034,2146.1654164752],[1546404e-11,2.91579701718,1751.539531416],[1024902e-11,3.69334099279,8962.4553499102],[891566e-11,.18293837498,16703.062133499],[858759e-11,2.4009381194,2914.0142358238],[832715e-11,2.46418619474,3340.5951730476],[83272e-10,4.49495782139,3340.629680352],[712902e-11,3.66335473479,1059.3819301892],[748723e-11,3.82248614017,155.4203994342],[723861e-11,.67497311481,3738.761430108],[635548e-11,2.92182225127,8432.7643848156],[655162e-11,.48864064125,3127.3133312618],[550474e-11,3.81001042328,.9803210682],[55275e-10,4.47479317037,1748.016413067],[425966e-11,.55364317304,6283.0758499914],[415131e-11,.49662285038,213.299095438],[472167e-11,3.62547124025,1194.4470102246],[306551e-11,.38052848348,6684.7479717486],[312141e-11,.99853944405,6677.7017350506],[293198e-11,4.22131299634,20.7753954924],[302375e-11,4.48618007156,3532.0606928114],[274027e-11,.54222167059,3340.545116397],[281079e-11,5.88163521788,1349.8674096588],[231183e-11,1.28242156993,3870.3033917944],[283602e-11,5.7688543494,3149.1641605882],[236117e-11,5.75503217933,3333.498879699],[274033e-11,.13372524985,3340.6797370026],[299395e-11,2.78323740866,6254.6266625236]],[[3340.61242700512,0,0],[.01457554523,3.60433733236,3340.6124266998],[.00168414711,3.92318567804,6681.2248533996],[.00020622975,4.26108844583,10021.8372800994],[3452392e-11,4.7321039319,3.523118349],[2586332e-11,4.60670058555,13362.4497067992],[841535e-11,4.45864030426,2281.2304965106]],[[.00058152577,2.04961712429,3340.6124266998],[.00013459579,2.45738706163,6681.2248533996]]],[[[.03197134986,3.76832042431,3340.6124266998],[.00298033234,4.10616996305,6681.2248533996],[.00289104742,0,0],[.00031365539,4.4465105309,10021.8372800994],[34841e-9,4.7881254926,13362.4497067992]],[[.00217310991,6.04472194776,3340.6124266998],[.00020976948,3.14159265359,0],[.00012834709,1.60810667915,6681.2248533996]]],[[[1.53033488271,0,0],[.1418495316,3.47971283528,3340.6124266998],[.00660776362,3.81783443019,6681.2248533996],[.00046179117,4.15595316782,10021.8372800994],[8109733e-11,5.55958416318,2810.9214616052],[7485318e-11,1.77239078402,5621.8429232104],[5523191e-11,1.3643630377,2281.2304965106],[382516e-10,4.49407183687,13362.4497067992],[2306537e-11,.09081579001,2544.3144198834],[1999396e-11,5.36059617709,3337.0893083508],[2484394e-11,4.9254563992,2942.4634232916],[1960195e-11,4.74249437639,3344.1355450488],[1167119e-11,2.11260868341,5092.1519581158],[1102816e-11,5.00908403998,398.1490034082],[899066e-11,4.40791133207,529.6909650946],[992252e-11,5.83861961952,6151.533888305],[807354e-11,2.10217065501,1059.3819301892],[797915e-11,3.44839203899,796.2980068164],[740975e-11,1.49906336885,2146.1654164752]],[[.01107433345,2.03250524857,3340.6124266998],[.00103175887,2.37071847807,6681.2248533996],[128772e-9,0,0],[.0001081588,2.70888095665,10021.8372800994]],[[.00044242249,.47930604954,3340.6124266998],[8138042e-11,.86998389204,6681.2248533996]]]],Jupiter:[[[[.59954691494,0,0],[.09695898719,5.06191793158,529.6909650946],[.00573610142,1.44406205629,7.1135470008],[.00306389205,5.41734730184,1059.3819301892],[.00097178296,4.14264726552,632.7837393132],[.00072903078,3.64042916389,522.5774180938],[.00064263975,3.41145165351,103.0927742186],[.00039806064,2.29376740788,419.4846438752],[.00038857767,1.27231755835,316.3918696566],[.00027964629,1.7845459182,536.8045120954],[.0001358973,5.7748104079,1589.0728952838],[8246349e-11,3.5822792584,206.1855484372],[8768704e-11,3.63000308199,949.1756089698],[7368042e-11,5.0810119427,735.8765135318],[626315e-10,.02497628807,213.299095438],[6114062e-11,4.51319998626,1162.4747044078],[4905396e-11,1.32084470588,110.2063212194],[5305285e-11,1.30671216791,14.2270940016],[5305441e-11,4.18625634012,1052.2683831884],[4647248e-11,4.69958103684,3.9321532631],[3045023e-11,4.31676431084,426.598190876],[2609999e-11,1.56667394063,846.0828347512],[2028191e-11,1.06376530715,3.1813937377],[1764763e-11,2.14148655117,1066.49547719],[1722972e-11,3.88036268267,1265.5674786264],[1920945e-11,.97168196472,639.897286314],[1633223e-11,3.58201833555,515.463871093],[1431999e-11,4.29685556046,625.6701923124],[973272e-11,4.09764549134,95.9792272178]],[[529.69096508814,0,0],[.00489503243,4.2208293947,529.6909650946],[.00228917222,6.02646855621,7.1135470008],[.00030099479,4.54540782858,1059.3819301892],[.0002072092,5.45943156902,522.5774180938],[.00012103653,.16994816098,536.8045120954],[6067987e-11,4.42422292017,103.0927742186],[5433968e-11,3.98480737746,419.4846438752],[4237744e-11,5.89008707199,14.2270940016]],[[.00047233601,4.32148536482,7.1135470008],[.00030649436,2.929777887,529.6909650946],[.00014837605,3.14159265359,0]]],[[[.02268615702,3.55852606721,529.6909650946],[.00109971634,3.90809347197,1059.3819301892],[.00110090358,0,0],[8101428e-11,3.60509572885,522.5774180938],[6043996e-11,4.25883108339,1589.0728952838],[6437782e-11,.30627119215,536.8045120954]],[[.00078203446,1.52377859742,529.6909650946]]],[[[5.20887429326,0,0],[.25209327119,3.49108639871,529.6909650946],[.00610599976,3.84115365948,1059.3819301892],[.00282029458,2.57419881293,632.7837393132],[.00187647346,2.07590383214,522.5774180938],[.00086792905,.71001145545,419.4846438752],[.00072062974,.21465724607,536.8045120954],[.00065517248,5.9799588479,316.3918696566],[.00029134542,1.67759379655,103.0927742186],[.00030135335,2.16132003734,949.1756089698],[.00023453271,3.54023522184,735.8765135318],[.00022283743,4.19362594399,1589.0728952838],[.00023947298,.2745803748,7.1135470008],[.00013032614,2.96042965363,1162.4747044078],[970336e-10,1.90669633585,206.1855484372],[.00012749023,2.71550286592,1052.2683831884],[7057931e-11,2.18184839926,1265.5674786264],[6137703e-11,6.26418240033,846.0828347512],[2616976e-11,2.00994012876,1581.959348283]],[[.0127180152,2.64937512894,529.6909650946],[.00061661816,3.00076460387,1059.3819301892],[.00053443713,3.89717383175,522.5774180938],[.00031185171,4.88276958012,536.8045120954],[.00041390269,0,0]]]],Saturn:[[[[.87401354025,0,0],[.11107659762,3.96205090159,213.299095438],[.01414150957,4.58581516874,7.1135470008],[.00398379389,.52112032699,206.1855484372],[.00350769243,3.30329907896,426.598190876],[.00206816305,.24658372002,103.0927742186],[792713e-9,3.84007056878,220.4126424388],[.00023990355,4.66976924553,110.2063212194],[.00016573588,.43719228296,419.4846438752],[.00014906995,5.76903183869,316.3918696566],[.0001582029,.93809155235,632.7837393132],[.00014609559,1.56518472,3.9321532631],[.00013160301,4.44891291899,14.2270940016],[.00015053543,2.71669915667,639.897286314],[.00013005299,5.98119023644,11.0457002639],[.00010725067,3.12939523827,202.2533951741],[5863206e-11,.23656938524,529.6909650946],[5227757e-11,4.20783365759,3.1813937377],[6126317e-11,1.76328667907,277.0349937414],[5019687e-11,3.17787728405,433.7117378768],[459255e-10,.61977744975,199.0720014364],[4005867e-11,2.24479718502,63.7358983034],[2953796e-11,.98280366998,95.9792272178],[387367e-10,3.22283226966,138.5174968707],[2461186e-11,2.03163875071,735.8765135318],[3269484e-11,.77492638211,949.1756089698],[1758145e-11,3.2658010994,522.5774180938],[1640172e-11,5.5050445305,846.0828347512],[1391327e-11,4.02333150505,323.5054166574],[1580648e-11,4.37265307169,309.2783226558],[1123498e-11,2.83726798446,415.5524906121],[1017275e-11,3.71700135395,227.5261894396],[848642e-11,3.1915017083,209.3669421749]],[[213.2990952169,0,0],[.01297370862,1.82834923978,213.299095438],[.00564345393,2.88499717272,7.1135470008],[.00093734369,1.06311793502,426.598190876],[.00107674962,2.27769131009,206.1855484372],[.00040244455,2.04108104671,220.4126424388],[.00019941774,1.2795439047,103.0927742186],[.00010511678,2.7488034213,14.2270940016],[6416106e-11,.38238295041,639.897286314],[4848994e-11,2.43037610229,419.4846438752],[4056892e-11,2.92133209468,110.2063212194],[3768635e-11,3.6496533078,3.9321532631]],[[.0011644133,1.17988132879,7.1135470008],[.00091841837,.0732519584,213.299095438],[.00036661728,0,0],[.00015274496,4.06493179167,206.1855484372]]],[[[.04330678039,3.60284428399,213.299095438],[.00240348302,2.85238489373,426.598190876],[.00084745939,0,0],[.00030863357,3.48441504555,220.4126424388],[.00034116062,.57297307557,206.1855484372],[.0001473407,2.11846596715,639.897286314],[9916667e-11,5.79003188904,419.4846438752],[6993564e-11,4.7360468972,7.1135470008],[4807588e-11,5.43305312061,316.3918696566]],[[.00198927992,4.93901017903,213.299095438],[.00036947916,3.14159265359,0],[.00017966989,.5197943111,426.598190876]]],[[[9.55758135486,0,0],[.52921382865,2.39226219573,213.299095438],[.01873679867,5.2354960466,206.1855484372],[.01464663929,1.64763042902,426.598190876],[.00821891141,5.93520042303,316.3918696566],[.00547506923,5.0153261898,103.0927742186],[.0037168465,2.27114821115,220.4126424388],[.00361778765,3.13904301847,7.1135470008],[.00140617506,5.70406606781,632.7837393132],[.00108974848,3.29313390175,110.2063212194],[.00069006962,5.94099540992,419.4846438752],[.00061053367,.94037691801,639.897286314],[.00048913294,1.55733638681,202.2533951741],[.00034143772,.19519102597,277.0349937414],[.00032401773,5.47084567016,949.1756089698],[.00020936596,.46349251129,735.8765135318],[9796004e-11,5.20477537945,1265.5674786264],[.00011993338,5.98050967385,846.0828347512],[208393e-9,1.52102476129,433.7117378768],[.00015298404,3.0594381494,529.6909650946],[6465823e-11,.17732249942,1052.2683831884],[.00011380257,1.7310542704,522.5774180938],[3419618e-11,4.94550542171,1581.959348283]],[[.0618298134,.2584351148,213.299095438],[.00506577242,.71114625261,206.1855484372],[.00341394029,5.79635741658,426.598190876],[.00188491195,.47215589652,220.4126424388],[.00186261486,3.14159265359,0],[.00143891146,1.40744822888,7.1135470008]],[[.00436902572,4.78671677509,213.299095438]]]],Uranus:[[[[5.48129294297,0,0],[.09260408234,.89106421507,74.7815985673],[.01504247898,3.6271926092,1.4844727083],[.00365981674,1.89962179044,73.297125859],[.00272328168,3.35823706307,149.5631971346],[.00070328461,5.39254450063,63.7358983034],[.00068892678,6.09292483287,76.2660712756],[.00061998615,2.26952066061,2.9689454166],[.00061950719,2.85098872691,11.0457002639],[.0002646877,3.14152083966,71.8126531507],[.00025710476,6.11379840493,454.9093665273],[.0002107885,4.36059339067,148.0787244263],[.00017818647,1.74436930289,36.6485629295],[.00014613507,4.73732166022,3.9321532631],[.00011162509,5.8268179635,224.3447957019],[.0001099791,.48865004018,138.5174968707],[9527478e-11,2.95516862826,35.1640902212],[7545601e-11,5.236265824,109.9456887885],[4220241e-11,3.23328220918,70.8494453042],[40519e-9,2.277550173,151.0476698429],[3354596e-11,1.0654900738,4.4534181249],[2926718e-11,4.62903718891,9.5612275556],[349034e-10,5.48306144511,146.594251718],[3144069e-11,4.75199570434,77.7505439839],[2922333e-11,5.35235361027,85.8272988312],[2272788e-11,4.36600400036,70.3281804424],[2051219e-11,1.51773566586,.1118745846],[2148602e-11,.60745949945,38.1330356378],[1991643e-11,4.92437588682,277.0349937414],[1376226e-11,2.04283539351,65.2203710117],[1666902e-11,3.62744066769,380.12776796],[1284107e-11,3.11347961505,202.2533951741],[1150429e-11,.93343589092,3.1813937377],[1533221e-11,2.58594681212,52.6901980395],[1281604e-11,.54271272721,222.8603229936],[1372139e-11,4.19641530878,111.4301614968],[1221029e-11,.1990065003,108.4612160802],[946181e-11,1.19253165736,127.4717966068],[1150989e-11,4.17898916639,33.6796175129]],[[74.7815986091,0,0],[.00154332863,5.24158770553,74.7815985673],[.00024456474,1.71260334156,1.4844727083],[9258442e-11,.4282973235,11.0457002639],[8265977e-11,1.50218091379,63.7358983034],[915016e-10,1.41213765216,149.5631971346]]],[[[.01346277648,2.61877810547,74.7815985673],[623414e-9,5.08111189648,149.5631971346],[.00061601196,3.14159265359,0],[9963722e-11,1.61603805646,76.2660712756],[992616e-10,.57630380333,73.297125859]],[[.00034101978,.01321929936,74.7815985673]]],[[[19.21264847206,0,0],[.88784984413,5.60377527014,74.7815985673],[.03440836062,.32836099706,73.297125859],[.0205565386,1.7829515933,149.5631971346],[.0064932241,4.52247285911,76.2660712756],[.00602247865,3.86003823674,63.7358983034],[.00496404167,1.40139935333,454.9093665273],[.00338525369,1.58002770318,138.5174968707],[.00243509114,1.57086606044,71.8126531507],[.00190522303,1.99809394714,1.4844727083],[.00161858838,2.79137786799,148.0787244263],[.00143706183,1.38368544947,11.0457002639],[.00093192405,.17437220467,36.6485629295],[.00071424548,4.24509236074,224.3447957019],[.00089806014,3.66105364565,109.9456887885],[.00039009723,1.66971401684,70.8494453042],[.00046677296,1.39976401694,35.1640902212],[.00039025624,3.36234773834,277.0349937414],[.00036755274,3.88649278513,146.594251718],[.00030348723,.70100838798,151.0476698429],[.00029156413,3.180563367,77.7505439839],[.00022637073,.72518687029,529.6909650946],[.00011959076,1.7504339214,984.6003316219],[.00025620756,5.25656086672,380.12776796]],[[.01479896629,3.67205697578,74.7815985673]]]],Neptune:[[[[5.31188633046,0,0],[.0179847553,2.9010127389,38.1330356378],[.01019727652,.48580922867,1.4844727083],[.00124531845,4.83008090676,36.6485629295],[.00042064466,5.41054993053,2.9689454166],[.00037714584,6.09221808686,35.1640902212],[.00033784738,1.24488874087,76.2660712756],[.00016482741,7727998e-11,491.5579294568],[9198584e-11,4.93747051954,39.6175083461],[899425e-10,.27462171806,175.1660598002]],[[38.13303563957,0,0],[.00016604172,4.86323329249,1.4844727083],[.00015744045,2.27887427527,38.1330356378]]],[[[.03088622933,1.44104372644,38.1330356378],[.00027780087,5.91271884599,76.2660712756],[.00027623609,0,0],[.00015355489,2.52123799551,36.6485629295],[.00015448133,3.50877079215,39.6175083461]]],[[[30.07013205828,0,0],[.27062259632,1.32999459377,38.1330356378],[.01691764014,3.25186135653,36.6485629295],[.00807830553,5.18592878704,1.4844727083],[.0053776051,4.52113935896,35.1640902212],[.00495725141,1.5710564165,491.5579294568],[.00274571975,1.84552258866,175.1660598002],[.0001201232,1.92059384991,1021.2488945514],[.00121801746,5.79754470298,76.2660712756],[.00100896068,.3770272493,73.297125859],[.00135134092,3.37220609835,39.6175083461],[7571796e-11,1.07149207335,388.4651552382]]]]};function Rne(n){var e,t,i,a,r,s,o;const c=2e3+(n-14)/_ne;return c<-500?(e=(c-1820)/100,-20+32*e*e):c<500?(e=c/100,t=e*e,i=e*t,a=t*t,r=t*i,s=i*i,10583.6-1014.41*e+33.78311*t-5.952053*i-.1798452*a+.022174192*r+.0090316521*s):c<1600?(e=(c-1e3)/100,t=e*e,i=e*t,a=t*t,r=t*i,s=i*i,1574.2-556.01*e+71.23472*t+.319781*i-.8503463*a-.005050998*r+.0083572073*s):c<1700?(e=c-1600,t=e*e,i=e*t,120-.9808*e-.01532*t+i/7129):c<1800?(e=c-1700,t=e*e,i=e*t,a=t*t,8.83+.1603*e-.0059285*t+13336e-8*i-a/1174e3):c<1860?(e=c-1800,t=e*e,i=e*t,a=t*t,r=t*i,s=i*i,o=i*a,13.72-.332447*e+.0068612*t+.0041116*i-37436e-8*a+121272e-10*r-1699e-10*s+875e-12*o):c<1900?(e=c-1860,t=e*e,i=e*t,a=t*t,r=t*i,7.62+.5737*e-.251754*t+.01680668*i-.0004473624*a+r/233174):c<1920?(e=c-1900,t=e*e,i=e*t,a=t*t,-2.79+1.494119*e-.0598939*t+.0061966*i-197e-6*a):c<1941?(e=c-1920,t=e*e,i=e*t,21.2+.84493*e-.0761*t+.0020936*i):c<1961?(e=c-1950,t=e*e,i=e*t,29.07+.407*e-t/233+i/2547):c<1986?(e=c-1975,t=e*e,i=e*t,45.45+1.067*e-t/260-i/718):c<2005?(e=c-2e3,t=e*e,i=e*t,a=t*t,r=t*i,63.86+.3345*e-.060374*t+.0017275*i+651814e-9*a+2373599e-11*r):c<2050?(e=c-2e3,62.92+.32217*e+.005589*e*e):c<2150?(e=(c-1820)/100,-20+32*e*e-.5628*(2150-c)):(e=(c-1820)/100,-20+32*e*e)}let wne=Rne;function SO(n){return n+wne(n)/86400}class lc{constructor(e){if(e instanceof lc){this.date=e.date,this.ut=e.ut,this.tt=e.tt;return}const t=1e3*3600*24;if(e instanceof Date&&Number.isFinite(e.getTime())){this.date=e,this.ut=(e.getTime()-yO.getTime())/t,this.tt=SO(this.ut);return}if(Number.isFinite(e)){this.date=new Date(yO.getTime()+e*t),this.ut=e,this.tt=SO(this.ut);return}throw"Argument must be a Date object, an AstroTime object, or a numeric UTC Julian date."}static FromTerrestrialTime(e){let t=new lc(e);for(;;){const i=e-t.tt;if(Math.abs(i)<1e-12)return t;t=t.AddDays(i)}}toString(){return this.date.toISOString()}AddDays(e){return new lc(this.ut+e)}}function ph(n){return n instanceof lc?n:new lc(n)}function Cne(n){function e(m){return m%yne*Xf}const t=n.tt/36525,i=e(128710479305e-5+t*1295965810481e-4),a=e(335779.526232+t*17395272628478e-4),r=e(107226070369e-5+t*1602961601209e-3),s=e(450160.398036-t*69628905431e-4);let o=Math.sin(s),c=Math.cos(s),h=(-172064161-174666*t)*o+33386*c,f=(92052331+9086*t)*c+15377*o,d=2*(a-r+s);return o=Math.sin(d),c=Math.cos(d),h+=(-13170906-1675*t)*o-13696*c,f+=(5730336-3015*t)*c-4587*o,d=2*(a+s),o=Math.sin(d),c=Math.cos(d),h+=(-2276413-234*t)*o+2796*c,f+=(978459-485*t)*c+1374*o,d=2*s,o=Math.sin(d),c=Math.cos(d),h+=(2074554+207*t)*o-698*c,f+=(-897492+470*t)*c-291*o,o=Math.sin(i),c=Math.cos(i),h+=(1475877-3633*t)*o+11817*c,f+=(73871-184*t)*c-1924*o,{dpsi:-135e-6+h*1e-7,deps:388e-6+f*1e-7}}function BP(n){var e=n.tt/36525,t=((((-434e-10*e-576e-9)*e+.0020034)*e-1831e-7)*e-46.836769)*e+84381.406;return t/3600}var qv;function HP(n){if(!qv||Math.abs(qv.tt-n.tt)>1e-6){const e=Cne(n),t=BP(n),i=t+e.deps/3600;qv={tt:n.tt,dpsi:e.dpsi,deps:e.deps,ee:e.dpsi*Math.cos(t*$u)/15,mobl:t,tobl:i}}return qv}function Nne(n,e){const t=n*$u,i=Math.cos(t),a=Math.sin(t);return[e[0],e[1]*i-e[2]*a,e[1]*a+e[2]*i]}function Dne(n,e){return Nne(BP(n),e)}function One(n){const e=n.tt/36525;function t(ot,Ke){const Te=[];let G;for(G=0;G<=Ke-ot;++G)Te.push(0);return{min:ot,array:Te}}function i(ot,Ke,Te,G){const Me=[];for(let De=0;De<=Ke-ot;++De)Me.push(t(Te,G));return{min:ot,array:Me}}function a(ot,Ke,Te){const G=ot.array[Ke-ot.min];return G.array[Te-G.min]}function r(ot,Ke,Te,G){const Me=ot.array[Ke-ot.min];Me.array[Te-Me.min]=G}let s,o,c,h,f,d,m,g,x,T,S,v,y,E,b,D,C,I,P,O,R,B,j,ee=i(-6,6,1,4),se=i(-6,6,1,4);function re(ot,Ke){return a(ee,ot,Ke)}function W(ot,Ke){return a(se,ot,Ke)}function te(ot,Ke,Te){return r(ee,ot,Ke,Te)}function K(ot,Ke,Te){return r(se,ot,Ke,Te)}function oe(ot,Ke,Te,G,Me){Me(ot*Te-Ke*G,Ke*Te+ot*G)}function ie(ot){return Math.sin(zo*ot)}m=e*e,x=0,j=0,S=0,v=3422.7;var Ce=ie(.19833+.05611*e),Xe=ie(.27869+.04508*e),nt=ie(.16827-.36903*e),tt=ie(.34734-5.37261*e),gt=ie(.10498-5.37899*e),ge=ie(.42681-.41855*e),Ae=ie(.14943-5.37511*e);for(I=.84*Ce+.31*Xe+14.27*nt+7.26*tt+.28*gt+.24*ge,P=2.94*Ce+.31*Xe+14.27*nt+9.34*tt+1.12*gt+.83*ge,O=-6.4*Ce-1.89*ge,R=.21*Ce+.31*Xe+14.27*nt-88.7*tt-15.3*gt+.24*ge-1.86*Ae,B=I-O,g=-3332e-9*ie(.59734-5.37261*e)-539e-9*ie(.35498-5.37899*e)-64e-9*ie(.39943-5.37511*e),y=zo*yf(.60643382+1336.85522467*e-313e-8*m)+I/Pl,E=zo*yf(.37489701+1325.55240982*e+2565e-8*m)+P/Pl,b=zo*yf(.99312619+99.99735956*e-44e-8*m)+O/Pl,D=zo*yf(.25909118+1342.2278298*e-892e-8*m)+R/Pl,C=zo*yf(.82736186+1236.85308708*e-397e-8*m)+B/Pl,f=1;f<=4;++f){switch(f){case 1:c=E,o=4,h=1.000002208;break;case 2:c=b,o=3,h=.997504612-.002495388*e;break;case 3:c=D,o=4,h=1.000002708+139.978*g;break;case 4:c=C,o=6,h=1;break;default:throw`Internal error: I = ${f}`}for(te(0,f,1),te(1,f,Math.cos(c)*h),K(0,f,0),K(1,f,Math.sin(c)*h),d=2;d<=o;++d)oe(re(d-1,f),W(d-1,f),re(1,f),W(1,f),(ot,Ke)=>(te(d,f,ot),K(d,f,Ke)));for(d=1;d<=o;++d)te(-d,f,re(d,f)),K(-d,f,-W(d,f))}function Ze(ot,Ke,Te,G){for(var Me={x:1,y:0},De=[0,ot,Ke,Te,G],Fe=1;Fe<=4;++Fe)De[Fe]!==0&&oe(Me.x,Me.y,re(De[Fe],Fe),W(De[Fe],Fe),(Be,$e)=>(Me.x=Be,Me.y=$e));return Me}function ue(ot,Ke,Te,G,Me,De,Fe,Be){var $e=Ze(Me,De,Fe,Be);x+=ot*$e.y,j+=Ke*$e.y,S+=Te*$e.x,v+=G*$e.x}ue(13.902,14.06,-.001,.2607,0,0,0,4),ue(.403,-4.01,.394,.0023,0,0,0,3),ue(2369.912,2373.36,.601,28.2333,0,0,0,2),ue(-125.154,-112.79,-.725,-.9781,0,0,0,1),ue(1.979,6.98,-.445,.0433,1,0,0,4),ue(191.953,192.72,.029,3.0861,1,0,0,2),ue(-8.466,-13.51,.455,-.1093,1,0,0,1),ue(22639.5,22609.07,.079,186.5398,1,0,0,0),ue(18.609,3.59,-.094,.0118,1,0,0,-1),ue(-4586.465,-4578.13,-.077,34.3117,1,0,0,-2),ue(3.215,5.44,.192,-.0386,1,0,0,-3),ue(-38.428,-38.64,.001,.6008,1,0,0,-4),ue(-.393,-1.43,-.092,.0086,1,0,0,-6),ue(-.289,-1.59,.123,-.0053,0,1,0,4),ue(-24.42,-25.1,.04,-.3,0,1,0,2),ue(18.023,17.93,.007,.1494,0,1,0,1),ue(-668.146,-126.98,-1.302,-.3997,0,1,0,0),ue(.56,.32,-.001,-.0037,0,1,0,-1),ue(-165.145,-165.06,.054,1.9178,0,1,0,-2),ue(-1.877,-6.46,-.416,.0339,0,1,0,-4),ue(.213,1.02,-.074,.0054,2,0,0,4),ue(14.387,14.78,-.017,.2833,2,0,0,2),ue(-.586,-1.2,.054,-.01,2,0,0,1),ue(769.016,767.96,.107,10.1657,2,0,0,0),ue(1.75,2.01,-.018,.0155,2,0,0,-1),ue(-211.656,-152.53,5.679,-.3039,2,0,0,-2),ue(1.225,.91,-.03,-.0088,2,0,0,-3),ue(-30.773,-34.07,-.308,.3722,2,0,0,-4),ue(-.57,-1.4,-.074,.0109,2,0,0,-6),ue(-2.921,-11.75,.787,-.0484,1,1,0,2),ue(1.267,1.52,-.022,.0164,1,1,0,1),ue(-109.673,-115.18,.461,-.949,1,1,0,0),ue(-205.962,-182.36,2.056,1.4437,1,1,0,-2),ue(.233,.36,.012,-.0025,1,1,0,-3),ue(-4.391,-9.66,-.471,.0673,1,1,0,-4),ue(.283,1.53,-.111,.006,1,-1,0,4),ue(14.577,31.7,-1.54,.2302,1,-1,0,2),ue(147.687,138.76,.679,1.1528,1,-1,0,0),ue(-1.089,.55,.021,0,1,-1,0,-1),ue(28.475,23.59,-.443,-.2257,1,-1,0,-2),ue(-.276,-.38,-.006,-.0036,1,-1,0,-3),ue(.636,2.27,.146,-.0102,1,-1,0,-4),ue(-.189,-1.68,.131,-.0028,0,2,0,2),ue(-7.486,-.66,-.037,-.0086,0,2,0,0),ue(-8.096,-16.35,-.74,.0918,0,2,0,-2),ue(-5.741,-.04,0,-9e-4,0,0,2,2),ue(.255,0,0,0,0,0,2,1),ue(-411.608,-.2,0,-.0124,0,0,2,0),ue(.584,.84,0,.0071,0,0,2,-1),ue(-55.173,-52.14,0,-.1052,0,0,2,-2),ue(.254,.25,0,-.0017,0,0,2,-3),ue(.025,-1.67,0,.0031,0,0,2,-4),ue(1.06,2.96,-.166,.0243,3,0,0,2),ue(36.124,50.64,-1.3,.6215,3,0,0,0),ue(-13.193,-16.4,.258,-.1187,3,0,0,-2),ue(-1.187,-.74,.042,.0074,3,0,0,-4),ue(-.293,-.31,-.002,.0046,3,0,0,-6),ue(-.29,-1.45,.116,-.0051,2,1,0,2),ue(-7.649,-10.56,.259,-.1038,2,1,0,0),ue(-8.627,-7.59,.078,-.0192,2,1,0,-2),ue(-2.74,-2.54,.022,.0324,2,1,0,-4),ue(1.181,3.32,-.212,.0213,2,-1,0,2),ue(9.703,11.67,-.151,.1268,2,-1,0,0),ue(-.352,-.37,.001,-.0028,2,-1,0,-1),ue(-2.494,-1.17,-.003,-.0017,2,-1,0,-2),ue(.36,.2,-.012,-.0043,2,-1,0,-4),ue(-1.167,-1.25,.008,-.0106,1,2,0,0),ue(-7.412,-6.12,.117,.0484,1,2,0,-2),ue(-.311,-.65,-.032,.0044,1,2,0,-4),ue(.757,1.82,-.105,.0112,1,-2,0,2),ue(2.58,2.32,.027,.0196,1,-2,0,0),ue(2.533,2.4,-.014,-.0212,1,-2,0,-2),ue(-.344,-.57,-.025,.0036,0,3,0,-2),ue(-.992,-.02,0,0,1,0,2,2),ue(-45.099,-.02,0,-.001,1,0,2,0),ue(-.179,-9.52,0,-.0833,1,0,2,-2),ue(-.301,-.33,0,.0014,1,0,2,-4),ue(-6.382,-3.37,0,-.0481,1,0,-2,2),ue(39.528,85.13,0,-.7136,1,0,-2,0),ue(9.366,.71,0,-.0112,1,0,-2,-2),ue(.202,.02,0,0,1,0,-2,-4),ue(.415,.1,0,.0013,0,1,2,0),ue(-2.152,-2.26,0,-.0066,0,1,2,-2),ue(-1.44,-1.3,0,.0014,0,1,-2,2),ue(.384,-.04,0,0,0,1,-2,-2),ue(1.938,3.6,-.145,.0401,4,0,0,0),ue(-.952,-1.58,.052,-.013,4,0,0,-2),ue(-.551,-.94,.032,-.0097,3,1,0,0),ue(-.482,-.57,.005,-.0045,3,1,0,-2),ue(.681,.96,-.026,.0115,3,-1,0,0),ue(-.297,-.27,.002,-9e-4,2,2,0,-2),ue(.254,.21,-.003,0,2,-2,0,-2),ue(-.25,-.22,.004,.0014,1,3,0,-2),ue(-3.996,0,0,4e-4,2,0,2,0),ue(.557,-.75,0,-.009,2,0,2,-2),ue(-.459,-.38,0,-.0053,2,0,-2,2),ue(-1.298,.74,0,4e-4,2,0,-2,0),ue(.538,1.14,0,-.0141,2,0,-2,-2),ue(.263,.02,0,0,1,1,2,0),ue(.426,.07,0,-6e-4,1,1,-2,-2),ue(-.304,.03,0,3e-4,1,-1,2,0),ue(-.372,-.19,0,-.0027,1,-1,-2,2),ue(.418,0,0,0,0,0,4,0),ue(-.33,-.04,0,0,3,0,2,0);function it(ot,Ke,Te,G,Me){return ot*Ze(Ke,Te,G,Me).y}T=0,T+=it(-526.069,0,0,1,-2),T+=it(-3.352,0,0,1,-4),T+=it(44.297,1,0,1,-2),T+=it(-6,1,0,1,-4),T+=it(20.599,-1,0,1,0),T+=it(-30.598,-1,0,1,-2),T+=it(-24.649,-2,0,1,0),T+=it(-2,-2,0,1,-2),T+=it(-22.571,0,1,1,-2),T+=it(10.985,0,-1,1,-2),x+=.82*ie(.7736-62.5512*e)+.31*ie(.0466-125.1025*e)+.35*ie(.5785-25.1042*e)+.66*ie(.4591+1335.8075*e)+.64*ie(.313-91.568*e)+1.14*ie(.148+1331.2898*e)+.21*ie(.5918+1056.5859*e)+.44*ie(.5784+1322.8595*e)+.24*ie(.2275-5.7374*e)+.28*ie(.2965+2.6929*e)+.33*ie(.3132+6.3368*e),s=D+j/Pl;let Mt=(1.000002708+139.978*g)*(18518.511+1.189+S)*Math.sin(s)-6.24*Math.sin(3*s)+T;return{geo_eclip_lon:zo*yf((y+x/Pl)/zo),geo_eclip_lat:Math.PI/(180*3600)*Mt,distance_au:Pl*Tne/(.999953253*v)}}function Lne(n,e){return[n.rot[0][0]*e[0]+n.rot[1][0]*e[1]+n.rot[2][0]*e[2],n.rot[0][1]*e[0]+n.rot[1][1]*e[1]+n.rot[2][1]*e[2],n.rot[0][2]*e[0]+n.rot[1][2]*e[1]+n.rot[2][2]*e[2]]}function Ine(n,e,t){const i=FP(e,t);return Lne(i,n)}function FP(n,e){const t=n.tt/36525;let i=84381.406,a=((((-951e-10*t+132851e-9)*t-.00114045)*t-1.0790069)*t+5038.481507)*t,r=((((3337e-10*t-467e-9)*t-.00772503)*t+.0512623)*t-.025754)*t+i,s=((((-56e-9*t+170663e-9)*t-.00121197)*t-2.3814292)*t+10.556403)*t;i*=Xf,a*=Xf,r*=Xf,s*=Xf;const o=Math.sin(i),c=Math.cos(i),h=Math.sin(-a),f=Math.cos(-a),d=Math.sin(-r),m=Math.cos(-r),g=Math.sin(s),x=Math.cos(s),T=x*f-h*g*m,S=x*h*c+g*m*f*c-o*g*d,v=x*h*o+g*m*f*o+c*g*d,y=-g*f-h*x*m,E=-g*h*c+x*m*f*c-o*x*d,b=-g*h*o+x*m*f*o+c*x*d,D=h*d,C=-d*f*c-o*m,I=-d*f*o+m*c;if(e===rl.Into2000)return new Id([[T,S,v],[y,E,b],[D,C,I]]);if(e===rl.From2000)return new Id([[T,y,D],[S,E,C],[v,b,I]]);throw"Invalid precess direction"}function Une(n){const e=.779057273264+.00273781191135448*n.ut,t=n.ut%1;let i=360*((e+t)%1);return i<0&&(i+=360),i}let jv;function Pne(n){if(!jv||jv.tt!==n.tt){const e=n.tt/36525;let t=15*HP(n).ee;const i=Une(n);let a=((t+.014506+((((-368e-10*e-29956e-9)*e-44e-8)*e+1.3915817)*e+4612.156534)*e)/3600+i)%360/15;a<0&&(a+=24),jv={tt:n.tt,st:a}}return jv.st}function zne(n){const e=ph(n);return Pne(e)}function Bne(n,e){const t=HP(n),i=t.mobl*$u,a=t.tobl*$u,r=t.dpsi*Xf,s=Math.cos(i),o=Math.sin(i),c=Math.cos(a),h=Math.sin(a),f=Math.cos(r),d=Math.sin(r),m=f,g=-d*s,x=-d*o,T=d*c,S=f*s*c+o*h,v=f*o*c-s*h,y=d*h,E=f*s*h-o*c,b=f*o*h+s*c;if(e===rl.From2000)return new Id([[m,T,y],[g,S,E],[x,v,b]]);if(e===rl.Into2000)return new Id([[m,g,x],[T,S,v],[y,E,b]]);throw"Invalid precess direction"}class Rs{constructor(e,t,i,a){this.x=e,this.y=t,this.z=i,this.t=a}Length(){return Math.hypot(this.x,this.y,this.z)}}class Hne{constructor(e,t,i,a,r,s,o){this.x=e,this.y=t,this.z=i,this.vx=a,this.vy=r,this.vz=s,this.t=o}}let Fne=class{constructor(e,t,i){this.lat=y_(e),this.lon=y_(t),this.dist=y_(i)}};class Id{constructor(e){this.rot=e}}function qE(n){const e=ph(n),t=One(e),i=t.distance_au*Math.cos(t.geo_eclip_lat),a=[i*Math.cos(t.geo_eclip_lon),i*Math.sin(t.geo_eclip_lon),t.distance_au*Math.sin(t.geo_eclip_lat)],r=Dne(e,a),s=Ine(r,e,rl.Into2000);return new Rs(s[0],s[1],s[2],e)}function ad(n,e,t){let i=1,a=0;for(let r of n){let s=0;for(let[c,h,f]of r)s+=c*Math.cos(h+e*f);let o=i*s;t&&(o%=zo),a+=o,i*=e}return a}function J2(n,e){let t=1,i=0,a=0,r=0;for(let s of n){let o=0,c=0;for(let[h,f,d]of s){let m=f+e*d;o+=h*d*Math.sin(m),r>0&&(c+=h*Math.cos(m))}a+=r*i*c-t*o,i=t,t*=e,++r}return a}const pm=365250,jE=0,ZE=1,KE=2;function QE(n){return new ya(n[0]+44036e-11*n[1]-190919e-12*n[2],-479966e-12*n[0]+.917482137087*n[1]-.397776982902*n[2],.397776982902*n[1]+.917482137087*n[2])}function GP(n,e,t){const i=t*Math.cos(e),a=Math.cos(n),r=Math.sin(n);return[i*a,i*r,t*Math.sin(e)]}function S_(n,e){const t=e.tt/pm,i=ad(n[jE],t,!0),a=ad(n[ZE],t,!1),r=ad(n[KE],t,!1),s=GP(i,a,r);return QE(s).ToAstroVector(e)}function Gne(n,e){const t=e/pm,i=ad(n[jE],t,!0),a=ad(n[ZE],t,!1),r=ad(n[KE],t,!1),s=J2(n[jE],t),o=J2(n[ZE],t),c=J2(n[KE],t),h=Math.cos(i),f=Math.sin(i),d=Math.cos(a),m=Math.sin(a),g=+(c*d*h)-r*m*h*o-r*d*f*s,x=+(c*d*f)-r*m*f*o+r*d*h*s,T=+(c*m)+r*d*o,S=GP(i,a,r),v=[g/pm,x/pm,T/pm],y=QE(S),E=QE(v);return new eh(e,y,E)}function Zv(n,e,t,i){const a=i/(i+_A),r=S_(Yf[t],e);n.x+=a*r.x,n.y+=a*r.y,n.z+=a*r.z}function Vne(n){const e=new Rs(0,0,0,n);return Zv(e,n,zn.Jupiter,kE),Zv(e,n,zn.Saturn,WE),Zv(e,n,zn.Uranus,XE),Zv(e,n,zn.Neptune,YE),e}const JE=51,kne=29200,qf=146,Bo=201,Au=[[-73e4,[-26.118207232108,-14.376168177825,3.384402515299],[.0016339372163656,-.0027861699588508,-.0013585880229445]],[-700800,[41.974905202127,-.448502952929,-12.770351505989],[.00073458569351457,.0022785014891658,.00048619778602049]],[-671600,[14.706930780744,44.269110540027,9.353698474772],[-.00210001479998,.00022295915939915,.00070143443551414]],[-642400,[-29.441003929957,-6.43016153057,6.858481011305],[.00084495803960544,-.0030783914758711,-.0012106305981192]],[-613200,[39.444396946234,-6.557989760571,-13.913760296463],[.0011480029005873,.0022400006880665,.00035168075922288]],[-584e3,[20.2303809507,43.266966657189,7.382966091923],[-.0019754081700585,.00053457141292226,.00075929169129793]],[-554800,[-30.65832536462,2.093818874552,9.880531138071],[61010603013347e-18,-.0031326500935382,-.00099346125151067]],[-525600,[35.737703251673,-12.587706024764,-14.677847247563],[.0015802939375649,.0021347678412429,.00019074436384343]],[-496400,[25.466295188546,41.367478338417,5.216476873382],[-.0018054401046468,.0008328308359951,.00080260156912107]],[-467200,[-29.847174904071,10.636426313081,12.297904180106],[-.00063257063052907,-.0029969577578221,-.00074476074151596]],[-438e3,[30.774692107687,-18.236637015304,-14.945535879896],[.0020113162005465,.0019353827024189,-20937793168297e-19]],[-408800,[30.243153324028,38.656267888503,2.938501750218],[-.0016052508674468,.0011183495337525,.00083333973416824]],[-379600,[-27.288984772533,18.643162147874,14.023633623329],[-.0011856388898191,-.0027170609282181,-.00049015526126399]],[-350400,[24.519605196774,-23.245756064727,-14.626862367368],[.0024322321483154,.0016062008146048,-.00023369181613312]],[-321200,[34.505274805875,35.125338586954,.557361475637],[-.0013824391637782,.0013833397561817,.00084823598806262]],[-292e3,[-23.275363915119,25.818514298769,15.055381588598],[-.0016062295460975,-.0023395961498533,-.00024377362639479]],[-262800,[17.050384798092,-27.180376290126,-13.608963321694],[.0028175521080578,.0011358749093955,-.00049548725258825]],[-233600,[38.093671910285,30.880588383337,-1.843688067413],[-.0011317697153459,.0016128814698472,.00084177586176055]],[-204400,[-18.197852930878,31.932869934309,15.438294826279],[-.0019117272501813,-.0019146495909842,-19657304369835e-18]],[-175200,[8.528924039997,-29.618422200048,-11.805400994258],[.0031034370787005,.0005139363329243,-.00077293066202546]],[-146e3,[40.94685725864,25.904973592021,-4.256336240499],[-.00083652705194051,.0018129497136404,.0008156422827306]],[-116800,[-12.326958895325,36.881883446292,15.217158258711],[-.0021166103705038,-.001481442003599,.00017401209844705]],[-87600,[-.633258375909,-30.018759794709,-9.17193287495],[.0032016994581737,-.00025279858672148,-.0010411088271861]],[-58400,[42.936048423883,20.344685584452,-6.588027007912],[-.00050525450073192,.0019910074335507,.00077440196540269]],[-29200,[-5.975910552974,40.61180995846,14.470131723673],[-.0022184202156107,-.0010562361130164,.00033652250216211]],[0,[-9.875369580774,-27.978926224737,-5.753711824704],[.0030287533248818,-.0011276087003636,-.0012651326732361]],[29200,[43.958831986165,14.214147973292,-8.808306227163],[-.00014717608981871,.0021404187242141,.00071486567806614]],[58400,[.67813676352,43.094461639362,13.243238780721],[-.0022358226110718,-.00063233636090933,.00047664798895648]],[87600,[-18.282602096834,-23.30503958666,-1.766620508028],[.0025567245263557,-.0019902940754171,-.0013943491701082]],[116800,[43.873338744526,7.700705617215,-10.814273666425],[.00023174803055677,.0022402163127924,.00062988756452032]],[146e3,[7.392949027906,44.382678951534,11.629500214854],[-.002193281545383,-.00021751799585364,.00059556516201114]],[175200,[-24.981690229261,-16.204012851426,2.466457544298],[.001819398914958,-.0026765419531201,-.0013848283502247]],[204400,[42.530187039511,.845935508021,-12.554907527683],[.00065059779150669,.0022725657282262,.00051133743202822]],[233600,[13.999526486822,44.462363044894,9.669418486465],[-.0021079296569252,.00017533423831993,.00069128485798076]],[262800,[-29.184024803031,-7.371243995762,6.493275957928],[.00093581363109681,-.0030610357109184,-.0012364201089345]],[292e3,[39.831980671753,-6.078405766765,-13.909815358656],[.0011117769689167,.0022362097830152,.00036230548231153]],[321200,[20.294955108476,43.417190420251,7.450091985932],[-.0019742157451535,.00053102050468554,.00075938408813008]],[350400,[-30.66999230216,2.318743558955,9.973480913858],[45605107450676e-18,-.0031308219926928,-.00099066533301924]],[379600,[35.626122155983,-12.897647509224,-14.777586508444],[.0016015684949743,.0021171931182284,.00018002516202204]],[408800,[26.133186148561,41.232139187599,5.00640132622],[-.0017857704419579,.00086046232702817,.00080614690298954]],[438e3,[-29.57674022923,11.863535943587,12.631323039872],[-.00072292830060955,-.0029587820140709,-.000708242964503]],[467200,[29.910805787391,-19.159019294,-15.013363865194],[.0020871080437997,.0018848372554514,-38528655083926e-18]],[496400,[31.375957451819,38.050372720763,2.433138343754],[-.0015546055556611,.0011699815465629,.00083565439266001]],[525600,[-26.360071336928,20.662505904952,14.414696258958],[-.0013142373118349,-.0026236647854842,-.00042542017598193]],[554800,[22.599441488648,-24.508879898306,-14.484045731468],[.0025454108304806,.0014917058755191,-.00030243665086079]],[584e3,[35.877864013014,33.894226366071,-.224524636277],[-.0012941245730845,.0014560427668319,.00084762160640137]],[613200,[-21.538149762417,28.204068269761,15.321973799534],[-.001731211740901,-.0021939631314577,-.0001631691327518]],[642400,[13.971521374415,-28.339941764789,-13.083792871886],[.0029334630526035,.00091860931752944,-.00059939422488627]],[671600,[39.526942044143,28.93989736011,-2.872799527539],[-.0010068481658095,.001702113288809,.00083578230511981]],[700800,[-15.576200701394,34.399412961275,15.466033737854],[-.0020098814612884,-.0017191109825989,70414782780416e-18]],[73e4,[4.24325283709,-30.118201690825,-10.707441231349],[.0031725847067411,.0001609846120227,-.00090672150593868]]];class ya{constructor(e,t,i){this.x=e,this.y=t,this.z=i}clone(){return new ya(this.x,this.y,this.z)}ToAstroVector(e){return new Rs(this.x,this.y,this.z,e)}static zero(){return new ya(0,0,0)}quadrature(){return this.x*this.x+this.y*this.y+this.z*this.z}add(e){return new ya(this.x+e.x,this.y+e.y,this.z+e.z)}sub(e){return new ya(this.x-e.x,this.y-e.y,this.z-e.z)}incr(e){this.x+=e.x,this.y+=e.y,this.z+=e.z}decr(e){this.x-=e.x,this.y-=e.y,this.z-=e.z}mul(e){return new ya(e*this.x,e*this.y,e*this.z)}div(e){return new ya(this.x/e,this.y/e,this.z/e)}mean(e){return new ya((this.x+e.x)/2,(this.y+e.y)/2,(this.z+e.z)/2)}neg(){return new ya(-this.x,-this.y,-this.z)}}class eh{constructor(e,t,i){this.tt=e,this.r=t,this.v=i}clone(){return new eh(this.tt,this.r,this.v)}sub(e){return new eh(this.tt,this.r.sub(e.r),this.v.sub(e.v))}}function Wne(n){let[e,[t,i,a],[r,s,o]]=n;return new eh(e,new ya(t,i,a),new ya(r,s,o))}function Kv(n,e,t,i){const a=i/(i+_A),r=Gne(Yf[t],e);return n.r.incr(r.r.mul(a)),n.v.incr(r.v.mul(a)),r}function $p(n,e,t){const i=t.sub(n),a=i.quadrature();return i.mul(e/(a*Math.sqrt(a)))}class xA{constructor(e){let t=new eh(e,new ya(0,0,0),new ya(0,0,0));this.Jupiter=Kv(t,e,zn.Jupiter,kE),this.Saturn=Kv(t,e,zn.Saturn,WE),this.Uranus=Kv(t,e,zn.Uranus,XE),this.Neptune=Kv(t,e,zn.Neptune,YE),this.Jupiter.r.decr(t.r),this.Jupiter.v.decr(t.v),this.Saturn.r.decr(t.r),this.Saturn.v.decr(t.v),this.Uranus.r.decr(t.r),this.Uranus.v.decr(t.v),this.Neptune.r.decr(t.r),this.Neptune.v.decr(t.v),this.Sun=new eh(e,t.r.mul(-1),t.v.mul(-1))}Acceleration(e){let t=$p(e,_A,this.Sun.r);return t.incr($p(e,kE,this.Jupiter.r)),t.incr($p(e,WE,this.Saturn.r)),t.incr($p(e,XE,this.Uranus.r)),t.incr($p(e,YE,this.Neptune.r)),t}}let VP=class kP{constructor(e,t,i,a){this.tt=e,this.r=t,this.v=i,this.a=a}clone(){return new kP(this.tt,this.r.clone(),this.v.clone(),this.a.clone())}},WP=class{constructor(e,t){this.bary=e,this.grav=t}};function n1(n,e,t,i){return new ya(e.x+n*(t.x+n*i.x/2),e.y+n*(t.y+n*i.y/2),e.z+n*(t.z+n*i.z/2))}function TO(n,e,t){return new ya(e.x+n*t.x,e.y+n*t.y,e.z+n*t.z)}function $E(n,e){const t=n-e.tt,i=new xA(n),a=n1(t,e.r,e.v,e.a),r=i.Acceleration(a).mean(e.a),s=n1(t,e.r,e.v,r),o=e.v.add(r.mul(t)),c=i.Acceleration(s),h=new VP(n,s,o,c);return new WP(i,h)}const Xne=[];function XP(n,e){const t=Math.floor(n);return t<0?0:t>=e?e-1:t}function eM(n){const e=Wne(n),t=new xA(e.tt),i=e.r.add(t.Sun.r),a=e.v.add(t.Sun.v),r=t.Acceleration(i),s=new VP(e.tt,i,a,r);return new WP(t,s)}function Yne(n,e){const t=Au[0][0];if(eAu[JE-1][0])return null;const i=XP((e-t)/kne,JE-1);if(!n[i]){const r=n[i]=[];r[0]=eM(Au[i]).grav,r[Bo-1]=eM(Au[i+1]).grav;let s,o=r[0].tt;for(s=1;s0;--s)a[s]=$E(o-=qf,a[s+1]).grav;for(s=Bo-2;s>0;--s){const c=s/(Bo-1);r[s].r=r[s].r.mul(1-c).add(a[s].r.mul(c)),r[s].v=r[s].v.mul(1-c).add(a[s].v.mul(c)),r[s].a=r[s].a.mul(1-c).add(a[s].a.mul(c))}}return n[i]}function EO(n,e,t){let i=eM(n);const a=Math.ceil((e-i.grav.tt)/t);for(let r=0;r1)throw"Object is too distant for light-travel solver.";const o=e.AddDays(-s);if(i=Math.abs(o.tt-t.tt),i<1e-9)return r;t=o}throw`Light-travel time solver did not converge: dt = ${i}`}class Zne{constructor(e,t,i,a){this.observerBody=e,this.targetBody=t,this.aberration=i,this.observerPos=a}Position(e){this.aberration&&(this.observerPos=Vm(this.observerBody,e));const t=Vm(this.targetBody,e);return new Rs(t.x-this.observerPos.x,t.y-this.observerPos.y,t.z-this.observerPos.z,e)}}function Kne(n,e,t,i){const a=ph(n);if(zP(t)){const o=Vm(t,a),c=Vm(e,a);return new Rs(o.x-c.x,o.y-c.y,o.z-c.z,a)}let r;r=Vm(e,a);const s=new Zne(e,t,i,r);return jne(o=>s.Position(o),a)}function Qne(n,e,t){const i=ph(e);switch(n){case zn.Earth:return new Rs(0,0,0,i);case zn.Moon:return qE(i);default:const a=Kne(i,zn.Earth,n,t);return a.t=i,a}}var MO;(function(n){n[n.Pericenter=0]="Pericenter",n[n.Apocenter=1]="Apocenter"})(MO||(MO={}));function Jne(n,e){return new Id([[e.rot[0][0]*n.rot[0][0]+e.rot[1][0]*n.rot[0][1]+e.rot[2][0]*n.rot[0][2],e.rot[0][1]*n.rot[0][0]+e.rot[1][1]*n.rot[0][1]+e.rot[2][1]*n.rot[0][2],e.rot[0][2]*n.rot[0][0]+e.rot[1][2]*n.rot[0][1]+e.rot[2][2]*n.rot[0][2]],[e.rot[0][0]*n.rot[1][0]+e.rot[1][0]*n.rot[1][1]+e.rot[2][0]*n.rot[1][2],e.rot[0][1]*n.rot[1][0]+e.rot[1][1]*n.rot[1][1]+e.rot[2][1]*n.rot[1][2],e.rot[0][2]*n.rot[1][0]+e.rot[1][2]*n.rot[1][1]+e.rot[2][2]*n.rot[1][2]],[e.rot[0][0]*n.rot[2][0]+e.rot[1][0]*n.rot[2][1]+e.rot[2][0]*n.rot[2][2],e.rot[0][1]*n.rot[2][0]+e.rot[1][1]*n.rot[2][1]+e.rot[2][1]*n.rot[2][2],e.rot[0][2]*n.rot[2][0]+e.rot[1][2]*n.rot[2][1]+e.rot[2][2]*n.rot[2][2]]])}function $ne(n,e,t){const i=y_(t)*$u,a=Math.cos(i),r=Math.sin(i),s=(e+1)%3,o=(e+2)%3,c=e;let h=[[0,0,0],[0,0,0],[0,0,0]];return h[s][s]=a*n.rot[s][s]-r*n.rot[s][o],h[s][o]=r*n.rot[s][s]+a*n.rot[s][o],h[s][c]=n.rot[s][c],h[o][s]=a*n.rot[o][s]-r*n.rot[o][o],h[o][o]=r*n.rot[o][s]+a*n.rot[o][o],h[o][c]=n.rot[o][c],h[c][s]=a*n.rot[c][s]-r*n.rot[c][o],h[c][o]=r*n.rot[c][s]+a*n.rot[c][o],h[c][c]=n.rot[c][c],new Id(h)}function eie(n,e){e=ph(e);const t=n.lat*$u,i=n.lon*$u,a=n.dist*Math.cos(t);return new Rs(a*Math.cos(i),a*Math.sin(i),n.dist*Math.sin(t),e)}function tie(n){n=ph(n);const e=FP(n,rl.From2000),t=Bne(n,rl.From2000);return Jne(e,t)}var bO;(function(n){n.Penumbral="penumbral",n.Partial="partial",n.Annular="annular",n.Total="total"})(bO||(bO={}));var AO;(function(n){n[n.Invalid=0]="Invalid",n[n.Ascending=1]="Ascending",n[n.Descending=-1]="Descending"})(AO||(AO={}));function yA(n){return n instanceof lc?n:new lc(n instanceof Date?n:new Date(n))}function nie(n,e=new L){const{x:t,y:i,z:a}=n;return e.set(t,i,a)}function iie(n,e=new ke){const[t,i,a]=n.rot;return e.set(t[0],i[0],a[0],0,t[1],i[1],a[1],0,t[2],i[2],a[2],0,0,0,0,1)}function aie(n,e=new ke){const t=yA(n),i=$ne(tie(t),2,-15*zne(t));return iie(i,e)}function YP(n,e,t,i,a){const r=Qne(n,e,!1);return nie(r,t),i!=null,t.normalize()}function rie(n,e=new L,t){return YP(zn.Sun,yA(n),e,t)}function sie(n,e=new L,t){return YP(zn.Moon,yA(n),e,t)}const oie=`precision highp float; + */const vne=173.1446326846693,_ne=14959787069098932e-8,th=.017453292519943295,xne=365.24217,EO=new Date("2000-01-01T12:00:00Z"),Bo=2*Math.PI,Bl=3600*(180/Math.PI),qf=484813681109536e-20,yne=10800*60,Sne=2*yne,Tne=6378.1366,Ene=Tne/_ne,Mne=81.30056,SA=.0002959122082855911,YE=2825345909524226e-22,qE=8459715185680659e-23,jE=1292024916781969e-23,ZE=1524358900784276e-23;function T_(n){if(!Number.isFinite(n))throw console.trace(),`Value is not a finite number: ${n}`;return n}function Tf(n){return n-Math.floor(n)}var zn;(function(n){n.Sun="Sun",n.Moon="Moon",n.Mercury="Mercury",n.Venus="Venus",n.Earth="Earth",n.Mars="Mars",n.Jupiter="Jupiter",n.Saturn="Saturn",n.Uranus="Uranus",n.Neptune="Neptune",n.Pluto="Pluto",n.SSB="SSB",n.EMB="EMB",n.Star1="Star1",n.Star2="Star2",n.Star3="Star3",n.Star4="Star4",n.Star5="Star5",n.Star6="Star6",n.Star7="Star7",n.Star8="Star8"})(zn||(zn={}));const bne=[zn.Star1,zn.Star2,zn.Star3,zn.Star4,zn.Star5,zn.Star6,zn.Star7,zn.Star8],Ane=[{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0}];function wne(n){const e=bne.indexOf(n);return e>=0?Ane[e]:null}function HP(n){const e=wne(n);return e&&e.dist>0?e:null}var sl;(function(n){n[n.From2000=0]="From2000",n[n.Into2000=1]="Into2000"})(sl||(sl={}));const jf={Mercury:[[[[4.40250710144,0,0],[.40989414977,1.48302034195,26087.9031415742],[.050462942,4.47785489551,52175.8062831484],[.00855346844,1.16520322459,78263.70942472259],[.00165590362,4.11969163423,104351.61256629678],[.00034561897,.77930768443,130439.51570787099],[7583476e-11,3.71348404924,156527.41884944518]],[[26087.90313685529,0,0],[.01131199811,6.21874197797,26087.9031415742],[.00292242298,3.04449355541,52175.8062831484],[.00075775081,6.08568821653,78263.70942472259],[.00019676525,2.80965111777,104351.61256629678]]],[[[.11737528961,1.98357498767,26087.9031415742],[.02388076996,5.03738959686,52175.8062831484],[.01222839532,3.14159265359,0],[.0054325181,1.79644363964,78263.70942472259],[.0012977877,4.83232503958,104351.61256629678],[.00031866927,1.58088495658,130439.51570787099],[7963301e-11,4.60972126127,156527.41884944518]],[[.00274646065,3.95008450011,26087.9031415742],[.00099737713,3.14159265359,0]]],[[[.39528271651,0,0],[.07834131818,6.19233722598,26087.9031415742],[.00795525558,2.95989690104,52175.8062831484],[.00121281764,6.01064153797,78263.70942472259],[.00021921969,2.77820093972,104351.61256629678],[4354065e-11,5.82894543774,130439.51570787099]],[[.0021734774,4.65617158665,26087.9031415742],[.00044141826,1.42385544001,52175.8062831484]]]],Venus:[[[[3.17614666774,0,0],[.01353968419,5.59313319619,10213.285546211],[.00089891645,5.30650047764,20426.571092422],[5477194e-11,4.41630661466,7860.4193924392],[3455741e-11,2.6996444782,11790.6290886588],[2372061e-11,2.99377542079,3930.2096962196],[1317168e-11,5.18668228402,26.2983197998],[1664146e-11,4.25018630147,1577.3435424478],[1438387e-11,4.15745084182,9683.5945811164],[1200521e-11,6.15357116043,30639.856638633]],[[10213.28554621638,0,0],[.00095617813,2.4640651111,10213.285546211],[7787201e-11,.6247848222,20426.571092422]]],[[[.05923638472,.26702775812,10213.285546211],[.00040107978,1.14737178112,20426.571092422],[.00032814918,3.14159265359,0]],[[.00287821243,1.88964962838,10213.285546211]]],[[[.72334820891,0,0],[.00489824182,4.02151831717,10213.285546211],[1658058e-11,4.90206728031,20426.571092422],[1378043e-11,1.12846591367,11790.6290886588],[1632096e-11,2.84548795207,7860.4193924392],[498395e-11,2.58682193892,9683.5945811164],[221985e-11,2.01346696541,19367.1891622328],[237454e-11,2.55136053886,15720.8387848784]],[[.00034551041,.89198706276,10213.285546211]]]],Earth:[[[[1.75347045673,0,0],[.03341656453,4.66925680415,6283.0758499914],[.00034894275,4.62610242189,12566.1516999828],[3417572e-11,2.82886579754,3.523118349],[3497056e-11,2.74411783405,5753.3848848968],[3135899e-11,3.62767041756,77713.7714681205],[2676218e-11,4.41808345438,7860.4193924392],[2342691e-11,6.13516214446,3930.2096962196],[1273165e-11,2.03709657878,529.6909650946],[1324294e-11,.74246341673,11506.7697697936],[901854e-11,2.04505446477,26.2983197998],[1199167e-11,1.10962946234,1577.3435424478],[857223e-11,3.50849152283,398.1490034082],[779786e-11,1.17882681962,5223.6939198022],[99025e-10,5.23268072088,5884.9268465832],[753141e-11,2.53339052847,5507.5532386674],[505267e-11,4.58292599973,18849.2275499742],[492392e-11,4.20505711826,775.522611324],[356672e-11,2.91954114478,.0673103028],[284125e-11,1.89869240932,796.2980068164],[242879e-11,.34481445893,5486.777843175],[317087e-11,5.84901948512,11790.6290886588],[271112e-11,.31486255375,10977.078804699],[206217e-11,4.80646631478,2544.3144198834],[205478e-11,1.86953770281,5573.1428014331],[202318e-11,2.45767790232,6069.7767545534],[126225e-11,1.08295459501,20.7753954924],[155516e-11,.83306084617,213.299095438]],[[6283.0758499914,0,0],[.00206058863,2.67823455808,6283.0758499914],[4303419e-11,2.63512233481,12566.1516999828]],[[8721859e-11,1.07253635559,6283.0758499914]]],[[],[[.00227777722,3.4137662053,6283.0758499914],[3805678e-11,3.37063423795,12566.1516999828]]],[[[1.00013988784,0,0],[.01670699632,3.09846350258,6283.0758499914],[.00013956024,3.05524609456,12566.1516999828],[308372e-10,5.19846674381,77713.7714681205],[1628463e-11,1.17387558054,5753.3848848968],[1575572e-11,2.84685214877,7860.4193924392],[924799e-11,5.45292236722,11506.7697697936],[542439e-11,4.56409151453,3930.2096962196],[47211e-10,3.66100022149,5884.9268465832],[85831e-11,1.27079125277,161000.6857376741],[57056e-11,2.01374292245,83996.84731811189],[55736e-11,5.2415979917,71430.69561812909],[174844e-11,3.01193636733,18849.2275499742],[243181e-11,4.2734953079,11790.6290886588]],[[.00103018607,1.10748968172,6283.0758499914],[1721238e-11,1.06442300386,12566.1516999828]],[[4359385e-11,5.78455133808,6283.0758499914]]]],Mars:[[[[6.20347711581,0,0],[.18656368093,5.0503710027,3340.6124266998],[.01108216816,5.40099836344,6681.2248533996],[.00091798406,5.75478744667,10021.8372800994],[.00027744987,5.97049513147,3.523118349],[.00010610235,2.93958560338,2281.2304965106],[.00012315897,.84956094002,2810.9214616052],[8926784e-11,4.15697846427,.0172536522],[8715691e-11,6.11005153139,13362.4497067992],[6797556e-11,.36462229657,398.1490034082],[7774872e-11,3.33968761376,5621.8429232104],[3575078e-11,1.6618650571,2544.3144198834],[4161108e-11,.22814971327,2942.4634232916],[3075252e-11,.85696614132,191.4482661116],[2628117e-11,.64806124465,3337.0893083508],[2937546e-11,6.07893711402,.0673103028],[2389414e-11,5.03896442664,796.2980068164],[2579844e-11,.02996736156,3344.1355450488],[1528141e-11,1.14979301996,6151.533888305],[1798806e-11,.65634057445,529.6909650946],[1264357e-11,3.62275122593,5092.1519581158],[1286228e-11,3.06796065034,2146.1654164752],[1546404e-11,2.91579701718,1751.539531416],[1024902e-11,3.69334099279,8962.4553499102],[891566e-11,.18293837498,16703.062133499],[858759e-11,2.4009381194,2914.0142358238],[832715e-11,2.46418619474,3340.5951730476],[83272e-10,4.49495782139,3340.629680352],[712902e-11,3.66335473479,1059.3819301892],[748723e-11,3.82248614017,155.4203994342],[723861e-11,.67497311481,3738.761430108],[635548e-11,2.92182225127,8432.7643848156],[655162e-11,.48864064125,3127.3133312618],[550474e-11,3.81001042328,.9803210682],[55275e-10,4.47479317037,1748.016413067],[425966e-11,.55364317304,6283.0758499914],[415131e-11,.49662285038,213.299095438],[472167e-11,3.62547124025,1194.4470102246],[306551e-11,.38052848348,6684.7479717486],[312141e-11,.99853944405,6677.7017350506],[293198e-11,4.22131299634,20.7753954924],[302375e-11,4.48618007156,3532.0606928114],[274027e-11,.54222167059,3340.545116397],[281079e-11,5.88163521788,1349.8674096588],[231183e-11,1.28242156993,3870.3033917944],[283602e-11,5.7688543494,3149.1641605882],[236117e-11,5.75503217933,3333.498879699],[274033e-11,.13372524985,3340.6797370026],[299395e-11,2.78323740866,6254.6266625236]],[[3340.61242700512,0,0],[.01457554523,3.60433733236,3340.6124266998],[.00168414711,3.92318567804,6681.2248533996],[.00020622975,4.26108844583,10021.8372800994],[3452392e-11,4.7321039319,3.523118349],[2586332e-11,4.60670058555,13362.4497067992],[841535e-11,4.45864030426,2281.2304965106]],[[.00058152577,2.04961712429,3340.6124266998],[.00013459579,2.45738706163,6681.2248533996]]],[[[.03197134986,3.76832042431,3340.6124266998],[.00298033234,4.10616996305,6681.2248533996],[.00289104742,0,0],[.00031365539,4.4465105309,10021.8372800994],[34841e-9,4.7881254926,13362.4497067992]],[[.00217310991,6.04472194776,3340.6124266998],[.00020976948,3.14159265359,0],[.00012834709,1.60810667915,6681.2248533996]]],[[[1.53033488271,0,0],[.1418495316,3.47971283528,3340.6124266998],[.00660776362,3.81783443019,6681.2248533996],[.00046179117,4.15595316782,10021.8372800994],[8109733e-11,5.55958416318,2810.9214616052],[7485318e-11,1.77239078402,5621.8429232104],[5523191e-11,1.3643630377,2281.2304965106],[382516e-10,4.49407183687,13362.4497067992],[2306537e-11,.09081579001,2544.3144198834],[1999396e-11,5.36059617709,3337.0893083508],[2484394e-11,4.9254563992,2942.4634232916],[1960195e-11,4.74249437639,3344.1355450488],[1167119e-11,2.11260868341,5092.1519581158],[1102816e-11,5.00908403998,398.1490034082],[899066e-11,4.40791133207,529.6909650946],[992252e-11,5.83861961952,6151.533888305],[807354e-11,2.10217065501,1059.3819301892],[797915e-11,3.44839203899,796.2980068164],[740975e-11,1.49906336885,2146.1654164752]],[[.01107433345,2.03250524857,3340.6124266998],[.00103175887,2.37071847807,6681.2248533996],[128772e-9,0,0],[.0001081588,2.70888095665,10021.8372800994]],[[.00044242249,.47930604954,3340.6124266998],[8138042e-11,.86998389204,6681.2248533996]]]],Jupiter:[[[[.59954691494,0,0],[.09695898719,5.06191793158,529.6909650946],[.00573610142,1.44406205629,7.1135470008],[.00306389205,5.41734730184,1059.3819301892],[.00097178296,4.14264726552,632.7837393132],[.00072903078,3.64042916389,522.5774180938],[.00064263975,3.41145165351,103.0927742186],[.00039806064,2.29376740788,419.4846438752],[.00038857767,1.27231755835,316.3918696566],[.00027964629,1.7845459182,536.8045120954],[.0001358973,5.7748104079,1589.0728952838],[8246349e-11,3.5822792584,206.1855484372],[8768704e-11,3.63000308199,949.1756089698],[7368042e-11,5.0810119427,735.8765135318],[626315e-10,.02497628807,213.299095438],[6114062e-11,4.51319998626,1162.4747044078],[4905396e-11,1.32084470588,110.2063212194],[5305285e-11,1.30671216791,14.2270940016],[5305441e-11,4.18625634012,1052.2683831884],[4647248e-11,4.69958103684,3.9321532631],[3045023e-11,4.31676431084,426.598190876],[2609999e-11,1.56667394063,846.0828347512],[2028191e-11,1.06376530715,3.1813937377],[1764763e-11,2.14148655117,1066.49547719],[1722972e-11,3.88036268267,1265.5674786264],[1920945e-11,.97168196472,639.897286314],[1633223e-11,3.58201833555,515.463871093],[1431999e-11,4.29685556046,625.6701923124],[973272e-11,4.09764549134,95.9792272178]],[[529.69096508814,0,0],[.00489503243,4.2208293947,529.6909650946],[.00228917222,6.02646855621,7.1135470008],[.00030099479,4.54540782858,1059.3819301892],[.0002072092,5.45943156902,522.5774180938],[.00012103653,.16994816098,536.8045120954],[6067987e-11,4.42422292017,103.0927742186],[5433968e-11,3.98480737746,419.4846438752],[4237744e-11,5.89008707199,14.2270940016]],[[.00047233601,4.32148536482,7.1135470008],[.00030649436,2.929777887,529.6909650946],[.00014837605,3.14159265359,0]]],[[[.02268615702,3.55852606721,529.6909650946],[.00109971634,3.90809347197,1059.3819301892],[.00110090358,0,0],[8101428e-11,3.60509572885,522.5774180938],[6043996e-11,4.25883108339,1589.0728952838],[6437782e-11,.30627119215,536.8045120954]],[[.00078203446,1.52377859742,529.6909650946]]],[[[5.20887429326,0,0],[.25209327119,3.49108639871,529.6909650946],[.00610599976,3.84115365948,1059.3819301892],[.00282029458,2.57419881293,632.7837393132],[.00187647346,2.07590383214,522.5774180938],[.00086792905,.71001145545,419.4846438752],[.00072062974,.21465724607,536.8045120954],[.00065517248,5.9799588479,316.3918696566],[.00029134542,1.67759379655,103.0927742186],[.00030135335,2.16132003734,949.1756089698],[.00023453271,3.54023522184,735.8765135318],[.00022283743,4.19362594399,1589.0728952838],[.00023947298,.2745803748,7.1135470008],[.00013032614,2.96042965363,1162.4747044078],[970336e-10,1.90669633585,206.1855484372],[.00012749023,2.71550286592,1052.2683831884],[7057931e-11,2.18184839926,1265.5674786264],[6137703e-11,6.26418240033,846.0828347512],[2616976e-11,2.00994012876,1581.959348283]],[[.0127180152,2.64937512894,529.6909650946],[.00061661816,3.00076460387,1059.3819301892],[.00053443713,3.89717383175,522.5774180938],[.00031185171,4.88276958012,536.8045120954],[.00041390269,0,0]]]],Saturn:[[[[.87401354025,0,0],[.11107659762,3.96205090159,213.299095438],[.01414150957,4.58581516874,7.1135470008],[.00398379389,.52112032699,206.1855484372],[.00350769243,3.30329907896,426.598190876],[.00206816305,.24658372002,103.0927742186],[792713e-9,3.84007056878,220.4126424388],[.00023990355,4.66976924553,110.2063212194],[.00016573588,.43719228296,419.4846438752],[.00014906995,5.76903183869,316.3918696566],[.0001582029,.93809155235,632.7837393132],[.00014609559,1.56518472,3.9321532631],[.00013160301,4.44891291899,14.2270940016],[.00015053543,2.71669915667,639.897286314],[.00013005299,5.98119023644,11.0457002639],[.00010725067,3.12939523827,202.2533951741],[5863206e-11,.23656938524,529.6909650946],[5227757e-11,4.20783365759,3.1813937377],[6126317e-11,1.76328667907,277.0349937414],[5019687e-11,3.17787728405,433.7117378768],[459255e-10,.61977744975,199.0720014364],[4005867e-11,2.24479718502,63.7358983034],[2953796e-11,.98280366998,95.9792272178],[387367e-10,3.22283226966,138.5174968707],[2461186e-11,2.03163875071,735.8765135318],[3269484e-11,.77492638211,949.1756089698],[1758145e-11,3.2658010994,522.5774180938],[1640172e-11,5.5050445305,846.0828347512],[1391327e-11,4.02333150505,323.5054166574],[1580648e-11,4.37265307169,309.2783226558],[1123498e-11,2.83726798446,415.5524906121],[1017275e-11,3.71700135395,227.5261894396],[848642e-11,3.1915017083,209.3669421749]],[[213.2990952169,0,0],[.01297370862,1.82834923978,213.299095438],[.00564345393,2.88499717272,7.1135470008],[.00093734369,1.06311793502,426.598190876],[.00107674962,2.27769131009,206.1855484372],[.00040244455,2.04108104671,220.4126424388],[.00019941774,1.2795439047,103.0927742186],[.00010511678,2.7488034213,14.2270940016],[6416106e-11,.38238295041,639.897286314],[4848994e-11,2.43037610229,419.4846438752],[4056892e-11,2.92133209468,110.2063212194],[3768635e-11,3.6496533078,3.9321532631]],[[.0011644133,1.17988132879,7.1135470008],[.00091841837,.0732519584,213.299095438],[.00036661728,0,0],[.00015274496,4.06493179167,206.1855484372]]],[[[.04330678039,3.60284428399,213.299095438],[.00240348302,2.85238489373,426.598190876],[.00084745939,0,0],[.00030863357,3.48441504555,220.4126424388],[.00034116062,.57297307557,206.1855484372],[.0001473407,2.11846596715,639.897286314],[9916667e-11,5.79003188904,419.4846438752],[6993564e-11,4.7360468972,7.1135470008],[4807588e-11,5.43305312061,316.3918696566]],[[.00198927992,4.93901017903,213.299095438],[.00036947916,3.14159265359,0],[.00017966989,.5197943111,426.598190876]]],[[[9.55758135486,0,0],[.52921382865,2.39226219573,213.299095438],[.01873679867,5.2354960466,206.1855484372],[.01464663929,1.64763042902,426.598190876],[.00821891141,5.93520042303,316.3918696566],[.00547506923,5.0153261898,103.0927742186],[.0037168465,2.27114821115,220.4126424388],[.00361778765,3.13904301847,7.1135470008],[.00140617506,5.70406606781,632.7837393132],[.00108974848,3.29313390175,110.2063212194],[.00069006962,5.94099540992,419.4846438752],[.00061053367,.94037691801,639.897286314],[.00048913294,1.55733638681,202.2533951741],[.00034143772,.19519102597,277.0349937414],[.00032401773,5.47084567016,949.1756089698],[.00020936596,.46349251129,735.8765135318],[9796004e-11,5.20477537945,1265.5674786264],[.00011993338,5.98050967385,846.0828347512],[208393e-9,1.52102476129,433.7117378768],[.00015298404,3.0594381494,529.6909650946],[6465823e-11,.17732249942,1052.2683831884],[.00011380257,1.7310542704,522.5774180938],[3419618e-11,4.94550542171,1581.959348283]],[[.0618298134,.2584351148,213.299095438],[.00506577242,.71114625261,206.1855484372],[.00341394029,5.79635741658,426.598190876],[.00188491195,.47215589652,220.4126424388],[.00186261486,3.14159265359,0],[.00143891146,1.40744822888,7.1135470008]],[[.00436902572,4.78671677509,213.299095438]]]],Uranus:[[[[5.48129294297,0,0],[.09260408234,.89106421507,74.7815985673],[.01504247898,3.6271926092,1.4844727083],[.00365981674,1.89962179044,73.297125859],[.00272328168,3.35823706307,149.5631971346],[.00070328461,5.39254450063,63.7358983034],[.00068892678,6.09292483287,76.2660712756],[.00061998615,2.26952066061,2.9689454166],[.00061950719,2.85098872691,11.0457002639],[.0002646877,3.14152083966,71.8126531507],[.00025710476,6.11379840493,454.9093665273],[.0002107885,4.36059339067,148.0787244263],[.00017818647,1.74436930289,36.6485629295],[.00014613507,4.73732166022,3.9321532631],[.00011162509,5.8268179635,224.3447957019],[.0001099791,.48865004018,138.5174968707],[9527478e-11,2.95516862826,35.1640902212],[7545601e-11,5.236265824,109.9456887885],[4220241e-11,3.23328220918,70.8494453042],[40519e-9,2.277550173,151.0476698429],[3354596e-11,1.0654900738,4.4534181249],[2926718e-11,4.62903718891,9.5612275556],[349034e-10,5.48306144511,146.594251718],[3144069e-11,4.75199570434,77.7505439839],[2922333e-11,5.35235361027,85.8272988312],[2272788e-11,4.36600400036,70.3281804424],[2051219e-11,1.51773566586,.1118745846],[2148602e-11,.60745949945,38.1330356378],[1991643e-11,4.92437588682,277.0349937414],[1376226e-11,2.04283539351,65.2203710117],[1666902e-11,3.62744066769,380.12776796],[1284107e-11,3.11347961505,202.2533951741],[1150429e-11,.93343589092,3.1813937377],[1533221e-11,2.58594681212,52.6901980395],[1281604e-11,.54271272721,222.8603229936],[1372139e-11,4.19641530878,111.4301614968],[1221029e-11,.1990065003,108.4612160802],[946181e-11,1.19253165736,127.4717966068],[1150989e-11,4.17898916639,33.6796175129]],[[74.7815986091,0,0],[.00154332863,5.24158770553,74.7815985673],[.00024456474,1.71260334156,1.4844727083],[9258442e-11,.4282973235,11.0457002639],[8265977e-11,1.50218091379,63.7358983034],[915016e-10,1.41213765216,149.5631971346]]],[[[.01346277648,2.61877810547,74.7815985673],[623414e-9,5.08111189648,149.5631971346],[.00061601196,3.14159265359,0],[9963722e-11,1.61603805646,76.2660712756],[992616e-10,.57630380333,73.297125859]],[[.00034101978,.01321929936,74.7815985673]]],[[[19.21264847206,0,0],[.88784984413,5.60377527014,74.7815985673],[.03440836062,.32836099706,73.297125859],[.0205565386,1.7829515933,149.5631971346],[.0064932241,4.52247285911,76.2660712756],[.00602247865,3.86003823674,63.7358983034],[.00496404167,1.40139935333,454.9093665273],[.00338525369,1.58002770318,138.5174968707],[.00243509114,1.57086606044,71.8126531507],[.00190522303,1.99809394714,1.4844727083],[.00161858838,2.79137786799,148.0787244263],[.00143706183,1.38368544947,11.0457002639],[.00093192405,.17437220467,36.6485629295],[.00071424548,4.24509236074,224.3447957019],[.00089806014,3.66105364565,109.9456887885],[.00039009723,1.66971401684,70.8494453042],[.00046677296,1.39976401694,35.1640902212],[.00039025624,3.36234773834,277.0349937414],[.00036755274,3.88649278513,146.594251718],[.00030348723,.70100838798,151.0476698429],[.00029156413,3.180563367,77.7505439839],[.00022637073,.72518687029,529.6909650946],[.00011959076,1.7504339214,984.6003316219],[.00025620756,5.25656086672,380.12776796]],[[.01479896629,3.67205697578,74.7815985673]]]],Neptune:[[[[5.31188633046,0,0],[.0179847553,2.9010127389,38.1330356378],[.01019727652,.48580922867,1.4844727083],[.00124531845,4.83008090676,36.6485629295],[.00042064466,5.41054993053,2.9689454166],[.00037714584,6.09221808686,35.1640902212],[.00033784738,1.24488874087,76.2660712756],[.00016482741,7727998e-11,491.5579294568],[9198584e-11,4.93747051954,39.6175083461],[899425e-10,.27462171806,175.1660598002]],[[38.13303563957,0,0],[.00016604172,4.86323329249,1.4844727083],[.00015744045,2.27887427527,38.1330356378]]],[[[.03088622933,1.44104372644,38.1330356378],[.00027780087,5.91271884599,76.2660712756],[.00027623609,0,0],[.00015355489,2.52123799551,36.6485629295],[.00015448133,3.50877079215,39.6175083461]]],[[[30.07013205828,0,0],[.27062259632,1.32999459377,38.1330356378],[.01691764014,3.25186135653,36.6485629295],[.00807830553,5.18592878704,1.4844727083],[.0053776051,4.52113935896,35.1640902212],[.00495725141,1.5710564165,491.5579294568],[.00274571975,1.84552258866,175.1660598002],[.0001201232,1.92059384991,1021.2488945514],[.00121801746,5.79754470298,76.2660712756],[.00100896068,.3770272493,73.297125859],[.00135134092,3.37220609835,39.6175083461],[7571796e-11,1.07149207335,388.4651552382]]]]};function Rne(n){var e,t,i,a,r,s,o;const c=2e3+(n-14)/xne;return c<-500?(e=(c-1820)/100,-20+32*e*e):c<500?(e=c/100,t=e*e,i=e*t,a=t*t,r=t*i,s=i*i,10583.6-1014.41*e+33.78311*t-5.952053*i-.1798452*a+.022174192*r+.0090316521*s):c<1600?(e=(c-1e3)/100,t=e*e,i=e*t,a=t*t,r=t*i,s=i*i,1574.2-556.01*e+71.23472*t+.319781*i-.8503463*a-.005050998*r+.0083572073*s):c<1700?(e=c-1600,t=e*e,i=e*t,120-.9808*e-.01532*t+i/7129):c<1800?(e=c-1700,t=e*e,i=e*t,a=t*t,8.83+.1603*e-.0059285*t+13336e-8*i-a/1174e3):c<1860?(e=c-1800,t=e*e,i=e*t,a=t*t,r=t*i,s=i*i,o=i*a,13.72-.332447*e+.0068612*t+.0041116*i-37436e-8*a+121272e-10*r-1699e-10*s+875e-12*o):c<1900?(e=c-1860,t=e*e,i=e*t,a=t*t,r=t*i,7.62+.5737*e-.251754*t+.01680668*i-.0004473624*a+r/233174):c<1920?(e=c-1900,t=e*e,i=e*t,a=t*t,-2.79+1.494119*e-.0598939*t+.0061966*i-197e-6*a):c<1941?(e=c-1920,t=e*e,i=e*t,21.2+.84493*e-.0761*t+.0020936*i):c<1961?(e=c-1950,t=e*e,i=e*t,29.07+.407*e-t/233+i/2547):c<1986?(e=c-1975,t=e*e,i=e*t,45.45+1.067*e-t/260-i/718):c<2005?(e=c-2e3,t=e*e,i=e*t,a=t*t,r=t*i,63.86+.3345*e-.060374*t+.0017275*i+651814e-9*a+2373599e-11*r):c<2050?(e=c-2e3,62.92+.32217*e+.005589*e*e):c<2150?(e=(c-1820)/100,-20+32*e*e-.5628*(2150-c)):(e=(c-1820)/100,-20+32*e*e)}let Cne=Rne;function MO(n){return n+Cne(n)/86400}class hc{constructor(e){if(e instanceof hc){this.date=e.date,this.ut=e.ut,this.tt=e.tt;return}const t=1e3*3600*24;if(e instanceof Date&&Number.isFinite(e.getTime())){this.date=e,this.ut=(e.getTime()-EO.getTime())/t,this.tt=MO(this.ut);return}if(Number.isFinite(e)){this.date=new Date(EO.getTime()+e*t),this.ut=e,this.tt=MO(this.ut);return}throw"Argument must be a Date object, an AstroTime object, or a numeric UTC Julian date."}static FromTerrestrialTime(e){let t=new hc(e);for(;;){const i=e-t.tt;if(Math.abs(i)<1e-12)return t;t=t.AddDays(i)}}toString(){return this.date.toISOString()}AddDays(e){return new hc(this.ut+e)}}function gh(n){return n instanceof hc?n:new hc(n)}function Nne(n){function e(m){return m%Sne*qf}const t=n.tt/36525,i=e(128710479305e-5+t*1295965810481e-4),a=e(335779.526232+t*17395272628478e-4),r=e(107226070369e-5+t*1602961601209e-3),s=e(450160.398036-t*69628905431e-4);let o=Math.sin(s),c=Math.cos(s),h=(-172064161-174666*t)*o+33386*c,f=(92052331+9086*t)*c+15377*o,d=2*(a-r+s);return o=Math.sin(d),c=Math.cos(d),h+=(-13170906-1675*t)*o-13696*c,f+=(5730336-3015*t)*c-4587*o,d=2*(a+s),o=Math.sin(d),c=Math.cos(d),h+=(-2276413-234*t)*o+2796*c,f+=(978459-485*t)*c+1374*o,d=2*s,o=Math.sin(d),c=Math.cos(d),h+=(2074554+207*t)*o-698*c,f+=(-897492+470*t)*c-291*o,o=Math.sin(i),c=Math.cos(i),h+=(1475877-3633*t)*o+11817*c,f+=(73871-184*t)*c-1924*o,{dpsi:-135e-6+h*1e-7,deps:388e-6+f*1e-7}}function FP(n){var e=n.tt/36525,t=((((-434e-10*e-576e-9)*e+.0020034)*e-1831e-7)*e-46.836769)*e+84381.406;return t/3600}var Zv;function GP(n){if(!Zv||Math.abs(Zv.tt-n.tt)>1e-6){const e=Nne(n),t=FP(n),i=t+e.deps/3600;Zv={tt:n.tt,dpsi:e.dpsi,deps:e.deps,ee:e.dpsi*Math.cos(t*th)/15,mobl:t,tobl:i}}return Zv}function Dne(n,e){const t=n*th,i=Math.cos(t),a=Math.sin(t);return[e[0],e[1]*i-e[2]*a,e[1]*a+e[2]*i]}function One(n,e){return Dne(FP(n),e)}function Lne(n){const e=n.tt/36525;function t(ot,Ke){const Te=[];let G;for(G=0;G<=Ke-ot;++G)Te.push(0);return{min:ot,array:Te}}function i(ot,Ke,Te,G){const be=[];for(let De=0;De<=Ke-ot;++De)be.push(t(Te,G));return{min:ot,array:be}}function a(ot,Ke,Te){const G=ot.array[Ke-ot.min];return G.array[Te-G.min]}function r(ot,Ke,Te,G){const be=ot.array[Ke-ot.min];be.array[Te-be.min]=G}let s,o,c,h,f,d,m,g,x,T,y,v,S,E,b,D,C,I,P,O,w,B,j,ee=i(-6,6,1,4),se=i(-6,6,1,4);function re(ot,Ke){return a(ee,ot,Ke)}function W(ot,Ke){return a(se,ot,Ke)}function te(ot,Ke,Te){return r(ee,ot,Ke,Te)}function K(ot,Ke,Te){return r(se,ot,Ke,Te)}function oe(ot,Ke,Te,G,be){be(ot*Te-Ke*G,Ke*Te+ot*G)}function ie(ot){return Math.sin(Bo*ot)}m=e*e,x=0,j=0,y=0,v=3422.7;var Ce=ie(.19833+.05611*e),Xe=ie(.27869+.04508*e),nt=ie(.16827-.36903*e),tt=ie(.34734-5.37261*e),gt=ie(.10498-5.37899*e),ge=ie(.42681-.41855*e),Ae=ie(.14943-5.37511*e);for(I=.84*Ce+.31*Xe+14.27*nt+7.26*tt+.28*gt+.24*ge,P=2.94*Ce+.31*Xe+14.27*nt+9.34*tt+1.12*gt+.83*ge,O=-6.4*Ce-1.89*ge,w=.21*Ce+.31*Xe+14.27*nt-88.7*tt-15.3*gt+.24*ge-1.86*Ae,B=I-O,g=-3332e-9*ie(.59734-5.37261*e)-539e-9*ie(.35498-5.37899*e)-64e-9*ie(.39943-5.37511*e),S=Bo*Tf(.60643382+1336.85522467*e-313e-8*m)+I/Bl,E=Bo*Tf(.37489701+1325.55240982*e+2565e-8*m)+P/Bl,b=Bo*Tf(.99312619+99.99735956*e-44e-8*m)+O/Bl,D=Bo*Tf(.25909118+1342.2278298*e-892e-8*m)+w/Bl,C=Bo*Tf(.82736186+1236.85308708*e-397e-8*m)+B/Bl,f=1;f<=4;++f){switch(f){case 1:c=E,o=4,h=1.000002208;break;case 2:c=b,o=3,h=.997504612-.002495388*e;break;case 3:c=D,o=4,h=1.000002708+139.978*g;break;case 4:c=C,o=6,h=1;break;default:throw`Internal error: I = ${f}`}for(te(0,f,1),te(1,f,Math.cos(c)*h),K(0,f,0),K(1,f,Math.sin(c)*h),d=2;d<=o;++d)oe(re(d-1,f),W(d-1,f),re(1,f),W(1,f),(ot,Ke)=>(te(d,f,ot),K(d,f,Ke)));for(d=1;d<=o;++d)te(-d,f,re(d,f)),K(-d,f,-W(d,f))}function Ze(ot,Ke,Te,G){for(var be={x:1,y:0},De=[0,ot,Ke,Te,G],Fe=1;Fe<=4;++Fe)De[Fe]!==0&&oe(be.x,be.y,re(De[Fe],Fe),W(De[Fe],Fe),(Be,$e)=>(be.x=Be,be.y=$e));return be}function ue(ot,Ke,Te,G,be,De,Fe,Be){var $e=Ze(be,De,Fe,Be);x+=ot*$e.y,j+=Ke*$e.y,y+=Te*$e.x,v+=G*$e.x}ue(13.902,14.06,-.001,.2607,0,0,0,4),ue(.403,-4.01,.394,.0023,0,0,0,3),ue(2369.912,2373.36,.601,28.2333,0,0,0,2),ue(-125.154,-112.79,-.725,-.9781,0,0,0,1),ue(1.979,6.98,-.445,.0433,1,0,0,4),ue(191.953,192.72,.029,3.0861,1,0,0,2),ue(-8.466,-13.51,.455,-.1093,1,0,0,1),ue(22639.5,22609.07,.079,186.5398,1,0,0,0),ue(18.609,3.59,-.094,.0118,1,0,0,-1),ue(-4586.465,-4578.13,-.077,34.3117,1,0,0,-2),ue(3.215,5.44,.192,-.0386,1,0,0,-3),ue(-38.428,-38.64,.001,.6008,1,0,0,-4),ue(-.393,-1.43,-.092,.0086,1,0,0,-6),ue(-.289,-1.59,.123,-.0053,0,1,0,4),ue(-24.42,-25.1,.04,-.3,0,1,0,2),ue(18.023,17.93,.007,.1494,0,1,0,1),ue(-668.146,-126.98,-1.302,-.3997,0,1,0,0),ue(.56,.32,-.001,-.0037,0,1,0,-1),ue(-165.145,-165.06,.054,1.9178,0,1,0,-2),ue(-1.877,-6.46,-.416,.0339,0,1,0,-4),ue(.213,1.02,-.074,.0054,2,0,0,4),ue(14.387,14.78,-.017,.2833,2,0,0,2),ue(-.586,-1.2,.054,-.01,2,0,0,1),ue(769.016,767.96,.107,10.1657,2,0,0,0),ue(1.75,2.01,-.018,.0155,2,0,0,-1),ue(-211.656,-152.53,5.679,-.3039,2,0,0,-2),ue(1.225,.91,-.03,-.0088,2,0,0,-3),ue(-30.773,-34.07,-.308,.3722,2,0,0,-4),ue(-.57,-1.4,-.074,.0109,2,0,0,-6),ue(-2.921,-11.75,.787,-.0484,1,1,0,2),ue(1.267,1.52,-.022,.0164,1,1,0,1),ue(-109.673,-115.18,.461,-.949,1,1,0,0),ue(-205.962,-182.36,2.056,1.4437,1,1,0,-2),ue(.233,.36,.012,-.0025,1,1,0,-3),ue(-4.391,-9.66,-.471,.0673,1,1,0,-4),ue(.283,1.53,-.111,.006,1,-1,0,4),ue(14.577,31.7,-1.54,.2302,1,-1,0,2),ue(147.687,138.76,.679,1.1528,1,-1,0,0),ue(-1.089,.55,.021,0,1,-1,0,-1),ue(28.475,23.59,-.443,-.2257,1,-1,0,-2),ue(-.276,-.38,-.006,-.0036,1,-1,0,-3),ue(.636,2.27,.146,-.0102,1,-1,0,-4),ue(-.189,-1.68,.131,-.0028,0,2,0,2),ue(-7.486,-.66,-.037,-.0086,0,2,0,0),ue(-8.096,-16.35,-.74,.0918,0,2,0,-2),ue(-5.741,-.04,0,-9e-4,0,0,2,2),ue(.255,0,0,0,0,0,2,1),ue(-411.608,-.2,0,-.0124,0,0,2,0),ue(.584,.84,0,.0071,0,0,2,-1),ue(-55.173,-52.14,0,-.1052,0,0,2,-2),ue(.254,.25,0,-.0017,0,0,2,-3),ue(.025,-1.67,0,.0031,0,0,2,-4),ue(1.06,2.96,-.166,.0243,3,0,0,2),ue(36.124,50.64,-1.3,.6215,3,0,0,0),ue(-13.193,-16.4,.258,-.1187,3,0,0,-2),ue(-1.187,-.74,.042,.0074,3,0,0,-4),ue(-.293,-.31,-.002,.0046,3,0,0,-6),ue(-.29,-1.45,.116,-.0051,2,1,0,2),ue(-7.649,-10.56,.259,-.1038,2,1,0,0),ue(-8.627,-7.59,.078,-.0192,2,1,0,-2),ue(-2.74,-2.54,.022,.0324,2,1,0,-4),ue(1.181,3.32,-.212,.0213,2,-1,0,2),ue(9.703,11.67,-.151,.1268,2,-1,0,0),ue(-.352,-.37,.001,-.0028,2,-1,0,-1),ue(-2.494,-1.17,-.003,-.0017,2,-1,0,-2),ue(.36,.2,-.012,-.0043,2,-1,0,-4),ue(-1.167,-1.25,.008,-.0106,1,2,0,0),ue(-7.412,-6.12,.117,.0484,1,2,0,-2),ue(-.311,-.65,-.032,.0044,1,2,0,-4),ue(.757,1.82,-.105,.0112,1,-2,0,2),ue(2.58,2.32,.027,.0196,1,-2,0,0),ue(2.533,2.4,-.014,-.0212,1,-2,0,-2),ue(-.344,-.57,-.025,.0036,0,3,0,-2),ue(-.992,-.02,0,0,1,0,2,2),ue(-45.099,-.02,0,-.001,1,0,2,0),ue(-.179,-9.52,0,-.0833,1,0,2,-2),ue(-.301,-.33,0,.0014,1,0,2,-4),ue(-6.382,-3.37,0,-.0481,1,0,-2,2),ue(39.528,85.13,0,-.7136,1,0,-2,0),ue(9.366,.71,0,-.0112,1,0,-2,-2),ue(.202,.02,0,0,1,0,-2,-4),ue(.415,.1,0,.0013,0,1,2,0),ue(-2.152,-2.26,0,-.0066,0,1,2,-2),ue(-1.44,-1.3,0,.0014,0,1,-2,2),ue(.384,-.04,0,0,0,1,-2,-2),ue(1.938,3.6,-.145,.0401,4,0,0,0),ue(-.952,-1.58,.052,-.013,4,0,0,-2),ue(-.551,-.94,.032,-.0097,3,1,0,0),ue(-.482,-.57,.005,-.0045,3,1,0,-2),ue(.681,.96,-.026,.0115,3,-1,0,0),ue(-.297,-.27,.002,-9e-4,2,2,0,-2),ue(.254,.21,-.003,0,2,-2,0,-2),ue(-.25,-.22,.004,.0014,1,3,0,-2),ue(-3.996,0,0,4e-4,2,0,2,0),ue(.557,-.75,0,-.009,2,0,2,-2),ue(-.459,-.38,0,-.0053,2,0,-2,2),ue(-1.298,.74,0,4e-4,2,0,-2,0),ue(.538,1.14,0,-.0141,2,0,-2,-2),ue(.263,.02,0,0,1,1,2,0),ue(.426,.07,0,-6e-4,1,1,-2,-2),ue(-.304,.03,0,3e-4,1,-1,2,0),ue(-.372,-.19,0,-.0027,1,-1,-2,2),ue(.418,0,0,0,0,0,4,0),ue(-.33,-.04,0,0,3,0,2,0);function it(ot,Ke,Te,G,be){return ot*Ze(Ke,Te,G,be).y}T=0,T+=it(-526.069,0,0,1,-2),T+=it(-3.352,0,0,1,-4),T+=it(44.297,1,0,1,-2),T+=it(-6,1,0,1,-4),T+=it(20.599,-1,0,1,0),T+=it(-30.598,-1,0,1,-2),T+=it(-24.649,-2,0,1,0),T+=it(-2,-2,0,1,-2),T+=it(-22.571,0,1,1,-2),T+=it(10.985,0,-1,1,-2),x+=.82*ie(.7736-62.5512*e)+.31*ie(.0466-125.1025*e)+.35*ie(.5785-25.1042*e)+.66*ie(.4591+1335.8075*e)+.64*ie(.313-91.568*e)+1.14*ie(.148+1331.2898*e)+.21*ie(.5918+1056.5859*e)+.44*ie(.5784+1322.8595*e)+.24*ie(.2275-5.7374*e)+.28*ie(.2965+2.6929*e)+.33*ie(.3132+6.3368*e),s=D+j/Bl;let Mt=(1.000002708+139.978*g)*(18518.511+1.189+y)*Math.sin(s)-6.24*Math.sin(3*s)+T;return{geo_eclip_lon:Bo*Tf((S+x/Bl)/Bo),geo_eclip_lat:Math.PI/(180*3600)*Mt,distance_au:Bl*Ene/(.999953253*v)}}function Ine(n,e){return[n.rot[0][0]*e[0]+n.rot[1][0]*e[1]+n.rot[2][0]*e[2],n.rot[0][1]*e[0]+n.rot[1][1]*e[1]+n.rot[2][1]*e[2],n.rot[0][2]*e[0]+n.rot[1][2]*e[1]+n.rot[2][2]*e[2]]}function Une(n,e,t){const i=VP(e,t);return Ine(i,n)}function VP(n,e){const t=n.tt/36525;let i=84381.406,a=((((-951e-10*t+132851e-9)*t-.00114045)*t-1.0790069)*t+5038.481507)*t,r=((((3337e-10*t-467e-9)*t-.00772503)*t+.0512623)*t-.025754)*t+i,s=((((-56e-9*t+170663e-9)*t-.00121197)*t-2.3814292)*t+10.556403)*t;i*=qf,a*=qf,r*=qf,s*=qf;const o=Math.sin(i),c=Math.cos(i),h=Math.sin(-a),f=Math.cos(-a),d=Math.sin(-r),m=Math.cos(-r),g=Math.sin(s),x=Math.cos(s),T=x*f-h*g*m,y=x*h*c+g*m*f*c-o*g*d,v=x*h*o+g*m*f*o+c*g*d,S=-g*f-h*x*m,E=-g*h*c+x*m*f*c-o*x*d,b=-g*h*o+x*m*f*o+c*x*d,D=h*d,C=-d*f*c-o*m,I=-d*f*o+m*c;if(e===sl.Into2000)return new Pd([[T,y,v],[S,E,b],[D,C,I]]);if(e===sl.From2000)return new Pd([[T,S,D],[y,E,C],[v,b,I]]);throw"Invalid precess direction"}function Pne(n){const e=.779057273264+.00273781191135448*n.ut,t=n.ut%1;let i=360*((e+t)%1);return i<0&&(i+=360),i}let Kv;function zne(n){if(!Kv||Kv.tt!==n.tt){const e=n.tt/36525;let t=15*GP(n).ee;const i=Pne(n);let a=((t+.014506+((((-368e-10*e-29956e-9)*e-44e-8)*e+1.3915817)*e+4612.156534)*e)/3600+i)%360/15;a<0&&(a+=24),Kv={tt:n.tt,st:a}}return Kv.st}function Bne(n){const e=gh(n);return zne(e)}function Hne(n,e){const t=GP(n),i=t.mobl*th,a=t.tobl*th,r=t.dpsi*qf,s=Math.cos(i),o=Math.sin(i),c=Math.cos(a),h=Math.sin(a),f=Math.cos(r),d=Math.sin(r),m=f,g=-d*s,x=-d*o,T=d*c,y=f*s*c+o*h,v=f*o*c-s*h,S=d*h,E=f*s*h-o*c,b=f*o*h+s*c;if(e===sl.From2000)return new Pd([[m,T,S],[g,y,E],[x,v,b]]);if(e===sl.Into2000)return new Pd([[m,g,x],[T,y,v],[S,E,b]]);throw"Invalid precess direction"}class Rs{constructor(e,t,i,a){this.x=e,this.y=t,this.z=i,this.t=a}Length(){return Math.hypot(this.x,this.y,this.z)}}class Fne{constructor(e,t,i,a,r,s,o){this.x=e,this.y=t,this.z=i,this.vx=a,this.vy=r,this.vz=s,this.t=o}}let Gne=class{constructor(e,t,i){this.lat=T_(e),this.lon=T_(t),this.dist=T_(i)}};class Pd{constructor(e){this.rot=e}}function KE(n){const e=gh(n),t=Lne(e),i=t.distance_au*Math.cos(t.geo_eclip_lat),a=[i*Math.cos(t.geo_eclip_lon),i*Math.sin(t.geo_eclip_lon),t.distance_au*Math.sin(t.geo_eclip_lat)],r=One(e,a),s=Une(r,e,sl.Into2000);return new Rs(s[0],s[1],s[2],e)}function sd(n,e,t){let i=1,a=0;for(let r of n){let s=0;for(let[c,h,f]of r)s+=c*Math.cos(h+e*f);let o=i*s;t&&(o%=Bo),a+=o,i*=e}return a}function t3(n,e){let t=1,i=0,a=0,r=0;for(let s of n){let o=0,c=0;for(let[h,f,d]of s){let m=f+e*d;o+=h*d*Math.sin(m),r>0&&(c+=h*Math.cos(m))}a+=r*i*c-t*o,i=t,t*=e,++r}return a}const gm=365250,QE=0,JE=1,$E=2;function eM(n){return new Sa(n[0]+44036e-11*n[1]-190919e-12*n[2],-479966e-12*n[0]+.917482137087*n[1]-.397776982902*n[2],.397776982902*n[1]+.917482137087*n[2])}function kP(n,e,t){const i=t*Math.cos(e),a=Math.cos(n),r=Math.sin(n);return[i*a,i*r,t*Math.sin(e)]}function E_(n,e){const t=e.tt/gm,i=sd(n[QE],t,!0),a=sd(n[JE],t,!1),r=sd(n[$E],t,!1),s=kP(i,a,r);return eM(s).ToAstroVector(e)}function Vne(n,e){const t=e/gm,i=sd(n[QE],t,!0),a=sd(n[JE],t,!1),r=sd(n[$E],t,!1),s=t3(n[QE],t),o=t3(n[JE],t),c=t3(n[$E],t),h=Math.cos(i),f=Math.sin(i),d=Math.cos(a),m=Math.sin(a),g=+(c*d*h)-r*m*h*o-r*d*f*s,x=+(c*d*f)-r*m*f*o+r*d*h*s,T=+(c*m)+r*d*o,y=kP(i,a,r),v=[g/gm,x/gm,T/gm],S=eM(y),E=eM(v);return new nh(e,S,E)}function Qv(n,e,t,i){const a=i/(i+SA),r=E_(jf[t],e);n.x+=a*r.x,n.y+=a*r.y,n.z+=a*r.z}function kne(n){const e=new Rs(0,0,0,n);return Qv(e,n,zn.Jupiter,YE),Qv(e,n,zn.Saturn,qE),Qv(e,n,zn.Uranus,jE),Qv(e,n,zn.Neptune,ZE),e}const tM=51,Wne=29200,Zf=146,Ho=201,Ru=[[-73e4,[-26.118207232108,-14.376168177825,3.384402515299],[.0016339372163656,-.0027861699588508,-.0013585880229445]],[-700800,[41.974905202127,-.448502952929,-12.770351505989],[.00073458569351457,.0022785014891658,.00048619778602049]],[-671600,[14.706930780744,44.269110540027,9.353698474772],[-.00210001479998,.00022295915939915,.00070143443551414]],[-642400,[-29.441003929957,-6.43016153057,6.858481011305],[.00084495803960544,-.0030783914758711,-.0012106305981192]],[-613200,[39.444396946234,-6.557989760571,-13.913760296463],[.0011480029005873,.0022400006880665,.00035168075922288]],[-584e3,[20.2303809507,43.266966657189,7.382966091923],[-.0019754081700585,.00053457141292226,.00075929169129793]],[-554800,[-30.65832536462,2.093818874552,9.880531138071],[61010603013347e-18,-.0031326500935382,-.00099346125151067]],[-525600,[35.737703251673,-12.587706024764,-14.677847247563],[.0015802939375649,.0021347678412429,.00019074436384343]],[-496400,[25.466295188546,41.367478338417,5.216476873382],[-.0018054401046468,.0008328308359951,.00080260156912107]],[-467200,[-29.847174904071,10.636426313081,12.297904180106],[-.00063257063052907,-.0029969577578221,-.00074476074151596]],[-438e3,[30.774692107687,-18.236637015304,-14.945535879896],[.0020113162005465,.0019353827024189,-20937793168297e-19]],[-408800,[30.243153324028,38.656267888503,2.938501750218],[-.0016052508674468,.0011183495337525,.00083333973416824]],[-379600,[-27.288984772533,18.643162147874,14.023633623329],[-.0011856388898191,-.0027170609282181,-.00049015526126399]],[-350400,[24.519605196774,-23.245756064727,-14.626862367368],[.0024322321483154,.0016062008146048,-.00023369181613312]],[-321200,[34.505274805875,35.125338586954,.557361475637],[-.0013824391637782,.0013833397561817,.00084823598806262]],[-292e3,[-23.275363915119,25.818514298769,15.055381588598],[-.0016062295460975,-.0023395961498533,-.00024377362639479]],[-262800,[17.050384798092,-27.180376290126,-13.608963321694],[.0028175521080578,.0011358749093955,-.00049548725258825]],[-233600,[38.093671910285,30.880588383337,-1.843688067413],[-.0011317697153459,.0016128814698472,.00084177586176055]],[-204400,[-18.197852930878,31.932869934309,15.438294826279],[-.0019117272501813,-.0019146495909842,-19657304369835e-18]],[-175200,[8.528924039997,-29.618422200048,-11.805400994258],[.0031034370787005,.0005139363329243,-.00077293066202546]],[-146e3,[40.94685725864,25.904973592021,-4.256336240499],[-.00083652705194051,.0018129497136404,.0008156422827306]],[-116800,[-12.326958895325,36.881883446292,15.217158258711],[-.0021166103705038,-.001481442003599,.00017401209844705]],[-87600,[-.633258375909,-30.018759794709,-9.17193287495],[.0032016994581737,-.00025279858672148,-.0010411088271861]],[-58400,[42.936048423883,20.344685584452,-6.588027007912],[-.00050525450073192,.0019910074335507,.00077440196540269]],[-29200,[-5.975910552974,40.61180995846,14.470131723673],[-.0022184202156107,-.0010562361130164,.00033652250216211]],[0,[-9.875369580774,-27.978926224737,-5.753711824704],[.0030287533248818,-.0011276087003636,-.0012651326732361]],[29200,[43.958831986165,14.214147973292,-8.808306227163],[-.00014717608981871,.0021404187242141,.00071486567806614]],[58400,[.67813676352,43.094461639362,13.243238780721],[-.0022358226110718,-.00063233636090933,.00047664798895648]],[87600,[-18.282602096834,-23.30503958666,-1.766620508028],[.0025567245263557,-.0019902940754171,-.0013943491701082]],[116800,[43.873338744526,7.700705617215,-10.814273666425],[.00023174803055677,.0022402163127924,.00062988756452032]],[146e3,[7.392949027906,44.382678951534,11.629500214854],[-.002193281545383,-.00021751799585364,.00059556516201114]],[175200,[-24.981690229261,-16.204012851426,2.466457544298],[.001819398914958,-.0026765419531201,-.0013848283502247]],[204400,[42.530187039511,.845935508021,-12.554907527683],[.00065059779150669,.0022725657282262,.00051133743202822]],[233600,[13.999526486822,44.462363044894,9.669418486465],[-.0021079296569252,.00017533423831993,.00069128485798076]],[262800,[-29.184024803031,-7.371243995762,6.493275957928],[.00093581363109681,-.0030610357109184,-.0012364201089345]],[292e3,[39.831980671753,-6.078405766765,-13.909815358656],[.0011117769689167,.0022362097830152,.00036230548231153]],[321200,[20.294955108476,43.417190420251,7.450091985932],[-.0019742157451535,.00053102050468554,.00075938408813008]],[350400,[-30.66999230216,2.318743558955,9.973480913858],[45605107450676e-18,-.0031308219926928,-.00099066533301924]],[379600,[35.626122155983,-12.897647509224,-14.777586508444],[.0016015684949743,.0021171931182284,.00018002516202204]],[408800,[26.133186148561,41.232139187599,5.00640132622],[-.0017857704419579,.00086046232702817,.00080614690298954]],[438e3,[-29.57674022923,11.863535943587,12.631323039872],[-.00072292830060955,-.0029587820140709,-.000708242964503]],[467200,[29.910805787391,-19.159019294,-15.013363865194],[.0020871080437997,.0018848372554514,-38528655083926e-18]],[496400,[31.375957451819,38.050372720763,2.433138343754],[-.0015546055556611,.0011699815465629,.00083565439266001]],[525600,[-26.360071336928,20.662505904952,14.414696258958],[-.0013142373118349,-.0026236647854842,-.00042542017598193]],[554800,[22.599441488648,-24.508879898306,-14.484045731468],[.0025454108304806,.0014917058755191,-.00030243665086079]],[584e3,[35.877864013014,33.894226366071,-.224524636277],[-.0012941245730845,.0014560427668319,.00084762160640137]],[613200,[-21.538149762417,28.204068269761,15.321973799534],[-.001731211740901,-.0021939631314577,-.0001631691327518]],[642400,[13.971521374415,-28.339941764789,-13.083792871886],[.0029334630526035,.00091860931752944,-.00059939422488627]],[671600,[39.526942044143,28.93989736011,-2.872799527539],[-.0010068481658095,.001702113288809,.00083578230511981]],[700800,[-15.576200701394,34.399412961275,15.466033737854],[-.0020098814612884,-.0017191109825989,70414782780416e-18]],[73e4,[4.24325283709,-30.118201690825,-10.707441231349],[.0031725847067411,.0001609846120227,-.00090672150593868]]];class Sa{constructor(e,t,i){this.x=e,this.y=t,this.z=i}clone(){return new Sa(this.x,this.y,this.z)}ToAstroVector(e){return new Rs(this.x,this.y,this.z,e)}static zero(){return new Sa(0,0,0)}quadrature(){return this.x*this.x+this.y*this.y+this.z*this.z}add(e){return new Sa(this.x+e.x,this.y+e.y,this.z+e.z)}sub(e){return new Sa(this.x-e.x,this.y-e.y,this.z-e.z)}incr(e){this.x+=e.x,this.y+=e.y,this.z+=e.z}decr(e){this.x-=e.x,this.y-=e.y,this.z-=e.z}mul(e){return new Sa(e*this.x,e*this.y,e*this.z)}div(e){return new Sa(this.x/e,this.y/e,this.z/e)}mean(e){return new Sa((this.x+e.x)/2,(this.y+e.y)/2,(this.z+e.z)/2)}neg(){return new Sa(-this.x,-this.y,-this.z)}}class nh{constructor(e,t,i){this.tt=e,this.r=t,this.v=i}clone(){return new nh(this.tt,this.r,this.v)}sub(e){return new nh(this.tt,this.r.sub(e.r),this.v.sub(e.v))}}function Xne(n){let[e,[t,i,a],[r,s,o]]=n;return new nh(e,new Sa(t,i,a),new Sa(r,s,o))}function Jv(n,e,t,i){const a=i/(i+SA),r=Vne(jf[t],e);return n.r.incr(r.r.mul(a)),n.v.incr(r.v.mul(a)),r}function tm(n,e,t){const i=t.sub(n),a=i.quadrature();return i.mul(e/(a*Math.sqrt(a)))}class TA{constructor(e){let t=new nh(e,new Sa(0,0,0),new Sa(0,0,0));this.Jupiter=Jv(t,e,zn.Jupiter,YE),this.Saturn=Jv(t,e,zn.Saturn,qE),this.Uranus=Jv(t,e,zn.Uranus,jE),this.Neptune=Jv(t,e,zn.Neptune,ZE),this.Jupiter.r.decr(t.r),this.Jupiter.v.decr(t.v),this.Saturn.r.decr(t.r),this.Saturn.v.decr(t.v),this.Uranus.r.decr(t.r),this.Uranus.v.decr(t.v),this.Neptune.r.decr(t.r),this.Neptune.v.decr(t.v),this.Sun=new nh(e,t.r.mul(-1),t.v.mul(-1))}Acceleration(e){let t=tm(e,SA,this.Sun.r);return t.incr(tm(e,YE,this.Jupiter.r)),t.incr(tm(e,qE,this.Saturn.r)),t.incr(tm(e,jE,this.Uranus.r)),t.incr(tm(e,ZE,this.Neptune.r)),t}}let WP=class XP{constructor(e,t,i,a){this.tt=e,this.r=t,this.v=i,this.a=a}clone(){return new XP(this.tt,this.r.clone(),this.v.clone(),this.a.clone())}},YP=class{constructor(e,t){this.bary=e,this.grav=t}};function r1(n,e,t,i){return new Sa(e.x+n*(t.x+n*i.x/2),e.y+n*(t.y+n*i.y/2),e.z+n*(t.z+n*i.z/2))}function bO(n,e,t){return new Sa(e.x+n*t.x,e.y+n*t.y,e.z+n*t.z)}function nM(n,e){const t=n-e.tt,i=new TA(n),a=r1(t,e.r,e.v,e.a),r=i.Acceleration(a).mean(e.a),s=r1(t,e.r,e.v,r),o=e.v.add(r.mul(t)),c=i.Acceleration(s),h=new WP(n,s,o,c);return new YP(i,h)}const Yne=[];function qP(n,e){const t=Math.floor(n);return t<0?0:t>=e?e-1:t}function iM(n){const e=Xne(n),t=new TA(e.tt),i=e.r.add(t.Sun.r),a=e.v.add(t.Sun.v),r=t.Acceleration(i),s=new WP(e.tt,i,a,r);return new YP(t,s)}function qne(n,e){const t=Ru[0][0];if(eRu[tM-1][0])return null;const i=qP((e-t)/Wne,tM-1);if(!n[i]){const r=n[i]=[];r[0]=iM(Ru[i]).grav,r[Ho-1]=iM(Ru[i+1]).grav;let s,o=r[0].tt;for(s=1;s0;--s)a[s]=nM(o-=Zf,a[s+1]).grav;for(s=Ho-2;s>0;--s){const c=s/(Ho-1);r[s].r=r[s].r.mul(1-c).add(a[s].r.mul(c)),r[s].v=r[s].v.mul(1-c).add(a[s].v.mul(c)),r[s].a=r[s].a.mul(1-c).add(a[s].a.mul(c))}}return n[i]}function AO(n,e,t){let i=iM(n);const a=Math.ceil((e-i.grav.tt)/t);for(let r=0;r1)throw"Object is too distant for light-travel solver.";const o=e.AddDays(-s);if(i=Math.abs(o.tt-t.tt),i<1e-9)return r;t=o}throw`Light-travel time solver did not converge: dt = ${i}`}class Kne{constructor(e,t,i,a){this.observerBody=e,this.targetBody=t,this.aberration=i,this.observerPos=a}Position(e){this.aberration&&(this.observerPos=Wm(this.observerBody,e));const t=Wm(this.targetBody,e);return new Rs(t.x-this.observerPos.x,t.y-this.observerPos.y,t.z-this.observerPos.z,e)}}function Qne(n,e,t,i){const a=gh(n);if(HP(t)){const o=Wm(t,a),c=Wm(e,a);return new Rs(o.x-c.x,o.y-c.y,o.z-c.z,a)}let r;r=Wm(e,a);const s=new Kne(e,t,i,r);return Zne(o=>s.Position(o),a)}function Jne(n,e,t){const i=gh(e);switch(n){case zn.Earth:return new Rs(0,0,0,i);case zn.Moon:return KE(i);default:const a=Qne(i,zn.Earth,n,t);return a.t=i,a}}var wO;(function(n){n[n.Pericenter=0]="Pericenter",n[n.Apocenter=1]="Apocenter"})(wO||(wO={}));function $ne(n,e){return new Pd([[e.rot[0][0]*n.rot[0][0]+e.rot[1][0]*n.rot[0][1]+e.rot[2][0]*n.rot[0][2],e.rot[0][1]*n.rot[0][0]+e.rot[1][1]*n.rot[0][1]+e.rot[2][1]*n.rot[0][2],e.rot[0][2]*n.rot[0][0]+e.rot[1][2]*n.rot[0][1]+e.rot[2][2]*n.rot[0][2]],[e.rot[0][0]*n.rot[1][0]+e.rot[1][0]*n.rot[1][1]+e.rot[2][0]*n.rot[1][2],e.rot[0][1]*n.rot[1][0]+e.rot[1][1]*n.rot[1][1]+e.rot[2][1]*n.rot[1][2],e.rot[0][2]*n.rot[1][0]+e.rot[1][2]*n.rot[1][1]+e.rot[2][2]*n.rot[1][2]],[e.rot[0][0]*n.rot[2][0]+e.rot[1][0]*n.rot[2][1]+e.rot[2][0]*n.rot[2][2],e.rot[0][1]*n.rot[2][0]+e.rot[1][1]*n.rot[2][1]+e.rot[2][1]*n.rot[2][2],e.rot[0][2]*n.rot[2][0]+e.rot[1][2]*n.rot[2][1]+e.rot[2][2]*n.rot[2][2]]])}function eie(n,e,t){const i=T_(t)*th,a=Math.cos(i),r=Math.sin(i),s=(e+1)%3,o=(e+2)%3,c=e;let h=[[0,0,0],[0,0,0],[0,0,0]];return h[s][s]=a*n.rot[s][s]-r*n.rot[s][o],h[s][o]=r*n.rot[s][s]+a*n.rot[s][o],h[s][c]=n.rot[s][c],h[o][s]=a*n.rot[o][s]-r*n.rot[o][o],h[o][o]=r*n.rot[o][s]+a*n.rot[o][o],h[o][c]=n.rot[o][c],h[c][s]=a*n.rot[c][s]-r*n.rot[c][o],h[c][o]=r*n.rot[c][s]+a*n.rot[c][o],h[c][c]=n.rot[c][c],new Pd(h)}function tie(n,e){e=gh(e);const t=n.lat*th,i=n.lon*th,a=n.dist*Math.cos(t);return new Rs(a*Math.cos(i),a*Math.sin(i),n.dist*Math.sin(t),e)}function nie(n){n=gh(n);const e=VP(n,sl.From2000),t=Hne(n,sl.From2000);return $ne(e,t)}var RO;(function(n){n.Penumbral="penumbral",n.Partial="partial",n.Annular="annular",n.Total="total"})(RO||(RO={}));var CO;(function(n){n[n.Invalid=0]="Invalid",n[n.Ascending=1]="Ascending",n[n.Descending=-1]="Descending"})(CO||(CO={}));function EA(n){return n instanceof hc?n:new hc(n instanceof Date?n:new Date(n))}function iie(n,e=new L){const{x:t,y:i,z:a}=n;return e.set(t,i,a)}function aie(n,e=new ke){const[t,i,a]=n.rot;return e.set(t[0],i[0],a[0],0,t[1],i[1],a[1],0,t[2],i[2],a[2],0,0,0,0,1)}function rie(n,e=new ke){const t=EA(n),i=eie(nie(t),2,-15*Bne(t));return aie(i,e)}function jP(n,e,t,i,a){const r=Jne(n,e,!1);return iie(r,t),i!=null,t.normalize()}function sie(n,e=new L,t){return jP(zn.Sun,EA(n),e,t)}function oie(n,e=new L,t){return jP(zn.Moon,EA(n),e,t)}const lie=`precision highp float; precision highp sampler3D; #include "bruneton/definitions" @@ -7714,7 +7714,7 @@ void main() { irradiance = vec3(0.0); outputColor = vec4(OUTPUT, 1.0); } -`,lie=`precision highp float; +`,cie=`precision highp float; precision highp sampler3D; #include "bruneton/definitions" @@ -7745,7 +7745,7 @@ void main() { irradiance = luminanceFromRadiance * deltaIrradiance; outputColor = vec4(OUTPUT, 1.0); } -`,cie=`precision highp float; +`,uie=`precision highp float; precision highp sampler3D; #include "bruneton/definitions" @@ -7779,7 +7779,7 @@ void main() { ); outputColor = OUTPUT; } -`,uie=`precision highp float; +`,hie=`precision highp float; precision highp sampler3D; #include "bruneton/definitions" @@ -7811,7 +7811,7 @@ void main() { ); scatteringDensity.a = 1.0; } -`,hie=`precision highp float; +`,fie=`precision highp float; precision highp sampler3D; #include "bruneton/definitions" @@ -7848,7 +7848,7 @@ void main() { singleMieScattering.a = 1.0; outputColor = OUTPUT; } -`,fie=`precision highp float; +`,die=`precision highp float; precision highp sampler3D; #include "bruneton/definitions" @@ -7866,13 +7866,13 @@ void main() { ); transmittance.a = 1.0; } -`,die=` +`,pie=` precision highp float; in vec2 position; void main() { gl_Position = vec4(position, 1.0, 1.0); } -`;function i1(n,e,t){const i=new _i(e,t,{depthBuffer:!1,type:n,format:Jn}),a=i.texture;return a.minFilter=Ht,a.magFilter=Ht,a.wrapS=Li,a.wrapT=Li,a.colorSpace=Na,i}function rd(n,e,t,i){const a=new zU(e,t,i,{depthBuffer:!1,type:n,format:Jn}),r=a.texture;return r.minFilter=Ht,r.magFilter=Ht,r.wrapS=Li,r.wrapT=Li,r.wrapR=Li,r.colorSpace=Na,a}function pie(n){const e=n[Symbol.iterator]();return new Promise((t,i)=>{const a=()=>{try{const{value:r,done:s}=e.next();s===!0?t(r):xO(a)}catch(r){i(r instanceof Error?r:new Error)}};xO(a)})}async function RO(n,e,t){const{width:i,height:a}=e,r=t.type===Xn?new Uint16Array(i*a*4):new Float32Array(i*a*4);await n.readRenderTargetPixelsAsync(e,0,0,e.width,e.height,r),t.userData.imageData=r}class mie{constructor(e){this.lambdas=new L,this.luminanceFromRadiance=new Et,e===Xn&&(this.opticalDepth=i1(e,Jd,$d)),this.deltaIrradiance=i1(e,Kd,Qd),this.deltaRayleighScattering=rd(e,Uu,Pu,zu),this.deltaMieScattering=rd(e,Uu,Pu,zu),this.deltaScatteringDensity=rd(e,Uu,Pu,zu),this.deltaMultipleScattering=this.deltaRayleighScattering}dispose(){var e;(e=this.opticalDepth)==null||e.dispose(),this.deltaIrradiance.dispose(),this.deltaRayleighScattering.dispose(),this.deltaMieScattering.dispose(),this.deltaScatteringDensity.dispose()}}class Sf extends ch{constructor(e){super({glslVersion:ao,vertexShader:die,...e,defines:{TRANSMITTANCE_TEXTURE_WIDTH:Jd.toFixed(0),TRANSMITTANCE_TEXTURE_HEIGHT:$d.toFixed(0),SCATTERING_TEXTURE_R_SIZE:dy.toFixed(0),SCATTERING_TEXTURE_MU_SIZE:py.toFixed(0),SCATTERING_TEXTURE_MU_S_SIZE:my.toFixed(0),SCATTERING_TEXTURE_NU_SIZE:gy.toFixed(0),IRRADIANCE_TEXTURE_WIDTH:Kd.toFixed(0),IRRADIANCE_TEXTURE_HEIGHT:Qd.toFixed(0),...e.defines}})}set additive(e){this.transparent=e,this.blending=e?lb:Sa,this.blendEquation=Qs,this.blendEquationAlpha=Qs,this.blendSrc=Gf,this.blendDst=Gf,this.blendSrcAlpha=Gf,this.blendDstAlpha=Gf}setUniforms(e){const t=this.uniforms;t.luminanceFromRadiance!=null&&t.luminanceFromRadiance.value.copy(e.luminanceFromRadiance),t.singleRayleighScatteringTexture!=null&&(t.singleRayleighScatteringTexture.value=e.deltaRayleighScattering.texture),t.singleMieScatteringTexture!=null&&(t.singleMieScatteringTexture.value=e.deltaMieScattering.texture),t.multipleScatteringTexture!=null&&(t.multipleScatteringTexture.value=e.deltaMultipleScattering.texture),t.scatteringDensityTexture!=null&&(t.scatteringDensityTexture.value=e.deltaScatteringDensity.texture),t.irradianceTexture!=null&&(t.irradianceTexture.value=e.deltaIrradiance.texture)}}class gie{constructor(e,{type:t=tP(e)?ri:Xn,combinedScattering:i=!0,higherOrderScattering:a=!0}={}){var r,s;this.transmittanceMaterial=new Sf({fragmentShader:Ca(fie,{bruneton:{common:Zs,definitions:Ks,precompute:_f}})}),this.directIrradianceMaterial=new Sf({fragmentShader:Ca(oie,{bruneton:{common:Zs,definitions:Ks,precompute:_f}}),uniforms:{transmittanceTexture:new J(null)}}),this.singleScatteringMaterial=new Sf({fragmentShader:Ca(hie,{bruneton:{common:Zs,definitions:Ks,precompute:_f}}),uniforms:{luminanceFromRadiance:new J(new Et),transmittanceTexture:new J(null),layer:new J(0)}}),this.scatteringDensityMaterial=new Sf({fragmentShader:Ca(uie,{bruneton:{common:Zs,definitions:Ks,precompute:_f}}),uniforms:{transmittanceTexture:new J(null),singleRayleighScatteringTexture:new J(null),singleMieScatteringTexture:new J(null),multipleScatteringTexture:new J(null),irradianceTexture:new J(null),scatteringOrder:new J(0),layer:new J(0)}}),this.indirectIrradianceMaterial=new Sf({fragmentShader:Ca(lie,{bruneton:{common:Zs,definitions:Ks,precompute:_f}}),uniforms:{luminanceFromRadiance:new J(new Et),singleRayleighScatteringTexture:new J(null),singleMieScatteringTexture:new J(null),multipleScatteringTexture:new J(null),scatteringOrder:new J(0)}}),this.multipleScatteringMaterial=new Sf({fragmentShader:Ca(cie,{bruneton:{common:Zs,definitions:Ks,precompute:_f}}),uniforms:{luminanceFromRadiance:new J(new Et),transmittanceTexture:new J(null),scatteringDensityTexture:new J(null),layer:new J(0)}}),this.mesh=new si(new lh(2,2)),this.scene=new Ad().add(this.mesh),this.camera=new Tc,this.updating=!1,this.renderer=e,this.type=t,this.transmittanceRenderTarget=i1(t,Jd,$d),this.scatteringRenderTarget=rd(t,Uu,Pu,zu),this.irradianceRenderTarget=i1(t,Kd,Qd),i||(this.singleMieScatteringRenderTarget=rd(t,Uu,Pu,zu)),a&&(this.higherOrderScatteringRenderTarget=rd(t,Uu,Pu,zu)),this.textures={transmittanceTexture:this.transmittanceRenderTarget.texture,scatteringTexture:this.scatteringRenderTarget.texture,irradianceTexture:this.irradianceRenderTarget.texture,singleMieScatteringTexture:(r=this.singleMieScatteringRenderTarget)==null?void 0:r.texture,higherOrderScatteringTexture:(s=this.higherOrderScatteringRenderTarget)==null?void 0:s.texture}}render3DRenderTarget(e,t){for(let i=0;i{this.dispose(e),this.disposeQueue=void 0};return}const{textures:t=!0}=e;t||(this.transmittanceRenderTarget.textures.splice(0,1),this.scatteringRenderTarget.textures.splice(0,1),this.irradianceRenderTarget.textures.splice(0,1),(i=this.singleMieScatteringRenderTarget)==null||i.textures.splice(0,1),(a=this.higherOrderScatteringRenderTarget)==null||a.textures.splice(0,1)),this.transmittanceRenderTarget.dispose(),this.scatteringRenderTarget.dispose(),this.irradianceRenderTarget.dispose(),(r=this.singleMieScatteringRenderTarget)==null||r.dispose(),(s=this.higherOrderScatteringRenderTarget)==null||s.dispose(),this.transmittanceMaterial.dispose(),this.directIrradianceMaterial.dispose(),this.singleScatteringMaterial.dispose(),this.scatteringDensityMaterial.dispose(),this.indirectIrradianceMaterial.dispose(),this.multipleScatteringMaterial.dispose(),this.mesh.geometry.dispose()}}function vie(n){var e=[];if(n.length===0)return"";if(typeof n[0]!="string")throw new TypeError("Url must be a string. Received "+n[0]);if(n[0].match(/^[^/:]+:\/*$/)&&n.length>1){var t=n.shift();n[0]=t+n[0]}n[0].match(/^file:\/\/\//)?n[0]=n[0].replace(/^([^/:]+):\/*/,"$1:///"):n[0]=n[0].replace(/^([^/:]+):\/*/,"$1://");for(var i=0;i0&&(a=a.replace(/^[\/]+/,"")),i0?"?":"")+s.join("&"),r}function _ie(){var n;return typeof arguments[0]=="object"?n=arguments[0]:n=[].slice.call(arguments),vie(n)}const wO={width:Jd,height:$d},Tf={width:Uu,height:Pu,depth:zu},CO={width:Kd,height:Qd};class qP extends Ti{constructor({format:e="exr",type:t=Xn,combinedScattering:i=!0,higherOrderScattering:a=!0}={},r){super(r),this.format=e,this.type=t,this.combinedScattering=i,this.higherOrderScattering=a}setType(e){return this.type=tP(e)?ri:Xn,this}setTypeFromRenderer(e){return this.setType(e)}load(e,t,i,a){const r={},s=({key:o,loader:c,path:h})=>(c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(_ie(e,h),f=>{f.type=this.type,this.type===ri&&(f.image.data=new Float32Array(new ll(f.image.data.buffer))),f.minFilter=Ht,f.magFilter=Ht,r[`${o}Texture`]=f,r.irradianceTexture!=null&&r.scatteringTexture!=null&&r.transmittanceTexture!=null&&(this.combinedScattering||r.singleMieScatteringTexture!=null)&&(!this.higherOrderScattering||r.higherOrderScatteringTexture!=null)&&(t==null||t(r))},i,a));return this.format==="exr"?{transmittanceTexture:s({key:"transmittance",loader:new _O(wO,this.manager),path:"transmittance.exr"}),scatteringTexture:s({key:"scattering",loader:new Q2(Tf,this.manager),path:"scattering.exr"}),irradianceTexture:s({key:"irradiance",loader:new _O(CO,this.manager),path:"irradiance.exr"}),singleMieScatteringTexture:this.combinedScattering?void 0:s({key:"singleMieScattering",loader:new Q2(Tf,this.manager),path:"single_mie_scattering.exr"}),higherOrderScatteringTexture:this.higherOrderScattering?s({key:"higherOrderScattering",loader:new Q2(Tf,this.manager),path:"higher_order_scattering.exr"}):void 0}:{transmittanceTexture:s({key:"transmittance",loader:new xu(Ja,Jp,wO,this.manager),path:"transmittance.bin"}),scatteringTexture:s({key:"scattering",loader:new xu(is,Jp,Tf,this.manager),path:"scattering.bin"}),irradianceTexture:s({key:"irradiance",loader:new xu(Ja,Jp,CO,this.manager),path:"irradiance.bin"}),singleMieScatteringTexture:this.combinedScattering?void 0:s({key:"singleMieScattering",loader:new xu(is,Jp,Tf,this.manager),path:"single_mie_scattering.bin"}),higherOrderScatteringTexture:this.higherOrderScattering?s({key:"higherOrderScattering",loader:new xu(is,Jp,Tf,this.manager),path:"higher_order_scattering.bin"}):void 0}}}const xie=`precision highp float; +`;function s1(n,e,t){const i=new xi(e,t,{depthBuffer:!1,type:n,format:$n}),a=i.texture;return a.minFilter=Ht,a.magFilter=Ht,a.wrapS=Pi,a.wrapT=Pi,a.colorSpace=Da,i}function od(n,e,t,i){const a=new HU(e,t,i,{depthBuffer:!1,type:n,format:$n}),r=a.texture;return r.minFilter=Ht,r.magFilter=Ht,r.wrapS=Pi,r.wrapT=Pi,r.wrapR=Pi,r.colorSpace=Da,a}function mie(n){const e=n[Symbol.iterator]();return new Promise((t,i)=>{const a=()=>{try{const{value:r,done:s}=e.next();s===!0?t(r):TO(a)}catch(r){i(r instanceof Error?r:new Error)}};TO(a)})}async function NO(n,e,t){const{width:i,height:a}=e,r=t.type===Xn?new Uint16Array(i*a*4):new Float32Array(i*a*4);await n.readRenderTargetPixelsAsync(e,0,0,e.width,e.height,r),t.userData.imageData=r}class gie{constructor(e){this.lambdas=new L,this.luminanceFromRadiance=new Et,e===Xn&&(this.opticalDepth=s1(e,ep,tp)),this.deltaIrradiance=s1(e,Jd,$d),this.deltaRayleighScattering=od(e,zu,Bu,Hu),this.deltaMieScattering=od(e,zu,Bu,Hu),this.deltaScatteringDensity=od(e,zu,Bu,Hu),this.deltaMultipleScattering=this.deltaRayleighScattering}dispose(){var e;(e=this.opticalDepth)==null||e.dispose(),this.deltaIrradiance.dispose(),this.deltaRayleighScattering.dispose(),this.deltaMieScattering.dispose(),this.deltaScatteringDensity.dispose()}}class Ef extends hh{constructor(e){super({glslVersion:ro,vertexShader:pie,...e,defines:{TRANSMITTANCE_TEXTURE_WIDTH:ep.toFixed(0),TRANSMITTANCE_TEXTURE_HEIGHT:tp.toFixed(0),SCATTERING_TEXTURE_R_SIZE:gy.toFixed(0),SCATTERING_TEXTURE_MU_SIZE:vy.toFixed(0),SCATTERING_TEXTURE_MU_S_SIZE:_y.toFixed(0),SCATTERING_TEXTURE_NU_SIZE:xy.toFixed(0),IRRADIANCE_TEXTURE_WIDTH:Jd.toFixed(0),IRRADIANCE_TEXTURE_HEIGHT:$d.toFixed(0),...e.defines}})}set additive(e){this.transparent=e,this.blending=e?ub:Ta,this.blendEquation=Js,this.blendEquationAlpha=Js,this.blendSrc=kf,this.blendDst=kf,this.blendSrcAlpha=kf,this.blendDstAlpha=kf}setUniforms(e){const t=this.uniforms;t.luminanceFromRadiance!=null&&t.luminanceFromRadiance.value.copy(e.luminanceFromRadiance),t.singleRayleighScatteringTexture!=null&&(t.singleRayleighScatteringTexture.value=e.deltaRayleighScattering.texture),t.singleMieScatteringTexture!=null&&(t.singleMieScatteringTexture.value=e.deltaMieScattering.texture),t.multipleScatteringTexture!=null&&(t.multipleScatteringTexture.value=e.deltaMultipleScattering.texture),t.scatteringDensityTexture!=null&&(t.scatteringDensityTexture.value=e.deltaScatteringDensity.texture),t.irradianceTexture!=null&&(t.irradianceTexture.value=e.deltaIrradiance.texture)}}class vie{constructor(e,{type:t=iP(e)?si:Xn,combinedScattering:i=!0,higherOrderScattering:a=!0}={}){var r,s;this.transmittanceMaterial=new Ef({fragmentShader:Na(die,{bruneton:{common:Ks,definitions:Qs,precompute:yf}})}),this.directIrradianceMaterial=new Ef({fragmentShader:Na(lie,{bruneton:{common:Ks,definitions:Qs,precompute:yf}}),uniforms:{transmittanceTexture:new J(null)}}),this.singleScatteringMaterial=new Ef({fragmentShader:Na(fie,{bruneton:{common:Ks,definitions:Qs,precompute:yf}}),uniforms:{luminanceFromRadiance:new J(new Et),transmittanceTexture:new J(null),layer:new J(0)}}),this.scatteringDensityMaterial=new Ef({fragmentShader:Na(hie,{bruneton:{common:Ks,definitions:Qs,precompute:yf}}),uniforms:{transmittanceTexture:new J(null),singleRayleighScatteringTexture:new J(null),singleMieScatteringTexture:new J(null),multipleScatteringTexture:new J(null),irradianceTexture:new J(null),scatteringOrder:new J(0),layer:new J(0)}}),this.indirectIrradianceMaterial=new Ef({fragmentShader:Na(cie,{bruneton:{common:Ks,definitions:Qs,precompute:yf}}),uniforms:{luminanceFromRadiance:new J(new Et),singleRayleighScatteringTexture:new J(null),singleMieScatteringTexture:new J(null),multipleScatteringTexture:new J(null),scatteringOrder:new J(0)}}),this.multipleScatteringMaterial=new Ef({fragmentShader:Na(uie,{bruneton:{common:Ks,definitions:Qs,precompute:yf}}),uniforms:{luminanceFromRadiance:new J(new Et),transmittanceTexture:new J(null),scatteringDensityTexture:new J(null),layer:new J(0)}}),this.mesh=new oi(new uh(2,2)),this.scene=new Rd().add(this.mesh),this.camera=new bc,this.updating=!1,this.renderer=e,this.type=t,this.transmittanceRenderTarget=s1(t,ep,tp),this.scatteringRenderTarget=od(t,zu,Bu,Hu),this.irradianceRenderTarget=s1(t,Jd,$d),i||(this.singleMieScatteringRenderTarget=od(t,zu,Bu,Hu)),a&&(this.higherOrderScatteringRenderTarget=od(t,zu,Bu,Hu)),this.textures={transmittanceTexture:this.transmittanceRenderTarget.texture,scatteringTexture:this.scatteringRenderTarget.texture,irradianceTexture:this.irradianceRenderTarget.texture,singleMieScatteringTexture:(r=this.singleMieScatteringRenderTarget)==null?void 0:r.texture,higherOrderScatteringTexture:(s=this.higherOrderScatteringRenderTarget)==null?void 0:s.texture}}render3DRenderTarget(e,t){for(let i=0;i{this.dispose(e),this.disposeQueue=void 0};return}const{textures:t=!0}=e;t||(this.transmittanceRenderTarget.textures.splice(0,1),this.scatteringRenderTarget.textures.splice(0,1),this.irradianceRenderTarget.textures.splice(0,1),(i=this.singleMieScatteringRenderTarget)==null||i.textures.splice(0,1),(a=this.higherOrderScatteringRenderTarget)==null||a.textures.splice(0,1)),this.transmittanceRenderTarget.dispose(),this.scatteringRenderTarget.dispose(),this.irradianceRenderTarget.dispose(),(r=this.singleMieScatteringRenderTarget)==null||r.dispose(),(s=this.higherOrderScatteringRenderTarget)==null||s.dispose(),this.transmittanceMaterial.dispose(),this.directIrradianceMaterial.dispose(),this.singleScatteringMaterial.dispose(),this.scatteringDensityMaterial.dispose(),this.indirectIrradianceMaterial.dispose(),this.multipleScatteringMaterial.dispose(),this.mesh.geometry.dispose()}}function _ie(n){var e=[];if(n.length===0)return"";if(typeof n[0]!="string")throw new TypeError("Url must be a string. Received "+n[0]);if(n[0].match(/^[^/:]+:\/*$/)&&n.length>1){var t=n.shift();n[0]=t+n[0]}n[0].match(/^file:\/\/\//)?n[0]=n[0].replace(/^([^/:]+):\/*/,"$1:///"):n[0]=n[0].replace(/^([^/:]+):\/*/,"$1://");for(var i=0;i0&&(a=a.replace(/^[\/]+/,"")),i0?"?":"")+s.join("&"),r}function xie(){var n;return typeof arguments[0]=="object"?n=arguments[0]:n=[].slice.call(arguments),_ie(n)}const DO={width:ep,height:tp},Mf={width:zu,height:Bu,depth:Hu},OO={width:Jd,height:$d};class ZP extends Mi{constructor({format:e="exr",type:t=Xn,combinedScattering:i=!0,higherOrderScattering:a=!0}={},r){super(r),this.format=e,this.type=t,this.combinedScattering=i,this.higherOrderScattering=a}setType(e){return this.type=iP(e)?si:Xn,this}setTypeFromRenderer(e){return this.setType(e)}load(e,t,i,a){const r={},s=({key:o,loader:c,path:h})=>(c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(xie(e,h),f=>{f.type=this.type,this.type===si&&(f.image.data=new Float32Array(new ul(f.image.data.buffer))),f.minFilter=Ht,f.magFilter=Ht,r[`${o}Texture`]=f,r.irradianceTexture!=null&&r.scatteringTexture!=null&&r.transmittanceTexture!=null&&(this.combinedScattering||r.singleMieScatteringTexture!=null)&&(!this.higherOrderScattering||r.higherOrderScatteringTexture!=null)&&(t==null||t(r))},i,a));return this.format==="exr"?{transmittanceTexture:s({key:"transmittance",loader:new SO(DO,this.manager),path:"transmittance.exr"}),scatteringTexture:s({key:"scattering",loader:new e3(Mf,this.manager),path:"scattering.exr"}),irradianceTexture:s({key:"irradiance",loader:new SO(OO,this.manager),path:"irradiance.exr"}),singleMieScatteringTexture:this.combinedScattering?void 0:s({key:"singleMieScattering",loader:new e3(Mf,this.manager),path:"single_mie_scattering.exr"}),higherOrderScatteringTexture:this.higherOrderScattering?s({key:"higherOrderScattering",loader:new e3(Mf,this.manager),path:"higher_order_scattering.exr"}):void 0}:{transmittanceTexture:s({key:"transmittance",loader:new Su($a,em,DO,this.manager),path:"transmittance.bin"}),scatteringTexture:s({key:"scattering",loader:new Su(as,em,Mf,this.manager),path:"scattering.bin"}),irradianceTexture:s({key:"irradiance",loader:new Su($a,em,OO,this.manager),path:"irradiance.bin"}),singleMieScatteringTexture:this.combinedScattering?void 0:s({key:"singleMieScattering",loader:new Su(as,em,Mf,this.manager),path:"single_mie_scattering.bin"}),higherOrderScatteringTexture:this.higherOrderScattering?s({key:"higherOrderScattering",loader:new Su(as,em,Mf,this.manager),path:"higher_order_scattering.bin"}):void 0}}}const yie=`precision highp float; precision highp sampler3D; #define RECIPROCAL_PI 0.3183098861837907 @@ -7983,7 +7983,7 @@ void main() { #include } -`,yie=`precision highp float; +`,Sie=`precision highp float; precision highp sampler3D; uniform mat4 inverseProjectionMatrix; @@ -8036,7 +8036,7 @@ void main() { gl_Position = vec4(position.xy, 1.0, 1.0); } -`;var Sie=Object.defineProperty,SA=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&Sie(e,t,a),a};const Tie={...vA,sun:!0,moon:!0,moonAngularRadius:.0045,lunarRadianceScale:1,ground:!0,groundAlbedo:new je(0)};class TA extends q0{constructor(e){const{sun:t,moon:i,moonDirection:a,moonAngularRadius:r,lunarRadianceScale:s,ground:o,groundAlbedo:c,...h}={...Tie,...e};super({name:"SkyMaterial",glslVersion:ao,vertexShader:yie,fragmentShader:Ca(xie,{core:{raySphereIntersection:fy},bruneton:{common:Zs,definitions:Ks,runtime:vy},sky:IP}),...h,uniforms:{inverseProjectionMatrix:new J(new ke),inverseViewMatrix:new J(new ke),moonDirection:new J((a==null?void 0:a.clone())??new L),moonAngularRadius:new J(r),lunarRadianceScale:new J(s),groundAlbedo:new J(c.clone()),shadowLengthBuffer:new J(null),...h.uniforms},defines:{PERSPECTIVE_CAMERA:"1"},depthTest:!0}),this.shadowLength=null,this.sun=t,this.moon=i,this.ground=o}onBeforeRender(e,t,i,a,r,s){super.onBeforeRender(e,t,i,a,r,s);const{uniforms:o,defines:c}=this;o.inverseProjectionMatrix.value.copy(i.projectionMatrixInverse),o.inverseViewMatrix.value.copy(i.matrixWorld);const h=c.PERSPECTIVE_CAMERA!=null,f=i.isPerspectiveCamera===!0;f!==h&&(f?c.PERSPECTIVE_CAMERA="1":delete c.PERSPECTIVE_CAMERA,this.needsUpdate=!0);const d=this.groundAlbedo,m=c.GROUND_ALBEDO!=null,g=d.r!==0||d.g!==0||d.b!==0;g!==m&&(g?this.defines.GROUND_ALBEDO="1":delete this.defines.GROUND_ALBEDO,this.needsUpdate=!0);const x=this.shadowLength,T=c.HAS_SHADOW_LENGTH!=null,S=x!=null;S!==T&&(S?c.HAS_SHADOW_LENGTH="1":(delete c.HAS_SHADOW_LENGTH,o.shadowLengthBuffer.value=null),this.needsUpdate=!0),S&&(o.shadowLengthBuffer.value=x.map)}get moonDirection(){return this.uniforms.moonDirection.value}get moonAngularRadius(){return this.uniforms.moonAngularRadius.value}set moonAngularRadius(e){this.uniforms.moonAngularRadius.value=e}get lunarRadianceScale(){return this.uniforms.lunarRadianceScale.value}set lunarRadianceScale(e){this.uniforms.lunarRadianceScale.value=e}get groundAlbedo(){return this.uniforms.groundAlbedo.value}}SA([dn("SUN")],TA.prototype,"sun");SA([dn("MOON")],TA.prototype,"moon");SA([dn("GROUND")],TA.prototype,"ground");const Eie=`precision highp float; +`;var Tie=Object.defineProperty,MA=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&Tie(e,t,a),a};const Eie={...yA,sun:!0,moon:!0,moonAngularRadius:.0045,lunarRadianceScale:1,ground:!0,groundAlbedo:new je(0)};class bA extends Z0{constructor(e){const{sun:t,moon:i,moonDirection:a,moonAngularRadius:r,lunarRadianceScale:s,ground:o,groundAlbedo:c,...h}={...Eie,...e};super({name:"SkyMaterial",glslVersion:ro,vertexShader:Sie,fragmentShader:Na(yie,{core:{raySphereIntersection:my},bruneton:{common:Ks,definitions:Qs,runtime:yy},sky:PP}),...h,uniforms:{inverseProjectionMatrix:new J(new ke),inverseViewMatrix:new J(new ke),moonDirection:new J((a==null?void 0:a.clone())??new L),moonAngularRadius:new J(r),lunarRadianceScale:new J(s),groundAlbedo:new J(c.clone()),shadowLengthBuffer:new J(null),...h.uniforms},defines:{PERSPECTIVE_CAMERA:"1"},depthTest:!0}),this.shadowLength=null,this.sun=t,this.moon=i,this.ground=o}onBeforeRender(e,t,i,a,r,s){super.onBeforeRender(e,t,i,a,r,s);const{uniforms:o,defines:c}=this;o.inverseProjectionMatrix.value.copy(i.projectionMatrixInverse),o.inverseViewMatrix.value.copy(i.matrixWorld);const h=c.PERSPECTIVE_CAMERA!=null,f=i.isPerspectiveCamera===!0;f!==h&&(f?c.PERSPECTIVE_CAMERA="1":delete c.PERSPECTIVE_CAMERA,this.needsUpdate=!0);const d=this.groundAlbedo,m=c.GROUND_ALBEDO!=null,g=d.r!==0||d.g!==0||d.b!==0;g!==m&&(g?this.defines.GROUND_ALBEDO="1":delete this.defines.GROUND_ALBEDO,this.needsUpdate=!0);const x=this.shadowLength,T=c.HAS_SHADOW_LENGTH!=null,y=x!=null;y!==T&&(y?c.HAS_SHADOW_LENGTH="1":(delete c.HAS_SHADOW_LENGTH,o.shadowLengthBuffer.value=null),this.needsUpdate=!0),y&&(o.shadowLengthBuffer.value=x.map)}get moonDirection(){return this.uniforms.moonDirection.value}get moonAngularRadius(){return this.uniforms.moonAngularRadius.value}set moonAngularRadius(e){this.uniforms.moonAngularRadius.value=e}get lunarRadianceScale(){return this.uniforms.lunarRadianceScale.value}set lunarRadianceScale(e){this.uniforms.lunarRadianceScale.value=e}get groundAlbedo(){return this.uniforms.groundAlbedo.value}}MA([dn("SUN")],bA.prototype,"sun");MA([dn("MOON")],bA.prototype,"moon");MA([dn("GROUND")],bA.prototype,"ground");const Mie=`precision highp float; precision highp sampler3D; #include "bruneton/definitions" @@ -8096,7 +8096,7 @@ void main() { #include } -`,Mie=`precision highp float; +`,bie=`precision highp float; precision highp sampler3D; #define saturate(x) clamp(x, 0.0, 1.0) @@ -8142,7 +8142,7 @@ void main() { gl_PointSize = pointSize; } -`;var bie=Object.defineProperty,jP=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&bie(e,t,a),a};const Aie={...vA,pointSize:1,intensity:1,background:!0,ground:!0};let ZP=class extends q0{constructor(e){const{pointSize:t,radianceScale:i,intensity:a,background:r,ground:s,...o}={...Aie,...e};super({name:"StarsMaterial",glslVersion:ao,vertexShader:Mie,fragmentShader:Ca(Eie,{bruneton:{common:Zs,definitions:Ks,runtime:vy}}),...o,uniforms:{projectionMatrix:new J(new ke),modelViewMatrix:new J(new ke),viewMatrix:new J(new ke),matrixWorld:new J(new ke),cameraFar:new J(0),pointSize:new J(0),magnitudeRange:new J(new de(-2,8)),intensity:new J(i??a),...o.uniforms},defines:{PERSPECTIVE_CAMERA:"1"}}),this.pointSize=t,this.background=r,this.ground=s}onBeforeRender(e,t,i,a,r,s){super.onBeforeRender(e,t,i,a,r,s);const o=this.uniforms;o.projectionMatrix.value.copy(i.projectionMatrix),o.modelViewMatrix.value.copy(i.modelViewMatrix),o.viewMatrix.value.copy(i.matrixWorldInverse),o.matrixWorld.value.copy(r.matrixWorld),o.cameraFar.value=i.far,o.pointSize.value=this.pointSize*e.getPixelRatio();const c=i.isPerspectiveCamera===!0;this.defines.PERSPECTIVE_CAMERA!=null!==c&&(c?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}get magnitudeRange(){return this.uniforms.magnitudeRange.value}get radianceScale(){return this.intensity}set radianceScale(e){this.intensity=e}get intensity(){return this.uniforms.intensity.value}set intensity(e){this.uniforms.intensity.value=e}};jP([dn("BACKGROUND")],ZP.prototype,"background");jP([dn("GROUND")],ZP.prototype,"ground");const EA=be.createContext({}),Rie=({ref:n,textures:e,ellipsoid:t=g0.WGS84,correctAltitude:i=!0,ground:a=!0,date:r,children:s})=>{const o=be.useRef({sunDirection:new L,moonDirection:new L,worldToECEFMatrix:new ke,inertialToECEFMatrix:new ke,overlay:null,shadow:null,shadowLength:null,lightingMask:null}),c=Qi(({gl:T})=>T),h=be.useMemo(()=>typeof e=="string"?new qP().setType(c).load(e):void 0,[e,c]);be.useEffect(()=>{if(h!=null)return()=>{for(const T of Object.values(h))T==null||T.dispose()}},[h]);const f=be.useMemo(()=>e==null?new gie(c):void 0,[e,c]);be.useEffect(()=>{if(f!=null)return f.update().catch(T=>{console.error(T)}),()=>{f.dispose()}},[f]);const d=(f==null?void 0:f.textures)??(typeof e=="string"?h:e),m=be.useMemo(()=>({textures:d,ellipsoid:t,correctAltitude:i,ground:a,transientStates:o.current}),[d,t,i,a]),g=be.useMemo(()=>{const{sunDirection:T,moonDirection:S,inertialToECEFMatrix:v}=o.current;return y=>{aie(y,v),rie(y,T).applyMatrix4(v),sie(y,S).applyMatrix4(v)}},[]),x=r!=null&&!isNaN(+r)?+r:void 0;return be.useEffect(()=>{x!=null&&g(x)},[x,g]),be.useImperativeHandle(n,()=>({...o.current,textures:d,updateByDate:g}),[d,g]),Nt.jsx(EA.Provider,{value:m,children:s})};function KP(n){const{irradianceTexture:e,scatteringTexture:t,transmittanceTexture:i,singleMieScatteringTexture:a,higherOrderScatteringTexture:r,ellipsoid:s,correctAltitude:o,sunDirection:c,sunAngularRadius:h,ground:f,renderTargetCount:d,...m}=n;return[{irradianceTexture:e,scatteringTexture:t,transmittanceTexture:i,singleMieScatteringTexture:a,higherOrderScatteringTexture:r,ellipsoid:s,correctAltitude:o,sunDirection:c,sunAngularRadius:h,ground:f,renderTargetCount:d},m]}function wie(n){const e=be.useMemo(()=>typeof n=="string"?new wP().load(n):void 0,[n]);return be.useEffect(()=>{if(e!=null)return()=>{e.dispose()}},[e]),(typeof n=="string"?e:n)??null}const Cie=({ref:n,stbnTexture:e=nP,...t})=>{const{textures:i,transientStates:a,...r}=be.useContext(EA),[s,{blendFunction:o,...c}]=KP({...UP,...r,...i,...t}),h=be.useContext(rA),{normalPass:f,camera:d}=h,m="geometryPass"in h&&h.geometryPass instanceof aA&&"geometryTexture"in h.geometryPass&&h.geometryPass.geometryTexture instanceof Nn?h.geometryPass.geometryTexture:void 0,g=be.useMemo(()=>new za(void 0,{blendFunction:o}),[o]);be.useEffect(()=>()=>{g.dispose()},[g]);const[x,T]=be.useState(!1);Ac(()=>{a!=null&&(g.sunDirection.copy(a.sunDirection),g.moonDirection.copy(a.moonDirection),g.worldToECEFMatrix.copy(a.worldToECEFMatrix),g.overlay=a.overlay,g.shadow=a.shadow,g.shadowLength=a.shadowLength,g.lightingMask=a.lightingMask,!x&&g.shadow!=null&&T(!0))});const S=wie(x?e:void 0);return Nt.jsx("primitive",{ref:n,object:g,mainCamera:d,normalBuffer:m??(f==null?void 0:f.texture)??null,...s,...c,stbnTexture:S,octEncodedNormal:m!=null})};function Nie(n){return e=>{for(const t of n)tM(t,e)}}function Die(n){return e=>{const t=[];for(const i of n){const a=tM(i,e),r=typeof a=="function";t.push(r?a:()=>tM(i,null))}return()=>{for(const i of t)i()}}}function tM(n,e){if(typeof n=="function")return n(e);n&&(n.current=e)}parseInt(be.version.split(".")[0],10)>=19;new qP;const NO=vy,DO=Zs,OO=Ks;class _y{constructor(e=0,t=0,i=0,a=0){this.expTerm=e,this.exponent=t,this.linearTerm=i,this.constantTerm=a}set(e=0,t=0,i=0,a=0){return this.expTerm=e,this.exponent=t,this.linearTerm=i,this.constantTerm=a,this}clone(){return new _y(this.expTerm,this.exponent,this.linearTerm,this.constantTerm)}copy(e){return this.expTerm=e.expTerm,this.exponent=e.exponent,this.linearTerm=e.linearTerm,this.constantTerm=e.constantTerm,this}}const Oie=["channel","altitude","height","densityScale","shapeAmount","shapeDetailAmount","weatherExponent","shapeAlteringBias","coverageFilterWidth","shadow","densityProfile"];function Lie(n,e){if(e!=null)for(const t of Oie){const i=e[t];i!=null&&(n[t]instanceof _y?n[t].copy(i):n[t]=i)}}const nM=class QP{constructor(e){this.channel="r",this.altitude=0,this.height=0,this.densityScale=.2,this.shapeAmount=1,this.shapeDetailAmount=1,this.weatherExponent=1,this.shapeAlteringBias=.35,this.coverageFilterWidth=.6,this.densityProfile=new _y(0,0,.75,.25),this.shadow=!1,this.set(e)}set(e){return Lie(this,e),this}clone(){return new QP(this)}copy(e){return this.channel=e.channel,this.altitude=e.altitude,this.height=e.height,this.densityScale=e.densityScale,this.shapeAmount=e.shapeAmount,this.shapeDetailAmount=e.shapeDetailAmount,this.weatherExponent=e.weatherExponent,this.shapeAlteringBias=e.shapeAlteringBias,this.coverageFilterWidth=e.coverageFilterWidth,this.densityProfile.copy(e.densityProfile),this.shadow=e.shadow,this}};nM.DEFAULT=new nM;let Ts=nM;const Ef=Array.from({length:8},()=>({value:0,flag:0})),em=Array.from({length:3},()=>({min:0,max:0}));function Iie(n,e){return n.value!==e.value?n.value-e.value:n.flag-e.flag}const iM=class JP extends Array{constructor(e){super(new Ts(e==null?void 0:e[0]),new Ts(e==null?void 0:e[1]),new Ts(e==null?void 0:e[2]),new Ts(e==null?void 0:e[3]))}set(e){return this[0].set(e==null?void 0:e[0]),this[1].set(e==null?void 0:e[1]),this[2].set(e==null?void 0:e[2]),this[3].set(e==null?void 0:e[3]),this}reset(){return this[0].copy(Ts.DEFAULT),this[1].copy(Ts.DEFAULT),this[2].copy(Ts.DEFAULT),this[3].copy(Ts.DEFAULT),this}clone(){return new JP(this)}copy(e){return this[0].copy(e[0]),this[1].copy(e[1]),this[2].copy(e[2]),this[3].copy(e[3]),this}get localWeatherChannels(){return this[0].channel+this[1].channel+this[2].channel+this[3].channel}packValues(e,t){return t.set(this[0][e],this[1][e],this[2][e],this[3][e])}packSums(e,t,i){return i.set(this[0][e]+this[0][t],this[1][e]+this[1][t],this[2][e]+this[2][t],this[3][e]+this[3][t])}packDensityProfiles(e,t){return t.set(this[0].densityProfile[e],this[1].densityProfile[e],this[2].densityProfile[e],this[3].densityProfile[e])}packIntervalHeights(e,t){for(let s=0;s<4;++s){const o=this[s];let c=Ef[s];c.value=o.altitude,c.flag=0,c=Ef[s+4],c.value=o.altitude+o.height,c.flag=1}Ef.sort(Iie);let i=0,a=0;for(let s=0;s0){const h=em[i++];h.min=Ef[s-1].value,h.max=o}a+=c===0?1:-1}for(;i<3;++i){const s=em[i];s.min=0,s.max=0}let r=em[0];e.x=r.min,t.x=r.max,r=em[1],e.y=r.min,t.y=r.max,r=em[2],e.z=r.min,t.z=r.max}};iM.DEFAULT=new iM([{channel:"r",altitude:750,height:650,densityScale:.2,shapeAmount:1,shapeDetailAmount:1,weatherExponent:1,shapeAlteringBias:.35,coverageFilterWidth:.6,shadow:!0},{channel:"g",altitude:1e3,height:1200,densityScale:.2,shapeAmount:1,shapeDetailAmount:1,weatherExponent:1,shapeAlteringBias:.35,coverageFilterWidth:.6,shadow:!0},{channel:"b",altitude:7500,height:500,densityScale:.003,shapeAmount:.4,shapeDetailAmount:0,weatherExponent:1,shapeAlteringBias:.35,coverageFilterWidth:.5},{channel:"a"}]);let a1=iM;var Uie="Invariant failed";function Ql(n,e){if(!n)throw new Error(Uie)}class v0{constructor(e,t){this.near=[new L,new L,new L,new L],this.far=[new L,new L,new L,new L],e!=null&&t!=null&&this.setFromCamera(e,t)}clone(){return new v0().copy(this)}copy(e){for(let t=0;t<4;++t)this.near[t].copy(e.near[t]),this.far[t].copy(e.far[t]);return this}setFromCamera(e,t){const i=e.isOrthographicCamera===!0,a=e.projectionMatrixInverse;this.near[0].set(1,1,-1),this.near[1].set(1,-1,-1),this.near[2].set(-1,-1,-1),this.near[3].set(-1,1,-1);for(let r=0;r<4;++r)this.near[r].applyMatrix4(a);this.far[0].set(1,1,1),this.far[1].set(1,-1,1),this.far[2].set(-1,-1,1),this.far[3].set(-1,1,1);for(let r=0;r<4;++r){const s=this.far[r];s.applyMatrix4(a);const o=Math.abs(s.z);i?s.z*=Math.min(t/o,1):s.multiplyScalar(Math.min(t/o,1))}return this}split(e,t=[]){for(let i=0;i{for(let r=0;r{for(let r=0;r{for(let r=0;r{const i=new de;for(let a=0;a<16;++a)if(PO[a]===t){i.set((a%4+.5)/4,(Math.floor(a/4)+.5)/4);break}return[...n,i]},[]),kie={resolutionScale:1,lightShafts:!0,shapeDetail:!0,turbulence:!0,haze:!0,clouds:{multiScatteringOctaves:8,accurateSunSkyLight:!0,accuratePhaseFunction:!1,maxIterationCount:500,minStepSize:50,maxStepSize:1e3,maxRayDistance:2e5,perspectiveStepScale:1.01,minDensity:1e-5,minExtinction:1e-5,minTransmittance:.01,maxIterationCountToGround:3,maxIterationCountToSun:2,minSecondaryStepSize:100,secondaryStepScale:2,maxShadowLengthIterationCount:500,minShadowLengthStepSize:50,maxShadowLengthRayDistance:2e5},shadow:{cascadeCount:3,mapSize:new de(512,512),maxIterationCount:50,minStepSize:100,maxStepSize:1e3,minDensity:1e-5,minExtinction:1e-5,minTransmittance:1e-4}},It=kie,Wie={low:{...It,lightShafts:!1,shapeDetail:!1,turbulence:!1,clouds:{...It.clouds,accurateSunSkyLight:!1,maxIterationCount:200,minStepSize:100,maxRayDistance:1e5,minDensity:1e-4,minExtinction:1e-4,minTransmittance:.1,maxIterationCountToGround:0,maxIterationCountToSun:1},shadow:{...It.shadow,maxIterationCount:25,minDensity:1e-4,minExtinction:1e-4,minTransmittance:.01,cascadeCount:2,mapSize:new de(256,256)}},medium:{...It,lightShafts:!1,turbulence:!1,clouds:{...It.clouds,minDensity:1e-4,minExtinction:1e-4,accurateSunSkyLight:!1,maxIterationCountToSun:2,maxIterationCountToGround:1},shadow:{...It.shadow,minDensity:1e-4,minExtinction:1e-4,mapSize:new de(256,256)}},high:It,ultra:{...It,clouds:{...It.clouds,minStepSize:10},shadow:{...It.shadow,mapSize:new de(1024,1024)}}},Xie=`precision highp float; +`;var Aie=Object.defineProperty,KP=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&Aie(e,t,a),a};const wie={...yA,pointSize:1,intensity:1,background:!0,ground:!0};let QP=class extends Z0{constructor(e){const{pointSize:t,radianceScale:i,intensity:a,background:r,ground:s,...o}={...wie,...e};super({name:"StarsMaterial",glslVersion:ro,vertexShader:bie,fragmentShader:Na(Mie,{bruneton:{common:Ks,definitions:Qs,runtime:yy}}),...o,uniforms:{projectionMatrix:new J(new ke),modelViewMatrix:new J(new ke),viewMatrix:new J(new ke),matrixWorld:new J(new ke),cameraFar:new J(0),pointSize:new J(0),magnitudeRange:new J(new de(-2,8)),intensity:new J(i??a),...o.uniforms},defines:{PERSPECTIVE_CAMERA:"1"}}),this.pointSize=t,this.background=r,this.ground=s}onBeforeRender(e,t,i,a,r,s){super.onBeforeRender(e,t,i,a,r,s);const o=this.uniforms;o.projectionMatrix.value.copy(i.projectionMatrix),o.modelViewMatrix.value.copy(i.modelViewMatrix),o.viewMatrix.value.copy(i.matrixWorldInverse),o.matrixWorld.value.copy(r.matrixWorld),o.cameraFar.value=i.far,o.pointSize.value=this.pointSize*e.getPixelRatio();const c=i.isPerspectiveCamera===!0;this.defines.PERSPECTIVE_CAMERA!=null!==c&&(c?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}get magnitudeRange(){return this.uniforms.magnitudeRange.value}get radianceScale(){return this.intensity}set radianceScale(e){this.intensity=e}get intensity(){return this.uniforms.intensity.value}set intensity(e){this.uniforms.intensity.value=e}};KP([dn("BACKGROUND")],QP.prototype,"background");KP([dn("GROUND")],QP.prototype,"ground");const AA=Me.createContext({}),Rie=({ref:n,textures:e,ellipsoid:t=_0.WGS84,correctAltitude:i=!0,ground:a=!0,date:r,children:s})=>{const o=Me.useRef({sunDirection:new L,moonDirection:new L,worldToECEFMatrix:new ke,inertialToECEFMatrix:new ke,overlay:null,shadow:null,shadowLength:null,lightingMask:null}),c=Oi(({gl:T})=>T),h=Me.useMemo(()=>typeof e=="string"?new ZP().setType(c).load(e):void 0,[e,c]);Me.useEffect(()=>{if(h!=null)return()=>{for(const T of Object.values(h))T==null||T.dispose()}},[h]);const f=Me.useMemo(()=>e==null?new vie(c):void 0,[e,c]);Me.useEffect(()=>{if(f!=null)return f.update().catch(T=>{console.error(T)}),()=>{f.dispose()}},[f]);const d=(f==null?void 0:f.textures)??(typeof e=="string"?h:e),m=Me.useMemo(()=>({textures:d,ellipsoid:t,correctAltitude:i,ground:a,transientStates:o.current}),[d,t,i,a]),g=Me.useMemo(()=>{const{sunDirection:T,moonDirection:y,inertialToECEFMatrix:v}=o.current;return S=>{rie(S,v),sie(S,T).applyMatrix4(v),oie(S,y).applyMatrix4(v)}},[]),x=r!=null&&!isNaN(+r)?+r:void 0;return Me.useEffect(()=>{x!=null&&g(x)},[x,g]),Me.useImperativeHandle(n,()=>({...o.current,textures:d,updateByDate:g}),[d,g]),Rt.jsx(AA.Provider,{value:m,children:s})};function JP(n){const{irradianceTexture:e,scatteringTexture:t,transmittanceTexture:i,singleMieScatteringTexture:a,higherOrderScatteringTexture:r,ellipsoid:s,correctAltitude:o,sunDirection:c,sunAngularRadius:h,ground:f,renderTargetCount:d,...m}=n;return[{irradianceTexture:e,scatteringTexture:t,transmittanceTexture:i,singleMieScatteringTexture:a,higherOrderScatteringTexture:r,ellipsoid:s,correctAltitude:o,sunDirection:c,sunAngularRadius:h,ground:f,renderTargetCount:d},m]}function Cie(n){const e=Me.useMemo(()=>typeof n=="string"?new NP().load(n):void 0,[n]);return Me.useEffect(()=>{if(e!=null)return()=>{e.dispose()}},[e]),(typeof n=="string"?e:n)??null}const Nie=({ref:n,stbnTexture:e=aP,...t})=>{const{textures:i,transientStates:a,...r}=Me.useContext(AA),[s,{blendFunction:o,...c}]=JP({...zP,...r,...i,...t}),h=Me.useContext(lA),{normalPass:f,camera:d}=h,m="geometryPass"in h&&h.geometryPass instanceof oA&&"geometryTexture"in h.geometryPass&&h.geometryPass.geometryTexture instanceof Nn?h.geometryPass.geometryTexture:void 0,g=Me.useMemo(()=>new Ba(void 0,{blendFunction:o}),[o]);Me.useEffect(()=>()=>{g.dispose()},[g]);const[x,T]=Me.useState(!1);cl(()=>{a!=null&&(g.sunDirection.copy(a.sunDirection),g.moonDirection.copy(a.moonDirection),g.worldToECEFMatrix.copy(a.worldToECEFMatrix),g.overlay=a.overlay,g.shadow=a.shadow,g.shadowLength=a.shadowLength,g.lightingMask=a.lightingMask,!x&&g.shadow!=null&&T(!0))});const y=Cie(x?e:void 0);return Rt.jsx("primitive",{ref:n,object:g,mainCamera:d,normalBuffer:m??(f==null?void 0:f.texture)??null,...s,...c,stbnTexture:y,octEncodedNormal:m!=null})};function Die(n){return e=>{for(const t of n)aM(t,e)}}function Oie(n){return e=>{const t=[];for(const i of n){const a=aM(i,e),r=typeof a=="function";t.push(r?a:()=>aM(i,null))}return()=>{for(const i of t)i()}}}function aM(n,e){if(typeof n=="function")return n(e);n&&(n.current=e)}parseInt(Me.version.split(".")[0],10)>=19;new ZP;const LO=yy,IO=Ks,UO=Qs;class Sy{constructor(e=0,t=0,i=0,a=0){this.expTerm=e,this.exponent=t,this.linearTerm=i,this.constantTerm=a}set(e=0,t=0,i=0,a=0){return this.expTerm=e,this.exponent=t,this.linearTerm=i,this.constantTerm=a,this}clone(){return new Sy(this.expTerm,this.exponent,this.linearTerm,this.constantTerm)}copy(e){return this.expTerm=e.expTerm,this.exponent=e.exponent,this.linearTerm=e.linearTerm,this.constantTerm=e.constantTerm,this}}const Lie=["channel","altitude","height","densityScale","shapeAmount","shapeDetailAmount","weatherExponent","shapeAlteringBias","coverageFilterWidth","shadow","densityProfile"];function Iie(n,e){if(e!=null)for(const t of Lie){const i=e[t];i!=null&&(n[t]instanceof Sy?n[t].copy(i):n[t]=i)}}const rM=class $P{constructor(e){this.channel="r",this.altitude=0,this.height=0,this.densityScale=.2,this.shapeAmount=1,this.shapeDetailAmount=1,this.weatherExponent=1,this.shapeAlteringBias=.35,this.coverageFilterWidth=.6,this.densityProfile=new Sy(0,0,.75,.25),this.shadow=!1,this.set(e)}set(e){return Iie(this,e),this}clone(){return new $P(this)}copy(e){return this.channel=e.channel,this.altitude=e.altitude,this.height=e.height,this.densityScale=e.densityScale,this.shapeAmount=e.shapeAmount,this.shapeDetailAmount=e.shapeDetailAmount,this.weatherExponent=e.weatherExponent,this.shapeAlteringBias=e.shapeAlteringBias,this.coverageFilterWidth=e.coverageFilterWidth,this.densityProfile.copy(e.densityProfile),this.shadow=e.shadow,this}};rM.DEFAULT=new rM;let Es=rM;const bf=Array.from({length:8},()=>({value:0,flag:0})),nm=Array.from({length:3},()=>({min:0,max:0}));function Uie(n,e){return n.value!==e.value?n.value-e.value:n.flag-e.flag}const sM=class e9 extends Array{constructor(e){super(new Es(e==null?void 0:e[0]),new Es(e==null?void 0:e[1]),new Es(e==null?void 0:e[2]),new Es(e==null?void 0:e[3]))}set(e){return this[0].set(e==null?void 0:e[0]),this[1].set(e==null?void 0:e[1]),this[2].set(e==null?void 0:e[2]),this[3].set(e==null?void 0:e[3]),this}reset(){return this[0].copy(Es.DEFAULT),this[1].copy(Es.DEFAULT),this[2].copy(Es.DEFAULT),this[3].copy(Es.DEFAULT),this}clone(){return new e9(this)}copy(e){return this[0].copy(e[0]),this[1].copy(e[1]),this[2].copy(e[2]),this[3].copy(e[3]),this}get localWeatherChannels(){return this[0].channel+this[1].channel+this[2].channel+this[3].channel}packValues(e,t){return t.set(this[0][e],this[1][e],this[2][e],this[3][e])}packSums(e,t,i){return i.set(this[0][e]+this[0][t],this[1][e]+this[1][t],this[2][e]+this[2][t],this[3][e]+this[3][t])}packDensityProfiles(e,t){return t.set(this[0].densityProfile[e],this[1].densityProfile[e],this[2].densityProfile[e],this[3].densityProfile[e])}packIntervalHeights(e,t){for(let s=0;s<4;++s){const o=this[s];let c=bf[s];c.value=o.altitude,c.flag=0,c=bf[s+4],c.value=o.altitude+o.height,c.flag=1}bf.sort(Uie);let i=0,a=0;for(let s=0;s0){const h=nm[i++];h.min=bf[s-1].value,h.max=o}a+=c===0?1:-1}for(;i<3;++i){const s=nm[i];s.min=0,s.max=0}let r=nm[0];e.x=r.min,t.x=r.max,r=nm[1],e.y=r.min,t.y=r.max,r=nm[2],e.z=r.min,t.z=r.max}};sM.DEFAULT=new sM([{channel:"r",altitude:750,height:650,densityScale:.2,shapeAmount:1,shapeDetailAmount:1,weatherExponent:1,shapeAlteringBias:.35,coverageFilterWidth:.6,shadow:!0},{channel:"g",altitude:1e3,height:1200,densityScale:.2,shapeAmount:1,shapeDetailAmount:1,weatherExponent:1,shapeAlteringBias:.35,coverageFilterWidth:.6,shadow:!0},{channel:"b",altitude:7500,height:500,densityScale:.003,shapeAmount:.4,shapeDetailAmount:0,weatherExponent:1,shapeAlteringBias:.35,coverageFilterWidth:.5},{channel:"a"}]);let o1=sM;var Pie="Invariant failed";function ec(n,e){if(!n)throw new Error(Pie)}class x0{constructor(e,t){this.near=[new L,new L,new L,new L],this.far=[new L,new L,new L,new L],e!=null&&t!=null&&this.setFromCamera(e,t)}clone(){return new x0().copy(this)}copy(e){for(let t=0;t<4;++t)this.near[t].copy(e.near[t]),this.far[t].copy(e.far[t]);return this}setFromCamera(e,t){const i=e.isOrthographicCamera===!0,a=e.projectionMatrixInverse;this.near[0].set(1,1,-1),this.near[1].set(1,-1,-1),this.near[2].set(-1,-1,-1),this.near[3].set(-1,1,-1);for(let r=0;r<4;++r)this.near[r].applyMatrix4(a);this.far[0].set(1,1,1),this.far[1].set(1,-1,1),this.far[2].set(-1,-1,1),this.far[3].set(-1,1,1);for(let r=0;r<4;++r){const s=this.far[r];s.applyMatrix4(a);const o=Math.abs(s.z);i?s.z*=Math.min(t/o,1):s.multiplyScalar(Math.min(t/o,1))}return this}split(e,t=[]){for(let i=0;i{for(let r=0;r{for(let r=0;r{for(let r=0;r{const i=new de;for(let a=0;a<16;++a)if(HO[a]===t){i.set((a%4+.5)/4,(Math.floor(a/4)+.5)/4);break}return[...n,i]},[]),Wie={resolutionScale:1,lightShafts:!0,shapeDetail:!0,turbulence:!0,haze:!0,clouds:{multiScatteringOctaves:8,accurateSunSkyLight:!0,accuratePhaseFunction:!1,maxIterationCount:500,minStepSize:50,maxStepSize:1e3,maxRayDistance:2e5,perspectiveStepScale:1.01,minDensity:1e-5,minExtinction:1e-5,minTransmittance:.01,maxIterationCountToGround:3,maxIterationCountToSun:2,minSecondaryStepSize:100,secondaryStepScale:2,maxShadowLengthIterationCount:500,minShadowLengthStepSize:50,maxShadowLengthRayDistance:2e5},shadow:{cascadeCount:3,mapSize:new de(512,512),maxIterationCount:50,minStepSize:100,maxStepSize:1e3,minDensity:1e-5,minExtinction:1e-5,minTransmittance:1e-4}},It=Wie,Xie={low:{...It,lightShafts:!1,shapeDetail:!1,turbulence:!1,clouds:{...It.clouds,accurateSunSkyLight:!1,maxIterationCount:200,minStepSize:100,maxRayDistance:1e5,minDensity:1e-4,minExtinction:1e-4,minTransmittance:.1,maxIterationCountToGround:0,maxIterationCountToSun:1},shadow:{...It.shadow,maxIterationCount:25,minDensity:1e-4,minExtinction:1e-4,minTransmittance:.01,cascadeCount:2,mapSize:new de(256,256)}},medium:{...It,lightShafts:!1,turbulence:!1,clouds:{...It.clouds,minDensity:1e-4,minExtinction:1e-4,accurateSunSkyLight:!1,maxIterationCountToSun:2,maxIterationCountToGround:1},shadow:{...It.shadow,minDensity:1e-4,minExtinction:1e-4,mapSize:new de(256,256)}},high:It,ultra:{...It,clouds:{...It.clouds,minStepSize:10},shadow:{...It.shadow,mapSize:new de(1024,1024)}}},Yie=`precision highp float; precision highp sampler3D; precision highp sampler2DArray; @@ -9153,7 +9153,7 @@ void main() { outputShadowLength = shadowLength * METER_TO_LENGTH_UNIT; #endif // SHADOW_LENGTH } -`,e9=`float getSTBN() { +`,n9=`float getSTBN() { ivec3 size = textureSize(stbnTexture, 0); vec3 scale = 1.0 / vec3(size); return texture(stbnTexture, vec3(gl_FragCoord.xy, float(frame % size.z)) * scale).r; @@ -9343,7 +9343,7 @@ MediaSample sampleMedia( ivec3 sampleCount; return sampleMedia(weather, position, uv, mipLevel, jitter, sampleCount); } -`,Yie=`precision highp float; +`,qie=`precision highp float; precision highp sampler3D; #include "atmosphere/bruneton/definitions" @@ -9424,7 +9424,7 @@ void main() { gl_Position = vec4(position.xy, 1.0, 1.0); } -`,t9=`uniform vec2 resolution; +`,i9=`uniform vec2 resolution; uniform int frame; uniform sampler3D stbnTexture; @@ -9490,7 +9490,7 @@ uniform float shadowTopHeight; uniform float shadowBottomHeight; uniform vec4 shadowLayerMask; uniform CloudDensityProfile densityProfile; -`,aM=`struct GroundIrradiance { +`,oM=`struct GroundIrradiance { vec3 sun; vec3 sky; }; @@ -9508,7 +9508,7 @@ struct CloudDensityProfile { vec4 linearTerms; vec4 constantTerms; }; -`;var qie=Object.defineProperty,ar=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&qie(e,t,a),a};const jie=new L,Zie=new q8;let Ba=class extends q0{constructor({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i},a=Y0.DEFAULT){super({name:"CloudsMaterial",glslVersion:ao,vertexShader:Ca(Yie,{atmosphere:{bruneton:{common:DO,definitions:OO,runtime:NO}},types:aM}),fragmentShader:X0(Ca(Xie,{core:{depth:NP,math:mA,turbo:OP,generators:Jte,raySphereIntersection:fy,cascadedShadowMaps:CP,interleavedGradientNoise:DP,vogelDisk:LP},atmosphere:{bruneton:{common:DO,definitions:OO,runtime:NO}},types:aM,parameters:t9,clouds:e9})),uniforms:{...e,...t,...i,depthBuffer:new J(null),viewMatrix:new J(new ke),inverseProjectionMatrix:new J(new ke),inverseViewMatrix:new J(new ke),reprojectionMatrix:new J(new ke),viewReprojectionMatrix:new J(new ke),resolution:new J(new de),cameraNear:new J(0),cameraFar:new J(0),cameraHeight:new J(0),frame:new J(0),temporalJitter:new J(new de),targetUvScale:new J(new de),mipLevelScale:new J(1),stbnTexture:new J(null),skyLightScale:new J(1),groundBounceScale:new J(1),powderScale:new J(.8),powderExponent:new J(150),maxIterationCount:new J(It.clouds.maxIterationCount),minStepSize:new J(It.clouds.minStepSize),maxStepSize:new J(It.clouds.maxStepSize),maxRayDistance:new J(It.clouds.maxRayDistance),perspectiveStepScale:new J(It.clouds.perspectiveStepScale),minDensity:new J(It.clouds.minDensity),minExtinction:new J(It.clouds.minExtinction),minTransmittance:new J(It.clouds.minTransmittance),maxIterationCountToSun:new J(It.clouds.maxIterationCountToSun),maxIterationCountToGround:new J(It.clouds.maxIterationCountToGround),minSecondaryStepSize:new J(It.clouds.minSecondaryStepSize),secondaryStepScale:new J(It.clouds.secondaryStepScale),shadowBuffer:new J(null),shadowTexelSize:new J(new de),shadowIntervals:new J(Array.from({length:4},()=>new de)),shadowMatrices:new J(Array.from({length:4},()=>new ke)),shadowFar:new J(0),maxShadowFilterRadius:new J(6),shadowLayerMask:new J(new zt().setScalar(1)),maxShadowLengthIterationCount:new J(It.clouds.maxShadowLengthIterationCount),minShadowLengthStepSize:new J(It.clouds.minShadowLengthStepSize),maxShadowLengthRayDistance:new J(It.clouds.maxShadowLengthRayDistance),hazeDensityScale:new J(3e-5),hazeExponent:new J(.001),hazeScatteringCoefficient:new J(.9),hazeAbsorptionCoefficient:new J(.5)}},a),this.temporalUpscale=!0,this.depthPacking=0,this.localWeatherChannels="rgba",this.shapeDetail=It.shapeDetail,this.turbulence=It.turbulence,this.shadowLength=It.lightShafts,this.haze=It.haze,this.multiScatteringOctaves=It.clouds.multiScatteringOctaves,this.accurateSunSkyLight=It.clouds.accurateSunSkyLight,this.accuratePhaseFunction=It.clouds.accuratePhaseFunction,this.shadowCascadeCount=It.shadow.cascadeCount,this.shadowSampleCount=8,this.scatterAnisotropy1=.7,this.scatterAnisotropy2=-.2,this.scatterAnisotropyMix=.5}onBeforeRender(e,t,i,a,r,s){const o=this.defines.USE_LOGARITHMIC_DEPTH_BUFFER!=null,c=e.capabilities.logarithmicDepthBuffer;c!==o&&(c?this.defines.USE_LOGARITHMIC_DEPTH_BUFFER="1":delete this.defines.USE_LOGARITHMIC_DEPTH_BUFFER);const h=this.defines.POWDER!=null,f=this.uniforms.powderScale.value>0;f!==h&&(f?this.defines.POWDER="1":delete this.defines.POWDER,this.needsUpdate=!0);const d=this.defines.GROUND_BOUNCE!=null;(this.uniforms.groundBounceScale.value>0&&this.uniforms.maxIterationCountToGround.value>0)!==d&&(f?this.defines.GROUND_BOUNCE="1":delete this.defines.GROUND_BOUNCE,this.needsUpdate=!0)}copyCameraSettings(e){e.isPerspectiveCamera===!0?this.defines.PERSPECTIVE_CAMERA!=="1"&&(this.defines.PERSPECTIVE_CAMERA="1",this.needsUpdate=!0):this.defines.PERSPECTIVE_CAMERA!=null&&(delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0);const t=this.uniforms;t.viewMatrix.value.copy(e.matrixWorldInverse),t.inverseViewMatrix.value.copy(e.matrixWorld);const i=this.previousProjectionMatrix??e.projectionMatrix,a=this.previousViewMatrix??e.matrixWorldInverse,r=t.inverseProjectionMatrix.value,s=t.inverseViewMatrix.value,o=t.reprojectionMatrix.value,c=t.viewReprojectionMatrix.value;if(this.temporalUpscale){const d=t.frame.value%16,m=t.resolution.value,g=$P[d],x=(g.x-.5)/m.x*4,T=(g.y-.5)/m.y*4;t.temporalJitter.value.set(x,T),t.mipLevelScale.value=.25,r.copy(e.projectionMatrix),r.elements[8]+=x*2,r.elements[9]+=T*2,r.invert(),o.copy(i),o.elements[8]+=x*2,o.elements[9]+=T*2,o.multiply(a),c.copy(o).multiply(s)}else t.temporalJitter.value.setScalar(0),t.mipLevelScale.value=1,r.copy(e.projectionMatrixInverse),o.copy(i).multiply(a),c.copy(o).multiply(s);t.cameraNear.value=e.near,t.cameraFar.value=e.far;const h=e.getWorldPosition(t.cameraPosition.value),f=jie.copy(h).applyMatrix4(t.worldToECEFMatrix.value);try{t.cameraHeight.value=Zie.setFromECEF(f).height}catch{}}copyReprojectionMatrix(e){this.previousProjectionMatrix??(this.previousProjectionMatrix=new ke),this.previousViewMatrix??(this.previousViewMatrix=new ke),this.previousProjectionMatrix.copy(e.projectionMatrix),this.previousViewMatrix.copy(e.matrixWorldInverse)}setSize(e,t,i,a){this.uniforms.resolution.value.set(e,t),i!=null&&a!=null?this.uniforms.targetUvScale.value.set(e/i,t/a):this.uniforms.targetUvScale.value.setScalar(1),this.previousProjectionMatrix=void 0,this.previousViewMatrix=void 0}setShadowSize(e,t){this.uniforms.shadowTexelSize.value.set(1/e,1/t)}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}get accurateSunSkyIrradiance(){return this.accurateSunSkyLight}set accurateSunSkyIrradiance(e){this.accurateSunSkyLight=e}};ar([dh("DEPTH_PACKING")],Ba.prototype,"depthPacking");ar([AP("LOCAL_WEATHER_CHANNELS",{validate:n=>/^[rgba]{4}$/.test(n)})],Ba.prototype,"localWeatherChannels");ar([dn("SHAPE_DETAIL")],Ba.prototype,"shapeDetail");ar([dn("TURBULENCE")],Ba.prototype,"turbulence");ar([dn("SHADOW_LENGTH")],Ba.prototype,"shadowLength");ar([dn("HAZE")],Ba.prototype,"haze");ar([dh("MULTI_SCATTERING_OCTAVES",{min:1,max:12})],Ba.prototype,"multiScatteringOctaves");ar([dn("ACCURATE_SUN_SKY_LIGHT")],Ba.prototype,"accurateSunSkyLight");ar([dn("ACCURATE_PHASE_FUNCTION")],Ba.prototype,"accuratePhaseFunction");ar([dh("SHADOW_CASCADE_COUNT",{min:1,max:4})],Ba.prototype,"shadowCascadeCount");ar([dh("SHADOW_SAMPLE_COUNT",{min:1,max:16})],Ba.prototype,"shadowSampleCount");ar([pA("SCATTER_ANISOTROPY_1")],Ba.prototype,"scatterAnisotropy1");ar([pA("SCATTER_ANISOTROPY_2")],Ba.prototype,"scatterAnisotropy2");ar([pA("SCATTER_ANISOTROPY_MIX")],Ba.prototype,"scatterAnisotropyMix");const Kie=`// Taken from https://gist.github.com/TheRealMJP/c83b8c0f46b63f3a88a5986f4fa982b1 +`;var jie=Object.defineProperty,rr=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&jie(e,t,a),a};const Zie=new L,Kie=new Z8;let Ha=class extends Z0{constructor({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i},a=j0.DEFAULT){super({name:"CloudsMaterial",glslVersion:ro,vertexShader:Na(qie,{atmosphere:{bruneton:{common:IO,definitions:UO,runtime:LO}},types:oM}),fragmentShader:q0(Na(Yie,{core:{depth:OP,math:_A,turbo:IP,generators:$te,raySphereIntersection:my,cascadedShadowMaps:DP,interleavedGradientNoise:LP,vogelDisk:UP},atmosphere:{bruneton:{common:IO,definitions:UO,runtime:LO}},types:oM,parameters:i9,clouds:n9})),uniforms:{...e,...t,...i,depthBuffer:new J(null),viewMatrix:new J(new ke),inverseProjectionMatrix:new J(new ke),inverseViewMatrix:new J(new ke),reprojectionMatrix:new J(new ke),viewReprojectionMatrix:new J(new ke),resolution:new J(new de),cameraNear:new J(0),cameraFar:new J(0),cameraHeight:new J(0),frame:new J(0),temporalJitter:new J(new de),targetUvScale:new J(new de),mipLevelScale:new J(1),stbnTexture:new J(null),skyLightScale:new J(1),groundBounceScale:new J(1),powderScale:new J(.8),powderExponent:new J(150),maxIterationCount:new J(It.clouds.maxIterationCount),minStepSize:new J(It.clouds.minStepSize),maxStepSize:new J(It.clouds.maxStepSize),maxRayDistance:new J(It.clouds.maxRayDistance),perspectiveStepScale:new J(It.clouds.perspectiveStepScale),minDensity:new J(It.clouds.minDensity),minExtinction:new J(It.clouds.minExtinction),minTransmittance:new J(It.clouds.minTransmittance),maxIterationCountToSun:new J(It.clouds.maxIterationCountToSun),maxIterationCountToGround:new J(It.clouds.maxIterationCountToGround),minSecondaryStepSize:new J(It.clouds.minSecondaryStepSize),secondaryStepScale:new J(It.clouds.secondaryStepScale),shadowBuffer:new J(null),shadowTexelSize:new J(new de),shadowIntervals:new J(Array.from({length:4},()=>new de)),shadowMatrices:new J(Array.from({length:4},()=>new ke)),shadowFar:new J(0),maxShadowFilterRadius:new J(6),shadowLayerMask:new J(new zt().setScalar(1)),maxShadowLengthIterationCount:new J(It.clouds.maxShadowLengthIterationCount),minShadowLengthStepSize:new J(It.clouds.minShadowLengthStepSize),maxShadowLengthRayDistance:new J(It.clouds.maxShadowLengthRayDistance),hazeDensityScale:new J(3e-5),hazeExponent:new J(.001),hazeScatteringCoefficient:new J(.9),hazeAbsorptionCoefficient:new J(.5)}},a),this.temporalUpscale=!0,this.depthPacking=0,this.localWeatherChannels="rgba",this.shapeDetail=It.shapeDetail,this.turbulence=It.turbulence,this.shadowLength=It.lightShafts,this.haze=It.haze,this.multiScatteringOctaves=It.clouds.multiScatteringOctaves,this.accurateSunSkyLight=It.clouds.accurateSunSkyLight,this.accuratePhaseFunction=It.clouds.accuratePhaseFunction,this.shadowCascadeCount=It.shadow.cascadeCount,this.shadowSampleCount=8,this.scatterAnisotropy1=.7,this.scatterAnisotropy2=-.2,this.scatterAnisotropyMix=.5}onBeforeRender(e,t,i,a,r,s){const o=this.defines.USE_LOGARITHMIC_DEPTH_BUFFER!=null,c=e.capabilities.logarithmicDepthBuffer;c!==o&&(c?this.defines.USE_LOGARITHMIC_DEPTH_BUFFER="1":delete this.defines.USE_LOGARITHMIC_DEPTH_BUFFER);const h=this.defines.POWDER!=null,f=this.uniforms.powderScale.value>0;f!==h&&(f?this.defines.POWDER="1":delete this.defines.POWDER,this.needsUpdate=!0);const d=this.defines.GROUND_BOUNCE!=null;(this.uniforms.groundBounceScale.value>0&&this.uniforms.maxIterationCountToGround.value>0)!==d&&(f?this.defines.GROUND_BOUNCE="1":delete this.defines.GROUND_BOUNCE,this.needsUpdate=!0)}copyCameraSettings(e){e.isPerspectiveCamera===!0?this.defines.PERSPECTIVE_CAMERA!=="1"&&(this.defines.PERSPECTIVE_CAMERA="1",this.needsUpdate=!0):this.defines.PERSPECTIVE_CAMERA!=null&&(delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0);const t=this.uniforms;t.viewMatrix.value.copy(e.matrixWorldInverse),t.inverseViewMatrix.value.copy(e.matrixWorld);const i=this.previousProjectionMatrix??e.projectionMatrix,a=this.previousViewMatrix??e.matrixWorldInverse,r=t.inverseProjectionMatrix.value,s=t.inverseViewMatrix.value,o=t.reprojectionMatrix.value,c=t.viewReprojectionMatrix.value;if(this.temporalUpscale){const d=t.frame.value%16,m=t.resolution.value,g=t9[d],x=(g.x-.5)/m.x*4,T=(g.y-.5)/m.y*4;t.temporalJitter.value.set(x,T),t.mipLevelScale.value=.25,r.copy(e.projectionMatrix),r.elements[8]+=x*2,r.elements[9]+=T*2,r.invert(),o.copy(i),o.elements[8]+=x*2,o.elements[9]+=T*2,o.multiply(a),c.copy(o).multiply(s)}else t.temporalJitter.value.setScalar(0),t.mipLevelScale.value=1,r.copy(e.projectionMatrixInverse),o.copy(i).multiply(a),c.copy(o).multiply(s);t.cameraNear.value=e.near,t.cameraFar.value=e.far;const h=e.getWorldPosition(t.cameraPosition.value),f=Zie.copy(h).applyMatrix4(t.worldToECEFMatrix.value);try{t.cameraHeight.value=Kie.setFromECEF(f).height}catch{}}copyReprojectionMatrix(e){this.previousProjectionMatrix??(this.previousProjectionMatrix=new ke),this.previousViewMatrix??(this.previousViewMatrix=new ke),this.previousProjectionMatrix.copy(e.projectionMatrix),this.previousViewMatrix.copy(e.matrixWorldInverse)}setSize(e,t,i,a){this.uniforms.resolution.value.set(e,t),i!=null&&a!=null?this.uniforms.targetUvScale.value.set(e/i,t/a):this.uniforms.targetUvScale.value.setScalar(1),this.previousProjectionMatrix=void 0,this.previousViewMatrix=void 0}setShadowSize(e,t){this.uniforms.shadowTexelSize.value.set(1/e,1/t)}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}get accurateSunSkyIrradiance(){return this.accurateSunSkyLight}set accurateSunSkyIrradiance(e){this.accurateSunSkyLight=e}};rr([mh("DEPTH_PACKING")],Ha.prototype,"depthPacking");rr([RP("LOCAL_WEATHER_CHANNELS",{validate:n=>/^[rgba]{4}$/.test(n)})],Ha.prototype,"localWeatherChannels");rr([dn("SHAPE_DETAIL")],Ha.prototype,"shapeDetail");rr([dn("TURBULENCE")],Ha.prototype,"turbulence");rr([dn("SHADOW_LENGTH")],Ha.prototype,"shadowLength");rr([dn("HAZE")],Ha.prototype,"haze");rr([mh("MULTI_SCATTERING_OCTAVES",{min:1,max:12})],Ha.prototype,"multiScatteringOctaves");rr([dn("ACCURATE_SUN_SKY_LIGHT")],Ha.prototype,"accurateSunSkyLight");rr([dn("ACCURATE_PHASE_FUNCTION")],Ha.prototype,"accuratePhaseFunction");rr([mh("SHADOW_CASCADE_COUNT",{min:1,max:4})],Ha.prototype,"shadowCascadeCount");rr([mh("SHADOW_SAMPLE_COUNT",{min:1,max:16})],Ha.prototype,"shadowSampleCount");rr([vA("SCATTER_ANISOTROPY_1")],Ha.prototype,"scatterAnisotropy1");rr([vA("SCATTER_ANISOTROPY_2")],Ha.prototype,"scatterAnisotropy2");rr([vA("SCATTER_ANISOTROPY_MIX")],Ha.prototype,"scatterAnisotropyMix");const Qie=`// Taken from https://gist.github.com/TheRealMJP/c83b8c0f46b63f3a88a5986f4fa982b1 // TODO: Use 5-taps version: https://www.shadertoy.com/view/MtVGWz // Or even 4 taps (requires preprocessing in the input buffer): // https://www.shadertoy.com/view/4tyGDD @@ -9621,7 +9621,7 @@ vec4 textureCatmullRom(sampler2DArray tex, vec3 uv) { result += texture(tex, vec3(texPos3.x, texPos3.y, uv.z)) * w3.x * w3.y; return result; } -`,Qie=`precision highp float; +`,Jie=`precision highp float; precision highp sampler2DArray; #include "core/turbo" @@ -9798,7 +9798,7 @@ void main() { outputColor.rgb = outputColor.rgb + vec3(abs(texture(depthVelocityBuffer, vUv).gb) * 10.0, 0.0); #endif // DEBUG_SHOW_VELOCITY } -`,Jie=`precision highp float; +`,$ie=`precision highp float; layout(location = 0) in vec3 position; @@ -9808,7 +9808,7 @@ void main() { vUv = position.xy * 0.5 + 0.5; gl_Position = vec4(position.xy, 1.0, 1.0); } -`,n9=`#ifdef VARIANCE_9_SAMPLES +`,a9=`#ifdef VARIANCE_9_SAMPLES #define VARIANCE_OFFSET_COUNT 8 const ivec2 varianceOffsets[8] = ivec2[8]( ivec2(-1, -1), @@ -9922,7 +9922,7 @@ vec4 varianceClipping( ) { return varianceClipping(inputBuffer, coord, current, history, 1.0); } -`;var $ie=Object.defineProperty,i9=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&$ie(e,t,a),a};class MA extends ch{constructor({colorBuffer:e=null,depthVelocityBuffer:t=null,shadowLengthBuffer:i=null,colorHistoryBuffer:a=null,shadowLengthHistoryBuffer:r=null}={}){super({name:"CloudsResolveMaterial",glslVersion:ao,vertexShader:Jie,fragmentShader:X0(Ca(Qie,{core:{turbo:OP},catmullRomSampling:Kie,varianceClipping:n9})),uniforms:{colorBuffer:new J(e),depthVelocityBuffer:new J(t),shadowLengthBuffer:new J(i),colorHistoryBuffer:new J(a),shadowLengthHistoryBuffer:new J(r),texelSize:new J(new de),frame:new J(0),jitterOffset:new J(new de),varianceGamma:new J(2),temporalAlpha:new J(.1)}}),this.temporalUpscale=!0,this.shadowLength=!0}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}onBeforeRender(e,t,i,a,r,s){const o=this.uniforms.frame.value%16,c=$P[o],h=(c.x-.5)*4,f=(c.y-.5)*4;this.uniforms.jitterOffset.value.set(h,f)}}i9([dn("TEMPORAL_UPSCALE")],MA.prototype,"temporalUpscale");i9([dn("SHADOW_LENGTH")],MA.prototype,"shadowLength");class a9 extends Pa{constructor(e,t){super(e),this._mainCamera=new Tc;const{shadow:i}=t;this.shadow=i}get mainCamera(){return this._mainCamera}set mainCamera(e){this._mainCamera=e}}function $2(n,{depthVelocity:e,shadowLength:t}){const i=new _i(1,1,{depthBuffer:!1,type:Xn});i.texture.minFilter=Ht,i.texture.magFilter=Ht,i.texture.name=n;let a;e&&(a=i.texture.clone(),a.isRenderTargetTexture=!0,i.depthVelocity=a,i.textures.push(a));let r;return t&&(r=i.texture.clone(),r.isRenderTargetTexture=!0,r.format=bs,i.shadowLength=r,i.textures.push(r)),Object.assign(i,{depthVelocity:a??null,shadowLength:r??null})}class eae extends a9{constructor({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i,...a},r){super("CloudsPass",a),this.atmosphere=r,this.width=0,this.height=0,this.currentMaterial=new Ba({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i},r),this.currentPass=new DE(this.currentMaterial),this.resolveMaterial=new MA,this.resolvePass=new DE(this.resolveMaterial),this.initRenderTargets({depthVelocity:!0,shadowLength:It.lightShafts})}copyCameraSettings(e){this.currentMaterial.copyCameraSettings(e)}initialize(e,t,i){this.currentPass.initialize(e,t,i),this.resolvePass.initialize(e,t,i)}initRenderTargets(e){var s,o,c;(s=this.currentRenderTarget)==null||s.dispose(),(o=this.resolveRenderTarget)==null||o.dispose(),(c=this.historyRenderTarget)==null||c.dispose();const t=$2("Clouds",e),i=$2("Clouds.A",{...e,depthVelocity:!1}),a=$2("Clouds.B",{...e,depthVelocity:!1});this.currentRenderTarget=t,this.resolveRenderTarget=i,this.historyRenderTarget=a;const r=this.resolveMaterial.uniforms;r.colorBuffer.value=t.texture,r.depthVelocityBuffer.value=t.depthVelocity,r.shadowLengthBuffer.value=t.shadowLength,r.colorHistoryBuffer.value=a.texture,r.shadowLengthHistoryBuffer.value=a.shadowLength}copyShadow(){const e=this.shadow,t=this.currentMaterial.uniforms;for(let i=0;i{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&eae(e,t,a),a};class wA extends hh{constructor({colorBuffer:e=null,depthVelocityBuffer:t=null,shadowLengthBuffer:i=null,colorHistoryBuffer:a=null,shadowLengthHistoryBuffer:r=null}={}){super({name:"CloudsResolveMaterial",glslVersion:ro,vertexShader:$ie,fragmentShader:q0(Na(Jie,{core:{turbo:IP},catmullRomSampling:Qie,varianceClipping:a9})),uniforms:{colorBuffer:new J(e),depthVelocityBuffer:new J(t),shadowLengthBuffer:new J(i),colorHistoryBuffer:new J(a),shadowLengthHistoryBuffer:new J(r),texelSize:new J(new de),frame:new J(0),jitterOffset:new J(new de),varianceGamma:new J(2),temporalAlpha:new J(.1)}}),this.temporalUpscale=!0,this.shadowLength=!0}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}onBeforeRender(e,t,i,a,r,s){const o=this.uniforms.frame.value%16,c=t9[o],h=(c.x-.5)*4,f=(c.y-.5)*4;this.uniforms.jitterOffset.value.set(h,f)}}r9([dn("TEMPORAL_UPSCALE")],wA.prototype,"temporalUpscale");r9([dn("SHADOW_LENGTH")],wA.prototype,"shadowLength");class s9 extends za{constructor(e,t){super(e),this._mainCamera=new bc;const{shadow:i}=t;this.shadow=i}get mainCamera(){return this._mainCamera}set mainCamera(e){this._mainCamera=e}}function n3(n,{depthVelocity:e,shadowLength:t}){const i=new xi(1,1,{depthBuffer:!1,type:Xn});i.texture.minFilter=Ht,i.texture.magFilter=Ht,i.texture.name=n;let a;e&&(a=i.texture.clone(),a.isRenderTargetTexture=!0,i.depthVelocity=a,i.textures.push(a));let r;return t&&(r=i.texture.clone(),r.isRenderTargetTexture=!0,r.format=As,i.shadowLength=r,i.textures.push(r)),Object.assign(i,{depthVelocity:a??null,shadowLength:r??null})}class tae extends s9{constructor({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i,...a},r){super("CloudsPass",a),this.atmosphere=r,this.width=0,this.height=0,this.currentMaterial=new Ha({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i},r),this.currentPass=new IE(this.currentMaterial),this.resolveMaterial=new wA,this.resolvePass=new IE(this.resolveMaterial),this.initRenderTargets({depthVelocity:!0,shadowLength:It.lightShafts})}copyCameraSettings(e){this.currentMaterial.copyCameraSettings(e)}initialize(e,t,i){this.currentPass.initialize(e,t,i),this.resolvePass.initialize(e,t,i)}initRenderTargets(e){var s,o,c;(s=this.currentRenderTarget)==null||s.dispose(),(o=this.resolveRenderTarget)==null||o.dispose(),(c=this.historyRenderTarget)==null||c.dispose();const t=n3("Clouds",e),i=n3("Clouds.A",{...e,depthVelocity:!1}),a=n3("Clouds.B",{...e,depthVelocity:!1});this.currentRenderTarget=t,this.resolveRenderTarget=i,this.historyRenderTarget=a;const r=this.resolveMaterial.uniforms;r.colorBuffer.value=t.texture,r.depthVelocityBuffer.value=t.depthVelocity,r.shadowLengthBuffer.value=t.shadowLength,r.colorHistoryBuffer.value=a.texture,r.shadowLengthHistoryBuffer.value=a.shadowLength}copyShadow(){const e=this.shadow,t=this.currentMaterial.uniforms;for(let i=0;i @@ -10115,7 +10115,7 @@ void main() { } #pragma unroll_loop_end } -`,iae=`precision highp float; +`,aae=`precision highp float; layout(location = 0) in vec3 position; @@ -10125,7 +10125,7 @@ void main() { vUv = position.xy * 0.5 + 0.5; gl_Position = vec4(position.xy, 1.0, 1.0); } -`,aae=`// Implements Structured Volume Sampling in fragment shader: +`,rae=`// Implements Structured Volume Sampling in fragment shader: // https://github.com/huwb/volsample // Implementation reference: // https://www.shadertoy.com/view/ttVfDc @@ -10226,7 +10226,7 @@ void intersectStructuredPlanes( stepOffset += stepSize; } } -`;var rae=Object.defineProperty,ep=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&rae(e,t,a),a};class mh extends ch{constructor({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i}){super({name:"ShadowMaterial",glslVersion:ao,vertexShader:iae,fragmentShader:X0(Ca(nae,{core:{math:mA,raySphereIntersection:fy},types:aM,parameters:t9,structuredSampling:aae,clouds:e9})),uniforms:{...e,...t,...i,inverseShadowMatrices:new J(Array.from({length:4},()=>new ke)),reprojectionMatrices:new J(Array.from({length:4},()=>new ke)),resolution:new J(new de),frame:new J(0),stbnTexture:new J(null),maxIterationCount:new J(It.shadow.maxIterationCount),minStepSize:new J(It.shadow.minStepSize),maxStepSize:new J(It.shadow.maxStepSize),minDensity:new J(It.shadow.minDensity),minExtinction:new J(It.shadow.minExtinction),minTransmittance:new J(It.shadow.minTransmittance),opticalDepthTailScale:new J(2)},defines:{SHADOW:"1",TEMPORAL_PASS:"1",TEMPORAL_JITTER:"1"}}),this.localWeatherChannels="rgba",this.cascadeCount=It.shadow.cascadeCount,this.temporalPass=!0,this.temporalJitter=!0,this.shapeDetail=It.shapeDetail,this.turbulence=It.turbulence,this.cascadeCount=It.shadow.cascadeCount}setSize(e,t){this.uniforms.resolution.value.set(e,t)}}ep([AP("LOCAL_WEATHER_CHANNELS",{validate:n=>/^[rgba]{4}$/.test(n)})],mh.prototype,"localWeatherChannels");ep([dh("CASCADE_COUNT",{min:1,max:4})],mh.prototype,"cascadeCount");ep([dn("TEMPORAL_PASS")],mh.prototype,"temporalPass");ep([dn("TEMPORAL_JITTER")],mh.prototype,"temporalJitter");ep([dn("SHAPE_DETAIL")],mh.prototype,"shapeDetail");ep([dn("TURBULENCE")],mh.prototype,"turbulence");const sae=`precision highp float; +`;var sae=Object.defineProperty,np=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&sae(e,t,a),a};class vh extends hh{constructor({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i}){super({name:"ShadowMaterial",glslVersion:ro,vertexShader:aae,fragmentShader:q0(Na(iae,{core:{math:_A,raySphereIntersection:my},types:oM,parameters:i9,structuredSampling:rae,clouds:n9})),uniforms:{...e,...t,...i,inverseShadowMatrices:new J(Array.from({length:4},()=>new ke)),reprojectionMatrices:new J(Array.from({length:4},()=>new ke)),resolution:new J(new de),frame:new J(0),stbnTexture:new J(null),maxIterationCount:new J(It.shadow.maxIterationCount),minStepSize:new J(It.shadow.minStepSize),maxStepSize:new J(It.shadow.maxStepSize),minDensity:new J(It.shadow.minDensity),minExtinction:new J(It.shadow.minExtinction),minTransmittance:new J(It.shadow.minTransmittance),opticalDepthTailScale:new J(2)},defines:{SHADOW:"1",TEMPORAL_PASS:"1",TEMPORAL_JITTER:"1"}}),this.localWeatherChannels="rgba",this.cascadeCount=It.shadow.cascadeCount,this.temporalPass=!0,this.temporalJitter=!0,this.shapeDetail=It.shapeDetail,this.turbulence=It.turbulence,this.cascadeCount=It.shadow.cascadeCount}setSize(e,t){this.uniforms.resolution.value.set(e,t)}}np([RP("LOCAL_WEATHER_CHANNELS",{validate:n=>/^[rgba]{4}$/.test(n)})],vh.prototype,"localWeatherChannels");np([mh("CASCADE_COUNT",{min:1,max:4})],vh.prototype,"cascadeCount");np([dn("TEMPORAL_PASS")],vh.prototype,"temporalPass");np([dn("TEMPORAL_JITTER")],vh.prototype,"temporalJitter");np([dn("SHAPE_DETAIL")],vh.prototype,"shapeDetail");np([dn("TURBULENCE")],vh.prototype,"turbulence");const oae=`precision highp float; precision highp sampler2DArray; #define VARIANCE_9_SAMPLES 1 @@ -10302,7 +10302,7 @@ void main() { } #pragma unroll_loop_end } -`,oae=`precision highp float; +`,lae=`precision highp float; layout(location = 0) in vec3 position; @@ -10312,7 +10312,7 @@ void main() { vUv = position.xy * 0.5 + 0.5; gl_Position = vec4(position.xy, 1.0, 1.0); } -`;var lae=Object.defineProperty,cae=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&lae(e,t,a),a};class r9 extends ch{constructor({inputBuffer:e=null,historyBuffer:t=null}={}){super({name:"ShadowResolveMaterial",glslVersion:ao,vertexShader:oae,fragmentShader:X0(Ca(sae,{varianceClipping:n9})),uniforms:{inputBuffer:new J(e),historyBuffer:new J(t),texelSize:new J(new de),varianceGamma:new J(1),temporalAlpha:new J(.01)},defines:{}}),this.cascadeCount=It.shadow.cascadeCount}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}}cae([dh("CASCADE_COUNT",{min:1,max:4})],r9.prototype,"cascadeCount");function e3(n){const e=new PU(1,1,1,{depthBuffer:!1});return e.texture.type=Xn,e.texture.minFilter=Ht,e.texture.magFilter=Ht,e.texture.name=n,e}class uae extends a9{constructor({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i,...a}){super("ShadowPass",a),this.width=0,this.height=0,this.currentMaterial=new mh({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i}),this.currentPass=new zO(this.currentMaterial),this.resolveMaterial=new r9,this.resolvePass=new zO(this.resolveMaterial),this.initRenderTargets()}initialize(e,t,i){this.currentPass.initialize(e,t,i),this.resolvePass.initialize(e,t,i)}initRenderTargets(){var r,s,o;(r=this.currentRenderTarget)==null||r.dispose(),(s=this.resolveRenderTarget)==null||s.dispose(),(o=this.historyRenderTarget)==null||o.dispose();const e=e3("Shadow"),t=this.temporalPass?e3("Shadow.A"):null,i=this.temporalPass?e3("Shadow.B"):null;this.currentRenderTarget=e,this.resolveRenderTarget=t,this.historyRenderTarget=i;const a=this.resolveMaterial.uniforms;a.inputBuffer.value=e.texture,a.historyBuffer.value=(i==null?void 0:i.texture)??null}copyShadow(){const e=this.shadow,t=this.currentMaterial.uniforms;for(let i=0;i0&&(ca&&(a=d),f&&d>s&&(s=d)),t3[o]=f?1:0}i!==1/0?(n.minHeight.value=i,n.maxHeight.value=a):(Ql(a===0),n.minHeight.value=0),r!==1/0?(n.shadowBottomHeight.value=r,n.shadowTopHeight.value=s):(Ql(s===0),n.shadowBottomHeight.value=0),n.shadowLayerMask.value.fromArray(t3)}function pae(n,e){return{bottomRadius:new J(n.bottomRadius),topRadius:new J(n.topRadius),worldToECEFMatrix:new J(e.worldToECEFMatrix),ecefToWorldMatrix:new J(e.ecefToWorldMatrix),altitudeCorrection:new J(e.altitudeCorrection),sunDirection:new J(e.sunDirection)}}const mae=`uniform sampler2D cloudsBuffer; +`;var cae=Object.defineProperty,uae=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&cae(e,t,a),a};class o9 extends hh{constructor({inputBuffer:e=null,historyBuffer:t=null}={}){super({name:"ShadowResolveMaterial",glslVersion:ro,vertexShader:lae,fragmentShader:q0(Na(oae,{varianceClipping:a9})),uniforms:{inputBuffer:new J(e),historyBuffer:new J(t),texelSize:new J(new de),varianceGamma:new J(1),temporalAlpha:new J(.01)},defines:{}}),this.cascadeCount=It.shadow.cascadeCount}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}}uae([mh("CASCADE_COUNT",{min:1,max:4})],o9.prototype,"cascadeCount");function i3(n){const e=new BU(1,1,1,{depthBuffer:!1});return e.texture.type=Xn,e.texture.minFilter=Ht,e.texture.magFilter=Ht,e.texture.name=n,e}class hae extends s9{constructor({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i,...a}){super("ShadowPass",a),this.width=0,this.height=0,this.currentMaterial=new vh({parameterUniforms:e,layerUniforms:t,atmosphereUniforms:i}),this.currentPass=new FO(this.currentMaterial),this.resolveMaterial=new o9,this.resolvePass=new FO(this.resolveMaterial),this.initRenderTargets()}initialize(e,t,i){this.currentPass.initialize(e,t,i),this.resolvePass.initialize(e,t,i)}initRenderTargets(){var r,s,o;(r=this.currentRenderTarget)==null||r.dispose(),(s=this.resolveRenderTarget)==null||s.dispose(),(o=this.historyRenderTarget)==null||o.dispose();const e=i3("Shadow"),t=this.temporalPass?i3("Shadow.A"):null,i=this.temporalPass?i3("Shadow.B"):null;this.currentRenderTarget=e,this.resolveRenderTarget=t,this.historyRenderTarget=i;const a=this.resolveMaterial.uniforms;a.inputBuffer.value=e.texture,a.historyBuffer.value=(i==null?void 0:i.texture)??null}copyShadow(){const e=this.shadow,t=this.currentMaterial.uniforms;for(let i=0;i0&&(ca&&(a=d),f&&d>s&&(s=d)),a3[o]=f?1:0}i!==1/0?(n.minHeight.value=i,n.maxHeight.value=a):(ec(a===0),n.minHeight.value=0),r!==1/0?(n.shadowBottomHeight.value=r,n.shadowTopHeight.value=s):(ec(s===0),n.shadowBottomHeight.value=0),n.shadowLayerMask.value.fromArray(a3)}function mae(n,e){return{bottomRadius:new J(n.bottomRadius),topRadius:new J(n.topRadius),worldToECEFMatrix:new J(e.worldToECEFMatrix),ecefToWorldMatrix:new J(e.ecefToWorldMatrix),altitudeCorrection:new J(e.altitudeCorrection),sunDirection:new J(e.sunDirection)}}const gae=`uniform sampler2D cloudsBuffer; void mainImage(const vec4 inputColor, const vec2 uv, out vec4 outputColor) { #ifdef SKIP_RENDERING @@ -10323,4 +10323,4 @@ void mainImage(const vec4 inputColor, const vec2 uv, out vec4 outputColor) { outputColor.a = inputColor.a * (1.0 - clouds.a) + clouds.a; #endif // SKIP_RENDERING } -`;var gae=Object.defineProperty,vae=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&gae(e,t,a),a};const tm=new L,_ae=new de,xae=new Et,yae=["maxIterationCount","minStepSize","maxStepSize","maxRayDistance","perspectiveStepScale","minDensity","minExtinction","minTransmittance","maxIterationCountToSun","maxIterationCountToGround","minSecondaryStepSize","secondaryStepScale","maxShadowFilterRadius","maxShadowLengthIterationCount","minShadowLengthStepSize","maxShadowLengthRayDistance","hazeDensityScale","hazeExponent","hazeScatteringCoefficient","hazeAbsorptionCoefficient"],Sae=["multiScatteringOctaves","accurateSunSkyLight","accuratePhaseFunction"],Tae=["maxIterationCount","minStepSize","maxStepSize","minDensity","minExtinction","minTransmittance","opticalDepthTailScale"],Eae=["temporalJitter"],Mae=["temporalPass"],bae=["cascadeCount","mapSize","maxFar","farScale","splitMode","splitLambda"],Io={type:"change"},s9={resolutionScale:It.resolutionScale,width:as.AUTO_SIZE,height:as.AUTO_SIZE};class o9 extends m0{constructor(e=new Tc,t,i=Y0.DEFAULT){var f,d,m,g;super("CloudsEffect",mae,{attributes:Jo.DEPTH,uniforms:new Map([["cloudsBuffer",new J(null)]])}),this.camera=e,this.atmosphere=i,this.cloudLayers=a1.DEFAULT.clone(),this.correctAltitude=!0,this.localWeatherRepeat=new de().setScalar(100),this.localWeatherOffset=new de,this.shapeRepeat=new L().setScalar(3e-4),this.shapeOffset=new L,this.shapeDetailRepeat=new L().setScalar(.006),this.shapeDetailOffset=new L,this.turbulenceRepeat=new de().setScalar(20),this.worldToECEFMatrix=new ke,this.ecefToWorldMatrix=new ke,this.altitudeCorrection=new L,this.sunDirection=new L,this.localWeatherVelocity=new de,this.shapeVelocity=new L,this.shapeDetailVelocity=new L,this._atmosphereOverlay=null,this._atmosphereShadow=null,this._atmosphereShadowLength=null,this.events=new tr,this.frame=0,this.shadowCascadeCount=0,this.shadowMapSize=new de,this.onResolutionChange=()=>{this.setSize(this.resolution.baseWidth,this.resolution.baseHeight)},this.skipRendering=!0;const{resolutionScale:a,width:r,height:s,resolutionX:o=r,resolutionY:c=s}={...s9,...t};this.shadowMaps=new Vie({cascadeCount:It.shadow.cascadeCount,mapSize:It.shadow.mapSize,splitLambda:.6}),this.parameterUniforms=hae({localWeatherTexture:((f=this.proceduralLocalWeather)==null?void 0:f.texture)??null,localWeatherRepeat:this.localWeatherRepeat,localWeatherOffset:this.localWeatherOffset,shapeTexture:((d=this.proceduralShape)==null?void 0:d.texture)??null,shapeRepeat:this.shapeRepeat,shapeOffset:this.shapeOffset,shapeDetailTexture:((m=this.proceduralShapeDetail)==null?void 0:m.texture)??null,shapeDetailRepeat:this.shapeDetailRepeat,shapeDetailOffset:this.shapeDetailOffset,turbulenceTexture:((g=this.proceduralTurbulence)==null?void 0:g.texture)??null,turbulenceRepeat:this.turbulenceRepeat}),this.layerUniforms=fae(),this.atmosphereUniforms=pae(i,{worldToECEFMatrix:this.worldToECEFMatrix,ecefToWorldMatrix:this.ecefToWorldMatrix,altitudeCorrection:this.altitudeCorrection,sunDirection:this.sunDirection});const h={shadow:this.shadowMaps,parameterUniforms:this.parameterUniforms,layerUniforms:this.layerUniforms,atmosphereUniforms:this.atmosphereUniforms};this.shadowPass=new uae(h),this.shadowPass.mainCamera=e,this.cloudsPass=new eae(h,i),this.cloudsPass.mainCamera=e,this.clouds=gO(vO({},this.cloudsPass.currentMaterial,yae),this.cloudsPass.currentMaterial,Sae),this.shadow=gO(vO({},this.shadowPass.currentMaterial,Tae),this.shadowPass.currentMaterial,Eae,this.shadowPass,Mae,this.shadowMaps,bae),this.resolution=new as(this,o,c,a),this.resolution.addEventListener("change",this.onResolutionChange)}get mainCamera(){return this.camera}set mainCamera(e){this.camera=e,this.shadowPass.mainCamera=e,this.cloudsPass.mainCamera=e}initialize(e,t,i){this.shadowPass.initialize(e,t,i),this.cloudsPass.initialize(e,t,i)}updateSharedUniforms(e){dae(this.layerUniforms,this.cloudLayers);const{parameterUniforms:t}=this;t.localWeatherOffset.value.add(_ae.copy(this.localWeatherVelocity).multiplyScalar(e)),t.shapeOffset.value.add(tm.copy(this.shapeVelocity).multiplyScalar(e)),t.shapeDetailOffset.value.add(tm.copy(this.shapeDetailVelocity).multiplyScalar(e));const i=this.worldToECEFMatrix;this.ecefToWorldMatrix.copy(i).invert();const a=this.camera.getWorldPosition(tm).applyMatrix4(this.worldToECEFMatrix),r=this.altitudeCorrection;this.correctAltitude?gA(a,this.atmosphere.bottomRadius,this.ellipsoid,r):r.setScalar(0);const s=this.ellipsoid.getSurfaceNormal(a,tm),o=this.sunDirection.dot(s),c=bP(1e6,1e3,o),h=xae.setFromMatrix4(i).transpose();this.shadowMaps.update(this.camera,tm.copy(this.sunDirection).applyMatrix3(h),c)}updateWeatherTextureChannels(){const e=this.cloudLayers.localWeatherChannels;this.cloudsPass.currentMaterial.localWeatherChannels=e,this.shadowPass.currentMaterial.localWeatherChannels=e}updateAtmosphereComposition(){const{shadowMaps:e,shadowPass:t,cloudsPass:i}=this,a=t.currentMaterial.uniforms,r=i.currentMaterial.uniforms,s=this._atmosphereOverlay,o=Object.assign(this._atmosphereOverlay??{},{map:i.outputBuffer});s!==o&&(this._atmosphereOverlay=o,Io.target=this,Io.property="atmosphereOverlay",this.events.dispatchEvent(Io));const c=this._atmosphereShadow,h=Object.assign(this._atmosphereShadow??{},{map:t.outputBuffer,mapSize:e.mapSize,cascadeCount:e.cascadeCount,intervals:r.shadowIntervals.value,matrices:r.shadowMatrices.value,inverseMatrices:a.inverseShadowMatrices.value,far:e.far,topHeight:r.shadowTopHeight.value});c!==h&&(this._atmosphereShadow=h,Io.target=this,Io.property="atmosphereShadow",this.events.dispatchEvent(Io));const f=this._atmosphereShadowLength,d=i.shadowLengthBuffer!=null?Object.assign(this._atmosphereShadowLength??{},{map:i.shadowLengthBuffer}):null;f!==d&&(this._atmosphereShadowLength=d,Io.target=this,Io.property="atmosphereShadowLength",this.events.dispatchEvent(Io))}update(e,t,i=0){var o,c,h,f;const{shadowMaps:a,shadowPass:r,cloudsPass:s}=this;if(a.cascadeCount!==this.shadowCascadeCount||!a.mapSize.equals(this.shadowMapSize)){const{width:d,height:m}=a.mapSize,g=a.cascadeCount;this.shadowMapSize.set(d,m),this.shadowCascadeCount=g,r.setSize(d,m,g),s.setShadowSize(d,m,g)}(o=this.proceduralLocalWeather)==null||o.render(e,i),(c=this.proceduralShape)==null||c.render(e,i),(h=this.proceduralShapeDetail)==null||h.render(e,i),(f=this.proceduralTurbulence)==null||f.render(e,i),++this.frame,this.updateSharedUniforms(i),this.updateWeatherTextureChannels(),r.update(e,this.frame,i),s.shadowBuffer=r.outputBuffer,s.update(e,this.frame,i),this.updateAtmosphereComposition(),this.uniforms.get("cloudsBuffer").value=this.cloudsPass.outputBuffer}setSize(e,t){const{resolution:i}=this;i.setBaseSize(e,t);const{width:a,height:r}=i;this.cloudsPass.setSize(a,r)}setDepthTexture(e,t){this.shadowPass.setDepthTexture(e,t),this.cloudsPass.setDepthTexture(e,t)}set qualityPreset(e){const{clouds:t,shadow:i,...a}=Wie[e];Object.assign(this,a),Object.assign(this.clouds,t),Object.assign(this.shadow,i)}get localWeatherTexture(){return this.proceduralLocalWeather??this.parameterUniforms.localWeatherTexture.value}set localWeatherTexture(e){e instanceof Nn||e==null?(this.proceduralLocalWeather=void 0,this.parameterUniforms.localWeatherTexture.value=e):(this.proceduralLocalWeather=e,this.parameterUniforms.localWeatherTexture.value=e.texture)}get shapeTexture(){return this.proceduralShape??this.parameterUniforms.shapeTexture.value}set shapeTexture(e){e instanceof is||e==null?(this.proceduralShape=void 0,this.parameterUniforms.shapeTexture.value=e):(this.proceduralShape=e,this.parameterUniforms.shapeTexture.value=e.texture)}get shapeDetailTexture(){return this.proceduralShapeDetail??this.parameterUniforms.shapeDetailTexture.value}set shapeDetailTexture(e){e instanceof is||e==null?(this.proceduralShapeDetail=void 0,this.parameterUniforms.shapeDetailTexture.value=e):(this.proceduralShapeDetail=e,this.parameterUniforms.shapeDetailTexture.value=e.texture)}get turbulenceTexture(){return this.proceduralTurbulence??this.parameterUniforms.turbulenceTexture.value}set turbulenceTexture(e){e instanceof Nn||e==null?(this.proceduralTurbulence=void 0,this.parameterUniforms.turbulenceTexture.value=e):(this.proceduralTurbulence=e,this.parameterUniforms.turbulenceTexture.value=e.texture)}get stbnTexture(){return this.cloudsPass.currentMaterial.uniforms.stbnTexture.value}set stbnTexture(e){this.cloudsPass.currentMaterial.uniforms.stbnTexture.value=e,this.shadowPass.currentMaterial.uniforms.stbnTexture.value=e}get resolutionScale(){return this.resolution.scale}set resolutionScale(e){this.resolution.scale=e}get temporalUpscale(){return this.cloudsPass.temporalUpscale}set temporalUpscale(e){this.cloudsPass.temporalUpscale=e}get lightShafts(){return this.cloudsPass.lightShafts}set lightShafts(e){this.cloudsPass.lightShafts=e}get shapeDetail(){return this.cloudsPass.currentMaterial.shapeDetail}set shapeDetail(e){this.cloudsPass.currentMaterial.shapeDetail=e,this.shadowPass.currentMaterial.shapeDetail=e}get turbulence(){return this.cloudsPass.currentMaterial.turbulence}set turbulence(e){this.cloudsPass.currentMaterial.turbulence=e,this.shadowPass.currentMaterial.turbulence=e}get haze(){return this.cloudsPass.currentMaterial.haze}set haze(e){this.cloudsPass.currentMaterial.haze=e}get scatteringCoefficient(){return this.parameterUniforms.scatteringCoefficient.value}set scatteringCoefficient(e){this.parameterUniforms.scatteringCoefficient.value=e}get absorptionCoefficient(){return this.parameterUniforms.absorptionCoefficient.value}set absorptionCoefficient(e){this.parameterUniforms.absorptionCoefficient.value=e}get coverage(){return this.parameterUniforms.coverage.value}set coverage(e){this.parameterUniforms.coverage.value=e}get turbulenceDisplacement(){return this.parameterUniforms.turbulenceDisplacement.value}set turbulenceDisplacement(e){this.parameterUniforms.turbulenceDisplacement.value=e}get scatterAnisotropy1(){return this.cloudsPass.currentMaterial.scatterAnisotropy1}set scatterAnisotropy1(e){this.cloudsPass.currentMaterial.scatterAnisotropy1=e}get scatterAnisotropy2(){return this.cloudsPass.currentMaterial.scatterAnisotropy2}set scatterAnisotropy2(e){this.cloudsPass.currentMaterial.scatterAnisotropy2=e}get scatterAnisotropyMix(){return this.cloudsPass.currentMaterial.scatterAnisotropyMix}set scatterAnisotropyMix(e){this.cloudsPass.currentMaterial.scatterAnisotropyMix=e}get skyIrradianceScale(){return this.skyLightScale}set skyIrradianceScale(e){this.skyLightScale=e}get skyLightScale(){return this.cloudsPass.currentMaterial.uniforms.skyLightScale.value}set skyLightScale(e){this.cloudsPass.currentMaterial.uniforms.skyLightScale.value=e}get groundIrradianceScale(){return this.groundBounceScale}set groundIrradianceScale(e){this.groundBounceScale=e}get groundBounceScale(){return this.cloudsPass.currentMaterial.uniforms.groundBounceScale.value}set groundBounceScale(e){this.cloudsPass.currentMaterial.uniforms.groundBounceScale.value=e}get powderScale(){return this.cloudsPass.currentMaterial.uniforms.powderScale.value}set powderScale(e){this.cloudsPass.currentMaterial.uniforms.powderScale.value=e}get powderExponent(){return this.cloudsPass.currentMaterial.uniforms.powderExponent.value}set powderExponent(e){this.cloudsPass.currentMaterial.uniforms.powderExponent.value=e}get atmosphereOverlay(){return this._atmosphereOverlay}get atmosphereShadow(){return this._atmosphereShadow}get atmosphereShadowLength(){return this._atmosphereShadowLength}get irradianceTexture(){return this.cloudsPass.currentMaterial.irradianceTexture}set irradianceTexture(e){this.cloudsPass.currentMaterial.irradianceTexture=e}get scatteringTexture(){return this.cloudsPass.currentMaterial.scatteringTexture}set scatteringTexture(e){this.cloudsPass.currentMaterial.scatteringTexture=e}get transmittanceTexture(){return this.cloudsPass.currentMaterial.transmittanceTexture}set transmittanceTexture(e){this.cloudsPass.currentMaterial.transmittanceTexture=e}get singleMieScatteringTexture(){return this.cloudsPass.currentMaterial.singleMieScatteringTexture}set singleMieScatteringTexture(e){this.cloudsPass.currentMaterial.singleMieScatteringTexture=e}get higherOrderScatteringTexture(){return this.cloudsPass.currentMaterial.higherOrderScatteringTexture}set higherOrderScatteringTexture(e){this.cloudsPass.currentMaterial.higherOrderScatteringTexture=e}get ellipsoid(){return this.cloudsPass.currentMaterial.ellipsoid}set ellipsoid(e){this.cloudsPass.currentMaterial.ellipsoid=e}get sunAngularRadius(){return this.cloudsPass.currentMaterial.sunAngularRadius}set sunAngularRadius(e){this.cloudsPass.currentMaterial.sunAngularRadius=e}}vae([dn("SKIP_RENDERING")],o9.prototype,"skipRendering");const Aae=128,Rae=32,xy="45a1c6c1bb9fd38b3680fd120795ff4c32df68ff",wae=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${xy}/packages/clouds/assets/local_weather.png`,Cae=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${xy}/packages/clouds/assets/shape.bin`,Nae=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${xy}/packages/clouds/assets/shape_detail.bin`,Dae=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${xy}/packages/clouds/assets/turbulence.png`,l9=be.createContext(null),Oae=({layers:n,disableDefault:e=!1,children:t})=>{const[i,a]=be.useState();return be.useLayoutEffect(()=>{n.set(e?Array(4).fill(Ts.DEFAULT):a1.DEFAULT),a({layers:n,indexPool:[0,1,2,3],disableDefault:e})},[n,e]),i!=null&&Nt.jsx(l9.Provider,{value:i,children:t})};function BO(n,e){const t=be.useMemo(()=>typeof n=="string"?new Fb().load(n,i=>{i.minFilter=_U,i.magFilter=Ht,i.wrapS=Ta,i.wrapT=Ta,i.colorSpace=Na,i.needsUpdate=!0}):void 0,[n]);return be.useEffect(()=>{if(t!=null)return()=>{t.dispose()}},[t]),(typeof n=="string"?t:n)??null}function HO(n,e){const t=be.useMemo(()=>typeof n=="string"?new xu(is,RP,{width:e,height:e,depth:e,format:bs,minFilter:Ht,magFilter:Ht,wrapS:Ta,wrapT:Ta,wrapR:Ta,colorSpace:Na}).load(n):void 0,[n,e]);return be.useEffect(()=>{if(t!=null)return()=>{t.dispose()}},[t]),(typeof n=="string"?t:n)??null}function Lae(n){const e=be.useMemo(()=>typeof n=="string"?new wP().load(n):void 0,[n]);return be.useEffect(()=>{if(e!=null)return()=>{e.dispose()}},[e]),(typeof n=="string"?e:n)??null}const Iae=({ref:n,disableDefaultLayers:e=!1,localWeatherTexture:t=wae,shapeTexture:i=Cae,shapeDetailTexture:a=Nae,turbulenceTexture:r=Dae,stbnTexture:s=nP,children:o,...c})=>{const{textures:h,transientStates:f,...d}=be.useContext(EA),[m,g]=KP({...s9,...d,...h,...c}),x=be.useMemo(()=>new o9,[]);be.useEffect(()=>()=>{x.dispose()},[x]),Ac(()=>{f!=null&&(x.sunDirection.copy(f.sunDirection),x.worldToECEFMatrix.copy(f.worldToECEFMatrix))}),be.useEffect(()=>{if(f!=null)return f.overlay=x.atmosphereOverlay,f.shadow=x.atmosphereShadow,f.shadowLength=x.atmosphereShadowLength,()=>{f.overlay=null,f.shadow=null,f.shadowLength=null}},[x,f]);const T=be.useCallback(C=>{if(f!=null)switch(C.property){case"atmosphereOverlay":f.overlay=x.atmosphereOverlay;break;case"atmosphereShadow":f.shadow=x.atmosphereShadow;break;case"atmosphereShadowLength":f.shadowLength=x.atmosphereShadowLength;break}},[x,f]);be.useEffect(()=>(x.events.addEventListener("change",T),()=>{x.events.removeEventListener("change",T)}),[x,T]),Qi(({gl:C})=>C);const S=BO(t),v=HO(i,Aae),y=HO(a,Rae),E=BO(r),b=Lae(s),{camera:D}=be.useContext(rA);return Nt.jsxs(Nt.Fragment,{children:[Nt.jsx("primitive",{ref:n,object:x,mainCamera:D,...m,localWeatherTexture:S,shapeTexture:v,shapeDetailTexture:y,turbulenceTexture:E,stbnTexture:b,...g}),Nt.jsx(Oae,{layers:x.cloudLayers,disableDefault:e,children:o})]})},Uae=({ref:n,index:e,...t})=>{const i=be.useContext(l9);if(i==null)throw new Error("CloudLayer can only be used within the Clouds component!");const{layers:a,indexPool:r,disableDefault:s}=i,[o,c]=be.useState();if(be.useLayoutEffect(()=>{if(e!=null){const h=r.indexOf(e);if(h!==-1)return r.splice(h,1),c(e),()=>{r.push(e),c(void 0)}}else{const h=r.sort((f,d)=>f-d).shift();if(h!=null)return c(h),()=>{r.push(h),c(void 0)}}},[e,a,r]),be.useLayoutEffect(()=>{if(o==null)return;const h=a[o];return()=>{h.copy(s?Ts.DEFAULT:a1.DEFAULT[o])}},[a,o,s]),be.useEffect(()=>{o!=null&&(typeof n=="function"?n(a[o]):n!=null&&(n.current=a[o]))},[n,a,o]),o!=null){const h=a[o];h.copy(s?Ts.DEFAULT:a1.DEFAULT[o]),h.set(t)}return null},c9="/pkg/atmosphere/",Pae=`${c9}ai.vrm`,zae=`${c9}fly.vrma`,rM=6378137,Bae=5*60*1e3,Hae=100,Fae=new Date("2024-06-21T12:00:00"),FO=[{name:"Clear (快晴)",coverage:.1,layers:[{channel:"r",altitude:1500,height:500,densityScale:0},{channel:"g",altitude:2500,height:800,densityScale:0},{channel:"b",altitude:7500,height:500,densityScale:.1}]},{name:"Sunny (晴れ)",coverage:.4,layers:[{channel:"r",altitude:1500,height:500,densityScale:.4},{channel:"g",altitude:2500,height:800,densityScale:0},{channel:"b",altitude:7500,height:500,densityScale:.2}]},{name:"Cloudy (曇り)",coverage:.75,layers:[{channel:"r",altitude:1500,height:500,densityScale:.6},{channel:"g",altitude:2e3,height:1e3,densityScale:.5},{channel:"b",altitude:7500,height:500,densityScale:0}]}];function Gae(){const{gl:n}=Qi(),e=be.useRef(),t=be.useRef(),i=be.useRef(new Date(Fae)),[a,r]=be.useState(FO[1]);return be.useEffect(()=>{n.toneMapping=ns,n.toneMappingExposure=10},[n]),be.useEffect(()=>{const s=setInterval(()=>{r(o=>{const c=FO.filter(f=>f.name!==o.name),h=c[Math.floor(Math.random()*c.length)];return console.log(`[Weather] Changing to: ${h.name}`),h})},Bae);return()=>clearInterval(s)},[]),Ac((s,o)=>{const c=i.current,h=o*Hae*1e3;if(c.setTime(c.getTime()+h),t.current&&t.current.updateByDate(c),e.current){const f=c.getHours()+c.getMinutes()/60+c.getSeconds()/3600,d=$t.mapLinear(f,6,18,0,Math.PI),m=-Math.cos(d),g=Math.sin(d);f<6||f>18?(e.current.position.set(0,-1,0),e.current.intensity=0):(e.current.position.set(m,g,.2),e.current.intensity=$t.lerp(.5,3,g))}}),Nt.jsxs(Nt.Fragment,{children:[Nt.jsx(V8,{makeDefault:!0,position:[0,rM+2e3,0],near:1,far:1e7,fov:45}),Nt.jsx("directionalLight",{ref:e,position:[0,1,0],intensity:3,castShadow:!0}),Nt.jsx(Rie,{ref:t,children:Nt.jsxs(uee,{multisampling:0,disableNormalPass:!1,children:[Nt.jsx(Iae,{disableDefaultLayers:!0,coverage:a.coverage,children:a.layers.map((s,o)=>Nt.jsx(Uae,{channel:s.channel,altitude:s.altitude,height:s.height,densityScale:s.densityScale,shapeAmount:.5},o))}),Nt.jsx(Cie,{sky:!0,sunLight:!0,skyLight:!0}),Nt.jsx(dee,{mode:Ya.AGX})]})}),Nt.jsx(Vae,{})]})}function Vae(){return Ac(n=>{const e=n.clock.getElapsedTime()*.05,t=2e3,i=5e3;n.camera.position.x=Math.sin(e)*i,n.camera.position.z=Math.cos(e)*i,n.camera.position.y=rM+t;const a=new L(Math.sin(e+.1)*i,rM+t,Math.cos(e+.1)*i);n.camera.lookAt(a)}),null}function kae(){const n=be.useRef(null),e=be.useRef(null),t=Gx(qN,Pae,a=>{a.register(r=>new sJ(r))}),i=Gx(qN,zae,a=>{a.register(r=>new VJ(r))});return be.useEffect(()=>{var r;const a=t.userData.vrm;if(e.current=a,fh.removeUnnecessaryJoints(a.scene),a.humanoid.resetPose(),a.scene.rotation.y=Math.PI,(r=i.userData.vrmAnimations)!=null&&r[0]){const s=PJ(i.userData.vrmAnimations[0],a);n.current=new C6(a.scene),n.current.clipAction(s).play()}},[t,i]),Ac((a,r)=>{var s,o;(s=n.current)==null||s.update(r),(o=e.current)==null||o.update(r)}),Nt.jsx("primitive",{object:t.scene})}function Wae(){return Nt.jsxs(m8,{gl:{alpha:!0,antialias:!0},children:[Nt.jsx(V8,{makeDefault:!0,position:[0,1.5,3],fov:30}),Nt.jsx("directionalLight",{position:[-1,1,1],intensity:1.5}),Nt.jsx("ambientLight",{intensity:1}),Nt.jsx("spotLight",{position:[0,2,-2],intensity:3,color:"#ffdcb4"}),Nt.jsx(be.Suspense,{fallback:null,children:Nt.jsx(kae,{})}),Nt.jsx($J,{target:[0,1.2,0]})]})}function Xae(){return Nt.jsx(m8,{children:Nt.jsx(Gae,{})})}function Yae(){const n={position:"absolute",top:0,left:0,width:"100%",height:"100%"};return Nt.jsxs("div",{style:{position:"relative",width:"100vw",height:"100vh",background:"#000"},children:[Nt.jsx("div",{style:{...n,zIndex:0},children:Nt.jsx(Xae,{})}),Nt.jsx("div",{style:{...n,zIndex:1,pointerEvents:"none"},children:Nt.jsx("div",{style:{width:"100%",height:"100%",pointerEvents:"auto"},children:Nt.jsx(Wae,{})})})]})}oF.createRoot(document.getElementById("root")).render(Nt.jsx(hM.StrictMode,{children:Nt.jsx(Yae,{})})); +`;var vae=Object.defineProperty,_ae=(n,e,t,i)=>{for(var a=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(a=s(e,t,a)||a);return a&&vae(e,t,a),a};const im=new L,xae=new de,yae=new Et,Sae=["maxIterationCount","minStepSize","maxStepSize","maxRayDistance","perspectiveStepScale","minDensity","minExtinction","minTransmittance","maxIterationCountToSun","maxIterationCountToGround","minSecondaryStepSize","secondaryStepScale","maxShadowFilterRadius","maxShadowLengthIterationCount","minShadowLengthStepSize","maxShadowLengthRayDistance","hazeDensityScale","hazeExponent","hazeScatteringCoefficient","hazeAbsorptionCoefficient"],Tae=["multiScatteringOctaves","accurateSunSkyLight","accuratePhaseFunction"],Eae=["maxIterationCount","minStepSize","maxStepSize","minDensity","minExtinction","minTransmittance","opticalDepthTailScale"],Mae=["temporalJitter"],bae=["temporalPass"],Aae=["cascadeCount","mapSize","maxFar","farScale","splitMode","splitLambda"],Uo={type:"change"},l9={resolutionScale:It.resolutionScale,width:rs.AUTO_SIZE,height:rs.AUTO_SIZE};class c9 extends v0{constructor(e=new bc,t,i=j0.DEFAULT){var f,d,m,g;super("CloudsEffect",gae,{attributes:$o.DEPTH,uniforms:new Map([["cloudsBuffer",new J(null)]])}),this.camera=e,this.atmosphere=i,this.cloudLayers=o1.DEFAULT.clone(),this.correctAltitude=!0,this.localWeatherRepeat=new de().setScalar(100),this.localWeatherOffset=new de,this.shapeRepeat=new L().setScalar(3e-4),this.shapeOffset=new L,this.shapeDetailRepeat=new L().setScalar(.006),this.shapeDetailOffset=new L,this.turbulenceRepeat=new de().setScalar(20),this.worldToECEFMatrix=new ke,this.ecefToWorldMatrix=new ke,this.altitudeCorrection=new L,this.sunDirection=new L,this.localWeatherVelocity=new de,this.shapeVelocity=new L,this.shapeDetailVelocity=new L,this._atmosphereOverlay=null,this._atmosphereShadow=null,this._atmosphereShadowLength=null,this.events=new nr,this.frame=0,this.shadowCascadeCount=0,this.shadowMapSize=new de,this.onResolutionChange=()=>{this.setSize(this.resolution.baseWidth,this.resolution.baseHeight)},this.skipRendering=!0;const{resolutionScale:a,width:r,height:s,resolutionX:o=r,resolutionY:c=s}={...l9,...t};this.shadowMaps=new kie({cascadeCount:It.shadow.cascadeCount,mapSize:It.shadow.mapSize,splitLambda:.6}),this.parameterUniforms=fae({localWeatherTexture:((f=this.proceduralLocalWeather)==null?void 0:f.texture)??null,localWeatherRepeat:this.localWeatherRepeat,localWeatherOffset:this.localWeatherOffset,shapeTexture:((d=this.proceduralShape)==null?void 0:d.texture)??null,shapeRepeat:this.shapeRepeat,shapeOffset:this.shapeOffset,shapeDetailTexture:((m=this.proceduralShapeDetail)==null?void 0:m.texture)??null,shapeDetailRepeat:this.shapeDetailRepeat,shapeDetailOffset:this.shapeDetailOffset,turbulenceTexture:((g=this.proceduralTurbulence)==null?void 0:g.texture)??null,turbulenceRepeat:this.turbulenceRepeat}),this.layerUniforms=dae(),this.atmosphereUniforms=mae(i,{worldToECEFMatrix:this.worldToECEFMatrix,ecefToWorldMatrix:this.ecefToWorldMatrix,altitudeCorrection:this.altitudeCorrection,sunDirection:this.sunDirection});const h={shadow:this.shadowMaps,parameterUniforms:this.parameterUniforms,layerUniforms:this.layerUniforms,atmosphereUniforms:this.atmosphereUniforms};this.shadowPass=new hae(h),this.shadowPass.mainCamera=e,this.cloudsPass=new tae(h,i),this.cloudsPass.mainCamera=e,this.clouds=xO(yO({},this.cloudsPass.currentMaterial,Sae),this.cloudsPass.currentMaterial,Tae),this.shadow=xO(yO({},this.shadowPass.currentMaterial,Eae),this.shadowPass.currentMaterial,Mae,this.shadowPass,bae,this.shadowMaps,Aae),this.resolution=new rs(this,o,c,a),this.resolution.addEventListener("change",this.onResolutionChange)}get mainCamera(){return this.camera}set mainCamera(e){this.camera=e,this.shadowPass.mainCamera=e,this.cloudsPass.mainCamera=e}initialize(e,t,i){this.shadowPass.initialize(e,t,i),this.cloudsPass.initialize(e,t,i)}updateSharedUniforms(e){pae(this.layerUniforms,this.cloudLayers);const{parameterUniforms:t}=this;t.localWeatherOffset.value.add(xae.copy(this.localWeatherVelocity).multiplyScalar(e)),t.shapeOffset.value.add(im.copy(this.shapeVelocity).multiplyScalar(e)),t.shapeDetailOffset.value.add(im.copy(this.shapeDetailVelocity).multiplyScalar(e));const i=this.worldToECEFMatrix;this.ecefToWorldMatrix.copy(i).invert();const a=this.camera.getWorldPosition(im).applyMatrix4(this.worldToECEFMatrix),r=this.altitudeCorrection;this.correctAltitude?xA(a,this.atmosphere.bottomRadius,this.ellipsoid,r):r.setScalar(0);const s=this.ellipsoid.getSurfaceNormal(a,im),o=this.sunDirection.dot(s),c=wP(1e6,1e3,o),h=yae.setFromMatrix4(i).transpose();this.shadowMaps.update(this.camera,im.copy(this.sunDirection).applyMatrix3(h),c)}updateWeatherTextureChannels(){const e=this.cloudLayers.localWeatherChannels;this.cloudsPass.currentMaterial.localWeatherChannels=e,this.shadowPass.currentMaterial.localWeatherChannels=e}updateAtmosphereComposition(){const{shadowMaps:e,shadowPass:t,cloudsPass:i}=this,a=t.currentMaterial.uniforms,r=i.currentMaterial.uniforms,s=this._atmosphereOverlay,o=Object.assign(this._atmosphereOverlay??{},{map:i.outputBuffer});s!==o&&(this._atmosphereOverlay=o,Uo.target=this,Uo.property="atmosphereOverlay",this.events.dispatchEvent(Uo));const c=this._atmosphereShadow,h=Object.assign(this._atmosphereShadow??{},{map:t.outputBuffer,mapSize:e.mapSize,cascadeCount:e.cascadeCount,intervals:r.shadowIntervals.value,matrices:r.shadowMatrices.value,inverseMatrices:a.inverseShadowMatrices.value,far:e.far,topHeight:r.shadowTopHeight.value});c!==h&&(this._atmosphereShadow=h,Uo.target=this,Uo.property="atmosphereShadow",this.events.dispatchEvent(Uo));const f=this._atmosphereShadowLength,d=i.shadowLengthBuffer!=null?Object.assign(this._atmosphereShadowLength??{},{map:i.shadowLengthBuffer}):null;f!==d&&(this._atmosphereShadowLength=d,Uo.target=this,Uo.property="atmosphereShadowLength",this.events.dispatchEvent(Uo))}update(e,t,i=0){var o,c,h,f;const{shadowMaps:a,shadowPass:r,cloudsPass:s}=this;if(a.cascadeCount!==this.shadowCascadeCount||!a.mapSize.equals(this.shadowMapSize)){const{width:d,height:m}=a.mapSize,g=a.cascadeCount;this.shadowMapSize.set(d,m),this.shadowCascadeCount=g,r.setSize(d,m,g),s.setShadowSize(d,m,g)}(o=this.proceduralLocalWeather)==null||o.render(e,i),(c=this.proceduralShape)==null||c.render(e,i),(h=this.proceduralShapeDetail)==null||h.render(e,i),(f=this.proceduralTurbulence)==null||f.render(e,i),++this.frame,this.updateSharedUniforms(i),this.updateWeatherTextureChannels(),r.update(e,this.frame,i),s.shadowBuffer=r.outputBuffer,s.update(e,this.frame,i),this.updateAtmosphereComposition(),this.uniforms.get("cloudsBuffer").value=this.cloudsPass.outputBuffer}setSize(e,t){const{resolution:i}=this;i.setBaseSize(e,t);const{width:a,height:r}=i;this.cloudsPass.setSize(a,r)}setDepthTexture(e,t){this.shadowPass.setDepthTexture(e,t),this.cloudsPass.setDepthTexture(e,t)}set qualityPreset(e){const{clouds:t,shadow:i,...a}=Xie[e];Object.assign(this,a),Object.assign(this.clouds,t),Object.assign(this.shadow,i)}get localWeatherTexture(){return this.proceduralLocalWeather??this.parameterUniforms.localWeatherTexture.value}set localWeatherTexture(e){e instanceof Nn||e==null?(this.proceduralLocalWeather=void 0,this.parameterUniforms.localWeatherTexture.value=e):(this.proceduralLocalWeather=e,this.parameterUniforms.localWeatherTexture.value=e.texture)}get shapeTexture(){return this.proceduralShape??this.parameterUniforms.shapeTexture.value}set shapeTexture(e){e instanceof as||e==null?(this.proceduralShape=void 0,this.parameterUniforms.shapeTexture.value=e):(this.proceduralShape=e,this.parameterUniforms.shapeTexture.value=e.texture)}get shapeDetailTexture(){return this.proceduralShapeDetail??this.parameterUniforms.shapeDetailTexture.value}set shapeDetailTexture(e){e instanceof as||e==null?(this.proceduralShapeDetail=void 0,this.parameterUniforms.shapeDetailTexture.value=e):(this.proceduralShapeDetail=e,this.parameterUniforms.shapeDetailTexture.value=e.texture)}get turbulenceTexture(){return this.proceduralTurbulence??this.parameterUniforms.turbulenceTexture.value}set turbulenceTexture(e){e instanceof Nn||e==null?(this.proceduralTurbulence=void 0,this.parameterUniforms.turbulenceTexture.value=e):(this.proceduralTurbulence=e,this.parameterUniforms.turbulenceTexture.value=e.texture)}get stbnTexture(){return this.cloudsPass.currentMaterial.uniforms.stbnTexture.value}set stbnTexture(e){this.cloudsPass.currentMaterial.uniforms.stbnTexture.value=e,this.shadowPass.currentMaterial.uniforms.stbnTexture.value=e}get resolutionScale(){return this.resolution.scale}set resolutionScale(e){this.resolution.scale=e}get temporalUpscale(){return this.cloudsPass.temporalUpscale}set temporalUpscale(e){this.cloudsPass.temporalUpscale=e}get lightShafts(){return this.cloudsPass.lightShafts}set lightShafts(e){this.cloudsPass.lightShafts=e}get shapeDetail(){return this.cloudsPass.currentMaterial.shapeDetail}set shapeDetail(e){this.cloudsPass.currentMaterial.shapeDetail=e,this.shadowPass.currentMaterial.shapeDetail=e}get turbulence(){return this.cloudsPass.currentMaterial.turbulence}set turbulence(e){this.cloudsPass.currentMaterial.turbulence=e,this.shadowPass.currentMaterial.turbulence=e}get haze(){return this.cloudsPass.currentMaterial.haze}set haze(e){this.cloudsPass.currentMaterial.haze=e}get scatteringCoefficient(){return this.parameterUniforms.scatteringCoefficient.value}set scatteringCoefficient(e){this.parameterUniforms.scatteringCoefficient.value=e}get absorptionCoefficient(){return this.parameterUniforms.absorptionCoefficient.value}set absorptionCoefficient(e){this.parameterUniforms.absorptionCoefficient.value=e}get coverage(){return this.parameterUniforms.coverage.value}set coverage(e){this.parameterUniforms.coverage.value=e}get turbulenceDisplacement(){return this.parameterUniforms.turbulenceDisplacement.value}set turbulenceDisplacement(e){this.parameterUniforms.turbulenceDisplacement.value=e}get scatterAnisotropy1(){return this.cloudsPass.currentMaterial.scatterAnisotropy1}set scatterAnisotropy1(e){this.cloudsPass.currentMaterial.scatterAnisotropy1=e}get scatterAnisotropy2(){return this.cloudsPass.currentMaterial.scatterAnisotropy2}set scatterAnisotropy2(e){this.cloudsPass.currentMaterial.scatterAnisotropy2=e}get scatterAnisotropyMix(){return this.cloudsPass.currentMaterial.scatterAnisotropyMix}set scatterAnisotropyMix(e){this.cloudsPass.currentMaterial.scatterAnisotropyMix=e}get skyIrradianceScale(){return this.skyLightScale}set skyIrradianceScale(e){this.skyLightScale=e}get skyLightScale(){return this.cloudsPass.currentMaterial.uniforms.skyLightScale.value}set skyLightScale(e){this.cloudsPass.currentMaterial.uniforms.skyLightScale.value=e}get groundIrradianceScale(){return this.groundBounceScale}set groundIrradianceScale(e){this.groundBounceScale=e}get groundBounceScale(){return this.cloudsPass.currentMaterial.uniforms.groundBounceScale.value}set groundBounceScale(e){this.cloudsPass.currentMaterial.uniforms.groundBounceScale.value=e}get powderScale(){return this.cloudsPass.currentMaterial.uniforms.powderScale.value}set powderScale(e){this.cloudsPass.currentMaterial.uniforms.powderScale.value=e}get powderExponent(){return this.cloudsPass.currentMaterial.uniforms.powderExponent.value}set powderExponent(e){this.cloudsPass.currentMaterial.uniforms.powderExponent.value=e}get atmosphereOverlay(){return this._atmosphereOverlay}get atmosphereShadow(){return this._atmosphereShadow}get atmosphereShadowLength(){return this._atmosphereShadowLength}get irradianceTexture(){return this.cloudsPass.currentMaterial.irradianceTexture}set irradianceTexture(e){this.cloudsPass.currentMaterial.irradianceTexture=e}get scatteringTexture(){return this.cloudsPass.currentMaterial.scatteringTexture}set scatteringTexture(e){this.cloudsPass.currentMaterial.scatteringTexture=e}get transmittanceTexture(){return this.cloudsPass.currentMaterial.transmittanceTexture}set transmittanceTexture(e){this.cloudsPass.currentMaterial.transmittanceTexture=e}get singleMieScatteringTexture(){return this.cloudsPass.currentMaterial.singleMieScatteringTexture}set singleMieScatteringTexture(e){this.cloudsPass.currentMaterial.singleMieScatteringTexture=e}get higherOrderScatteringTexture(){return this.cloudsPass.currentMaterial.higherOrderScatteringTexture}set higherOrderScatteringTexture(e){this.cloudsPass.currentMaterial.higherOrderScatteringTexture=e}get ellipsoid(){return this.cloudsPass.currentMaterial.ellipsoid}set ellipsoid(e){this.cloudsPass.currentMaterial.ellipsoid=e}get sunAngularRadius(){return this.cloudsPass.currentMaterial.sunAngularRadius}set sunAngularRadius(e){this.cloudsPass.currentMaterial.sunAngularRadius=e}}_ae([dn("SKIP_RENDERING")],c9.prototype,"skipRendering");const wae=128,Rae=32,Ty="45a1c6c1bb9fd38b3680fd120795ff4c32df68ff",Cae=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${Ty}/packages/clouds/assets/local_weather.png`,Nae=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${Ty}/packages/clouds/assets/shape.bin`,Dae=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${Ty}/packages/clouds/assets/shape_detail.bin`,Oae=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${Ty}/packages/clouds/assets/turbulence.png`,u9=Me.createContext(null),Lae=({layers:n,disableDefault:e=!1,children:t})=>{const[i,a]=Me.useState();return Me.useLayoutEffect(()=>{n.set(e?Array(4).fill(Es.DEFAULT):o1.DEFAULT),a({layers:n,indexPool:[0,1,2,3],disableDefault:e})},[n,e]),i!=null&&Rt.jsx(u9.Provider,{value:i,children:t})};function GO(n,e){const t=Me.useMemo(()=>typeof n=="string"?new kb().load(n,i=>{i.minFilter=SU,i.magFilter=Ht,i.wrapS=Ea,i.wrapT=Ea,i.colorSpace=Da,i.needsUpdate=!0}):void 0,[n]);return Me.useEffect(()=>{if(t!=null)return()=>{t.dispose()}},[t]),(typeof n=="string"?t:n)??null}function VO(n,e){const t=Me.useMemo(()=>typeof n=="string"?new Su(as,CP,{width:e,height:e,depth:e,format:As,minFilter:Ht,magFilter:Ht,wrapS:Ea,wrapT:Ea,wrapR:Ea,colorSpace:Da}).load(n):void 0,[n,e]);return Me.useEffect(()=>{if(t!=null)return()=>{t.dispose()}},[t]),(typeof n=="string"?t:n)??null}function Iae(n){const e=Me.useMemo(()=>typeof n=="string"?new NP().load(n):void 0,[n]);return Me.useEffect(()=>{if(e!=null)return()=>{e.dispose()}},[e]),(typeof n=="string"?e:n)??null}const Uae=({ref:n,disableDefaultLayers:e=!1,localWeatherTexture:t=Cae,shapeTexture:i=Nae,shapeDetailTexture:a=Dae,turbulenceTexture:r=Oae,stbnTexture:s=aP,children:o,...c})=>{const{textures:h,transientStates:f,...d}=Me.useContext(AA),[m,g]=JP({...l9,...d,...h,...c}),x=Me.useMemo(()=>new c9,[]);Me.useEffect(()=>()=>{x.dispose()},[x]),cl(()=>{f!=null&&(x.sunDirection.copy(f.sunDirection),x.worldToECEFMatrix.copy(f.worldToECEFMatrix))}),Me.useEffect(()=>{if(f!=null)return f.overlay=x.atmosphereOverlay,f.shadow=x.atmosphereShadow,f.shadowLength=x.atmosphereShadowLength,()=>{f.overlay=null,f.shadow=null,f.shadowLength=null}},[x,f]);const T=Me.useCallback(C=>{if(f!=null)switch(C.property){case"atmosphereOverlay":f.overlay=x.atmosphereOverlay;break;case"atmosphereShadow":f.shadow=x.atmosphereShadow;break;case"atmosphereShadowLength":f.shadowLength=x.atmosphereShadowLength;break}},[x,f]);Me.useEffect(()=>(x.events.addEventListener("change",T),()=>{x.events.removeEventListener("change",T)}),[x,T]),Oi(({gl:C})=>C);const y=GO(t),v=VO(i,wae),S=VO(a,Rae),E=GO(r),b=Iae(s),{camera:D}=Me.useContext(lA);return Rt.jsxs(Rt.Fragment,{children:[Rt.jsx("primitive",{ref:n,object:x,mainCamera:D,...m,localWeatherTexture:y,shapeTexture:v,shapeDetailTexture:S,turbulenceTexture:E,stbnTexture:b,...g}),Rt.jsx(Lae,{layers:x.cloudLayers,disableDefault:e,children:o})]})},Pae=({ref:n,index:e,...t})=>{const i=Me.useContext(u9);if(i==null)throw new Error("CloudLayer can only be used within the Clouds component!");const{layers:a,indexPool:r,disableDefault:s}=i,[o,c]=Me.useState();if(Me.useLayoutEffect(()=>{if(e!=null){const h=r.indexOf(e);if(h!==-1)return r.splice(h,1),c(e),()=>{r.push(e),c(void 0)}}else{const h=r.sort((f,d)=>f-d).shift();if(h!=null)return c(h),()=>{r.push(h),c(void 0)}}},[e,a,r]),Me.useLayoutEffect(()=>{if(o==null)return;const h=a[o];return()=>{h.copy(s?Es.DEFAULT:o1.DEFAULT[o])}},[a,o,s]),Me.useEffect(()=>{o!=null&&(typeof n=="function"?n(a[o]):n!=null&&(n.current=a[o]))},[n,a,o]),o!=null){const h=a[o];h.copy(s?Es.DEFAULT:o1.DEFAULT[o]),h.set(t)}return null},M_="/pkg/atmosphere/",zae=`${M_}ai.vrm`,Bae=6378137,Hae=5*60*1e3,Fae=100,Gae=new Date("2024-06-21T12:00:00"),kO=[{name:"Clear (快晴)",coverage:.1,layers:[{channel:"r",altitude:1500,height:500,densityScale:0},{channel:"g",altitude:2500,height:800,densityScale:0},{channel:"b",altitude:7500,height:500,densityScale:.1}]},{name:"Sunny (晴れ)",coverage:.4,layers:[{channel:"r",altitude:1500,height:500,densityScale:.4},{channel:"g",altitude:2500,height:800,densityScale:0},{channel:"b",altitude:7500,height:500,densityScale:.2}]},{name:"Cloudy (曇り)",coverage:.75,layers:[{channel:"r",altitude:1500,height:500,densityScale:.6},{channel:"g",altitude:2e3,height:1e3,densityScale:.5},{channel:"b",altitude:7500,height:500,densityScale:0}]}],Gl={position:new L(0,Bae+2e3,0),quaternion:new St,speed:5e3},Qn={w:!1,a:!1,s:!1,d:!1,Shift:!1,Space:!1};typeof window<"u"&&(window.addEventListener("keydown",n=>{const e=n.key.toLowerCase();Qn.hasOwnProperty(e)&&(Qn[e]=!0),n.key==="Shift"&&(Qn.Shift=!0),n.key===" "&&(Qn.Space=!0)}),window.addEventListener("keyup",n=>{const e=n.key.toLowerCase();Qn.hasOwnProperty(e)&&(Qn[e]=!1),n.key==="Shift"&&(Qn.Shift=!1),n.key===" "&&(Qn.Space=!1)}));function Vae(){const{gl:n}=Oi(),e=Me.useRef(),t=Me.useRef(),i=Me.useRef(new Date(Gae)),[a,r]=Me.useState(kO[1]);return Me.useEffect(()=>{n.toneMapping=is,n.toneMappingExposure=10},[n]),Me.useEffect(()=>{const s=setInterval(()=>{r(o=>{const c=kO.filter(f=>f.name!==o.name),h=c[Math.floor(Math.random()*c.length)];return console.log(`[Weather] Changing to: ${h.name}`),h})},Hae);return()=>clearInterval(s)},[]),cl((s,o)=>{const c=i.current,h=o*Fae*1e3;if(c.setTime(c.getTime()+h),t.current&&t.current.updateByDate(c),e.current){const f=c.getHours()+c.getMinutes()/60+c.getSeconds()/3600,d=$t.mapLinear(f,6,18,0,Math.PI),m=-Math.cos(d),g=Math.sin(d);f<6||f>18?(e.current.position.set(0,-1,0),e.current.intensity=0):(e.current.position.set(m,g,.2),e.current.intensity=$t.lerp(.5,3,g))}}),Rt.jsxs(Rt.Fragment,{children:[Rt.jsx(W8,{makeDefault:!0,near:1,far:1e7,fov:45}),Rt.jsx(kae,{}),Rt.jsx("directionalLight",{ref:e,position:[0,1,0],intensity:3,castShadow:!0}),Rt.jsx(Rie,{ref:t,children:Rt.jsxs(hee,{multisampling:0,disableNormalPass:!1,children:[Rt.jsx(Uae,{disableDefaultLayers:!0,coverage:a.coverage,children:a.layers.map((s,o)=>Rt.jsx(Pae,{channel:s.channel,altitude:s.altitude,height:s.height,densityScale:s.densityScale,shapeAmount:.5},o))}),Rt.jsx(Nie,{sky:!0,sunLight:!0,skyLight:!0}),Rt.jsx(pee,{mode:qa.AGX})]})})]})}function kae(){return cl(n=>{n.camera.position.copy(Gl.position),n.camera.quaternion.copy(Gl.quaternion)}),null}function Wae(){const n=Me.useRef(null),e=Me.useRef(null),{camera:t}=Oi(),i=Me.useRef({}),a=Me.useRef(null),r=Wx(KN,zae,h=>{h.register(f=>new oJ(f))}),[s,o,c]=Wx(KN,[`${M_}fly.vrma`,`${M_}fly_stop.vrma`,`${M_}fly_idle.vrma`],h=>{h.register(f=>new kJ(f))});return Me.useEffect(()=>{const h=r.userData.vrm;e.current=h,ph.removeUnnecessaryJoints(h.scene),h.humanoid.resetPose(),h.scene.rotation.y=Math.PI;const f=new D6(h.scene);n.current=f;const d=(y,v)=>{var S;if((S=y.userData.vrmAnimations)!=null&&S[0]){const E=zJ(y.userData.vrmAnimations[0],h),b=f.clipAction(E);return b.name=v,b}return null},m=d(s,"fly"),g=d(o,"fly_stop"),x=d(c,"fly_idle");i.current={fly:m,fly_stop:g,fly_idle:x},g&&(g.setLoop(gb),g.clampWhenFinished=!0),x?(x.play(),a.current="fly_idle"):m&&(m.play(),a.current="fly");const T=y=>{y.action===g&&i.current.fly_idle&&(g.fadeOut(.5),i.current.fly_idle.reset().fadeIn(.5).play(),a.current="fly_idle")};return f.addEventListener("finished",T),()=>{f.removeEventListener("finished",T)}},[r,s,o,c]),cl((h,f)=>{var x,T;(x=n.current)==null||x.update(f),(T=e.current)==null||T.update(f);const d=Qn.w||Qn.s||Qn.a||Qn.d,m=i.current,g=a.current;if(m.fly&&m.fly_stop&&m.fly_idle)if(d){if(g!=="fly"){const y=m[g];y&&y.fadeOut(.5),m.fly.reset().fadeIn(.5).play(),a.current="fly"}}else g==="fly"&&(m.fly.fadeOut(.5),m.fly_stop.reset().fadeIn(.5).play(),a.current="fly_stop");if(e.current){const y=e.current.scene,v=new L(0,0,0);if(Qn.w&&(v.z-=1),Qn.s&&(v.z+=1),Qn.a&&(v.x-=1),Qn.d&&(v.x+=1),v.lengthSq()>0){v.normalize();const S=t.quaternion.clone();v.applyQuaternion(S);const E=y.position.clone().sub(v),b=new Wt;b.position.copy(y.position),b.lookAt(E),y.quaternion.slerp(b.quaternion,10*f)}}}),Rt.jsx("primitive",{object:r.scene})}function Xae(){const{camera:n}=Oi(),e=new L;new Ei(0,0,0,"YXZ");const t=Me.useRef(0),i=10,a=2;return cl((r,s)=>{Gl.quaternion.copy(n.quaternion);const o=Qn.w||Qn.s||Qn.a||Qn.d,c=Gl.speed*(Qn.Shift?2:1)*s;Qn.w&&(e.set(0,0,-1).applyQuaternion(n.quaternion),Gl.position.addScaledVector(e,c)),Qn.s&&(e.set(0,0,1).applyQuaternion(n.quaternion),Gl.position.addScaledVector(e,c)),Qn.a&&(e.set(-1,0,0).applyQuaternion(n.quaternion),Gl.position.addScaledVector(e,c)),Qn.d&&(e.set(1,0,0).applyQuaternion(n.quaternion),Gl.position.addScaledVector(e,c));const d=((o?i:0)-t.current)*a*s;t.current+=d,n.translateZ(d)}),null}function Yae(){return Rt.jsxs(v8,{gl:{alpha:!0,antialias:!0},children:[Rt.jsx(W8,{makeDefault:!0,position:[0,1.5,3],fov:30}),Rt.jsx(Xae,{}),Rt.jsx("directionalLight",{position:[-1,1,1],intensity:1.5}),Rt.jsx("ambientLight",{intensity:1}),Rt.jsx("spotLight",{position:[0,2,-2],intensity:3,color:"#ffdcb4"}),Rt.jsx(Me.Suspense,{fallback:null,children:Rt.jsx(Wae,{})}),Rt.jsx(e$,{target:[0,1.2,0],minDistance:2,maxDistance:10})]})}function qae(){return Rt.jsx(v8,{children:Rt.jsx(Vae,{})})}function jae(){const n={position:"absolute",top:0,left:0,width:"100%",height:"100%"};return Rt.jsxs("div",{style:{position:"relative",width:"100vw",height:"100vh",background:"#000"},children:[Rt.jsx("div",{style:{...n,zIndex:0},children:Rt.jsx(qae,{})}),Rt.jsx("div",{style:{...n,zIndex:1,pointerEvents:"none"},children:Rt.jsx("div",{style:{width:"100%",height:"100%",pointerEvents:"auto"},children:Rt.jsx(Yae,{})})})]})}lF.createRoot(document.getElementById("root")).render(Rt.jsx(dM.StrictMode,{children:Rt.jsx(jae,{})})); diff --git a/static/pkg/atmosphere/fly_c.vrma b/static/pkg/atmosphere/fly_c.vrma new file mode 100644 index 0000000000000000000000000000000000000000..a05a7a9da93bb79bbfdfb5e7fbe867b7e8548c18 GIT binary patch literal 71736 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 literal 0 HcmV?d00001 diff --git a/static/pkg/atmosphere/fly_idle.vrma b/static/pkg/atmosphere/fly_idle.vrma new file mode 100644 index 0000000000000000000000000000000000000000..722c3821c57c3843086efe6cfe1204fbf2dec343 GIT binary patch literal 71736 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 literal 0 HcmV?d00001 diff --git a/static/pkg/atmosphere/fly_stop.vrma b/static/pkg/atmosphere/fly_stop.vrma new file mode 100644 index 0000000000000000000000000000000000000000..635b18f9066c20935c03a9e77f8091cd75565ee8 GIT binary patch literal 59252 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
3qB|K1Nb3$SC;%n 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 by|T9frXS9a_pIK(z^uo4?7@q`av%Q>`DG{+ literal 0 HcmV?d00001 diff --git a/static/pkg/atmosphere/index.html b/static/pkg/atmosphere/index.html index fe16c086..74780bd3 100644 --- a/static/pkg/atmosphere/index.html +++ b/static/pkg/atmosphere/index.html @@ -7,7 +7,7 @@ - +